From 0f966a3547f5fe53a0d7a2d7c0198ecdd4e9305e Mon Sep 17 00:00:00 2001 From: michaelkad <45772690+michaelkad@users.noreply.github.com> Date: Fri, 1 Mar 2024 13:20:18 -0600 Subject: [PATCH 001/118] Add hostgroups (#326) * Add hostgroups * Fix build --- clients/instance/ibm-pi-hostgroups.go | 163 ++++++++++++++++++++++++++ examples/hostgroups/main.go | 62 ++++++++++ 2 files changed, 225 insertions(+) create mode 100644 clients/instance/ibm-pi-hostgroups.go create mode 100644 examples/hostgroups/main.go diff --git a/clients/instance/ibm-pi-hostgroups.go b/clients/instance/ibm-pi-hostgroups.go new file mode 100644 index 00000000..4ded770e --- /dev/null +++ b/clients/instance/ibm-pi-hostgroups.go @@ -0,0 +1,163 @@ +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/hostgroups" + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// IBMPIHostgroupsClient +type IBMPIHostgroupsClient struct { + IBMPIClient +} + +// NewIBMPIHostgroupsClient +func NewIBMPHostgroupsClient(ctx context.Context, sess *ibmpisession.IBMPISession, cloudInstanceID string) *IBMPIHostgroupsClient { + return &IBMPIHostgroupsClient{ + *NewIBMPIClient(ctx, sess, cloudInstanceID), + } +} + +// Get All available hosts +func (f *IBMPIHostgroupsClient) GetAvailableHosts() (models.AvailableHostList, error) { + params := hostgroups.NewV1AvailableHostsParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut) + resp, err := f.session.Power.Hostgroups.V1AvailableHosts(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Get available hosts for %s: %w", f.cloudInstanceID, err)) + } + + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to Get Available hosts") + } + return resp.Payload, nil +} + +// Get all Hostgroups +func (f *IBMPIHostgroupsClient) GetHostgroups() (models.HostgroupList, error) { + params := hostgroups.NewV1HostgroupsGetParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut) + resp, err := f.session.Power.Hostgroups.V1HostgroupsGet(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Get Hostgroups for %s: %w", f.cloudInstanceID, err)) + } + + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to Get Hostgroups") + } + return resp.Payload, nil +} + +// Create a Hostgroup +func (f *IBMPIHostgroupsClient) CreateHostgroup(body *models.HostgroupCreate) (*models.Hostgroup, error) { + params := hostgroups.NewV1HostgroupsPostParams().WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).WithBody(body) + resp, err := f.session.Power.Hostgroups.V1HostgroupsPost(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Create Hostgroup for %s: %w", f.cloudInstanceID, err)) + } + + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to Get Hostgroups") + } + return resp.Payload, nil +} + +// Update a Hostgroup +func (f *IBMPIHostgroupsClient) UpdateHostgroup(body *models.HostgroupShareOp, id string) (*models.Hostgroup, error) { + params := hostgroups.NewV1HostgroupsIDPutParams().WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).WithBody(body).WithHostgroupID(id) + resp, err := f.session.Power.Hostgroups.V1HostgroupsIDPut(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Update Hostgroup for %s: %w", f.cloudInstanceID, err)) + } + + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to Update Hostgroups") + } + return resp.Payload, nil +} + +// Get a Hostgroup +func (f *IBMPIHostgroupsClient) GetHostgroup(id string) (*models.Hostgroup, error) { + params := hostgroups.NewV1HostgroupsIDGetParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).WithHostgroupID(id) + resp, err := f.session.Power.Hostgroups.V1HostgroupsIDGet(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Get Hostgroup %s for %s: %w", id, f.cloudInstanceID, err)) + } + + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to Get Hostgroup %s", id) + } + return resp.Payload, nil +} + +// Get All Hosts +func (f *IBMPIHostgroupsClient) GetHosts() (models.HostList, error) { + params := hostgroups.NewV1HostsGetParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut) + 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)) + } + + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to Get Hosts") + } + return resp.Payload, nil +} + +// Create a Host +func (f *IBMPIHostgroupsClient) CreateHost(body *models.HostCreate) (*models.Host, error) { + params := hostgroups.NewV1HostsPostParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).WithBody(body) + resp, err := f.session.Power.Hostgroups.V1HostsPost(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Create Hosts for %s: %w", f.cloudInstanceID, err)) + } + + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to Create Hosts") + } + return resp.Payload, nil +} + +// Get a Host +func (f *IBMPIHostgroupsClient) GetHost(id string) (*models.Host, error) { + params := hostgroups.NewV1HostsIDGetParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).WithHostID(id) + 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)) + } + + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to Get Host %s", id) + } + return resp.Payload, nil +} + +// Update a Host +func (f *IBMPIHostgroupsClient) UpdateHost(body *models.HostPut, id string) (*models.Host, error) { + params := hostgroups.NewV1HostsIDPutParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).WithHostID(id).WithBody(body) + resp, err := f.session.Power.Hostgroups.V1HostsIDPut(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Update Host %s for %s: %w", id, f.cloudInstanceID, err)) + } + + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to Update Host %s", id) + } + return resp.Payload, nil +} + +// Delete a Host +func (f *IBMPIHostgroupsClient) DeleteHost(id string) error { + params := hostgroups.NewV1HostsIDDeleteParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).WithHostID(id) + resp, err := f.session.Power.Hostgroups.V1HostsIDDelete(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Delete Host %s for %s: %w", id, f.cloudInstanceID, err)) + } + + if resp == nil || resp.Payload == nil { + return fmt.Errorf("failed to Delete Host %s", id) + } + return nil +} diff --git a/examples/hostgroups/main.go b/examples/hostgroups/main.go new file mode 100644 index 00000000..d1ab8bfa --- /dev/null +++ b/examples/hostgroups/main.go @@ -0,0 +1,62 @@ +package main + +import ( + "context" + "log" + + v "github.com/IBM-Cloud/power-go-client/clients/instance" + ps "github.com/IBM-Cloud/power-go-client/ibmpisession" + "github.com/IBM/go-sdk-core/v5/core" +) + +func main() { + //session Inputs + // < IAM TOKEN > + // token := "" + apiKey := "" + region := " < REGION > " + zone := " < ZONE > " + accountID := " < ACCOUNT ID > " + url := region + ".power-iaas.test.cloud.ibm.com" + + // dr location inputs + piID := " < POWER INSTANCE ID > " + + // authenticator := &core.BearerTokenAuthenticator{ + // BearerToken: token, + // } + authenticator := &core.IamAuthenticator{ + ApiKey: apiKey, + // Uncomment for test environment + URL: "https://iam.test.cloud.ibm.com", + } + + // Create the session + options := &ps.IBMPIOptions{ + Authenticator: authenticator, + UserAccount: accountID, + Zone: zone, + URL: url, + Debug: true, + } + session, err := ps.NewIBMPISession(options) + if err != nil { + log.Fatal(err) + } + powerClient := v.NewIBMPHostgroupsClient(context.Background(), session, piID) + if err != nil { + log.Fatal(err) + } + + getAllAvailableHost, err := powerClient.GetAvailableHosts() + if err != nil { + log.Fatal(err) + } + log.Printf("***************[0]****************** %+v \n", getAllAvailableHost) + + getHostgroups, err := powerClient.GetHostgroups() + if err != nil { + log.Fatal(err) + } + log.Printf("***************[1]****************** %+v \n", getHostgroups) +} From 855f96cfafcc32746d8011ab9432f2a5d8dd13ef Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Fri, 1 Mar 2024 13:31:05 -0600 Subject: [PATCH 002/118] Update swagger client and models to service-broker v1.140.0 (#337) * Generated Swagger client from service-broker commit f482db37dd0b38392de1f3aecdc2219212147830 * Fix build --------- Co-authored-by: michael kad --- .github/workflows/go.yml | 10 +++++----- power/models/p_vm_instance_create.go | 2 +- power/models/s_a_p_create.go | 2 +- power/models/s_a_p_profile.go | 3 +++ power/models/volumes_clone_async_request.go | 1 + power/models/volumes_clone_execute.go | 1 + power/models/volumes_clone_request.go | 1 + 7 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index c9da35fa..e146c8d4 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -14,6 +14,11 @@ jobs: steps: - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.20' - name: Lint uses: golangci/golangci-lint-action@v4 @@ -26,11 +31,6 @@ jobs: with: args: ./... - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: '1.20' - - name: Build run: go build -v ./... diff --git a/power/models/p_vm_instance_create.go b/power/models/p_vm_instance_create.go index 013a094c..62cceaef 100644 --- a/power/models/p_vm_instance_create.go +++ b/power/models/p_vm_instance_create.go @@ -106,7 +106,7 @@ type PVMInstanceCreate struct { // System type used to host the instance SysType string `json:"sysType,omitempty"` - // Cloud init user defined data + // 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"` // The pvm instance virtual CPU information diff --git a/power/models/s_a_p_create.go b/power/models/s_a_p_create.go index e16ee442..632bc758 100644 --- a/power/models/s_a_p_create.go +++ b/power/models/s_a_p_create.go @@ -63,7 +63,7 @@ type SAPCreate struct { // System type used to host the instance. Only e880, e980, e1080 are supported SysType string `json:"sysType,omitempty"` - // Cloud init user defined data + // 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"` // List of Volume IDs to attach to the pvm-instance on creation diff --git a/power/models/s_a_p_profile.go b/power/models/s_a_p_profile.go index 73096fa6..6333b489 100644 --- a/power/models/s_a_p_profile.go +++ b/power/models/s_a_p_profile.go @@ -36,6 +36,9 @@ type SAPProfile struct { // Required: true ProfileID *string `json:"profileID"` + // List of supported systems + SupportedSystems []string `json:"supportedSystems"` + // Type of profile // Required: true // Enum: [balanced compute memory non-production ultra-memory] diff --git a/power/models/volumes_clone_async_request.go b/power/models/volumes_clone_async_request.go index 7c4628c2..1b0993a1 100644 --- a/power/models/volumes_clone_async_request.go +++ b/power/models/volumes_clone_async_request.go @@ -26,6 +26,7 @@ type VolumesCloneAsyncRequest struct { // 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"` diff --git a/power/models/volumes_clone_execute.go b/power/models/volumes_clone_execute.go index 1d880001..b470cb78 100644 --- a/power/models/volumes_clone_execute.go +++ b/power/models/volumes_clone_execute.go @@ -26,6 +26,7 @@ type VolumesCloneExecute struct { // 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"` diff --git a/power/models/volumes_clone_request.go b/power/models/volumes_clone_request.go index 7ed5f8c5..cb238678 100644 --- a/power/models/volumes_clone_request.go +++ b/power/models/volumes_clone_request.go @@ -25,6 +25,7 @@ type VolumesCloneRequest struct { // 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"` From 7568b6491afc3648eee5daca27a45c78d596f161 Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Fri, 1 Mar 2024 13:32:01 -0600 Subject: [PATCH 003/118] Update swagger client and models to service-broker v1.140.0 (#336) * Generated Swagger client from service-broker commit 9786c4b2360ad846a1aa8f68f01fbb41979af3c9 * Fix build --------- Co-authored-by: michael kad --- .github/workflows/go.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index e146c8d4..6cba7a10 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -15,6 +15,11 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.20' + - name: Set up Go uses: actions/setup-go@v5 with: From 8bd10d353bc46bbeab8da88381508a672bb2d08f Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Wed, 13 Mar 2024 10:42:12 -0500 Subject: [PATCH 004/118] Update swagger client and models to service-broker v1.140.0 (#346) * Bump github.com/IBM/go-sdk-core/v5 from 5.15.1 to 5.15.3 Bumps [github.com/IBM/go-sdk-core/v5](https://github.com/IBM/go-sdk-core) from 5.15.1 to 5.15.3. - [Release notes](https://github.com/IBM/go-sdk-core/releases) - [Changelog](https://github.com/IBM/go-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/go-sdk-core/compare/v5.15.1...v5.15.3) --- updated-dependencies: - dependency-name: github.com/IBM/go-sdk-core/v5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Fix golangci-lint action v4 requirement Signed-off-by: Yussuf Shaikh * Update golangci-lint version and skip cache Signed-off-by: Yussuf Shaikh * Add branch to dependabot (#338) * Add branch to dependabot * Fix build * Generated Swagger client from service-broker commit 1db48bf5f665abf4e91c66d019aa231b913db3d9 --------- Signed-off-by: dependabot[bot] Signed-off-by: Yussuf Shaikh Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Yussuf Shaikh Co-authored-by: michaelkad <45772690+michaelkad@users.noreply.github.com> --- .github/dependabot.yml | 8 ++ .github/workflows/go.yml | 8 +- go.mod | 2 +- go.sum | 4 +- power/models/host.go | 39 ++++---- power/models/host_capacity.go | 127 +++++++++++++++++++++---- power/models/host_resource_capacity.go | 59 ++++++++++++ power/models/hostgroup_href.go | 27 ------ power/models/hostgroup_summary.go | 56 +++++++++++ 9 files changed, 258 insertions(+), 72 deletions(-) create mode 100644 power/models/host_resource_capacity.go delete mode 100644 power/models/hostgroup_href.go create mode 100644 power/models/hostgroup_summary.go diff --git a/.github/dependabot.yml b/.github/dependabot.yml index efccb78d..49720d33 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,12 +9,20 @@ updates: directory: / schedule: interval: daily + branches: + - "master" + - "dev" assignees: - yussufsh + - michaelkad - package-ecosystem: github-actions directory: / schedule: interval: weekly + branches: + - "master" + - "dev" assignees: - yussufsh + - michaelkad diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 6cba7a10..12494508 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -15,11 +15,6 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: '1.20' - - name: Set up Go uses: actions/setup-go@v5 with: @@ -28,8 +23,9 @@ jobs: - name: Lint uses: golangci/golangci-lint-action@v4 with: - version: v1.53.3 + version: v1.56 args: --timeout=10m + skip-cache: true - name: Run go Security Scanner uses: securego/gosec@master diff --git a/go.mod b/go.mod index a6de90a0..66ea26ff 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/IBM-Cloud/power-go-client go 1.20 require ( - github.com/IBM/go-sdk-core/v5 v5.15.1 + github.com/IBM/go-sdk-core/v5 v5.15.3 github.com/IBM/platform-services-go-sdk v0.59.1 github.com/apparentlymart/go-cidr v1.1.0 github.com/go-openapi/errors v0.21.0 diff --git a/go.sum b/go.sum index f1326778..56839574 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/IBM/go-sdk-core/v5 v5.15.1 h1:XOzNZbBgnlxOGK1JMMBtZJYSVguK4TFPJiYutuzFmdA= -github.com/IBM/go-sdk-core/v5 v5.15.1/go.mod h1:so2mbdIgSp6X8Zm/qLV+whdchTGgi04c3j4xFMsqlCc= +github.com/IBM/go-sdk-core/v5 v5.15.3 h1:yBSSYLuQSO9Ip+j3mONsTcymoYQyxarQ6rh3aU9cVt8= +github.com/IBM/go-sdk-core/v5 v5.15.3/go.mod h1:ee+AZaB15yUwZigJdRCwZZ3u7HIvEQzxNUdxVpnJHY8= github.com/IBM/platform-services-go-sdk v0.59.1 h1:qyXJX1sNgbDDrXb5M9LrjMjCm2w9dkSEtBGAfZJlT0Y= github.com/IBM/platform-services-go-sdk v0.59.1/go.mod h1:cLKLn9Bd1YcTM/micLQmikjZDDQvRgfhdAHKOeulILg= github.com/apparentlymart/go-cidr v1.1.0 h1:2mAhrMoF+nhXqxTzSZMUzDHkLjmIHC+Zzn4tdgBZjnU= diff --git a/power/models/host.go b/power/models/host.go index d0ad65f7..4f4ac653 100644 --- a/power/models/host.go +++ b/power/models/host.go @@ -24,8 +24,8 @@ type Host struct { // Name of the host (chosen by the user) DisplayName string `json:"displayName,omitempty"` - // Link to the owning hostgroup - Hostgroup HostgroupHref `json:"hostgroup,omitempty"` + // Information about the owning hostgroup + Hostgroup *HostgroupSummary `json:"hostgroup,omitempty"` // ID of the host ID string `json:"id,omitempty"` @@ -82,13 +82,15 @@ func (m *Host) validateHostgroup(formats strfmt.Registry) error { return 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") + 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 err } return nil @@ -135,17 +137,20 @@ func (m *Host) contextValidateCapacity(ctx context.Context, formats strfmt.Regis func (m *Host) contextValidateHostgroup(ctx context.Context, formats strfmt.Registry) error { - if swag.IsZero(m.Hostgroup) { // not required - return nil - } + if m.Hostgroup != 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") + 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 err } return nil diff --git a/power/models/host_capacity.go b/power/models/host_capacity.go index 1e822fb7..9ded7f72 100644 --- a/power/models/host_capacity.go +++ b/power/models/host_capacity.go @@ -8,6 +8,7 @@ package models import ( "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -17,38 +18,126 @@ import ( // swagger:model HostCapacity type HostCapacity struct { - // Number of cores currently available - AvailableCore float64 `json:"availableCore,omitempty"` + // Core capacity of the host + Cores *HostResourceCapacity `json:"cores,omitempty"` - // Amount of memory currently available (in MB) - AvailableMemory float64 `json:"availableMemory,omitempty"` + // Memory capacity of the host (in MB) + Memory *HostResourceCapacity `json:"memory,omitempty"` +} - // Number of cores reserved for system use - ReservedCore float64 `json:"reservedCore,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) + } - // Amount of memory reserved for system use (in MB) - ReservedMemory float64 `json:"reservedMemory,omitempty"` + if err := m.validateMemory(formats); err != nil { + res = append(res, err) + } - // Total number of cores of the host - TotalCore float64 `json:"totalCore,omitempty"` + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} - // Total amount of memory of the host (in MB) - TotalMemory float64 `json:"totalMemory,omitempty"` +func (m *HostCapacity) validateCores(formats strfmt.Registry) error { + if swag.IsZero(m.Cores) { // not required + return nil + } - // Number of cores in use on the host - UsedCore float64 `json:"usedCore,omitempty"` + 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 + } + } - // Amount of memory used on the host (in MB) - UsedMemory float64 `json:"usedMemory,omitempty"` + return nil } -// Validate validates this host capacity -func (m *HostCapacity) Validate(formats strfmt.Registry) error { +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 validates this host capacity based on context it is used +// 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 } diff --git a/power/models/host_resource_capacity.go b/power/models/host_resource_capacity.go new file mode 100644 index 00000000..4814c505 --- /dev/null +++ b/power/models/host_resource_capacity.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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" +) + +// HostResourceCapacity host resource capacity +// +// swagger:model HostResourceCapacity +type HostResourceCapacity struct { + + // available + Available float64 `json:"available,omitempty"` + + // reserved + Reserved float64 `json:"reserved,omitempty"` + + // total + Total float64 `json:"total,omitempty"` + + // used + Used float64 `json:"used,omitempty"` +} + +// Validate validates this host resource capacity +func (m *HostResourceCapacity) Validate(formats strfmt.Registry) error { + 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/hostgroup_href.go b/power/models/hostgroup_href.go deleted file mode 100644 index 2733f00f..00000000 --- a/power/models/hostgroup_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" -) - -// HostgroupHref Link to hostgroup resource -// -// swagger:model HostgroupHref -type HostgroupHref string - -// Validate validates this hostgroup href -func (m HostgroupHref) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this hostgroup href based on context it is used -func (m HostgroupHref) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/power/models/hostgroup_summary.go b/power/models/hostgroup_summary.go new file mode 100644 index 00000000..6112fd1d --- /dev/null +++ b/power/models/hostgroup_summary.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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 hostgroup summary +// +// swagger:model HostgroupSummary +type HostgroupSummary struct { + + // Whether the hostgroup is a primary or secondary hostgroup + Access string `json:"access,omitempty"` + + // Link to the hostgroup resource + Href string `json:"href,omitempty"` + + // Name of the hostgroup + Name string `json:"name,omitempty"` +} + +// Validate validates this hostgroup summary +func (m *HostgroupSummary) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this hostgroup 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 +} From f0cebebbf0d65a5779b92e6fc8c62965378baecb Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Wed, 13 Mar 2024 10:47:37 -0500 Subject: [PATCH 005/118] Update swagger client and models to service-broker v1.140.0 (#347) * Bump github.com/IBM/go-sdk-core/v5 from 5.15.1 to 5.15.3 Bumps [github.com/IBM/go-sdk-core/v5](https://github.com/IBM/go-sdk-core) from 5.15.1 to 5.15.3. - [Release notes](https://github.com/IBM/go-sdk-core/releases) - [Changelog](https://github.com/IBM/go-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/go-sdk-core/compare/v5.15.1...v5.15.3) --- updated-dependencies: - dependency-name: github.com/IBM/go-sdk-core/v5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Fix golangci-lint action v4 requirement Signed-off-by: Yussuf Shaikh * Update golangci-lint version and skip cache Signed-off-by: Yussuf Shaikh * Add branch to dependabot (#338) * Add branch to dependabot * Fix build * Generated Swagger client from service-broker commit b0bfdfb575c650fd620a92f064c1f7b05d1dd56d --------- Signed-off-by: dependabot[bot] Signed-off-by: Yussuf Shaikh Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Yussuf Shaikh Co-authored-by: michaelkad <45772690+michaelkad@users.noreply.github.com> --- power/models/create_cos_image_import_job.go | 51 +++++ power/models/image_import_details.go | 205 ++++++++++++++++++++ 2 files changed, 256 insertions(+) create mode 100644 power/models/image_import_details.go diff --git a/power/models/create_cos_image_import_job.go b/power/models/create_cos_image_import_job.go index 12186df3..7511771e 100644 --- a/power/models/create_cos_image_import_job.go +++ b/power/models/create_cos_image_import_job.go @@ -39,6 +39,9 @@ type CreateCosImageImportJob struct { // 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"` @@ -80,6 +83,10 @@ func (m *CreateCosImageImportJob) Validate(formats strfmt.Registry) error { 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) } @@ -167,6 +174,25 @@ func (m *CreateCosImageImportJob) validateImageName(formats strfmt.Registry) 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() { @@ -247,6 +273,10 @@ func (m *CreateCosImageImportJob) validateStorageAffinity(formats strfmt.Registr 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) } @@ -257,6 +287,27 @@ func (m *CreateCosImageImportJob) ContextValidate(ctx context.Context, formats s 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 { diff --git a/power/models/image_import_details.go b/power/models/image_import_details.go new file mode 100644 index 00000000..59560a09 --- /dev/null +++ b/power/models/image_import_details.go @@ -0,0 +1,205 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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 +} From 9e25e630cc6f077c88929d94bdf9e9883cc80bdb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Feb 2024 02:29:29 +0000 Subject: [PATCH 006/118] Bump github.com/IBM/go-sdk-core/v5 from 5.15.1 to 5.15.3 Bumps [github.com/IBM/go-sdk-core/v5](https://github.com/IBM/go-sdk-core) from 5.15.1 to 5.15.3. - [Release notes](https://github.com/IBM/go-sdk-core/releases) - [Changelog](https://github.com/IBM/go-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/go-sdk-core/compare/v5.15.1...v5.15.3) --- updated-dependencies: - dependency-name: github.com/IBM/go-sdk-core/v5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] From 6966b1f75ee4d2eb65c582d0b4d303e2ff4bd4fe Mon Sep 17 00:00:00 2001 From: Yussuf Shaikh Date: Mon, 4 Mar 2024 09:35:42 +0530 Subject: [PATCH 007/118] Fix golangci-lint action v4 requirement Signed-off-by: Yussuf Shaikh --- .github/workflows/go.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 12494508..b345bcf5 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -15,6 +15,11 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.20' + - name: Set up Go uses: actions/setup-go@v5 with: From ac9384d58b4893d5b28f3def56135afa4e9a6d7d Mon Sep 17 00:00:00 2001 From: michaelkad <45772690+michaelkad@users.noreply.github.com> Date: Mon, 4 Mar 2024 08:14:06 -0600 Subject: [PATCH 008/118] Add branch to dependabot (#338) * Add branch to dependabot * Fix build From f0a510c69af3ea2c0d27262dc9d3615bc12a9cea Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Mar 2024 03:00:58 +0000 Subject: [PATCH 009/118] Bump github.com/stretchr/testify from 1.8.4 to 1.9.0 Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.4 to 1.9.0. - [Release notes](https://github.com/stretchr/testify/releases) - [Commits](https://github.com/stretchr/testify/compare/v1.8.4...v1.9.0) --- updated-dependencies: - dependency-name: github.com/stretchr/testify dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 66ea26ff..64a6ae82 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/go-openapi/strfmt v0.22.0 github.com/go-openapi/swag v0.22.5 github.com/go-openapi/validate v0.22.4 - github.com/stretchr/testify v1.8.4 + github.com/stretchr/testify v1.9.0 ) require ( diff --git a/go.sum b/go.sum index 56839574..2c69ba29 100644 --- a/go.sum +++ b/go.sum @@ -82,8 +82,8 @@ github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDN github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4= github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM= From 357f6bed8bff5a6b3b8afc06a3bb6ddf5cb7ac68 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Mar 2024 02:11:41 +0000 Subject: [PATCH 010/118] Bump github.com/IBM/platform-services-go-sdk from 0.59.1 to 0.60.0 Bumps [github.com/IBM/platform-services-go-sdk](https://github.com/IBM/platform-services-go-sdk) from 0.59.1 to 0.60.0. - [Release notes](https://github.com/IBM/platform-services-go-sdk/releases) - [Changelog](https://github.com/IBM/platform-services-go-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/platform-services-go-sdk/compare/v0.59.1...v0.60.0) --- updated-dependencies: - dependency-name: github.com/IBM/platform-services-go-sdk dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 8 +++----- go.sum | 54 +++++++----------------------------------------------- 2 files changed, 10 insertions(+), 52 deletions(-) diff --git a/go.mod b/go.mod index 64a6ae82..063cd48c 100644 --- a/go.mod +++ b/go.mod @@ -4,11 +4,11 @@ go 1.20 require ( github.com/IBM/go-sdk-core/v5 v5.15.3 - github.com/IBM/platform-services-go-sdk v0.59.1 + github.com/IBM/platform-services-go-sdk v0.60.0 github.com/apparentlymart/go-cidr v1.1.0 github.com/go-openapi/errors v0.21.0 github.com/go-openapi/runtime v0.26.0 - github.com/go-openapi/strfmt v0.22.0 + github.com/go-openapi/strfmt v0.22.1 github.com/go-openapi/swag v0.22.5 github.com/go-openapi/validate v0.22.4 github.com/stretchr/testify v1.9.0 @@ -28,7 +28,6 @@ require ( github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect github.com/go-playground/validator/v10 v10.17.0 // indirect - github.com/google/go-cmp v0.6.0 // indirect github.com/google/uuid v1.6.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-retryablehttp v0.7.5 // indirect @@ -37,10 +36,9 @@ require ( github.com/mailru/easyjson v0.7.7 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/oklog/ulid v1.3.1 // indirect - github.com/onsi/gomega v1.29.0 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - go.mongodb.org/mongo-driver v1.13.1 // indirect + go.mongodb.org/mongo-driver v1.14.0 // indirect go.opentelemetry.io/otel v1.14.0 // indirect go.opentelemetry.io/otel/trace v1.14.0 // indirect golang.org/x/crypto v0.18.0 // indirect diff --git a/go.sum b/go.sum index 2c69ba29..b4c1a0d5 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ github.com/IBM/go-sdk-core/v5 v5.15.3 h1:yBSSYLuQSO9Ip+j3mONsTcymoYQyxarQ6rh3aU9cVt8= github.com/IBM/go-sdk-core/v5 v5.15.3/go.mod h1:ee+AZaB15yUwZigJdRCwZZ3u7HIvEQzxNUdxVpnJHY8= -github.com/IBM/platform-services-go-sdk v0.59.1 h1:qyXJX1sNgbDDrXb5M9LrjMjCm2w9dkSEtBGAfZJlT0Y= -github.com/IBM/platform-services-go-sdk v0.59.1/go.mod h1:cLKLn9Bd1YcTM/micLQmikjZDDQvRgfhdAHKOeulILg= +github.com/IBM/platform-services-go-sdk v0.60.0 h1:DXCp5hAtFO6quUmb5qKeosQw0ln/fYE5nrKjgXbiSBU= +github.com/IBM/platform-services-go-sdk v0.60.0/go.mod h1:fcmUb29QKLjMM0UWrR5bAidC7qfKWrf96H0xxmGJHdE= github.com/apparentlymart/go-cidr v1.1.0 h1:2mAhrMoF+nhXqxTzSZMUzDHkLjmIHC+Zzn4tdgBZjnU= github.com/apparentlymart/go-cidr v1.1.0/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= @@ -31,8 +31,8 @@ github.com/go-openapi/runtime v0.26.0 h1:HYOFtG00FM1UvqrcxbEJg/SwvDRvYLQKGhw2zaQ github.com/go-openapi/runtime v0.26.0/go.mod h1:QgRGeZwrUcSHdeh4Ka9Glvo0ug1LC5WyE+EV88plZrQ= github.com/go-openapi/spec v0.20.12 h1:cgSLbrsmziAP2iais+Vz7kSazwZ8rsUZd6TUzdDgkVI= github.com/go-openapi/spec v0.20.12/go.mod h1:iSCgnBcwbMW9SfzJb8iYynXvcY6C/QFrI7otzF7xGM4= -github.com/go-openapi/strfmt v0.22.0 h1:Ew9PnEYc246TwrEspvBdDHS4BVKXy/AOVsfqGDgAcaI= -github.com/go-openapi/strfmt v0.22.0/go.mod h1:HzJ9kokGIju3/K6ap8jL+OlGAbjpSv27135Yr9OivU4= +github.com/go-openapi/strfmt v0.22.1 h1:5Ky8cybT4576C6Ffc+8gYji/wRXCo6Ozm8RaWjPI6jc= +github.com/go-openapi/strfmt v0.22.1/go.mod h1:OfVoytIXJasDkkGvkb1Cceb3BPyMOwk1FgmyyEw7NYg= github.com/go-openapi/swag v0.22.5 h1:fVS63IE3M0lsuWRzuom3RLwUMVI2peDH01s6M70ugys= github.com/go-openapi/swag v0.22.5/go.mod h1:Gl91UqO+btAM0plGGxHqJcQZ1ZTy6jbmridBTsDy8A0= github.com/go-openapi/validate v0.22.4 h1:5v3jmMyIPKTR8Lv9syBAIRxG6lY0RqeBPB1LKEijzk8= @@ -44,10 +44,7 @@ github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJn github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= github.com/go-playground/validator/v10 v10.17.0 h1:SmVVlfAOtlZncTxRuinDPomC2DkXJ4E5T9gDA0AIH74= github.com/go-playground/validator/v10 v10.17.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= -github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= -github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= @@ -58,7 +55,6 @@ github.com/hashicorp/go-retryablehttp v0.7.5 h1:bJj+Pj19UZMIweq/iie+1u5YCdGrnxCT github.com/hashicorp/go-retryablehttp v0.7.5/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/leodido/go-urn v1.3.0 h1:jX8FDLfW4ThVXctBNZ+3cIWnCSnrACDV73r76dy0aQQ= @@ -67,13 +63,11 @@ github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0 github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg= -github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= +github.com/onsi/gomega v1.31.1 h1:KYppCUK+bUgAZwHOu7EXVBKyQA6ILvOESHkn/tgoqvo= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -84,55 +78,21 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= -github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4= -github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM= -github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -go.mongodb.org/mongo-driver v1.13.1 h1:YIc7HTYsKndGK4RFzJ3covLz1byri52x0IoMB0Pt/vk= -go.mongodb.org/mongo-driver v1.13.1/go.mod h1:wcDf1JBCXy2mOW0bWHwO/IOYqdca1MPCwDtFu/Z9+eo= +go.mongodb.org/mongo-driver v1.14.0 h1:P98w8egYRjYe3XDjxhYJagTokP/H6HzlsnojRgZRd80= +go.mongodb.org/mongo-driver v1.14.0/go.mod h1:Vzb0Mk/pa7e6cWw85R4F/endUC3u0U9jGcNU603k65c= go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM= go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU= go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY= go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M= go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= From eedc628eca08771a090f9d1ba24c14a9ed533d9c Mon Sep 17 00:00:00 2001 From: michaelkad <45772690+michaelkad@users.noreply.github.com> Date: Wed, 13 Mar 2024 10:12:43 -0500 Subject: [PATCH 011/118] Add Removal of Create VPN (#315) Adding back vpn create removal --- clients/instance/ibm-pi-vpn.go | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/clients/instance/ibm-pi-vpn.go b/clients/instance/ibm-pi-vpn.go index a8862428..9348533a 100644 --- a/clients/instance/ibm-pi-vpn.go +++ b/clients/instance/ibm-pi-vpn.go @@ -44,20 +44,7 @@ func (f *IBMPIVpnConnectionClient) Get(id string) (*models.VPNConnection, error) // Create a VPN Connection func (f *IBMPIVpnConnectionClient) Create(body *models.VPNConnectionCreate) (*models.VPNConnectionCreateResponse, error) { - if f.session.IsOnPrem() { - return nil, fmt.Errorf("operation not supported in satellite location, check documentation") - } - params := p_cloud_v_p_n_connections.NewPcloudVpnconnectionsPostParams(). - WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut). - WithCloudInstanceID(f.cloudInstanceID).WithBody(body) - postaccepted, err := f.session.Power.PCloudvpnConnections.PcloudVpnconnectionsPost(params, f.session.AuthInfo(f.cloudInstanceID)) - if err != nil { - return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf(errors.CreateVPNConnectionOperationFailed, f.cloudInstanceID, err)) - } - if postaccepted != nil && postaccepted.Payload != nil { - return postaccepted.Payload, nil - } - return nil, fmt.Errorf("failed to Create VPN Connection") + return nil, fmt.Errorf("Create VPN Connection is no longer supported") } // Update a VPN Connection From 326860ebb956d88d59517e920bd17afd43e3bfb6 Mon Sep 17 00:00:00 2001 From: ismirlia <90468712+ismirlia@users.noreply.github.com> Date: Wed, 13 Mar 2024 10:13:59 -0500 Subject: [PATCH 012/118] Revert "Enable shared-processor-pool functionality on stratos" (#354) This reverts commit d32d15616555c890d73c99bbfcb564d1ef2b0ad9. --- clients/instance/ibm-pi-shared-processor-pool.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/clients/instance/ibm-pi-shared-processor-pool.go b/clients/instance/ibm-pi-shared-processor-pool.go index cbe4c674..1722f9ac 100644 --- a/clients/instance/ibm-pi-shared-processor-pool.go +++ b/clients/instance/ibm-pi-shared-processor-pool.go @@ -26,6 +26,9 @@ func NewIBMPISharedProcessorPoolClient(ctx context.Context, sess *ibmpisession.I // Get a PI Shared Processor Pool func (f *IBMPISharedProcessorPoolClient) Get(id string) (*models.SharedProcessorPoolDetail, error) { + if f.session.IsOnPrem() { + return nil, fmt.Errorf("operation not supported in satellite location, check documentation") + } params := p_cloud_shared_processor_pools.NewPcloudSharedprocessorpoolsGetParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithSharedProcessorPoolID(id) @@ -41,6 +44,9 @@ func (f *IBMPISharedProcessorPoolClient) Get(id string) (*models.SharedProcessor // Get All Shared Processor Pools func (f *IBMPISharedProcessorPoolClient) GetAll() (*models.SharedProcessorPools, error) { + if f.session.IsOnPrem() { + return nil, fmt.Errorf("operation not supported in satellite location, check documentation") + } params := p_cloud_shared_processor_pools.NewPcloudSharedprocessorpoolsGetallParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID) @@ -56,6 +62,9 @@ func (f *IBMPISharedProcessorPoolClient) GetAll() (*models.SharedProcessorPools, // Create a Shared Processor Pool func (f *IBMPISharedProcessorPoolClient) Create(body *models.SharedProcessorPoolCreate) (*models.SharedProcessorPool, error) { + if f.session.IsOnPrem() { + return nil, fmt.Errorf("operation not supported in satellite location, check documentation") + } params := p_cloud_shared_processor_pools.NewPcloudSharedprocessorpoolsPostParams(). WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithBody(body) @@ -71,6 +80,9 @@ func (f *IBMPISharedProcessorPoolClient) Create(body *models.SharedProcessorPool // Delete a Shared Processor Pool func (f *IBMPISharedProcessorPoolClient) Delete(id string) error { + if f.session.IsOnPrem() { + return fmt.Errorf("operation not supported in satellite location, check documentation") + } params := p_cloud_shared_processor_pools.NewPcloudSharedprocessorpoolsDeleteParams(). WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithSharedProcessorPoolID(id) @@ -83,6 +95,9 @@ func (f *IBMPISharedProcessorPoolClient) Delete(id string) error { // Update a PI Shared Processor Pool func (f *IBMPISharedProcessorPoolClient) Update(id string, body *models.SharedProcessorPoolUpdate) (*models.SharedProcessorPool, error) { + if f.session.IsOnPrem() { + return nil, fmt.Errorf("operation not supported in satellite location, check documentation") + } params := p_cloud_shared_processor_pools.NewPcloudSharedprocessorpoolsPutParams(). WithContext(f.ctx).WithTimeout(helpers.PIUpdateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithBody(body).WithSharedProcessorPoolID(id) From 0dd5d429735baf6ce482292a0c4601fd982812d2 Mon Sep 17 00:00:00 2001 From: Yussuf Shaikh Date: Wed, 13 Mar 2024 21:15:47 +0530 Subject: [PATCH 013/118] Remove duplicate go setup step (#348) --- .github/workflows/go.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index b345bcf5..12494508 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -15,11 +15,6 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: '1.20' - - name: Set up Go uses: actions/setup-go@v5 with: From a5f5eefe20cf1fa7090b1b2c86fead4fd393fac0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Feb 2024 02:29:29 +0000 Subject: [PATCH 014/118] Bump github.com/IBM/go-sdk-core/v5 from 5.15.1 to 5.15.3 Bumps [github.com/IBM/go-sdk-core/v5](https://github.com/IBM/go-sdk-core) from 5.15.1 to 5.15.3. - [Release notes](https://github.com/IBM/go-sdk-core/releases) - [Changelog](https://github.com/IBM/go-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/go-sdk-core/compare/v5.15.1...v5.15.3) --- updated-dependencies: - dependency-name: github.com/IBM/go-sdk-core/v5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] From b28470aba54022ee95b413f01d6aef4909266f15 Mon Sep 17 00:00:00 2001 From: Yussuf Shaikh Date: Mon, 4 Mar 2024 09:35:42 +0530 Subject: [PATCH 015/118] Fix golangci-lint action v4 requirement Signed-off-by: Yussuf Shaikh --- .github/workflows/go.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 12494508..b345bcf5 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -15,6 +15,11 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.20' + - name: Set up Go uses: actions/setup-go@v5 with: From 091bf693f353939a79a78b213385c2cf1bc1a4dc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Feb 2024 02:29:29 +0000 Subject: [PATCH 016/118] Bump github.com/IBM/go-sdk-core/v5 from 5.15.1 to 5.15.3 Bumps [github.com/IBM/go-sdk-core/v5](https://github.com/IBM/go-sdk-core) from 5.15.1 to 5.15.3. - [Release notes](https://github.com/IBM/go-sdk-core/releases) - [Changelog](https://github.com/IBM/go-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/go-sdk-core/compare/v5.15.1...v5.15.3) --- updated-dependencies: - dependency-name: github.com/IBM/go-sdk-core/v5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 10 ++++++---- go.sum | 58 +++++++++++++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 55 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index 063cd48c..66ea26ff 100644 --- a/go.mod +++ b/go.mod @@ -4,14 +4,14 @@ go 1.20 require ( github.com/IBM/go-sdk-core/v5 v5.15.3 - github.com/IBM/platform-services-go-sdk v0.60.0 + github.com/IBM/platform-services-go-sdk v0.59.1 github.com/apparentlymart/go-cidr v1.1.0 github.com/go-openapi/errors v0.21.0 github.com/go-openapi/runtime v0.26.0 - github.com/go-openapi/strfmt v0.22.1 + github.com/go-openapi/strfmt v0.22.0 github.com/go-openapi/swag v0.22.5 github.com/go-openapi/validate v0.22.4 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.8.4 ) require ( @@ -28,6 +28,7 @@ require ( github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect github.com/go-playground/validator/v10 v10.17.0 // indirect + github.com/google/go-cmp v0.6.0 // indirect github.com/google/uuid v1.6.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-retryablehttp v0.7.5 // indirect @@ -36,9 +37,10 @@ require ( github.com/mailru/easyjson v0.7.7 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/oklog/ulid v1.3.1 // indirect + github.com/onsi/gomega v1.29.0 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - go.mongodb.org/mongo-driver v1.14.0 // indirect + go.mongodb.org/mongo-driver v1.13.1 // indirect go.opentelemetry.io/otel v1.14.0 // indirect go.opentelemetry.io/otel/trace v1.14.0 // indirect golang.org/x/crypto v0.18.0 // indirect diff --git a/go.sum b/go.sum index b4c1a0d5..56839574 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ github.com/IBM/go-sdk-core/v5 v5.15.3 h1:yBSSYLuQSO9Ip+j3mONsTcymoYQyxarQ6rh3aU9cVt8= github.com/IBM/go-sdk-core/v5 v5.15.3/go.mod h1:ee+AZaB15yUwZigJdRCwZZ3u7HIvEQzxNUdxVpnJHY8= -github.com/IBM/platform-services-go-sdk v0.60.0 h1:DXCp5hAtFO6quUmb5qKeosQw0ln/fYE5nrKjgXbiSBU= -github.com/IBM/platform-services-go-sdk v0.60.0/go.mod h1:fcmUb29QKLjMM0UWrR5bAidC7qfKWrf96H0xxmGJHdE= +github.com/IBM/platform-services-go-sdk v0.59.1 h1:qyXJX1sNgbDDrXb5M9LrjMjCm2w9dkSEtBGAfZJlT0Y= +github.com/IBM/platform-services-go-sdk v0.59.1/go.mod h1:cLKLn9Bd1YcTM/micLQmikjZDDQvRgfhdAHKOeulILg= github.com/apparentlymart/go-cidr v1.1.0 h1:2mAhrMoF+nhXqxTzSZMUzDHkLjmIHC+Zzn4tdgBZjnU= github.com/apparentlymart/go-cidr v1.1.0/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= @@ -31,8 +31,8 @@ github.com/go-openapi/runtime v0.26.0 h1:HYOFtG00FM1UvqrcxbEJg/SwvDRvYLQKGhw2zaQ github.com/go-openapi/runtime v0.26.0/go.mod h1:QgRGeZwrUcSHdeh4Ka9Glvo0ug1LC5WyE+EV88plZrQ= github.com/go-openapi/spec v0.20.12 h1:cgSLbrsmziAP2iais+Vz7kSazwZ8rsUZd6TUzdDgkVI= github.com/go-openapi/spec v0.20.12/go.mod h1:iSCgnBcwbMW9SfzJb8iYynXvcY6C/QFrI7otzF7xGM4= -github.com/go-openapi/strfmt v0.22.1 h1:5Ky8cybT4576C6Ffc+8gYji/wRXCo6Ozm8RaWjPI6jc= -github.com/go-openapi/strfmt v0.22.1/go.mod h1:OfVoytIXJasDkkGvkb1Cceb3BPyMOwk1FgmyyEw7NYg= +github.com/go-openapi/strfmt v0.22.0 h1:Ew9PnEYc246TwrEspvBdDHS4BVKXy/AOVsfqGDgAcaI= +github.com/go-openapi/strfmt v0.22.0/go.mod h1:HzJ9kokGIju3/K6ap8jL+OlGAbjpSv27135Yr9OivU4= github.com/go-openapi/swag v0.22.5 h1:fVS63IE3M0lsuWRzuom3RLwUMVI2peDH01s6M70ugys= github.com/go-openapi/swag v0.22.5/go.mod h1:Gl91UqO+btAM0plGGxHqJcQZ1ZTy6jbmridBTsDy8A0= github.com/go-openapi/validate v0.22.4 h1:5v3jmMyIPKTR8Lv9syBAIRxG6lY0RqeBPB1LKEijzk8= @@ -44,7 +44,10 @@ github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJn github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= github.com/go-playground/validator/v10 v10.17.0 h1:SmVVlfAOtlZncTxRuinDPomC2DkXJ4E5T9gDA0AIH74= github.com/go-playground/validator/v10 v10.17.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= +github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= @@ -55,6 +58,7 @@ github.com/hashicorp/go-retryablehttp v0.7.5 h1:bJj+Pj19UZMIweq/iie+1u5YCdGrnxCT github.com/hashicorp/go-retryablehttp v0.7.5/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/leodido/go-urn v1.3.0 h1:jX8FDLfW4ThVXctBNZ+3cIWnCSnrACDV73r76dy0aQQ= @@ -63,11 +67,13 @@ github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0 github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/gomega v1.31.1 h1:KYppCUK+bUgAZwHOu7EXVBKyQA6ILvOESHkn/tgoqvo= +github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg= +github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -76,23 +82,57 @@ github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDN github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -go.mongodb.org/mongo-driver v1.14.0 h1:P98w8egYRjYe3XDjxhYJagTokP/H6HzlsnojRgZRd80= -go.mongodb.org/mongo-driver v1.14.0/go.mod h1:Vzb0Mk/pa7e6cWw85R4F/endUC3u0U9jGcNU603k65c= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= +github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4= +github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM= +github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +go.mongodb.org/mongo-driver v1.13.1 h1:YIc7HTYsKndGK4RFzJ3covLz1byri52x0IoMB0Pt/vk= +go.mongodb.org/mongo-driver v1.13.1/go.mod h1:wcDf1JBCXy2mOW0bWHwO/IOYqdca1MPCwDtFu/Z9+eo= go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM= go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU= go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY= go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M= go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= From 0a7cd7d2bcee2321d8823d39378716d99f1e1776 Mon Sep 17 00:00:00 2001 From: Yussuf Shaikh Date: Mon, 4 Mar 2024 09:35:42 +0530 Subject: [PATCH 017/118] Fix golangci-lint action v4 requirement Signed-off-by: Yussuf Shaikh --- .github/workflows/go.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index b345bcf5..64a0c3b7 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -14,11 +14,6 @@ jobs: steps: - uses: actions/checkout@v4 - - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: '1.20' - name: Set up Go uses: actions/setup-go@v5 @@ -44,4 +39,4 @@ jobs: run: go test -v `go list ./... | grep -v '/power/' | grep -v examples` - name: Coverage - run: go test `go list ./... | grep -v '/power/' | grep -v examples` -coverprofile=profile.cov && go tool cover -func profile.cov + run: go test `go list ./... | grep -v '/power/' | grep -v examples` -coverprofile=profile.cov && go tool cover -func profile.cov \ No newline at end of file From 7336d57cc9f7f774c496ceab06b98ec49d703e06 Mon Sep 17 00:00:00 2001 From: michaelkad <45772690+michaelkad@users.noreply.github.com> Date: Mon, 4 Mar 2024 08:14:06 -0600 Subject: [PATCH 018/118] Add branch to dependabot (#338) * Add branch to dependabot * Fix build --- .github/workflows/go.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 64a0c3b7..a9afce70 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -14,6 +14,10 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.20' - name: Set up Go uses: actions/setup-go@v5 From d7614acbb4c7985d4f235db5b7da9e71270270c5 Mon Sep 17 00:00:00 2001 From: Yussuf Shaikh Date: Wed, 13 Mar 2024 21:15:47 +0530 Subject: [PATCH 019/118] Remove duplicate go setup step (#348) --- .github/workflows/go.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index a9afce70..64a0c3b7 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -14,10 +14,6 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: '1.20' - name: Set up Go uses: actions/setup-go@v5 From b5eab50dba901e6730d22a90907a410432d1e134 Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Fri, 1 Mar 2024 13:31:05 -0600 Subject: [PATCH 020/118] Update swagger client and models to service-broker v1.140.0 (#337) * Generated Swagger client from service-broker commit f482db37dd0b38392de1f3aecdc2219212147830 * Fix build --------- Co-authored-by: michael kad --- .github/workflows/go.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 64a0c3b7..183232cf 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -14,6 +14,11 @@ jobs: steps: - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.20' - name: Set up Go uses: actions/setup-go@v5 From 6e3be4a8e08292eeb0d76f26e3cda4ec276d512b Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Wed, 13 Mar 2024 10:42:12 -0500 Subject: [PATCH 021/118] Update swagger client and models to service-broker v1.140.0 (#346) * Bump github.com/IBM/go-sdk-core/v5 from 5.15.1 to 5.15.3 Bumps [github.com/IBM/go-sdk-core/v5](https://github.com/IBM/go-sdk-core) from 5.15.1 to 5.15.3. - [Release notes](https://github.com/IBM/go-sdk-core/releases) - [Changelog](https://github.com/IBM/go-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/go-sdk-core/compare/v5.15.1...v5.15.3) --- updated-dependencies: - dependency-name: github.com/IBM/go-sdk-core/v5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Fix golangci-lint action v4 requirement Signed-off-by: Yussuf Shaikh * Update golangci-lint version and skip cache Signed-off-by: Yussuf Shaikh * Add branch to dependabot (#338) * Add branch to dependabot * Fix build * Generated Swagger client from service-broker commit 1db48bf5f665abf4e91c66d019aa231b913db3d9 --------- Signed-off-by: dependabot[bot] Signed-off-by: Yussuf Shaikh Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Yussuf Shaikh Co-authored-by: michaelkad <45772690+michaelkad@users.noreply.github.com> --- .github/workflows/go.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 183232cf..dd321b20 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -15,11 +15,6 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: '1.20' - - name: Set up Go uses: actions/setup-go@v5 with: From 3f8867e9a026a6e7cfa98ab6f381aec8a1f6ef39 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Feb 2024 02:29:29 +0000 Subject: [PATCH 022/118] Bump github.com/IBM/go-sdk-core/v5 from 5.15.1 to 5.15.3 Bumps [github.com/IBM/go-sdk-core/v5](https://github.com/IBM/go-sdk-core) from 5.15.1 to 5.15.3. - [Release notes](https://github.com/IBM/go-sdk-core/releases) - [Changelog](https://github.com/IBM/go-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/go-sdk-core/compare/v5.15.1...v5.15.3) --- updated-dependencies: - dependency-name: github.com/IBM/go-sdk-core/v5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] From fbd13219cbd6916a1cfa3bd6c700e7aa0c6f7f89 Mon Sep 17 00:00:00 2001 From: michaelkad <45772690+michaelkad@users.noreply.github.com> Date: Mon, 4 Mar 2024 08:14:06 -0600 Subject: [PATCH 023/118] Add branch to dependabot (#338) * Add branch to dependabot * Fix build From 50dc09e273d155a44ecf2f8cdecdf460cb2c6742 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Feb 2024 02:29:29 +0000 Subject: [PATCH 024/118] Bump github.com/IBM/go-sdk-core/v5 from 5.15.1 to 5.15.3 Bumps [github.com/IBM/go-sdk-core/v5](https://github.com/IBM/go-sdk-core) from 5.15.1 to 5.15.3. - [Release notes](https://github.com/IBM/go-sdk-core/releases) - [Changelog](https://github.com/IBM/go-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/go-sdk-core/compare/v5.15.1...v5.15.3) --- updated-dependencies: - dependency-name: github.com/IBM/go-sdk-core/v5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] From 79508bdef1165a7c750022cf5a8c9b1d047122bb Mon Sep 17 00:00:00 2001 From: michaelkad <45772690+michaelkad@users.noreply.github.com> Date: Fri, 1 Mar 2024 13:20:18 -0600 Subject: [PATCH 025/118] Add hostgroups (#326) * Add hostgroups * Fix build --- clients/instance/ibm-pi-hostgroups.go | 163 ++++++++++++++++++++++++++ examples/hostgroups/main.go | 62 ++++++++++ 2 files changed, 225 insertions(+) create mode 100644 clients/instance/ibm-pi-hostgroups.go create mode 100644 examples/hostgroups/main.go diff --git a/clients/instance/ibm-pi-hostgroups.go b/clients/instance/ibm-pi-hostgroups.go new file mode 100644 index 00000000..4ded770e --- /dev/null +++ b/clients/instance/ibm-pi-hostgroups.go @@ -0,0 +1,163 @@ +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/hostgroups" + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// IBMPIHostgroupsClient +type IBMPIHostgroupsClient struct { + IBMPIClient +} + +// NewIBMPIHostgroupsClient +func NewIBMPHostgroupsClient(ctx context.Context, sess *ibmpisession.IBMPISession, cloudInstanceID string) *IBMPIHostgroupsClient { + return &IBMPIHostgroupsClient{ + *NewIBMPIClient(ctx, sess, cloudInstanceID), + } +} + +// Get All available hosts +func (f *IBMPIHostgroupsClient) GetAvailableHosts() (models.AvailableHostList, error) { + params := hostgroups.NewV1AvailableHostsParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut) + resp, err := f.session.Power.Hostgroups.V1AvailableHosts(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Get available hosts for %s: %w", f.cloudInstanceID, err)) + } + + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to Get Available hosts") + } + return resp.Payload, nil +} + +// Get all Hostgroups +func (f *IBMPIHostgroupsClient) GetHostgroups() (models.HostgroupList, error) { + params := hostgroups.NewV1HostgroupsGetParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut) + resp, err := f.session.Power.Hostgroups.V1HostgroupsGet(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Get Hostgroups for %s: %w", f.cloudInstanceID, err)) + } + + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to Get Hostgroups") + } + return resp.Payload, nil +} + +// Create a Hostgroup +func (f *IBMPIHostgroupsClient) CreateHostgroup(body *models.HostgroupCreate) (*models.Hostgroup, error) { + params := hostgroups.NewV1HostgroupsPostParams().WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).WithBody(body) + resp, err := f.session.Power.Hostgroups.V1HostgroupsPost(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Create Hostgroup for %s: %w", f.cloudInstanceID, err)) + } + + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to Get Hostgroups") + } + return resp.Payload, nil +} + +// Update a Hostgroup +func (f *IBMPIHostgroupsClient) UpdateHostgroup(body *models.HostgroupShareOp, id string) (*models.Hostgroup, error) { + params := hostgroups.NewV1HostgroupsIDPutParams().WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).WithBody(body).WithHostgroupID(id) + resp, err := f.session.Power.Hostgroups.V1HostgroupsIDPut(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Update Hostgroup for %s: %w", f.cloudInstanceID, err)) + } + + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to Update Hostgroups") + } + return resp.Payload, nil +} + +// Get a Hostgroup +func (f *IBMPIHostgroupsClient) GetHostgroup(id string) (*models.Hostgroup, error) { + params := hostgroups.NewV1HostgroupsIDGetParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).WithHostgroupID(id) + resp, err := f.session.Power.Hostgroups.V1HostgroupsIDGet(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Get Hostgroup %s for %s: %w", id, f.cloudInstanceID, err)) + } + + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to Get Hostgroup %s", id) + } + return resp.Payload, nil +} + +// Get All Hosts +func (f *IBMPIHostgroupsClient) GetHosts() (models.HostList, error) { + params := hostgroups.NewV1HostsGetParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut) + 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)) + } + + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to Get Hosts") + } + return resp.Payload, nil +} + +// Create a Host +func (f *IBMPIHostgroupsClient) CreateHost(body *models.HostCreate) (*models.Host, error) { + params := hostgroups.NewV1HostsPostParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).WithBody(body) + resp, err := f.session.Power.Hostgroups.V1HostsPost(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Create Hosts for %s: %w", f.cloudInstanceID, err)) + } + + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to Create Hosts") + } + return resp.Payload, nil +} + +// Get a Host +func (f *IBMPIHostgroupsClient) GetHost(id string) (*models.Host, error) { + params := hostgroups.NewV1HostsIDGetParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).WithHostID(id) + 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)) + } + + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to Get Host %s", id) + } + return resp.Payload, nil +} + +// Update a Host +func (f *IBMPIHostgroupsClient) UpdateHost(body *models.HostPut, id string) (*models.Host, error) { + params := hostgroups.NewV1HostsIDPutParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).WithHostID(id).WithBody(body) + resp, err := f.session.Power.Hostgroups.V1HostsIDPut(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Update Host %s for %s: %w", id, f.cloudInstanceID, err)) + } + + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to Update Host %s", id) + } + return resp.Payload, nil +} + +// Delete a Host +func (f *IBMPIHostgroupsClient) DeleteHost(id string) error { + params := hostgroups.NewV1HostsIDDeleteParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).WithHostID(id) + resp, err := f.session.Power.Hostgroups.V1HostsIDDelete(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Delete Host %s for %s: %w", id, f.cloudInstanceID, err)) + } + + if resp == nil || resp.Payload == nil { + return fmt.Errorf("failed to Delete Host %s", id) + } + return nil +} diff --git a/examples/hostgroups/main.go b/examples/hostgroups/main.go new file mode 100644 index 00000000..d1ab8bfa --- /dev/null +++ b/examples/hostgroups/main.go @@ -0,0 +1,62 @@ +package main + +import ( + "context" + "log" + + v "github.com/IBM-Cloud/power-go-client/clients/instance" + ps "github.com/IBM-Cloud/power-go-client/ibmpisession" + "github.com/IBM/go-sdk-core/v5/core" +) + +func main() { + //session Inputs + // < IAM TOKEN > + // token := "" + apiKey := "" + region := " < REGION > " + zone := " < ZONE > " + accountID := " < ACCOUNT ID > " + url := region + ".power-iaas.test.cloud.ibm.com" + + // dr location inputs + piID := " < POWER INSTANCE ID > " + + // authenticator := &core.BearerTokenAuthenticator{ + // BearerToken: token, + // } + authenticator := &core.IamAuthenticator{ + ApiKey: apiKey, + // Uncomment for test environment + URL: "https://iam.test.cloud.ibm.com", + } + + // Create the session + options := &ps.IBMPIOptions{ + Authenticator: authenticator, + UserAccount: accountID, + Zone: zone, + URL: url, + Debug: true, + } + session, err := ps.NewIBMPISession(options) + if err != nil { + log.Fatal(err) + } + powerClient := v.NewIBMPHostgroupsClient(context.Background(), session, piID) + if err != nil { + log.Fatal(err) + } + + getAllAvailableHost, err := powerClient.GetAvailableHosts() + if err != nil { + log.Fatal(err) + } + log.Printf("***************[0]****************** %+v \n", getAllAvailableHost) + + getHostgroups, err := powerClient.GetHostgroups() + if err != nil { + log.Fatal(err) + } + log.Printf("***************[1]****************** %+v \n", getHostgroups) +} From cc26ee65eb886041e71ad286c224e56c033562c3 Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Fri, 1 Mar 2024 13:31:05 -0600 Subject: [PATCH 026/118] Update swagger client and models to service-broker v1.140.0 (#337) * Generated Swagger client from service-broker commit f482db37dd0b38392de1f3aecdc2219212147830 * Fix build --------- Co-authored-by: michael kad --- .github/workflows/go.yml | 5 +++++ power/models/p_vm_instance_create.go | 2 +- power/models/s_a_p_create.go | 2 +- power/models/s_a_p_profile.go | 3 +++ power/models/volumes_clone_async_request.go | 1 + power/models/volumes_clone_execute.go | 1 + power/models/volumes_clone_request.go | 1 + 7 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 56a83e7c..b345bcf5 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -14,6 +14,11 @@ jobs: steps: - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.20' - name: Set up Go uses: actions/setup-go@v5 diff --git a/power/models/p_vm_instance_create.go b/power/models/p_vm_instance_create.go index 013a094c..62cceaef 100644 --- a/power/models/p_vm_instance_create.go +++ b/power/models/p_vm_instance_create.go @@ -106,7 +106,7 @@ type PVMInstanceCreate struct { // System type used to host the instance SysType string `json:"sysType,omitempty"` - // Cloud init user defined data + // 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"` // The pvm instance virtual CPU information diff --git a/power/models/s_a_p_create.go b/power/models/s_a_p_create.go index e16ee442..632bc758 100644 --- a/power/models/s_a_p_create.go +++ b/power/models/s_a_p_create.go @@ -63,7 +63,7 @@ type SAPCreate struct { // System type used to host the instance. Only e880, e980, e1080 are supported SysType string `json:"sysType,omitempty"` - // Cloud init user defined data + // 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"` // List of Volume IDs to attach to the pvm-instance on creation diff --git a/power/models/s_a_p_profile.go b/power/models/s_a_p_profile.go index 73096fa6..6333b489 100644 --- a/power/models/s_a_p_profile.go +++ b/power/models/s_a_p_profile.go @@ -36,6 +36,9 @@ type SAPProfile struct { // Required: true ProfileID *string `json:"profileID"` + // List of supported systems + SupportedSystems []string `json:"supportedSystems"` + // Type of profile // Required: true // Enum: [balanced compute memory non-production ultra-memory] diff --git a/power/models/volumes_clone_async_request.go b/power/models/volumes_clone_async_request.go index 7c4628c2..1b0993a1 100644 --- a/power/models/volumes_clone_async_request.go +++ b/power/models/volumes_clone_async_request.go @@ -26,6 +26,7 @@ type VolumesCloneAsyncRequest struct { // 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"` diff --git a/power/models/volumes_clone_execute.go b/power/models/volumes_clone_execute.go index 1d880001..b470cb78 100644 --- a/power/models/volumes_clone_execute.go +++ b/power/models/volumes_clone_execute.go @@ -26,6 +26,7 @@ type VolumesCloneExecute struct { // 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"` diff --git a/power/models/volumes_clone_request.go b/power/models/volumes_clone_request.go index 7ed5f8c5..cb238678 100644 --- a/power/models/volumes_clone_request.go +++ b/power/models/volumes_clone_request.go @@ -25,6 +25,7 @@ type VolumesCloneRequest struct { // 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"` From d78b5772259b89373b8ad0a59231057da5f2eab0 Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Wed, 13 Mar 2024 10:42:12 -0500 Subject: [PATCH 027/118] Update swagger client and models to service-broker v1.140.0 (#346) * Bump github.com/IBM/go-sdk-core/v5 from 5.15.1 to 5.15.3 Bumps [github.com/IBM/go-sdk-core/v5](https://github.com/IBM/go-sdk-core) from 5.15.1 to 5.15.3. - [Release notes](https://github.com/IBM/go-sdk-core/releases) - [Changelog](https://github.com/IBM/go-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/go-sdk-core/compare/v5.15.1...v5.15.3) --- updated-dependencies: - dependency-name: github.com/IBM/go-sdk-core/v5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Fix golangci-lint action v4 requirement Signed-off-by: Yussuf Shaikh * Update golangci-lint version and skip cache Signed-off-by: Yussuf Shaikh * Add branch to dependabot (#338) * Add branch to dependabot * Fix build * Generated Swagger client from service-broker commit 1db48bf5f665abf4e91c66d019aa231b913db3d9 --------- Signed-off-by: dependabot[bot] Signed-off-by: Yussuf Shaikh Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Yussuf Shaikh Co-authored-by: michaelkad <45772690+michaelkad@users.noreply.github.com> --- .github/workflows/go.yml | 5 - go.mod | 10 +- go.sum | 58 +++++++++-- power/models/host.go | 39 ++++---- power/models/host_capacity.go | 127 +++++++++++++++++++++---- power/models/host_resource_capacity.go | 59 ++++++++++++ power/models/hostgroup_href.go | 27 ------ power/models/hostgroup_summary.go | 56 +++++++++++ 8 files changed, 300 insertions(+), 81 deletions(-) create mode 100644 power/models/host_resource_capacity.go delete mode 100644 power/models/hostgroup_href.go create mode 100644 power/models/hostgroup_summary.go diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index b345bcf5..12494508 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -15,11 +15,6 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: '1.20' - - name: Set up Go uses: actions/setup-go@v5 with: diff --git a/go.mod b/go.mod index 063cd48c..66ea26ff 100644 --- a/go.mod +++ b/go.mod @@ -4,14 +4,14 @@ go 1.20 require ( github.com/IBM/go-sdk-core/v5 v5.15.3 - github.com/IBM/platform-services-go-sdk v0.60.0 + github.com/IBM/platform-services-go-sdk v0.59.1 github.com/apparentlymart/go-cidr v1.1.0 github.com/go-openapi/errors v0.21.0 github.com/go-openapi/runtime v0.26.0 - github.com/go-openapi/strfmt v0.22.1 + github.com/go-openapi/strfmt v0.22.0 github.com/go-openapi/swag v0.22.5 github.com/go-openapi/validate v0.22.4 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.8.4 ) require ( @@ -28,6 +28,7 @@ require ( github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect github.com/go-playground/validator/v10 v10.17.0 // indirect + github.com/google/go-cmp v0.6.0 // indirect github.com/google/uuid v1.6.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-retryablehttp v0.7.5 // indirect @@ -36,9 +37,10 @@ require ( github.com/mailru/easyjson v0.7.7 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/oklog/ulid v1.3.1 // indirect + github.com/onsi/gomega v1.29.0 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - go.mongodb.org/mongo-driver v1.14.0 // indirect + go.mongodb.org/mongo-driver v1.13.1 // indirect go.opentelemetry.io/otel v1.14.0 // indirect go.opentelemetry.io/otel/trace v1.14.0 // indirect golang.org/x/crypto v0.18.0 // indirect diff --git a/go.sum b/go.sum index b4c1a0d5..56839574 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ github.com/IBM/go-sdk-core/v5 v5.15.3 h1:yBSSYLuQSO9Ip+j3mONsTcymoYQyxarQ6rh3aU9cVt8= github.com/IBM/go-sdk-core/v5 v5.15.3/go.mod h1:ee+AZaB15yUwZigJdRCwZZ3u7HIvEQzxNUdxVpnJHY8= -github.com/IBM/platform-services-go-sdk v0.60.0 h1:DXCp5hAtFO6quUmb5qKeosQw0ln/fYE5nrKjgXbiSBU= -github.com/IBM/platform-services-go-sdk v0.60.0/go.mod h1:fcmUb29QKLjMM0UWrR5bAidC7qfKWrf96H0xxmGJHdE= +github.com/IBM/platform-services-go-sdk v0.59.1 h1:qyXJX1sNgbDDrXb5M9LrjMjCm2w9dkSEtBGAfZJlT0Y= +github.com/IBM/platform-services-go-sdk v0.59.1/go.mod h1:cLKLn9Bd1YcTM/micLQmikjZDDQvRgfhdAHKOeulILg= github.com/apparentlymart/go-cidr v1.1.0 h1:2mAhrMoF+nhXqxTzSZMUzDHkLjmIHC+Zzn4tdgBZjnU= github.com/apparentlymart/go-cidr v1.1.0/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= @@ -31,8 +31,8 @@ github.com/go-openapi/runtime v0.26.0 h1:HYOFtG00FM1UvqrcxbEJg/SwvDRvYLQKGhw2zaQ github.com/go-openapi/runtime v0.26.0/go.mod h1:QgRGeZwrUcSHdeh4Ka9Glvo0ug1LC5WyE+EV88plZrQ= github.com/go-openapi/spec v0.20.12 h1:cgSLbrsmziAP2iais+Vz7kSazwZ8rsUZd6TUzdDgkVI= github.com/go-openapi/spec v0.20.12/go.mod h1:iSCgnBcwbMW9SfzJb8iYynXvcY6C/QFrI7otzF7xGM4= -github.com/go-openapi/strfmt v0.22.1 h1:5Ky8cybT4576C6Ffc+8gYji/wRXCo6Ozm8RaWjPI6jc= -github.com/go-openapi/strfmt v0.22.1/go.mod h1:OfVoytIXJasDkkGvkb1Cceb3BPyMOwk1FgmyyEw7NYg= +github.com/go-openapi/strfmt v0.22.0 h1:Ew9PnEYc246TwrEspvBdDHS4BVKXy/AOVsfqGDgAcaI= +github.com/go-openapi/strfmt v0.22.0/go.mod h1:HzJ9kokGIju3/K6ap8jL+OlGAbjpSv27135Yr9OivU4= github.com/go-openapi/swag v0.22.5 h1:fVS63IE3M0lsuWRzuom3RLwUMVI2peDH01s6M70ugys= github.com/go-openapi/swag v0.22.5/go.mod h1:Gl91UqO+btAM0plGGxHqJcQZ1ZTy6jbmridBTsDy8A0= github.com/go-openapi/validate v0.22.4 h1:5v3jmMyIPKTR8Lv9syBAIRxG6lY0RqeBPB1LKEijzk8= @@ -44,7 +44,10 @@ github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJn github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= github.com/go-playground/validator/v10 v10.17.0 h1:SmVVlfAOtlZncTxRuinDPomC2DkXJ4E5T9gDA0AIH74= github.com/go-playground/validator/v10 v10.17.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= +github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= @@ -55,6 +58,7 @@ github.com/hashicorp/go-retryablehttp v0.7.5 h1:bJj+Pj19UZMIweq/iie+1u5YCdGrnxCT github.com/hashicorp/go-retryablehttp v0.7.5/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/leodido/go-urn v1.3.0 h1:jX8FDLfW4ThVXctBNZ+3cIWnCSnrACDV73r76dy0aQQ= @@ -63,11 +67,13 @@ github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0 github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/gomega v1.31.1 h1:KYppCUK+bUgAZwHOu7EXVBKyQA6ILvOESHkn/tgoqvo= +github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg= +github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -76,23 +82,57 @@ github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDN github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -go.mongodb.org/mongo-driver v1.14.0 h1:P98w8egYRjYe3XDjxhYJagTokP/H6HzlsnojRgZRd80= -go.mongodb.org/mongo-driver v1.14.0/go.mod h1:Vzb0Mk/pa7e6cWw85R4F/endUC3u0U9jGcNU603k65c= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= +github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4= +github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM= +github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +go.mongodb.org/mongo-driver v1.13.1 h1:YIc7HTYsKndGK4RFzJ3covLz1byri52x0IoMB0Pt/vk= +go.mongodb.org/mongo-driver v1.13.1/go.mod h1:wcDf1JBCXy2mOW0bWHwO/IOYqdca1MPCwDtFu/Z9+eo= go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM= go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU= go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY= go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M= go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= diff --git a/power/models/host.go b/power/models/host.go index d0ad65f7..4f4ac653 100644 --- a/power/models/host.go +++ b/power/models/host.go @@ -24,8 +24,8 @@ type Host struct { // Name of the host (chosen by the user) DisplayName string `json:"displayName,omitempty"` - // Link to the owning hostgroup - Hostgroup HostgroupHref `json:"hostgroup,omitempty"` + // Information about the owning hostgroup + Hostgroup *HostgroupSummary `json:"hostgroup,omitempty"` // ID of the host ID string `json:"id,omitempty"` @@ -82,13 +82,15 @@ func (m *Host) validateHostgroup(formats strfmt.Registry) error { return 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") + 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 err } return nil @@ -135,17 +137,20 @@ func (m *Host) contextValidateCapacity(ctx context.Context, formats strfmt.Regis func (m *Host) contextValidateHostgroup(ctx context.Context, formats strfmt.Registry) error { - if swag.IsZero(m.Hostgroup) { // not required - return nil - } + if m.Hostgroup != 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") + 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 err } return nil diff --git a/power/models/host_capacity.go b/power/models/host_capacity.go index 1e822fb7..9ded7f72 100644 --- a/power/models/host_capacity.go +++ b/power/models/host_capacity.go @@ -8,6 +8,7 @@ package models import ( "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -17,38 +18,126 @@ import ( // swagger:model HostCapacity type HostCapacity struct { - // Number of cores currently available - AvailableCore float64 `json:"availableCore,omitempty"` + // Core capacity of the host + Cores *HostResourceCapacity `json:"cores,omitempty"` - // Amount of memory currently available (in MB) - AvailableMemory float64 `json:"availableMemory,omitempty"` + // Memory capacity of the host (in MB) + Memory *HostResourceCapacity `json:"memory,omitempty"` +} - // Number of cores reserved for system use - ReservedCore float64 `json:"reservedCore,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) + } - // Amount of memory reserved for system use (in MB) - ReservedMemory float64 `json:"reservedMemory,omitempty"` + if err := m.validateMemory(formats); err != nil { + res = append(res, err) + } - // Total number of cores of the host - TotalCore float64 `json:"totalCore,omitempty"` + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} - // Total amount of memory of the host (in MB) - TotalMemory float64 `json:"totalMemory,omitempty"` +func (m *HostCapacity) validateCores(formats strfmt.Registry) error { + if swag.IsZero(m.Cores) { // not required + return nil + } - // Number of cores in use on the host - UsedCore float64 `json:"usedCore,omitempty"` + 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 + } + } - // Amount of memory used on the host (in MB) - UsedMemory float64 `json:"usedMemory,omitempty"` + return nil } -// Validate validates this host capacity -func (m *HostCapacity) Validate(formats strfmt.Registry) error { +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 validates this host capacity based on context it is used +// 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 } diff --git a/power/models/host_resource_capacity.go b/power/models/host_resource_capacity.go new file mode 100644 index 00000000..4814c505 --- /dev/null +++ b/power/models/host_resource_capacity.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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" +) + +// HostResourceCapacity host resource capacity +// +// swagger:model HostResourceCapacity +type HostResourceCapacity struct { + + // available + Available float64 `json:"available,omitempty"` + + // reserved + Reserved float64 `json:"reserved,omitempty"` + + // total + Total float64 `json:"total,omitempty"` + + // used + Used float64 `json:"used,omitempty"` +} + +// Validate validates this host resource capacity +func (m *HostResourceCapacity) Validate(formats strfmt.Registry) error { + 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/hostgroup_href.go b/power/models/hostgroup_href.go deleted file mode 100644 index 2733f00f..00000000 --- a/power/models/hostgroup_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" -) - -// HostgroupHref Link to hostgroup resource -// -// swagger:model HostgroupHref -type HostgroupHref string - -// Validate validates this hostgroup href -func (m HostgroupHref) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this hostgroup href based on context it is used -func (m HostgroupHref) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/power/models/hostgroup_summary.go b/power/models/hostgroup_summary.go new file mode 100644 index 00000000..6112fd1d --- /dev/null +++ b/power/models/hostgroup_summary.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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 hostgroup summary +// +// swagger:model HostgroupSummary +type HostgroupSummary struct { + + // Whether the hostgroup is a primary or secondary hostgroup + Access string `json:"access,omitempty"` + + // Link to the hostgroup resource + Href string `json:"href,omitempty"` + + // Name of the hostgroup + Name string `json:"name,omitempty"` +} + +// Validate validates this hostgroup summary +func (m *HostgroupSummary) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this hostgroup 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 +} From 8cf745a4620e5fb8c87af1192c7aa5cc553cc0ce Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Wed, 13 Mar 2024 10:47:37 -0500 Subject: [PATCH 028/118] Update swagger client and models to service-broker v1.140.0 (#347) * Bump github.com/IBM/go-sdk-core/v5 from 5.15.1 to 5.15.3 Bumps [github.com/IBM/go-sdk-core/v5](https://github.com/IBM/go-sdk-core) from 5.15.1 to 5.15.3. - [Release notes](https://github.com/IBM/go-sdk-core/releases) - [Changelog](https://github.com/IBM/go-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/go-sdk-core/compare/v5.15.1...v5.15.3) --- updated-dependencies: - dependency-name: github.com/IBM/go-sdk-core/v5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Fix golangci-lint action v4 requirement Signed-off-by: Yussuf Shaikh * Update golangci-lint version and skip cache Signed-off-by: Yussuf Shaikh * Add branch to dependabot (#338) * Add branch to dependabot * Fix build * Generated Swagger client from service-broker commit b0bfdfb575c650fd620a92f064c1f7b05d1dd56d --------- Signed-off-by: dependabot[bot] Signed-off-by: Yussuf Shaikh Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Yussuf Shaikh Co-authored-by: michaelkad <45772690+michaelkad@users.noreply.github.com> --- power/models/create_cos_image_import_job.go | 51 +++++ power/models/image_import_details.go | 205 ++++++++++++++++++++ 2 files changed, 256 insertions(+) create mode 100644 power/models/image_import_details.go diff --git a/power/models/create_cos_image_import_job.go b/power/models/create_cos_image_import_job.go index 12186df3..7511771e 100644 --- a/power/models/create_cos_image_import_job.go +++ b/power/models/create_cos_image_import_job.go @@ -39,6 +39,9 @@ type CreateCosImageImportJob struct { // 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"` @@ -80,6 +83,10 @@ func (m *CreateCosImageImportJob) Validate(formats strfmt.Registry) error { 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) } @@ -167,6 +174,25 @@ func (m *CreateCosImageImportJob) validateImageName(formats strfmt.Registry) 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() { @@ -247,6 +273,10 @@ func (m *CreateCosImageImportJob) validateStorageAffinity(formats strfmt.Registr 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) } @@ -257,6 +287,27 @@ func (m *CreateCosImageImportJob) ContextValidate(ctx context.Context, formats s 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 { diff --git a/power/models/image_import_details.go b/power/models/image_import_details.go new file mode 100644 index 00000000..59560a09 --- /dev/null +++ b/power/models/image_import_details.go @@ -0,0 +1,205 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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 +} From de0be2687f3dfc4a0070351d1925507386154058 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Feb 2024 02:29:29 +0000 Subject: [PATCH 029/118] Bump github.com/IBM/go-sdk-core/v5 from 5.15.1 to 5.15.3 Bumps [github.com/IBM/go-sdk-core/v5](https://github.com/IBM/go-sdk-core) from 5.15.1 to 5.15.3. - [Release notes](https://github.com/IBM/go-sdk-core/releases) - [Changelog](https://github.com/IBM/go-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/go-sdk-core/compare/v5.15.1...v5.15.3) --- updated-dependencies: - dependency-name: github.com/IBM/go-sdk-core/v5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] From 77e29f24e342a42e82dd56897f6d4f7b1de93415 Mon Sep 17 00:00:00 2001 From: Yussuf Shaikh Date: Mon, 4 Mar 2024 09:35:42 +0530 Subject: [PATCH 030/118] Fix golangci-lint action v4 requirement Signed-off-by: Yussuf Shaikh --- .github/workflows/go.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 12494508..b345bcf5 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -15,6 +15,11 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.20' + - name: Set up Go uses: actions/setup-go@v5 with: From bc7627fcb5f3072fc6e594afa5e57c71373e2481 Mon Sep 17 00:00:00 2001 From: michaelkad <45772690+michaelkad@users.noreply.github.com> Date: Mon, 4 Mar 2024 08:14:06 -0600 Subject: [PATCH 031/118] Add branch to dependabot (#338) * Add branch to dependabot * Fix build From 1b317842b6986eaa17903a1ea9cfa8ef6b576daa Mon Sep 17 00:00:00 2001 From: Yussuf Shaikh Date: Wed, 13 Mar 2024 21:15:47 +0530 Subject: [PATCH 032/118] Remove duplicate go setup step (#348) --- .github/workflows/go.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index b345bcf5..12494508 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -15,11 +15,6 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: '1.20' - - name: Set up Go uses: actions/setup-go@v5 with: From d8ff7dc1a8e2626ebf082b1dbfd8822c84215ae0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Feb 2024 02:29:29 +0000 Subject: [PATCH 033/118] Bump github.com/IBM/go-sdk-core/v5 from 5.15.1 to 5.15.3 Bumps [github.com/IBM/go-sdk-core/v5](https://github.com/IBM/go-sdk-core) from 5.15.1 to 5.15.3. - [Release notes](https://github.com/IBM/go-sdk-core/releases) - [Changelog](https://github.com/IBM/go-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/go-sdk-core/compare/v5.15.1...v5.15.3) --- updated-dependencies: - dependency-name: github.com/IBM/go-sdk-core/v5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] From 2473bcb3876dc24182acf2d6cdd34b1d596a20e2 Mon Sep 17 00:00:00 2001 From: Yussuf Shaikh Date: Mon, 4 Mar 2024 09:35:42 +0530 Subject: [PATCH 034/118] Fix golangci-lint action v4 requirement Signed-off-by: Yussuf Shaikh --- .github/workflows/go.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 12494508..b345bcf5 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -15,6 +15,11 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.20' + - name: Set up Go uses: actions/setup-go@v5 with: From 768f51686a4724f7e73c76018565519717e55283 Mon Sep 17 00:00:00 2001 From: Yussuf Shaikh Date: Mon, 4 Mar 2024 09:35:42 +0530 Subject: [PATCH 035/118] Fix golangci-lint action v4 requirement Signed-off-by: Yussuf Shaikh --- .github/workflows/go.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index b345bcf5..64a0c3b7 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -14,11 +14,6 @@ jobs: steps: - uses: actions/checkout@v4 - - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: '1.20' - name: Set up Go uses: actions/setup-go@v5 @@ -44,4 +39,4 @@ jobs: run: go test -v `go list ./... | grep -v '/power/' | grep -v examples` - name: Coverage - run: go test `go list ./... | grep -v '/power/' | grep -v examples` -coverprofile=profile.cov && go tool cover -func profile.cov + run: go test `go list ./... | grep -v '/power/' | grep -v examples` -coverprofile=profile.cov && go tool cover -func profile.cov \ No newline at end of file From 8ff6540d8cecb923de1369202dccb54151c57a1c Mon Sep 17 00:00:00 2001 From: michaelkad <45772690+michaelkad@users.noreply.github.com> Date: Mon, 4 Mar 2024 08:14:06 -0600 Subject: [PATCH 036/118] Add branch to dependabot (#338) * Add branch to dependabot * Fix build --- .github/workflows/go.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 64a0c3b7..a9afce70 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -14,6 +14,10 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.20' - name: Set up Go uses: actions/setup-go@v5 From 7f9a509308103301bd40bf1efaa74d086923cace Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Fri, 1 Mar 2024 13:31:05 -0600 Subject: [PATCH 037/118] Update swagger client and models to service-broker v1.140.0 (#337) * Generated Swagger client from service-broker commit f482db37dd0b38392de1f3aecdc2219212147830 * Fix build --------- Co-authored-by: michael kad --- .github/workflows/go.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index a9afce70..183232cf 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -14,6 +14,7 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Set up Go uses: actions/setup-go@v5 with: From 583e237d055c2075ac37cd21cdbc557df7cd434a Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Wed, 13 Mar 2024 10:42:12 -0500 Subject: [PATCH 038/118] Update swagger client and models to service-broker v1.140.0 (#346) * Bump github.com/IBM/go-sdk-core/v5 from 5.15.1 to 5.15.3 Bumps [github.com/IBM/go-sdk-core/v5](https://github.com/IBM/go-sdk-core) from 5.15.1 to 5.15.3. - [Release notes](https://github.com/IBM/go-sdk-core/releases) - [Changelog](https://github.com/IBM/go-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/go-sdk-core/compare/v5.15.1...v5.15.3) --- updated-dependencies: - dependency-name: github.com/IBM/go-sdk-core/v5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Fix golangci-lint action v4 requirement Signed-off-by: Yussuf Shaikh * Update golangci-lint version and skip cache Signed-off-by: Yussuf Shaikh * Add branch to dependabot (#338) * Add branch to dependabot * Fix build * Generated Swagger client from service-broker commit 1db48bf5f665abf4e91c66d019aa231b913db3d9 --------- Signed-off-by: dependabot[bot] Signed-off-by: Yussuf Shaikh Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Yussuf Shaikh Co-authored-by: michaelkad <45772690+michaelkad@users.noreply.github.com> --- .github/workflows/go.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 183232cf..dd321b20 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -15,11 +15,6 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: '1.20' - - name: Set up Go uses: actions/setup-go@v5 with: From 57071c4b38f4c9062a08472ec6fdcb253288c006 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Feb 2024 02:29:29 +0000 Subject: [PATCH 039/118] Bump github.com/IBM/go-sdk-core/v5 from 5.15.1 to 5.15.3 Bumps [github.com/IBM/go-sdk-core/v5](https://github.com/IBM/go-sdk-core) from 5.15.1 to 5.15.3. - [Release notes](https://github.com/IBM/go-sdk-core/releases) - [Changelog](https://github.com/IBM/go-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/go-sdk-core/compare/v5.15.1...v5.15.3) --- updated-dependencies: - dependency-name: github.com/IBM/go-sdk-core/v5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] From f3907ff29809a394707c7af32eb2a3a60de675b2 Mon Sep 17 00:00:00 2001 From: michaelkad <45772690+michaelkad@users.noreply.github.com> Date: Mon, 4 Mar 2024 08:14:06 -0600 Subject: [PATCH 040/118] Add branch to dependabot (#338) * Add branch to dependabot * Fix build From b1cc07060a150c6f63a27315bc950f1f72b2f5e2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Feb 2024 02:29:29 +0000 Subject: [PATCH 041/118] Bump github.com/IBM/go-sdk-core/v5 from 5.15.1 to 5.15.3 Bumps [github.com/IBM/go-sdk-core/v5](https://github.com/IBM/go-sdk-core) from 5.15.1 to 5.15.3. - [Release notes](https://github.com/IBM/go-sdk-core/releases) - [Changelog](https://github.com/IBM/go-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/go-sdk-core/compare/v5.15.1...v5.15.3) --- updated-dependencies: - dependency-name: github.com/IBM/go-sdk-core/v5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] From 1983051d5ae4b50f4de6fcbda187f7e2340d1b18 Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Thu, 14 Mar 2024 11:39:48 -0500 Subject: [PATCH 042/118] Generated Swagger client from service-broker commit 0fecb85e68db0dcc5ddf2eb1072b39d45e2fef86 (#356) --- .../p_cloud_volumes/p_cloud_volumes_client.go | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/power/client/p_cloud_volumes/p_cloud_volumes_client.go b/power/client/p_cloud_volumes/p_cloud_volumes_client.go index c662828e..e2819358 100644 --- a/power/client/p_cloud_volumes/p_cloud_volumes_client.go +++ b/power/client/p_cloud_volumes/p_cloud_volumes_client.go @@ -519,7 +519,11 @@ func (a *Client) PcloudPvminstancesVolumesGetall(params *PcloudPvminstancesVolum } /* -PcloudPvminstancesVolumesPost attaches a volume to a p VM instance + PcloudPvminstancesVolumesPost attaches a volume to a p VM instance + + Attach a volume to a PVMInstance. + +>**Note**: In the case of VMRM, the first volume being attached will be converted to a bootable volume. */ func (a *Client) PcloudPvminstancesVolumesPost(params *PcloudPvminstancesVolumesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVolumesPostOK, error) { // TODO: Validate the params before sending @@ -597,7 +601,11 @@ func (a *Client) PcloudPvminstancesVolumesPut(params *PcloudPvminstancesVolumesP } /* -PcloudPvminstancesVolumesSetbootPut sets the p VM instance volume as the boot volume + 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 @@ -675,7 +683,11 @@ func (a *Client) PcloudV2PvminstancesVolumesDelete(params *PcloudV2PvminstancesV } /* -PcloudV2PvminstancesVolumesPost attaches all volumes to a p VM instance + 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 From dbe786df782959dff4b9b00cb7f52edffa6d00d2 Mon Sep 17 00:00:00 2001 From: powervs-ibm Date: Thu, 21 Mar 2024 12:12:19 +0000 Subject: [PATCH 043/118] Generated Swagger client from service-broker commit a74a353d92fbe6cfeb2421df47b52c5cc0e9d689 --- .../host_groups_client.go} | 82 +-- .../v1_available_hosts_parameters.go | 2 +- .../v1_available_hosts_responses.go | 2 +- .../v1_host_groups_get_parameters.go | 128 ++++ .../v1_host_groups_get_responses.go | 471 +++++++++++++ .../v1_host_groups_id_get_parameters.go | 151 +++++ .../v1_host_groups_id_get_responses.go | 547 +++++++++++++++ .../v1_host_groups_id_put_parameters.go | 175 +++++ .../v1_host_groups_id_put_responses.go | 621 ++++++++++++++++++ .../v1_host_groups_post_parameters.go | 153 +++++ .../v1_host_groups_post_responses.go | 621 ++++++++++++++++++ .../v1_hosts_get_parameters.go | 2 +- .../v1_hosts_get_responses.go | 2 +- .../v1_hosts_id_delete_parameters.go | 2 +- .../v1_hosts_id_delete_responses.go | 2 +- .../v1_hosts_id_get_parameters.go | 2 +- .../v1_hosts_id_get_responses.go | 2 +- .../v1_hosts_id_put_parameters.go | 2 +- .../v1_hosts_id_put_responses.go | 2 +- .../v1_hosts_post_parameters.go | 4 +- .../v1_hosts_post_responses.go | 2 +- .../v1_hostgroups_get_parameters.go | 128 ---- .../hostgroups/v1_hostgroups_get_responses.go | 471 ------------- .../v1_hostgroups_id_get_parameters.go | 151 ----- .../v1_hostgroups_id_get_responses.go | 547 --------------- .../v1_hostgroups_id_put_parameters.go | 175 ----- .../v1_hostgroups_id_put_responses.go | 621 ------------------ .../v1_hostgroups_post_parameters.go | 153 ----- .../v1_hostgroups_post_responses.go | 621 ------------------ .../p_cloud_volumes/p_cloud_volumes_client.go | 18 +- power/client/power_iaas_api_client.go | 8 +- power/models/add_host.go | 2 +- power/models/create_cos_image_import_job.go | 51 ++ power/models/host.go | 49 +- power/models/host_capacity.go | 127 +++- power/models/host_create.go | 12 +- power/models/{hostgroup.go => host_group.go} | 36 +- ...stgroup_create.go => host_group_create.go} | 36 +- .../{hostgroup_list.go => host_group_list.go} | 14 +- ...oup_share_op.go => host_group_share_op.go} | 28 +- power/models/host_group_summary.go | 56 ++ power/models/host_resource_capacity.go | 59 ++ power/models/hostgroup_href.go | 27 - power/models/image_import_details.go | 205 ++++++ power/models/p_vm_instance_create.go | 4 +- power/models/s_a_p_create.go | 2 +- power/models/s_a_p_profile.go | 3 + power/models/secondary.go | 6 +- power/models/volumes_clone_async_request.go | 1 + power/models/volumes_clone_execute.go | 1 + power/models/volumes_clone_request.go | 1 + 51 files changed, 3522 insertions(+), 3066 deletions(-) rename power/client/{hostgroups/hostgroups_client.go => host_groups/host_groups_client.go} (83%) rename power/client/{hostgroups => host_groups}/v1_available_hosts_parameters.go (99%) rename power/client/{hostgroups => host_groups}/v1_available_hosts_responses.go (99%) create mode 100644 power/client/host_groups/v1_host_groups_get_parameters.go create mode 100644 power/client/host_groups/v1_host_groups_get_responses.go create mode 100644 power/client/host_groups/v1_host_groups_id_get_parameters.go create mode 100644 power/client/host_groups/v1_host_groups_id_get_responses.go create mode 100644 power/client/host_groups/v1_host_groups_id_put_parameters.go create mode 100644 power/client/host_groups/v1_host_groups_id_put_responses.go create mode 100644 power/client/host_groups/v1_host_groups_post_parameters.go create mode 100644 power/client/host_groups/v1_host_groups_post_responses.go rename power/client/{hostgroups => host_groups}/v1_hosts_get_parameters.go (99%) rename power/client/{hostgroups => host_groups}/v1_hosts_get_responses.go (99%) rename power/client/{hostgroups => host_groups}/v1_hosts_id_delete_parameters.go (99%) rename power/client/{hostgroups => host_groups}/v1_hosts_id_delete_responses.go (99%) rename power/client/{hostgroups => host_groups}/v1_hosts_id_get_parameters.go (99%) rename power/client/{hostgroups => host_groups}/v1_hosts_id_get_responses.go (99%) rename power/client/{hostgroups => host_groups}/v1_hosts_id_put_parameters.go (99%) rename power/client/{hostgroups => host_groups}/v1_hosts_id_put_responses.go (99%) rename power/client/{hostgroups => host_groups}/v1_hosts_post_parameters.go (98%) rename power/client/{hostgroups => host_groups}/v1_hosts_post_responses.go (99%) delete mode 100644 power/client/hostgroups/v1_hostgroups_get_parameters.go delete mode 100644 power/client/hostgroups/v1_hostgroups_get_responses.go delete mode 100644 power/client/hostgroups/v1_hostgroups_id_get_parameters.go delete mode 100644 power/client/hostgroups/v1_hostgroups_id_get_responses.go delete mode 100644 power/client/hostgroups/v1_hostgroups_id_put_parameters.go delete mode 100644 power/client/hostgroups/v1_hostgroups_id_put_responses.go delete mode 100644 power/client/hostgroups/v1_hostgroups_post_parameters.go delete mode 100644 power/client/hostgroups/v1_hostgroups_post_responses.go rename power/models/{hostgroup.go => host_group.go} (74%) rename power/models/{hostgroup_create.go => host_group_create.go} (78%) rename power/models/{hostgroup_list.go => host_group_list.go} (79%) rename power/models/{hostgroup_share_op.go => host_group_share_op.go} (72%) create mode 100644 power/models/host_group_summary.go create mode 100644 power/models/host_resource_capacity.go delete mode 100644 power/models/hostgroup_href.go create mode 100644 power/models/image_import_details.go diff --git a/power/client/hostgroups/hostgroups_client.go b/power/client/host_groups/host_groups_client.go similarity index 83% rename from power/client/hostgroups/hostgroups_client.go rename to power/client/host_groups/host_groups_client.go index 19daf7c8..9ccc05d1 100644 --- a/power/client/hostgroups/hostgroups_client.go +++ b/power/client/host_groups/host_groups_client.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +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 @@ -12,13 +12,13 @@ import ( "github.com/go-openapi/strfmt" ) -// New creates a new hostgroups API client. +// New creates a new host groups API client. func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { return &Client{transport: transport, formats: formats} } /* -Client for hostgroups API +Client for host groups API */ type Client struct { transport runtime.ClientTransport @@ -32,13 +32,13 @@ type ClientOption func(*runtime.ClientOperation) type ClientService interface { V1AvailableHosts(params *V1AvailableHostsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1AvailableHostsOK, error) - V1HostgroupsGet(params *V1HostgroupsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostgroupsGetOK, error) + V1HostGroupsGet(params *V1HostGroupsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostGroupsGetOK, error) - V1HostgroupsIDGet(params *V1HostgroupsIDGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostgroupsIDGetOK, error) + V1HostGroupsIDGet(params *V1HostGroupsIDGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostGroupsIDGetOK, error) - V1HostgroupsIDPut(params *V1HostgroupsIDPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostgroupsIDPutOK, error) + V1HostGroupsIDPut(params *V1HostGroupsIDPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostGroupsIDPutOK, error) - V1HostgroupsPost(params *V1HostgroupsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostgroupsPostCreated, error) + V1HostGroupsPost(params *V1HostGroupsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostGroupsPostCreated, error) V1HostsGet(params *V1HostsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostsGetOK, error) @@ -93,22 +93,22 @@ func (a *Client) V1AvailableHosts(params *V1AvailableHostsParams, authInfo runti } /* -V1HostgroupsGet gets the list of hostgroups for the workspace +V1HostGroupsGet gets the list of host groups for the workspace */ -func (a *Client) V1HostgroupsGet(params *V1HostgroupsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostgroupsGetOK, error) { +func (a *Client) V1HostGroupsGet(params *V1HostGroupsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostGroupsGetOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewV1HostgroupsGetParams() + params = NewV1HostGroupsGetParams() } op := &runtime.ClientOperation{ - ID: "v1.hostgroups.get", + ID: "v1.hostGroups.get", Method: "GET", - PathPattern: "/v1/hostgroups", + PathPattern: "/v1/host-groups", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &V1HostgroupsGetReader{formats: a.formats}, + Reader: &V1HostGroupsGetReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -121,33 +121,33 @@ func (a *Client) V1HostgroupsGet(params *V1HostgroupsGetParams, authInfo runtime if err != nil { return nil, err } - success, ok := result.(*V1HostgroupsGetOK) + 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) + 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 hostgroup +V1HostGroupsIDGet gets the details of a host group */ -func (a *Client) V1HostgroupsIDGet(params *V1HostgroupsIDGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostgroupsIDGetOK, error) { +func (a *Client) V1HostGroupsIDGet(params *V1HostGroupsIDGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostGroupsIDGetOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewV1HostgroupsIDGetParams() + params = NewV1HostGroupsIDGetParams() } op := &runtime.ClientOperation{ - ID: "v1.hostgroups.id.get", + ID: "v1.hostGroups.id.get", Method: "GET", - PathPattern: "/v1/hostgroups/{hostgroup_id}", + 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}, + Reader: &V1HostGroupsIDGetReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -160,33 +160,33 @@ func (a *Client) V1HostgroupsIDGet(params *V1HostgroupsIDGetParams, authInfo run if err != nil { return nil, err } - success, ok := result.(*V1HostgroupsIDGetOK) + 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) + 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 hostgroup with another workspace +V1HostGroupsIDPut shares unshare a host group with another workspace */ -func (a *Client) V1HostgroupsIDPut(params *V1HostgroupsIDPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostgroupsIDPutOK, error) { +func (a *Client) V1HostGroupsIDPut(params *V1HostGroupsIDPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostGroupsIDPutOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewV1HostgroupsIDPutParams() + params = NewV1HostGroupsIDPutParams() } op := &runtime.ClientOperation{ - ID: "v1.hostgroups.id.put", + ID: "v1.hostGroups.id.put", Method: "PUT", - PathPattern: "/v1/hostgroups/{hostgroup_id}", + 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}, + Reader: &V1HostGroupsIDPutReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -199,33 +199,33 @@ func (a *Client) V1HostgroupsIDPut(params *V1HostgroupsIDPutParams, authInfo run if err != nil { return nil, err } - success, ok := result.(*V1HostgroupsIDPutOK) + 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) + 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 hostgroup with one or more host +V1HostGroupsPost creates a host group with one or more host */ -func (a *Client) V1HostgroupsPost(params *V1HostgroupsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostgroupsPostCreated, error) { +func (a *Client) V1HostGroupsPost(params *V1HostGroupsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostGroupsPostCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewV1HostgroupsPostParams() + params = NewV1HostGroupsPostParams() } op := &runtime.ClientOperation{ - ID: "v1.hostgroups.post", + ID: "v1.hostGroups.post", Method: "POST", - PathPattern: "/v1/hostgroups", + PathPattern: "/v1/host-groups", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &V1HostgroupsPostReader{formats: a.formats}, + Reader: &V1HostGroupsPostReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -238,13 +238,13 @@ func (a *Client) V1HostgroupsPost(params *V1HostgroupsPostParams, authInfo runti if err != nil { return nil, err } - success, ok := result.(*V1HostgroupsPostCreated) + 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) + 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) } @@ -288,7 +288,7 @@ func (a *Client) V1HostsGet(params *V1HostsGetParams, authInfo runtime.ClientAut } /* -V1HostsIDDelete releases a host from its hostgroup +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 @@ -405,7 +405,7 @@ func (a *Client) V1HostsIDPut(params *V1HostsIDPutParams, authInfo runtime.Clien } /* -V1HostsPost adds new host s to an existing hostgroup +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 diff --git a/power/client/hostgroups/v1_available_hosts_parameters.go b/power/client/host_groups/v1_available_hosts_parameters.go similarity index 99% rename from power/client/hostgroups/v1_available_hosts_parameters.go rename to power/client/host_groups/v1_available_hosts_parameters.go index f2c3babf..8a26b9cd 100644 --- a/power/client/hostgroups/v1_available_hosts_parameters.go +++ b/power/client/host_groups/v1_available_hosts_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +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 diff --git a/power/client/hostgroups/v1_available_hosts_responses.go b/power/client/host_groups/v1_available_hosts_responses.go similarity index 99% rename from power/client/hostgroups/v1_available_hosts_responses.go rename to power/client/host_groups/v1_available_hosts_responses.go index a591b6e1..8ef00909 100644 --- a/power/client/hostgroups/v1_available_hosts_responses.go +++ b/power/client/host_groups/v1_available_hosts_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +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 diff --git a/power/client/host_groups/v1_host_groups_get_parameters.go b/power/client/host_groups/v1_host_groups_get_parameters.go new file mode 100644 index 00000000..91bf33de --- /dev/null +++ b/power/client/host_groups/v1_host_groups_get_parameters.go @@ -0,0 +1,128 @@ +// 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 new file mode 100644 index 00000000..8801484f --- /dev/null +++ b/power/client/host_groups/v1_host_groups_get_responses.go @@ -0,0 +1,471 @@ +// 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" + "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 { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetOK %+v", 200, o.Payload) +} + +func (o *V1HostGroupsGetOK) String() string { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetOK %+v", 200, o.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 { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetBadRequest %+v", 400, o.Payload) +} + +func (o *V1HostGroupsGetBadRequest) String() string { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetBadRequest %+v", 400, o.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 { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetUnauthorized %+v", 401, o.Payload) +} + +func (o *V1HostGroupsGetUnauthorized) String() string { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetUnauthorized %+v", 401, o.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 { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetForbidden %+v", 403, o.Payload) +} + +func (o *V1HostGroupsGetForbidden) String() string { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetForbidden %+v", 403, o.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 { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetInternalServerError %+v", 500, o.Payload) +} + +func (o *V1HostGroupsGetInternalServerError) String() string { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetInternalServerError %+v", 500, o.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 { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetGatewayTimeout %+v", 504, o.Payload) +} + +func (o *V1HostGroupsGetGatewayTimeout) String() string { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetGatewayTimeout %+v", 504, o.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 new file mode 100644 index 00000000..2952b90a --- /dev/null +++ b/power/client/host_groups/v1_host_groups_id_get_parameters.go @@ -0,0 +1,151 @@ +// 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 new file mode 100644 index 00000000..72b372e7 --- /dev/null +++ b/power/client/host_groups/v1_host_groups_id_get_responses.go @@ -0,0 +1,547 @@ +// 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" + "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 { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetOK %+v", 200, o.Payload) +} + +func (o *V1HostGroupsIDGetOK) String() string { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetOK %+v", 200, o.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 { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetBadRequest %+v", 400, o.Payload) +} + +func (o *V1HostGroupsIDGetBadRequest) String() string { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetBadRequest %+v", 400, o.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 { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetUnauthorized %+v", 401, o.Payload) +} + +func (o *V1HostGroupsIDGetUnauthorized) String() string { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetUnauthorized %+v", 401, o.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 { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetForbidden %+v", 403, o.Payload) +} + +func (o *V1HostGroupsIDGetForbidden) String() string { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetForbidden %+v", 403, o.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 { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetNotFound %+v", 404, o.Payload) +} + +func (o *V1HostGroupsIDGetNotFound) String() string { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetNotFound %+v", 404, o.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 { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetInternalServerError %+v", 500, o.Payload) +} + +func (o *V1HostGroupsIDGetInternalServerError) String() string { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetInternalServerError %+v", 500, o.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 { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetGatewayTimeout %+v", 504, o.Payload) +} + +func (o *V1HostGroupsIDGetGatewayTimeout) String() string { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetGatewayTimeout %+v", 504, o.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 new file mode 100644 index 00000000..02a106c1 --- /dev/null +++ b/power/client/host_groups/v1_host_groups_id_put_parameters.go @@ -0,0 +1,175 @@ +// 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 new file mode 100644 index 00000000..126854de --- /dev/null +++ b/power/client/host_groups/v1_host_groups_id_put_responses.go @@ -0,0 +1,621 @@ +// 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" + "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 { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutOK %+v", 200, o.Payload) +} + +func (o *V1HostGroupsIDPutOK) String() string { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutOK %+v", 200, o.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 { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutBadRequest %+v", 400, o.Payload) +} + +func (o *V1HostGroupsIDPutBadRequest) String() string { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutBadRequest %+v", 400, o.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 { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutUnauthorized %+v", 401, o.Payload) +} + +func (o *V1HostGroupsIDPutUnauthorized) String() string { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutUnauthorized %+v", 401, o.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 { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutForbidden %+v", 403, o.Payload) +} + +func (o *V1HostGroupsIDPutForbidden) String() string { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutForbidden %+v", 403, o.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 { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutNotFound %+v", 404, o.Payload) +} + +func (o *V1HostGroupsIDPutNotFound) String() string { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutNotFound %+v", 404, o.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 { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutConflict %+v", 409, o.Payload) +} + +func (o *V1HostGroupsIDPutConflict) String() string { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutConflict %+v", 409, o.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 { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutInternalServerError %+v", 500, o.Payload) +} + +func (o *V1HostGroupsIDPutInternalServerError) String() string { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutInternalServerError %+v", 500, o.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 { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutGatewayTimeout %+v", 504, o.Payload) +} + +func (o *V1HostGroupsIDPutGatewayTimeout) String() string { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutGatewayTimeout %+v", 504, o.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 new file mode 100644 index 00000000..f75d2a3a --- /dev/null +++ b/power/client/host_groups/v1_host_groups_post_parameters.go @@ -0,0 +1,153 @@ +// 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 new file mode 100644 index 00000000..18415773 --- /dev/null +++ b/power/client/host_groups/v1_host_groups_post_responses.go @@ -0,0 +1,621 @@ +// 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" + "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 { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostCreated %+v", 201, o.Payload) +} + +func (o *V1HostGroupsPostCreated) String() string { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostCreated %+v", 201, o.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 { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostBadRequest %+v", 400, o.Payload) +} + +func (o *V1HostGroupsPostBadRequest) String() string { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostBadRequest %+v", 400, o.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 { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostUnauthorized %+v", 401, o.Payload) +} + +func (o *V1HostGroupsPostUnauthorized) String() string { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostUnauthorized %+v", 401, o.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 { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostForbidden %+v", 403, o.Payload) +} + +func (o *V1HostGroupsPostForbidden) String() string { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostForbidden %+v", 403, o.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 { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostConflict %+v", 409, o.Payload) +} + +func (o *V1HostGroupsPostConflict) String() string { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostConflict %+v", 409, o.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 { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *V1HostGroupsPostUnprocessableEntity) String() string { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostUnprocessableEntity %+v", 422, o.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 { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostInternalServerError %+v", 500, o.Payload) +} + +func (o *V1HostGroupsPostInternalServerError) String() string { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostInternalServerError %+v", 500, o.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 { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostGatewayTimeout %+v", 504, o.Payload) +} + +func (o *V1HostGroupsPostGatewayTimeout) String() string { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostGatewayTimeout %+v", 504, o.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/hostgroups/v1_hosts_get_parameters.go b/power/client/host_groups/v1_hosts_get_parameters.go similarity index 99% rename from power/client/hostgroups/v1_hosts_get_parameters.go rename to power/client/host_groups/v1_hosts_get_parameters.go index b2b9e6c7..b4139ea5 100644 --- a/power/client/hostgroups/v1_hosts_get_parameters.go +++ b/power/client/host_groups/v1_hosts_get_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +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 diff --git a/power/client/hostgroups/v1_hosts_get_responses.go b/power/client/host_groups/v1_hosts_get_responses.go similarity index 99% rename from power/client/hostgroups/v1_hosts_get_responses.go rename to power/client/host_groups/v1_hosts_get_responses.go index 80e385ed..ba907c0d 100644 --- a/power/client/hostgroups/v1_hosts_get_responses.go +++ b/power/client/host_groups/v1_hosts_get_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +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 diff --git a/power/client/hostgroups/v1_hosts_id_delete_parameters.go b/power/client/host_groups/v1_hosts_id_delete_parameters.go similarity index 99% rename from power/client/hostgroups/v1_hosts_id_delete_parameters.go rename to power/client/host_groups/v1_hosts_id_delete_parameters.go index e2508c8d..412fe32c 100644 --- a/power/client/hostgroups/v1_hosts_id_delete_parameters.go +++ b/power/client/host_groups/v1_hosts_id_delete_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +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 diff --git a/power/client/hostgroups/v1_hosts_id_delete_responses.go b/power/client/host_groups/v1_hosts_id_delete_responses.go similarity index 99% rename from power/client/hostgroups/v1_hosts_id_delete_responses.go rename to power/client/host_groups/v1_hosts_id_delete_responses.go index e41a8ea2..1681c9fe 100644 --- a/power/client/hostgroups/v1_hosts_id_delete_responses.go +++ b/power/client/host_groups/v1_hosts_id_delete_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +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 diff --git a/power/client/hostgroups/v1_hosts_id_get_parameters.go b/power/client/host_groups/v1_hosts_id_get_parameters.go similarity index 99% rename from power/client/hostgroups/v1_hosts_id_get_parameters.go rename to power/client/host_groups/v1_hosts_id_get_parameters.go index 73c5b368..422c12ff 100644 --- a/power/client/hostgroups/v1_hosts_id_get_parameters.go +++ b/power/client/host_groups/v1_hosts_id_get_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +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 diff --git a/power/client/hostgroups/v1_hosts_id_get_responses.go b/power/client/host_groups/v1_hosts_id_get_responses.go similarity index 99% rename from power/client/hostgroups/v1_hosts_id_get_responses.go rename to power/client/host_groups/v1_hosts_id_get_responses.go index f28f8270..42411024 100644 --- a/power/client/hostgroups/v1_hosts_id_get_responses.go +++ b/power/client/host_groups/v1_hosts_id_get_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +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 diff --git a/power/client/hostgroups/v1_hosts_id_put_parameters.go b/power/client/host_groups/v1_hosts_id_put_parameters.go similarity index 99% rename from power/client/hostgroups/v1_hosts_id_put_parameters.go rename to power/client/host_groups/v1_hosts_id_put_parameters.go index d1186ae9..557c18a4 100644 --- a/power/client/hostgroups/v1_hosts_id_put_parameters.go +++ b/power/client/host_groups/v1_hosts_id_put_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +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 diff --git a/power/client/hostgroups/v1_hosts_id_put_responses.go b/power/client/host_groups/v1_hosts_id_put_responses.go similarity index 99% rename from power/client/hostgroups/v1_hosts_id_put_responses.go rename to power/client/host_groups/v1_hosts_id_put_responses.go index 322ce86b..8723d370 100644 --- a/power/client/hostgroups/v1_hosts_id_put_responses.go +++ b/power/client/host_groups/v1_hosts_id_put_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +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 diff --git a/power/client/hostgroups/v1_hosts_post_parameters.go b/power/client/host_groups/v1_hosts_post_parameters.go similarity index 98% rename from power/client/hostgroups/v1_hosts_post_parameters.go rename to power/client/host_groups/v1_hosts_post_parameters.go index d44a5ff3..21437e7a 100644 --- a/power/client/hostgroups/v1_hosts_post_parameters.go +++ b/power/client/host_groups/v1_hosts_post_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +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 @@ -65,7 +65,7 @@ type V1HostsPostParams struct { /* Body. - Parameters to add a host to an existing hostgroup + Parameters to add a host to an existing host group */ Body *models.HostCreate diff --git a/power/client/hostgroups/v1_hosts_post_responses.go b/power/client/host_groups/v1_hosts_post_responses.go similarity index 99% rename from power/client/hostgroups/v1_hosts_post_responses.go rename to power/client/host_groups/v1_hosts_post_responses.go index 40dc82e7..4a4229b6 100644 --- a/power/client/hostgroups/v1_hosts_post_responses.go +++ b/power/client/host_groups/v1_hosts_post_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +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 diff --git a/power/client/hostgroups/v1_hostgroups_get_parameters.go b/power/client/hostgroups/v1_hostgroups_get_parameters.go deleted file mode 100644 index e4c9dcc2..00000000 --- a/power/client/hostgroups/v1_hostgroups_get_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package hostgroups - -// 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 hostgroups 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 hostgroups 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 hostgroups 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 hostgroups get params -func (o *V1HostgroupsGetParams) WithTimeout(timeout time.Duration) *V1HostgroupsGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 hostgroups get params -func (o *V1HostgroupsGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 hostgroups get params -func (o *V1HostgroupsGetParams) WithContext(ctx context.Context) *V1HostgroupsGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 hostgroups get params -func (o *V1HostgroupsGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 hostgroups get params -func (o *V1HostgroupsGetParams) WithHTTPClient(client *http.Client) *V1HostgroupsGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 hostgroups 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/hostgroups/v1_hostgroups_get_responses.go b/power/client/hostgroups/v1_hostgroups_get_responses.go deleted file mode 100644 index 6ee0eeca..00000000 --- a/power/client/hostgroups/v1_hostgroups_get_responses.go +++ /dev/null @@ -1,471 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package hostgroups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "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/hostgroups] 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 hostgroups get o k response has a 2xx status code -func (o *V1HostgroupsGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 hostgroups get o k response has a 3xx status code -func (o *V1HostgroupsGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups get o k response has a 4xx status code -func (o *V1HostgroupsGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups get o k response has a 5xx status code -func (o *V1HostgroupsGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups get o k response -func (o *V1HostgroupsGetOK) Code() int { - return 200 -} - -func (o *V1HostgroupsGetOK) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetOK %+v", 200, o.Payload) -} - -func (o *V1HostgroupsGetOK) String() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetOK %+v", 200, o.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 hostgroups get bad request response has a 2xx status code -func (o *V1HostgroupsGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups get bad request response has a 3xx status code -func (o *V1HostgroupsGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups get bad request response has a 4xx status code -func (o *V1HostgroupsGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups get bad request response has a 5xx status code -func (o *V1HostgroupsGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups get bad request response -func (o *V1HostgroupsGetBadRequest) Code() int { - return 400 -} - -func (o *V1HostgroupsGetBadRequest) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetBadRequest %+v", 400, o.Payload) -} - -func (o *V1HostgroupsGetBadRequest) String() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetBadRequest %+v", 400, o.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 hostgroups get unauthorized response has a 2xx status code -func (o *V1HostgroupsGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups get unauthorized response has a 3xx status code -func (o *V1HostgroupsGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups get unauthorized response has a 4xx status code -func (o *V1HostgroupsGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups get unauthorized response has a 5xx status code -func (o *V1HostgroupsGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups get unauthorized response -func (o *V1HostgroupsGetUnauthorized) Code() int { - return 401 -} - -func (o *V1HostgroupsGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetUnauthorized %+v", 401, o.Payload) -} - -func (o *V1HostgroupsGetUnauthorized) String() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetUnauthorized %+v", 401, o.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 hostgroups get forbidden response has a 2xx status code -func (o *V1HostgroupsGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups get forbidden response has a 3xx status code -func (o *V1HostgroupsGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups get forbidden response has a 4xx status code -func (o *V1HostgroupsGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups get forbidden response has a 5xx status code -func (o *V1HostgroupsGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups get forbidden response -func (o *V1HostgroupsGetForbidden) Code() int { - return 403 -} - -func (o *V1HostgroupsGetForbidden) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetForbidden %+v", 403, o.Payload) -} - -func (o *V1HostgroupsGetForbidden) String() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetForbidden %+v", 403, o.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 hostgroups get internal server error response has a 2xx status code -func (o *V1HostgroupsGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups get internal server error response has a 3xx status code -func (o *V1HostgroupsGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups get internal server error response has a 4xx status code -func (o *V1HostgroupsGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups get internal server error response has a 5xx status code -func (o *V1HostgroupsGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups get internal server error response -func (o *V1HostgroupsGetInternalServerError) Code() int { - return 500 -} - -func (o *V1HostgroupsGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetInternalServerError %+v", 500, o.Payload) -} - -func (o *V1HostgroupsGetInternalServerError) String() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetInternalServerError %+v", 500, o.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 hostgroups get gateway timeout response has a 2xx status code -func (o *V1HostgroupsGetGatewayTimeout) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups get gateway timeout response has a 3xx status code -func (o *V1HostgroupsGetGatewayTimeout) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups get gateway timeout response has a 4xx status code -func (o *V1HostgroupsGetGatewayTimeout) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups get gateway timeout response has a 5xx status code -func (o *V1HostgroupsGetGatewayTimeout) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups get gateway timeout response -func (o *V1HostgroupsGetGatewayTimeout) Code() int { - return 504 -} - -func (o *V1HostgroupsGetGatewayTimeout) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetGatewayTimeout %+v", 504, o.Payload) -} - -func (o *V1HostgroupsGetGatewayTimeout) String() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetGatewayTimeout %+v", 504, o.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/hostgroups/v1_hostgroups_id_get_parameters.go b/power/client/hostgroups/v1_hostgroups_id_get_parameters.go deleted file mode 100644 index f266f7eb..00000000 --- a/power/client/hostgroups/v1_hostgroups_id_get_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package hostgroups - -// 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 hostgroups 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 hostgroups 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 hostgroups 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 hostgroups id get params -func (o *V1HostgroupsIDGetParams) WithTimeout(timeout time.Duration) *V1HostgroupsIDGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 hostgroups id get params -func (o *V1HostgroupsIDGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 hostgroups id get params -func (o *V1HostgroupsIDGetParams) WithContext(ctx context.Context) *V1HostgroupsIDGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 hostgroups id get params -func (o *V1HostgroupsIDGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 hostgroups id get params -func (o *V1HostgroupsIDGetParams) WithHTTPClient(client *http.Client) *V1HostgroupsIDGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 hostgroups id get params -func (o *V1HostgroupsIDGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithHostgroupID adds the hostgroupID to the v1 hostgroups id get params -func (o *V1HostgroupsIDGetParams) WithHostgroupID(hostgroupID string) *V1HostgroupsIDGetParams { - o.SetHostgroupID(hostgroupID) - return o -} - -// SetHostgroupID adds the hostgroupId to the v1 hostgroups 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 hostgroup_id - if err := r.SetPathParam("hostgroup_id", o.HostgroupID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/hostgroups/v1_hostgroups_id_get_responses.go b/power/client/hostgroups/v1_hostgroups_id_get_responses.go deleted file mode 100644 index d458c4db..00000000 --- a/power/client/hostgroups/v1_hostgroups_id_get_responses.go +++ /dev/null @@ -1,547 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package hostgroups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "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/hostgroups/{hostgroup_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 hostgroups Id get o k response has a 2xx status code -func (o *V1HostgroupsIDGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 hostgroups Id get o k response has a 3xx status code -func (o *V1HostgroupsIDGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id get o k response has a 4xx status code -func (o *V1HostgroupsIDGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups Id get o k response has a 5xx status code -func (o *V1HostgroupsIDGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id get o k response -func (o *V1HostgroupsIDGetOK) Code() int { - return 200 -} - -func (o *V1HostgroupsIDGetOK) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetOK %+v", 200, o.Payload) -} - -func (o *V1HostgroupsIDGetOK) String() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetOK %+v", 200, o.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 hostgroups Id get bad request response has a 2xx status code -func (o *V1HostgroupsIDGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id get bad request response has a 3xx status code -func (o *V1HostgroupsIDGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id get bad request response has a 4xx status code -func (o *V1HostgroupsIDGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups Id get bad request response has a 5xx status code -func (o *V1HostgroupsIDGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id get bad request response -func (o *V1HostgroupsIDGetBadRequest) Code() int { - return 400 -} - -func (o *V1HostgroupsIDGetBadRequest) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetBadRequest %+v", 400, o.Payload) -} - -func (o *V1HostgroupsIDGetBadRequest) String() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetBadRequest %+v", 400, o.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 hostgroups Id get unauthorized response has a 2xx status code -func (o *V1HostgroupsIDGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id get unauthorized response has a 3xx status code -func (o *V1HostgroupsIDGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id get unauthorized response has a 4xx status code -func (o *V1HostgroupsIDGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups Id get unauthorized response has a 5xx status code -func (o *V1HostgroupsIDGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id get unauthorized response -func (o *V1HostgroupsIDGetUnauthorized) Code() int { - return 401 -} - -func (o *V1HostgroupsIDGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetUnauthorized %+v", 401, o.Payload) -} - -func (o *V1HostgroupsIDGetUnauthorized) String() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetUnauthorized %+v", 401, o.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 hostgroups Id get forbidden response has a 2xx status code -func (o *V1HostgroupsIDGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id get forbidden response has a 3xx status code -func (o *V1HostgroupsIDGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id get forbidden response has a 4xx status code -func (o *V1HostgroupsIDGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups Id get forbidden response has a 5xx status code -func (o *V1HostgroupsIDGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id get forbidden response -func (o *V1HostgroupsIDGetForbidden) Code() int { - return 403 -} - -func (o *V1HostgroupsIDGetForbidden) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetForbidden %+v", 403, o.Payload) -} - -func (o *V1HostgroupsIDGetForbidden) String() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetForbidden %+v", 403, o.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 hostgroups Id get not found response has a 2xx status code -func (o *V1HostgroupsIDGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id get not found response has a 3xx status code -func (o *V1HostgroupsIDGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id get not found response has a 4xx status code -func (o *V1HostgroupsIDGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups Id get not found response has a 5xx status code -func (o *V1HostgroupsIDGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id get not found response -func (o *V1HostgroupsIDGetNotFound) Code() int { - return 404 -} - -func (o *V1HostgroupsIDGetNotFound) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetNotFound %+v", 404, o.Payload) -} - -func (o *V1HostgroupsIDGetNotFound) String() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetNotFound %+v", 404, o.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 hostgroups Id get internal server error response has a 2xx status code -func (o *V1HostgroupsIDGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id get internal server error response has a 3xx status code -func (o *V1HostgroupsIDGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id get internal server error response has a 4xx status code -func (o *V1HostgroupsIDGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups Id get internal server error response has a 5xx status code -func (o *V1HostgroupsIDGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id get internal server error response -func (o *V1HostgroupsIDGetInternalServerError) Code() int { - return 500 -} - -func (o *V1HostgroupsIDGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetInternalServerError %+v", 500, o.Payload) -} - -func (o *V1HostgroupsIDGetInternalServerError) String() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetInternalServerError %+v", 500, o.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 hostgroups Id get gateway timeout response has a 2xx status code -func (o *V1HostgroupsIDGetGatewayTimeout) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id get gateway timeout response has a 3xx status code -func (o *V1HostgroupsIDGetGatewayTimeout) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id get gateway timeout response has a 4xx status code -func (o *V1HostgroupsIDGetGatewayTimeout) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups Id get gateway timeout response has a 5xx status code -func (o *V1HostgroupsIDGetGatewayTimeout) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id get gateway timeout response -func (o *V1HostgroupsIDGetGatewayTimeout) Code() int { - return 504 -} - -func (o *V1HostgroupsIDGetGatewayTimeout) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetGatewayTimeout %+v", 504, o.Payload) -} - -func (o *V1HostgroupsIDGetGatewayTimeout) String() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetGatewayTimeout %+v", 504, o.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/hostgroups/v1_hostgroups_id_put_parameters.go b/power/client/hostgroups/v1_hostgroups_id_put_parameters.go deleted file mode 100644 index 61e2d566..00000000 --- a/power/client/hostgroups/v1_hostgroups_id_put_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package hostgroups - -// 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 hostgroups id put operation. - - Typically these are written to a http.Request. -*/ -type V1HostgroupsIDPutParams struct { - - /* Body. - - Parameters to set the sharing status of the hostgroup - */ - Body *models.HostgroupShareOp - - /* HostgroupID. - - Hostgroup ID - */ - HostgroupID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 hostgroups 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 hostgroups 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 hostgroups id put params -func (o *V1HostgroupsIDPutParams) WithTimeout(timeout time.Duration) *V1HostgroupsIDPutParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 hostgroups id put params -func (o *V1HostgroupsIDPutParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 hostgroups id put params -func (o *V1HostgroupsIDPutParams) WithContext(ctx context.Context) *V1HostgroupsIDPutParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 hostgroups id put params -func (o *V1HostgroupsIDPutParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 hostgroups id put params -func (o *V1HostgroupsIDPutParams) WithHTTPClient(client *http.Client) *V1HostgroupsIDPutParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 hostgroups id put params -func (o *V1HostgroupsIDPutParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the v1 hostgroups id put params -func (o *V1HostgroupsIDPutParams) WithBody(body *models.HostgroupShareOp) *V1HostgroupsIDPutParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the v1 hostgroups id put params -func (o *V1HostgroupsIDPutParams) SetBody(body *models.HostgroupShareOp) { - o.Body = body -} - -// WithHostgroupID adds the hostgroupID to the v1 hostgroups id put params -func (o *V1HostgroupsIDPutParams) WithHostgroupID(hostgroupID string) *V1HostgroupsIDPutParams { - o.SetHostgroupID(hostgroupID) - return o -} - -// SetHostgroupID adds the hostgroupId to the v1 hostgroups 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 hostgroup_id - if err := r.SetPathParam("hostgroup_id", o.HostgroupID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/hostgroups/v1_hostgroups_id_put_responses.go b/power/client/hostgroups/v1_hostgroups_id_put_responses.go deleted file mode 100644 index 33b7c6b4..00000000 --- a/power/client/hostgroups/v1_hostgroups_id_put_responses.go +++ /dev/null @@ -1,621 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package hostgroups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "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/hostgroups/{hostgroup_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 hostgroups Id put o k response has a 2xx status code -func (o *V1HostgroupsIDPutOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 hostgroups Id put o k response has a 3xx status code -func (o *V1HostgroupsIDPutOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id put o k response has a 4xx status code -func (o *V1HostgroupsIDPutOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups Id put o k response has a 5xx status code -func (o *V1HostgroupsIDPutOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id put o k response -func (o *V1HostgroupsIDPutOK) Code() int { - return 200 -} - -func (o *V1HostgroupsIDPutOK) Error() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutOK %+v", 200, o.Payload) -} - -func (o *V1HostgroupsIDPutOK) String() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutOK %+v", 200, o.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 hostgroups Id put bad request response has a 2xx status code -func (o *V1HostgroupsIDPutBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id put bad request response has a 3xx status code -func (o *V1HostgroupsIDPutBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id put bad request response has a 4xx status code -func (o *V1HostgroupsIDPutBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups Id put bad request response has a 5xx status code -func (o *V1HostgroupsIDPutBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id put bad request response -func (o *V1HostgroupsIDPutBadRequest) Code() int { - return 400 -} - -func (o *V1HostgroupsIDPutBadRequest) Error() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutBadRequest %+v", 400, o.Payload) -} - -func (o *V1HostgroupsIDPutBadRequest) String() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutBadRequest %+v", 400, o.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 hostgroups Id put unauthorized response has a 2xx status code -func (o *V1HostgroupsIDPutUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id put unauthorized response has a 3xx status code -func (o *V1HostgroupsIDPutUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id put unauthorized response has a 4xx status code -func (o *V1HostgroupsIDPutUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups Id put unauthorized response has a 5xx status code -func (o *V1HostgroupsIDPutUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id put unauthorized response -func (o *V1HostgroupsIDPutUnauthorized) Code() int { - return 401 -} - -func (o *V1HostgroupsIDPutUnauthorized) Error() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutUnauthorized %+v", 401, o.Payload) -} - -func (o *V1HostgroupsIDPutUnauthorized) String() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutUnauthorized %+v", 401, o.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 hostgroups Id put forbidden response has a 2xx status code -func (o *V1HostgroupsIDPutForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id put forbidden response has a 3xx status code -func (o *V1HostgroupsIDPutForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id put forbidden response has a 4xx status code -func (o *V1HostgroupsIDPutForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups Id put forbidden response has a 5xx status code -func (o *V1HostgroupsIDPutForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id put forbidden response -func (o *V1HostgroupsIDPutForbidden) Code() int { - return 403 -} - -func (o *V1HostgroupsIDPutForbidden) Error() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutForbidden %+v", 403, o.Payload) -} - -func (o *V1HostgroupsIDPutForbidden) String() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutForbidden %+v", 403, o.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 hostgroups Id put not found response has a 2xx status code -func (o *V1HostgroupsIDPutNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id put not found response has a 3xx status code -func (o *V1HostgroupsIDPutNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id put not found response has a 4xx status code -func (o *V1HostgroupsIDPutNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups Id put not found response has a 5xx status code -func (o *V1HostgroupsIDPutNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id put not found response -func (o *V1HostgroupsIDPutNotFound) Code() int { - return 404 -} - -func (o *V1HostgroupsIDPutNotFound) Error() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutNotFound %+v", 404, o.Payload) -} - -func (o *V1HostgroupsIDPutNotFound) String() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutNotFound %+v", 404, o.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 hostgroups Id put conflict response has a 2xx status code -func (o *V1HostgroupsIDPutConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id put conflict response has a 3xx status code -func (o *V1HostgroupsIDPutConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id put conflict response has a 4xx status code -func (o *V1HostgroupsIDPutConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups Id put conflict response has a 5xx status code -func (o *V1HostgroupsIDPutConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id put conflict response -func (o *V1HostgroupsIDPutConflict) Code() int { - return 409 -} - -func (o *V1HostgroupsIDPutConflict) Error() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutConflict %+v", 409, o.Payload) -} - -func (o *V1HostgroupsIDPutConflict) String() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutConflict %+v", 409, o.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 hostgroups Id put internal server error response has a 2xx status code -func (o *V1HostgroupsIDPutInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id put internal server error response has a 3xx status code -func (o *V1HostgroupsIDPutInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id put internal server error response has a 4xx status code -func (o *V1HostgroupsIDPutInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups Id put internal server error response has a 5xx status code -func (o *V1HostgroupsIDPutInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id put internal server error response -func (o *V1HostgroupsIDPutInternalServerError) Code() int { - return 500 -} - -func (o *V1HostgroupsIDPutInternalServerError) Error() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutInternalServerError %+v", 500, o.Payload) -} - -func (o *V1HostgroupsIDPutInternalServerError) String() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutInternalServerError %+v", 500, o.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 hostgroups Id put gateway timeout response has a 2xx status code -func (o *V1HostgroupsIDPutGatewayTimeout) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id put gateway timeout response has a 3xx status code -func (o *V1HostgroupsIDPutGatewayTimeout) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id put gateway timeout response has a 4xx status code -func (o *V1HostgroupsIDPutGatewayTimeout) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups Id put gateway timeout response has a 5xx status code -func (o *V1HostgroupsIDPutGatewayTimeout) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id put gateway timeout response -func (o *V1HostgroupsIDPutGatewayTimeout) Code() int { - return 504 -} - -func (o *V1HostgroupsIDPutGatewayTimeout) Error() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutGatewayTimeout %+v", 504, o.Payload) -} - -func (o *V1HostgroupsIDPutGatewayTimeout) String() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutGatewayTimeout %+v", 504, o.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/hostgroups/v1_hostgroups_post_parameters.go b/power/client/hostgroups/v1_hostgroups_post_parameters.go deleted file mode 100644 index 56fe0baa..00000000 --- a/power/client/hostgroups/v1_hostgroups_post_parameters.go +++ /dev/null @@ -1,153 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package hostgroups - -// 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 hostgroups post operation. - - Typically these are written to a http.Request. -*/ -type V1HostgroupsPostParams struct { - - /* Body. - - Parameters for the creation of a new hostgroup - */ - Body *models.HostgroupCreate - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 hostgroups 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 hostgroups 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 hostgroups post params -func (o *V1HostgroupsPostParams) WithTimeout(timeout time.Duration) *V1HostgroupsPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 hostgroups post params -func (o *V1HostgroupsPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 hostgroups post params -func (o *V1HostgroupsPostParams) WithContext(ctx context.Context) *V1HostgroupsPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 hostgroups post params -func (o *V1HostgroupsPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 hostgroups post params -func (o *V1HostgroupsPostParams) WithHTTPClient(client *http.Client) *V1HostgroupsPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 hostgroups post params -func (o *V1HostgroupsPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the v1 hostgroups post params -func (o *V1HostgroupsPostParams) WithBody(body *models.HostgroupCreate) *V1HostgroupsPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the v1 hostgroups 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/hostgroups/v1_hostgroups_post_responses.go b/power/client/hostgroups/v1_hostgroups_post_responses.go deleted file mode 100644 index 81b051bb..00000000 --- a/power/client/hostgroups/v1_hostgroups_post_responses.go +++ /dev/null @@ -1,621 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package hostgroups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "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/hostgroups] 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 hostgroups post created response has a 2xx status code -func (o *V1HostgroupsPostCreated) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 hostgroups post created response has a 3xx status code -func (o *V1HostgroupsPostCreated) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups post created response has a 4xx status code -func (o *V1HostgroupsPostCreated) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups post created response has a 5xx status code -func (o *V1HostgroupsPostCreated) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups post created response -func (o *V1HostgroupsPostCreated) Code() int { - return 201 -} - -func (o *V1HostgroupsPostCreated) Error() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostCreated %+v", 201, o.Payload) -} - -func (o *V1HostgroupsPostCreated) String() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostCreated %+v", 201, o.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 hostgroups post bad request response has a 2xx status code -func (o *V1HostgroupsPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups post bad request response has a 3xx status code -func (o *V1HostgroupsPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups post bad request response has a 4xx status code -func (o *V1HostgroupsPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups post bad request response has a 5xx status code -func (o *V1HostgroupsPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups post bad request response -func (o *V1HostgroupsPostBadRequest) Code() int { - return 400 -} - -func (o *V1HostgroupsPostBadRequest) Error() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostBadRequest %+v", 400, o.Payload) -} - -func (o *V1HostgroupsPostBadRequest) String() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostBadRequest %+v", 400, o.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 hostgroups post unauthorized response has a 2xx status code -func (o *V1HostgroupsPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups post unauthorized response has a 3xx status code -func (o *V1HostgroupsPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups post unauthorized response has a 4xx status code -func (o *V1HostgroupsPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups post unauthorized response has a 5xx status code -func (o *V1HostgroupsPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups post unauthorized response -func (o *V1HostgroupsPostUnauthorized) Code() int { - return 401 -} - -func (o *V1HostgroupsPostUnauthorized) Error() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostUnauthorized %+v", 401, o.Payload) -} - -func (o *V1HostgroupsPostUnauthorized) String() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostUnauthorized %+v", 401, o.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 hostgroups post forbidden response has a 2xx status code -func (o *V1HostgroupsPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups post forbidden response has a 3xx status code -func (o *V1HostgroupsPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups post forbidden response has a 4xx status code -func (o *V1HostgroupsPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups post forbidden response has a 5xx status code -func (o *V1HostgroupsPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups post forbidden response -func (o *V1HostgroupsPostForbidden) Code() int { - return 403 -} - -func (o *V1HostgroupsPostForbidden) Error() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostForbidden %+v", 403, o.Payload) -} - -func (o *V1HostgroupsPostForbidden) String() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostForbidden %+v", 403, o.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 hostgroups post conflict response has a 2xx status code -func (o *V1HostgroupsPostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups post conflict response has a 3xx status code -func (o *V1HostgroupsPostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups post conflict response has a 4xx status code -func (o *V1HostgroupsPostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups post conflict response has a 5xx status code -func (o *V1HostgroupsPostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups post conflict response -func (o *V1HostgroupsPostConflict) Code() int { - return 409 -} - -func (o *V1HostgroupsPostConflict) Error() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostConflict %+v", 409, o.Payload) -} - -func (o *V1HostgroupsPostConflict) String() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostConflict %+v", 409, o.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 hostgroups post unprocessable entity response has a 2xx status code -func (o *V1HostgroupsPostUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups post unprocessable entity response has a 3xx status code -func (o *V1HostgroupsPostUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups post unprocessable entity response has a 4xx status code -func (o *V1HostgroupsPostUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups post unprocessable entity response has a 5xx status code -func (o *V1HostgroupsPostUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups post unprocessable entity response -func (o *V1HostgroupsPostUnprocessableEntity) Code() int { - return 422 -} - -func (o *V1HostgroupsPostUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *V1HostgroupsPostUnprocessableEntity) String() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostUnprocessableEntity %+v", 422, o.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 hostgroups post internal server error response has a 2xx status code -func (o *V1HostgroupsPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups post internal server error response has a 3xx status code -func (o *V1HostgroupsPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups post internal server error response has a 4xx status code -func (o *V1HostgroupsPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups post internal server error response has a 5xx status code -func (o *V1HostgroupsPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups post internal server error response -func (o *V1HostgroupsPostInternalServerError) Code() int { - return 500 -} - -func (o *V1HostgroupsPostInternalServerError) Error() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostInternalServerError %+v", 500, o.Payload) -} - -func (o *V1HostgroupsPostInternalServerError) String() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostInternalServerError %+v", 500, o.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 hostgroups post gateway timeout response has a 2xx status code -func (o *V1HostgroupsPostGatewayTimeout) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups post gateway timeout response has a 3xx status code -func (o *V1HostgroupsPostGatewayTimeout) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups post gateway timeout response has a 4xx status code -func (o *V1HostgroupsPostGatewayTimeout) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups post gateway timeout response has a 5xx status code -func (o *V1HostgroupsPostGatewayTimeout) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups post gateway timeout response -func (o *V1HostgroupsPostGatewayTimeout) Code() int { - return 504 -} - -func (o *V1HostgroupsPostGatewayTimeout) Error() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostGatewayTimeout %+v", 504, o.Payload) -} - -func (o *V1HostgroupsPostGatewayTimeout) String() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostGatewayTimeout %+v", 504, o.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/p_cloud_volumes/p_cloud_volumes_client.go b/power/client/p_cloud_volumes/p_cloud_volumes_client.go index c662828e..e2819358 100644 --- a/power/client/p_cloud_volumes/p_cloud_volumes_client.go +++ b/power/client/p_cloud_volumes/p_cloud_volumes_client.go @@ -519,7 +519,11 @@ func (a *Client) PcloudPvminstancesVolumesGetall(params *PcloudPvminstancesVolum } /* -PcloudPvminstancesVolumesPost attaches a volume to a p VM instance + PcloudPvminstancesVolumesPost attaches a volume to a p VM instance + + Attach a volume to a PVMInstance. + +>**Note**: In the case of VMRM, the first volume being attached will be converted to a bootable volume. */ func (a *Client) PcloudPvminstancesVolumesPost(params *PcloudPvminstancesVolumesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVolumesPostOK, error) { // TODO: Validate the params before sending @@ -597,7 +601,11 @@ func (a *Client) PcloudPvminstancesVolumesPut(params *PcloudPvminstancesVolumesP } /* -PcloudPvminstancesVolumesSetbootPut sets the p VM instance volume as the boot volume + 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 @@ -675,7 +683,11 @@ func (a *Client) PcloudV2PvminstancesVolumesDelete(params *PcloudV2PvminstancesV } /* -PcloudV2PvminstancesVolumesPost attaches all volumes to a p VM instance + 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 diff --git a/power/client/power_iaas_api_client.go b/power/client/power_iaas_api_client.go index 2b8c1a8c..fe13576c 100644 --- a/power/client/power_iaas_api_client.go +++ b/power/client/power_iaas_api_client.go @@ -15,7 +15,7 @@ import ( "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/hostgroups" + "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" @@ -102,7 +102,7 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *PowerIaasA cli.Catalog = catalog.New(transport, formats) cli.Datacenters = datacenters.New(transport, formats) cli.HardwarePlatforms = hardware_platforms.New(transport, formats) - cli.Hostgroups = hostgroups.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) @@ -194,7 +194,7 @@ type PowerIaasAPI struct { HardwarePlatforms hardware_platforms.ClientService - Hostgroups hostgroups.ClientService + HostGroups host_groups.ClientService IaasServiceBroker iaas_service_broker.ClientService @@ -281,7 +281,7 @@ func (c *PowerIaasAPI) SetTransport(transport runtime.ClientTransport) { c.Catalog.SetTransport(transport) c.Datacenters.SetTransport(transport) c.HardwarePlatforms.SetTransport(transport) - c.Hostgroups.SetTransport(transport) + c.HostGroups.SetTransport(transport) c.IaasServiceBroker.SetTransport(transport) c.InternalPowervsInstances.SetTransport(transport) c.InternalPowervsLocations.SetTransport(transport) diff --git a/power/models/add_host.go b/power/models/add_host.go index fb06e74e..b0e6358a 100644 --- a/power/models/add_host.go +++ b/power/models/add_host.go @@ -14,7 +14,7 @@ import ( "github.com/go-openapi/validate" ) -// AddHost Host to add to a hostgroup +// AddHost Host to add to a host group // // swagger:model AddHost type AddHost struct { diff --git a/power/models/create_cos_image_import_job.go b/power/models/create_cos_image_import_job.go index 12186df3..7511771e 100644 --- a/power/models/create_cos_image_import_job.go +++ b/power/models/create_cos_image_import_job.go @@ -39,6 +39,9 @@ type CreateCosImageImportJob struct { // 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"` @@ -80,6 +83,10 @@ func (m *CreateCosImageImportJob) Validate(formats strfmt.Registry) error { 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) } @@ -167,6 +174,25 @@ func (m *CreateCosImageImportJob) validateImageName(formats strfmt.Registry) 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() { @@ -247,6 +273,10 @@ func (m *CreateCosImageImportJob) validateStorageAffinity(formats strfmt.Registr 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) } @@ -257,6 +287,27 @@ func (m *CreateCosImageImportJob) ContextValidate(ctx context.Context, formats s 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 { diff --git a/power/models/host.go b/power/models/host.go index d0ad65f7..51e2d4a4 100644 --- a/power/models/host.go +++ b/power/models/host.go @@ -24,8 +24,8 @@ type Host struct { // Name of the host (chosen by the user) DisplayName string `json:"displayName,omitempty"` - // Link to the owning hostgroup - Hostgroup HostgroupHref `json:"hostgroup,omitempty"` + // Information about the owning host group + HostGroup *HostGroupSummary `json:"hostGroup,omitempty"` // ID of the host ID string `json:"id,omitempty"` @@ -48,7 +48,7 @@ func (m *Host) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateHostgroup(formats); err != nil { + if err := m.validateHostGroup(formats); err != nil { res = append(res, err) } @@ -77,18 +77,20 @@ func (m *Host) validateCapacity(formats strfmt.Registry) error { return nil } -func (m *Host) validateHostgroup(formats strfmt.Registry) error { - if swag.IsZero(m.Hostgroup) { // not required +func (m *Host) validateHostGroup(formats strfmt.Registry) error { + if swag.IsZero(m.HostGroup) { // not required return 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") + 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 err } return nil @@ -102,7 +104,7 @@ func (m *Host) ContextValidate(ctx context.Context, formats strfmt.Registry) err res = append(res, err) } - if err := m.contextValidateHostgroup(ctx, formats); err != nil { + if err := m.contextValidateHostGroup(ctx, formats); err != nil { res = append(res, err) } @@ -133,19 +135,22 @@ func (m *Host) contextValidateCapacity(ctx context.Context, formats strfmt.Regis return nil } -func (m *Host) contextValidateHostgroup(ctx context.Context, formats strfmt.Registry) error { +func (m *Host) contextValidateHostGroup(ctx context.Context, formats strfmt.Registry) error { - if swag.IsZero(m.Hostgroup) { // not required - return nil - } + if m.HostGroup != 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") + 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 err } return nil diff --git a/power/models/host_capacity.go b/power/models/host_capacity.go index 1e822fb7..9ded7f72 100644 --- a/power/models/host_capacity.go +++ b/power/models/host_capacity.go @@ -8,6 +8,7 @@ package models import ( "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -17,38 +18,126 @@ import ( // swagger:model HostCapacity type HostCapacity struct { - // Number of cores currently available - AvailableCore float64 `json:"availableCore,omitempty"` + // Core capacity of the host + Cores *HostResourceCapacity `json:"cores,omitempty"` - // Amount of memory currently available (in MB) - AvailableMemory float64 `json:"availableMemory,omitempty"` + // Memory capacity of the host (in MB) + Memory *HostResourceCapacity `json:"memory,omitempty"` +} - // Number of cores reserved for system use - ReservedCore float64 `json:"reservedCore,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) + } - // Amount of memory reserved for system use (in MB) - ReservedMemory float64 `json:"reservedMemory,omitempty"` + if err := m.validateMemory(formats); err != nil { + res = append(res, err) + } - // Total number of cores of the host - TotalCore float64 `json:"totalCore,omitempty"` + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} - // Total amount of memory of the host (in MB) - TotalMemory float64 `json:"totalMemory,omitempty"` +func (m *HostCapacity) validateCores(formats strfmt.Registry) error { + if swag.IsZero(m.Cores) { // not required + return nil + } - // Number of cores in use on the host - UsedCore float64 `json:"usedCore,omitempty"` + 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 + } + } - // Amount of memory used on the host (in MB) - UsedMemory float64 `json:"usedMemory,omitempty"` + return nil } -// Validate validates this host capacity -func (m *HostCapacity) Validate(formats strfmt.Registry) error { +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 validates this host capacity based on context it is used +// 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 } diff --git a/power/models/host_create.go b/power/models/host_create.go index 0e7d68ee..cf758f1e 100644 --- a/power/models/host_create.go +++ b/power/models/host_create.go @@ -14,7 +14,7 @@ import ( "github.com/go-openapi/validate" ) -// HostCreate Parameters to add a host to an existing hostgroup +// HostCreate Parameters to add a host to an existing host group // // swagger:model HostCreate type HostCreate struct { @@ -23,9 +23,9 @@ type HostCreate struct { // Required: true Host *AddHost `json:"host"` - // ID of the hostgroup to which the host should be added + // ID of the host group to which the host should be added // Required: true - HostgroupID *string `json:"hostgroupID"` + HostGroupID *string `json:"hostGroupID"` } // Validate validates this host create @@ -36,7 +36,7 @@ func (m *HostCreate) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateHostgroupID(formats); err != nil { + if err := m.validateHostGroupID(formats); err != nil { res = append(res, err) } @@ -66,9 +66,9 @@ func (m *HostCreate) validateHost(formats strfmt.Registry) error { return nil } -func (m *HostCreate) validateHostgroupID(formats strfmt.Registry) error { +func (m *HostCreate) validateHostGroupID(formats strfmt.Registry) error { - if err := validate.Required("hostgroupID", "body", m.HostgroupID); err != nil { + if err := validate.Required("hostGroupID", "body", m.HostGroupID); err != nil { return err } diff --git a/power/models/hostgroup.go b/power/models/host_group.go similarity index 74% rename from power/models/hostgroup.go rename to power/models/host_group.go index 7ca1c07c..fec8e12c 100644 --- a/power/models/hostgroup.go +++ b/power/models/host_group.go @@ -15,33 +15,33 @@ import ( "github.com/go-openapi/validate" ) -// Hostgroup Description of a hostgroup +// HostGroup Description of a host group // -// swagger:model Hostgroup -type Hostgroup struct { +// swagger:model HostGroup +type HostGroup struct { - // Date/Time of hostgroup creation + // Date/Time of host group creation // Format: date-time CreationDate strfmt.DateTime `json:"creationDate,omitempty"` // List of hosts Hosts []HostHref `json:"hosts"` - // Hostgroup ID + // Host Group ID ID string `json:"id,omitempty"` - // Name of the hostgroup + // Name of the host group Name string `json:"name,omitempty"` - // Name of the workspace owning the hostgroup + // Name of the workspace owning the host group Primary string `json:"primary,omitempty"` - // Names of workspaces the hostgroup has been shared with + // Names of workspaces the host group has been shared with Secondaries []string `json:"secondaries"` } -// Validate validates this hostgroup -func (m *Hostgroup) Validate(formats strfmt.Registry) error { +// Validate validates this host group +func (m *HostGroup) Validate(formats strfmt.Registry) error { var res []error if err := m.validateCreationDate(formats); err != nil { @@ -58,7 +58,7 @@ func (m *Hostgroup) Validate(formats strfmt.Registry) error { return nil } -func (m *Hostgroup) validateCreationDate(formats strfmt.Registry) error { +func (m *HostGroup) validateCreationDate(formats strfmt.Registry) error { if swag.IsZero(m.CreationDate) { // not required return nil } @@ -70,7 +70,7 @@ func (m *Hostgroup) validateCreationDate(formats strfmt.Registry) error { return nil } -func (m *Hostgroup) validateHosts(formats strfmt.Registry) error { +func (m *HostGroup) validateHosts(formats strfmt.Registry) error { if swag.IsZero(m.Hosts) { // not required return nil } @@ -91,8 +91,8 @@ func (m *Hostgroup) validateHosts(formats strfmt.Registry) error { return nil } -// ContextValidate validate this hostgroup based on the context it is used -func (m *Hostgroup) ContextValidate(ctx context.Context, formats strfmt.Registry) error { +// 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 { @@ -105,7 +105,7 @@ func (m *Hostgroup) ContextValidate(ctx context.Context, formats strfmt.Registry return nil } -func (m *Hostgroup) contextValidateHosts(ctx context.Context, formats strfmt.Registry) error { +func (m *HostGroup) contextValidateHosts(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Hosts); i++ { @@ -128,7 +128,7 @@ func (m *Hostgroup) contextValidateHosts(ctx context.Context, formats strfmt.Reg } // MarshalBinary interface implementation -func (m *Hostgroup) MarshalBinary() ([]byte, error) { +func (m *HostGroup) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -136,8 +136,8 @@ func (m *Hostgroup) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *Hostgroup) UnmarshalBinary(b []byte) error { - var res Hostgroup +func (m *HostGroup) UnmarshalBinary(b []byte) error { + var res HostGroup if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/power/models/hostgroup_create.go b/power/models/host_group_create.go similarity index 78% rename from power/models/hostgroup_create.go rename to power/models/host_group_create.go index b2c8b2cd..ddd5fc9f 100644 --- a/power/models/hostgroup_create.go +++ b/power/models/host_group_create.go @@ -15,25 +15,25 @@ import ( "github.com/go-openapi/validate" ) -// HostgroupCreate Parameters for the creation of a new hostgroup +// HostGroupCreate Parameters for the creation of a new host group // -// swagger:model HostgroupCreate -type HostgroupCreate struct { +// swagger:model HostGroupCreate +type HostGroupCreate struct { - // List of hosts to add to the group + // List of hosts to add to the host group // Required: true Hosts []*AddHost `json:"hosts"` - // Name of the hostgroup to create + // Name of the host group to create // Required: true Name *string `json:"name"` - // List of workspace names to share the hostgroup with (optional) + // List of workspace names to share the host group with (optional) Secondaries []*Secondary `json:"secondaries"` } -// Validate validates this hostgroup create -func (m *HostgroupCreate) Validate(formats strfmt.Registry) error { +// Validate validates this host group create +func (m *HostGroupCreate) Validate(formats strfmt.Registry) error { var res []error if err := m.validateHosts(formats); err != nil { @@ -54,7 +54,7 @@ func (m *HostgroupCreate) Validate(formats strfmt.Registry) error { return nil } -func (m *HostgroupCreate) validateHosts(formats strfmt.Registry) error { +func (m *HostGroupCreate) validateHosts(formats strfmt.Registry) error { if err := validate.Required("hosts", "body", m.Hosts); err != nil { return err @@ -81,7 +81,7 @@ func (m *HostgroupCreate) validateHosts(formats strfmt.Registry) error { return nil } -func (m *HostgroupCreate) validateName(formats strfmt.Registry) error { +func (m *HostGroupCreate) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { return err @@ -90,7 +90,7 @@ func (m *HostgroupCreate) validateName(formats strfmt.Registry) error { return nil } -func (m *HostgroupCreate) validateSecondaries(formats strfmt.Registry) error { +func (m *HostGroupCreate) validateSecondaries(formats strfmt.Registry) error { if swag.IsZero(m.Secondaries) { // not required return nil } @@ -116,8 +116,8 @@ func (m *HostgroupCreate) validateSecondaries(formats strfmt.Registry) error { return nil } -// ContextValidate validate this hostgroup create based on the context it is used -func (m *HostgroupCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { +// 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 { @@ -134,7 +134,7 @@ func (m *HostgroupCreate) ContextValidate(ctx context.Context, formats strfmt.Re return nil } -func (m *HostgroupCreate) contextValidateHosts(ctx context.Context, formats strfmt.Registry) error { +func (m *HostGroupCreate) contextValidateHosts(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Hosts); i++ { @@ -159,7 +159,7 @@ func (m *HostgroupCreate) contextValidateHosts(ctx context.Context, formats strf return nil } -func (m *HostgroupCreate) contextValidateSecondaries(ctx context.Context, formats strfmt.Registry) error { +func (m *HostGroupCreate) contextValidateSecondaries(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Secondaries); i++ { @@ -185,7 +185,7 @@ func (m *HostgroupCreate) contextValidateSecondaries(ctx context.Context, format } // MarshalBinary interface implementation -func (m *HostgroupCreate) MarshalBinary() ([]byte, error) { +func (m *HostGroupCreate) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -193,8 +193,8 @@ func (m *HostgroupCreate) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *HostgroupCreate) UnmarshalBinary(b []byte) error { - var res HostgroupCreate +func (m *HostGroupCreate) UnmarshalBinary(b []byte) error { + var res HostGroupCreate if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/power/models/hostgroup_list.go b/power/models/host_group_list.go similarity index 79% rename from power/models/hostgroup_list.go rename to power/models/host_group_list.go index bdcc2bb3..617cb02d 100644 --- a/power/models/hostgroup_list.go +++ b/power/models/host_group_list.go @@ -14,13 +14,13 @@ import ( "github.com/go-openapi/swag" ) -// HostgroupList hostgroup list +// HostGroupList host group list // -// swagger:model HostgroupList -type HostgroupList []*Hostgroup +// swagger:model HostGroupList +type HostGroupList []*HostGroup -// Validate validates this hostgroup list -func (m HostgroupList) Validate(formats strfmt.Registry) error { +// Validate validates this host group list +func (m HostGroupList) Validate(formats strfmt.Registry) error { var res []error for i := 0; i < len(m); i++ { @@ -47,8 +47,8 @@ func (m HostgroupList) Validate(formats strfmt.Registry) error { return nil } -// ContextValidate validate this hostgroup list based on the context it is used -func (m HostgroupList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { +// 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++ { diff --git a/power/models/hostgroup_share_op.go b/power/models/host_group_share_op.go similarity index 72% rename from power/models/hostgroup_share_op.go rename to power/models/host_group_share_op.go index ebd3fd75..fe1f2c99 100644 --- a/power/models/hostgroup_share_op.go +++ b/power/models/host_group_share_op.go @@ -14,20 +14,20 @@ import ( "github.com/go-openapi/swag" ) -// HostgroupShareOp Operation updating the sharing status (mutually exclusive) +// HostGroupShareOp Operation updating the sharing status (mutually exclusive) // -// swagger:model HostgroupShareOp -type HostgroupShareOp struct { +// swagger:model HostGroupShareOp +type HostGroupShareOp struct { - // List of workspace names to share the hostgroup with + // List of workspace names to share the host group with Add []*Secondary `json:"add"` - // A workspace name to stop sharing the hostgroup with + // A workspace name to stop sharing the host group with Remove string `json:"remove,omitempty"` } -// Validate validates this hostgroup share op -func (m *HostgroupShareOp) Validate(formats strfmt.Registry) error { +// 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 { @@ -40,7 +40,7 @@ func (m *HostgroupShareOp) Validate(formats strfmt.Registry) error { return nil } -func (m *HostgroupShareOp) validateAdd(formats strfmt.Registry) error { +func (m *HostGroupShareOp) validateAdd(formats strfmt.Registry) error { if swag.IsZero(m.Add) { // not required return nil } @@ -66,8 +66,8 @@ func (m *HostgroupShareOp) validateAdd(formats strfmt.Registry) error { return nil } -// ContextValidate validate this hostgroup share op based on the context it is used -func (m *HostgroupShareOp) ContextValidate(ctx context.Context, formats strfmt.Registry) error { +// 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 { @@ -80,7 +80,7 @@ func (m *HostgroupShareOp) ContextValidate(ctx context.Context, formats strfmt.R return nil } -func (m *HostgroupShareOp) contextValidateAdd(ctx context.Context, formats strfmt.Registry) error { +func (m *HostGroupShareOp) contextValidateAdd(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Add); i++ { @@ -106,7 +106,7 @@ func (m *HostgroupShareOp) contextValidateAdd(ctx context.Context, formats strfm } // MarshalBinary interface implementation -func (m *HostgroupShareOp) MarshalBinary() ([]byte, error) { +func (m *HostGroupShareOp) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -114,8 +114,8 @@ func (m *HostgroupShareOp) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *HostgroupShareOp) UnmarshalBinary(b []byte) error { - var res HostgroupShareOp +func (m *HostGroupShareOp) UnmarshalBinary(b []byte) error { + var res HostGroupShareOp if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/power/models/host_group_summary.go b/power/models/host_group_summary.go new file mode 100644 index 00000000..f4c345ed --- /dev/null +++ b/power/models/host_group_summary.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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_resource_capacity.go b/power/models/host_resource_capacity.go new file mode 100644 index 00000000..4814c505 --- /dev/null +++ b/power/models/host_resource_capacity.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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" +) + +// HostResourceCapacity host resource capacity +// +// swagger:model HostResourceCapacity +type HostResourceCapacity struct { + + // available + Available float64 `json:"available,omitempty"` + + // reserved + Reserved float64 `json:"reserved,omitempty"` + + // total + Total float64 `json:"total,omitempty"` + + // used + Used float64 `json:"used,omitempty"` +} + +// Validate validates this host resource capacity +func (m *HostResourceCapacity) Validate(formats strfmt.Registry) error { + 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/hostgroup_href.go b/power/models/hostgroup_href.go deleted file mode 100644 index 2733f00f..00000000 --- a/power/models/hostgroup_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" -) - -// HostgroupHref Link to hostgroup resource -// -// swagger:model HostgroupHref -type HostgroupHref string - -// Validate validates this hostgroup href -func (m HostgroupHref) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this hostgroup href based on context it is used -func (m HostgroupHref) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/power/models/image_import_details.go b/power/models/image_import_details.go new file mode 100644 index 00000000..59560a09 --- /dev/null +++ b/power/models/image_import_details.go @@ -0,0 +1,205 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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/p_vm_instance_create.go b/power/models/p_vm_instance_create.go index 013a094c..5023f322 100644 --- a/power/models/p_vm_instance_create.go +++ b/power/models/p_vm_instance_create.go @@ -21,7 +21,7 @@ import ( // swagger:model PVMInstanceCreate type PVMInstanceCreate struct { - // The name of the host or hostgroup where to deploy the VM + // The name of the host or host group where to deploy the VM DeployTarget string `json:"deployTarget,omitempty"` // The custom deployment type @@ -106,7 +106,7 @@ type PVMInstanceCreate struct { // System type used to host the instance SysType string `json:"sysType,omitempty"` - // Cloud init user defined data + // 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"` // The pvm instance virtual CPU information diff --git a/power/models/s_a_p_create.go b/power/models/s_a_p_create.go index e16ee442..632bc758 100644 --- a/power/models/s_a_p_create.go +++ b/power/models/s_a_p_create.go @@ -63,7 +63,7 @@ type SAPCreate struct { // System type used to host the instance. Only e880, e980, e1080 are supported SysType string `json:"sysType,omitempty"` - // Cloud init user defined data + // 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"` // List of Volume IDs to attach to the pvm-instance on creation diff --git a/power/models/s_a_p_profile.go b/power/models/s_a_p_profile.go index 73096fa6..6333b489 100644 --- a/power/models/s_a_p_profile.go +++ b/power/models/s_a_p_profile.go @@ -36,6 +36,9 @@ type SAPProfile struct { // Required: true ProfileID *string `json:"profileID"` + // List of supported systems + SupportedSystems []string `json:"supportedSystems"` + // Type of profile // Required: true // Enum: [balanced compute memory non-production ultra-memory] diff --git a/power/models/secondary.go b/power/models/secondary.go index 11c37f88..63bca7d5 100644 --- a/power/models/secondary.go +++ b/power/models/secondary.go @@ -14,15 +14,15 @@ import ( "github.com/go-openapi/validate" ) -// Secondary Information to create a secondary hostgroup +// Secondary Information to create a secondary host group // // swagger:model Secondary type Secondary struct { - // Name of the hostgroup to create in the secondary workspace + // Name of the host group to create in the secondary workspace Name string `json:"name,omitempty"` - // Name of the workspace to share the hostgroup with + // Name of the workspace to share the host group with // Required: true Workspace *string `json:"workspace"` } diff --git a/power/models/volumes_clone_async_request.go b/power/models/volumes_clone_async_request.go index 7c4628c2..1b0993a1 100644 --- a/power/models/volumes_clone_async_request.go +++ b/power/models/volumes_clone_async_request.go @@ -26,6 +26,7 @@ type VolumesCloneAsyncRequest struct { // 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"` diff --git a/power/models/volumes_clone_execute.go b/power/models/volumes_clone_execute.go index 1d880001..b470cb78 100644 --- a/power/models/volumes_clone_execute.go +++ b/power/models/volumes_clone_execute.go @@ -26,6 +26,7 @@ type VolumesCloneExecute struct { // 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"` diff --git a/power/models/volumes_clone_request.go b/power/models/volumes_clone_request.go index 7ed5f8c5..cb238678 100644 --- a/power/models/volumes_clone_request.go +++ b/power/models/volumes_clone_request.go @@ -25,6 +25,7 @@ type VolumesCloneRequest struct { // 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"` From a49a1e4fae0612036219c5ce65f60fbfc62f8a60 Mon Sep 17 00:00:00 2001 From: powervs-ibm Date: Thu, 21 Mar 2024 12:59:13 +0000 Subject: [PATCH 044/118] Generated Swagger client from service-broker commit e98a290ebdfbe53e5fec9ff5100a299bc77a6014 --- .../host_groups_client.go} | 82 +-- .../v1_available_hosts_parameters.go | 2 +- .../v1_available_hosts_responses.go | 2 +- .../v1_host_groups_get_parameters.go | 128 ++++ .../v1_host_groups_get_responses.go | 471 +++++++++++++ .../v1_host_groups_id_get_parameters.go | 151 +++++ .../v1_host_groups_id_get_responses.go | 547 +++++++++++++++ .../v1_host_groups_id_put_parameters.go | 175 +++++ .../v1_host_groups_id_put_responses.go | 621 ++++++++++++++++++ .../v1_host_groups_post_parameters.go | 153 +++++ .../v1_host_groups_post_responses.go | 621 ++++++++++++++++++ .../v1_hosts_get_parameters.go | 2 +- .../v1_hosts_get_responses.go | 2 +- .../v1_hosts_id_delete_parameters.go | 2 +- .../v1_hosts_id_delete_responses.go | 2 +- .../v1_hosts_id_get_parameters.go | 2 +- .../v1_hosts_id_get_responses.go | 2 +- .../v1_hosts_id_put_parameters.go | 2 +- .../v1_hosts_id_put_responses.go | 2 +- .../v1_hosts_post_parameters.go | 4 +- .../v1_hosts_post_responses.go | 10 +- .../v1_hostgroups_get_parameters.go | 128 ---- .../hostgroups/v1_hostgroups_get_responses.go | 471 ------------- .../v1_hostgroups_id_get_parameters.go | 151 ----- .../v1_hostgroups_id_get_responses.go | 547 --------------- .../v1_hostgroups_id_put_parameters.go | 175 ----- .../v1_hostgroups_id_put_responses.go | 621 ------------------ .../v1_hostgroups_post_parameters.go | 153 ----- .../v1_hostgroups_post_responses.go | 621 ------------------ .../p_cloud_volumes/p_cloud_volumes_client.go | 18 +- power/client/power_iaas_api_client.go | 8 +- power/models/add_host.go | 2 +- power/models/available_host.go | 2 +- power/models/available_host_capacity.go | 160 +++++ .../available_host_resource_capacity.go | 50 ++ power/models/create_cos_image_import_job.go | 51 ++ power/models/host.go | 49 +- power/models/host_available_capacity.go | 53 -- power/models/host_capacity.go | 127 +++- power/models/host_create.go | 78 ++- power/models/{hostgroup.go => host_group.go} | 36 +- ...stgroup_create.go => host_group_create.go} | 36 +- .../{hostgroup_list.go => host_group_list.go} | 14 +- ...oup_share_op.go => host_group_share_op.go} | 28 +- power/models/host_group_summary.go | 56 ++ power/models/host_resource_capacity.go | 59 ++ power/models/hostgroup_href.go | 27 - power/models/image_import_details.go | 205 ++++++ power/models/p_vm_instance_create.go | 4 +- power/models/s_a_p_create.go | 2 +- power/models/s_a_p_profile.go | 3 + power/models/secondary.go | 6 +- power/models/volumes_clone_async_request.go | 1 + power/models/volumes_clone_execute.go | 1 + power/models/volumes_clone_request.go | 1 + 55 files changed, 3777 insertions(+), 3150 deletions(-) rename power/client/{hostgroups/hostgroups_client.go => host_groups/host_groups_client.go} (83%) rename power/client/{hostgroups => host_groups}/v1_available_hosts_parameters.go (99%) rename power/client/{hostgroups => host_groups}/v1_available_hosts_responses.go (99%) create mode 100644 power/client/host_groups/v1_host_groups_get_parameters.go create mode 100644 power/client/host_groups/v1_host_groups_get_responses.go create mode 100644 power/client/host_groups/v1_host_groups_id_get_parameters.go create mode 100644 power/client/host_groups/v1_host_groups_id_get_responses.go create mode 100644 power/client/host_groups/v1_host_groups_id_put_parameters.go create mode 100644 power/client/host_groups/v1_host_groups_id_put_responses.go create mode 100644 power/client/host_groups/v1_host_groups_post_parameters.go create mode 100644 power/client/host_groups/v1_host_groups_post_responses.go rename power/client/{hostgroups => host_groups}/v1_hosts_get_parameters.go (99%) rename power/client/{hostgroups => host_groups}/v1_hosts_get_responses.go (99%) rename power/client/{hostgroups => host_groups}/v1_hosts_id_delete_parameters.go (99%) rename power/client/{hostgroups => host_groups}/v1_hosts_id_delete_responses.go (99%) rename power/client/{hostgroups => host_groups}/v1_hosts_id_get_parameters.go (99%) rename power/client/{hostgroups => host_groups}/v1_hosts_id_get_responses.go (99%) rename power/client/{hostgroups => host_groups}/v1_hosts_id_put_parameters.go (99%) rename power/client/{hostgroups => host_groups}/v1_hosts_id_put_responses.go (99%) rename power/client/{hostgroups => host_groups}/v1_hosts_post_parameters.go (98%) rename power/client/{hostgroups => host_groups}/v1_hosts_post_responses.go (98%) delete mode 100644 power/client/hostgroups/v1_hostgroups_get_parameters.go delete mode 100644 power/client/hostgroups/v1_hostgroups_get_responses.go delete mode 100644 power/client/hostgroups/v1_hostgroups_id_get_parameters.go delete mode 100644 power/client/hostgroups/v1_hostgroups_id_get_responses.go delete mode 100644 power/client/hostgroups/v1_hostgroups_id_put_parameters.go delete mode 100644 power/client/hostgroups/v1_hostgroups_id_put_responses.go delete mode 100644 power/client/hostgroups/v1_hostgroups_post_parameters.go delete mode 100644 power/client/hostgroups/v1_hostgroups_post_responses.go create mode 100644 power/models/available_host_capacity.go create mode 100644 power/models/available_host_resource_capacity.go delete mode 100644 power/models/host_available_capacity.go rename power/models/{hostgroup.go => host_group.go} (74%) rename power/models/{hostgroup_create.go => host_group_create.go} (78%) rename power/models/{hostgroup_list.go => host_group_list.go} (79%) rename power/models/{hostgroup_share_op.go => host_group_share_op.go} (72%) create mode 100644 power/models/host_group_summary.go create mode 100644 power/models/host_resource_capacity.go delete mode 100644 power/models/hostgroup_href.go create mode 100644 power/models/image_import_details.go diff --git a/power/client/hostgroups/hostgroups_client.go b/power/client/host_groups/host_groups_client.go similarity index 83% rename from power/client/hostgroups/hostgroups_client.go rename to power/client/host_groups/host_groups_client.go index 19daf7c8..9ccc05d1 100644 --- a/power/client/hostgroups/hostgroups_client.go +++ b/power/client/host_groups/host_groups_client.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +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 @@ -12,13 +12,13 @@ import ( "github.com/go-openapi/strfmt" ) -// New creates a new hostgroups API client. +// New creates a new host groups API client. func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { return &Client{transport: transport, formats: formats} } /* -Client for hostgroups API +Client for host groups API */ type Client struct { transport runtime.ClientTransport @@ -32,13 +32,13 @@ type ClientOption func(*runtime.ClientOperation) type ClientService interface { V1AvailableHosts(params *V1AvailableHostsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1AvailableHostsOK, error) - V1HostgroupsGet(params *V1HostgroupsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostgroupsGetOK, error) + V1HostGroupsGet(params *V1HostGroupsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostGroupsGetOK, error) - V1HostgroupsIDGet(params *V1HostgroupsIDGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostgroupsIDGetOK, error) + V1HostGroupsIDGet(params *V1HostGroupsIDGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostGroupsIDGetOK, error) - V1HostgroupsIDPut(params *V1HostgroupsIDPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostgroupsIDPutOK, error) + V1HostGroupsIDPut(params *V1HostGroupsIDPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostGroupsIDPutOK, error) - V1HostgroupsPost(params *V1HostgroupsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostgroupsPostCreated, error) + V1HostGroupsPost(params *V1HostGroupsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostGroupsPostCreated, error) V1HostsGet(params *V1HostsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostsGetOK, error) @@ -93,22 +93,22 @@ func (a *Client) V1AvailableHosts(params *V1AvailableHostsParams, authInfo runti } /* -V1HostgroupsGet gets the list of hostgroups for the workspace +V1HostGroupsGet gets the list of host groups for the workspace */ -func (a *Client) V1HostgroupsGet(params *V1HostgroupsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostgroupsGetOK, error) { +func (a *Client) V1HostGroupsGet(params *V1HostGroupsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostGroupsGetOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewV1HostgroupsGetParams() + params = NewV1HostGroupsGetParams() } op := &runtime.ClientOperation{ - ID: "v1.hostgroups.get", + ID: "v1.hostGroups.get", Method: "GET", - PathPattern: "/v1/hostgroups", + PathPattern: "/v1/host-groups", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &V1HostgroupsGetReader{formats: a.formats}, + Reader: &V1HostGroupsGetReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -121,33 +121,33 @@ func (a *Client) V1HostgroupsGet(params *V1HostgroupsGetParams, authInfo runtime if err != nil { return nil, err } - success, ok := result.(*V1HostgroupsGetOK) + 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) + 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 hostgroup +V1HostGroupsIDGet gets the details of a host group */ -func (a *Client) V1HostgroupsIDGet(params *V1HostgroupsIDGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostgroupsIDGetOK, error) { +func (a *Client) V1HostGroupsIDGet(params *V1HostGroupsIDGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostGroupsIDGetOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewV1HostgroupsIDGetParams() + params = NewV1HostGroupsIDGetParams() } op := &runtime.ClientOperation{ - ID: "v1.hostgroups.id.get", + ID: "v1.hostGroups.id.get", Method: "GET", - PathPattern: "/v1/hostgroups/{hostgroup_id}", + 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}, + Reader: &V1HostGroupsIDGetReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -160,33 +160,33 @@ func (a *Client) V1HostgroupsIDGet(params *V1HostgroupsIDGetParams, authInfo run if err != nil { return nil, err } - success, ok := result.(*V1HostgroupsIDGetOK) + 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) + 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 hostgroup with another workspace +V1HostGroupsIDPut shares unshare a host group with another workspace */ -func (a *Client) V1HostgroupsIDPut(params *V1HostgroupsIDPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostgroupsIDPutOK, error) { +func (a *Client) V1HostGroupsIDPut(params *V1HostGroupsIDPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostGroupsIDPutOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewV1HostgroupsIDPutParams() + params = NewV1HostGroupsIDPutParams() } op := &runtime.ClientOperation{ - ID: "v1.hostgroups.id.put", + ID: "v1.hostGroups.id.put", Method: "PUT", - PathPattern: "/v1/hostgroups/{hostgroup_id}", + 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}, + Reader: &V1HostGroupsIDPutReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -199,33 +199,33 @@ func (a *Client) V1HostgroupsIDPut(params *V1HostgroupsIDPutParams, authInfo run if err != nil { return nil, err } - success, ok := result.(*V1HostgroupsIDPutOK) + 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) + 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 hostgroup with one or more host +V1HostGroupsPost creates a host group with one or more host */ -func (a *Client) V1HostgroupsPost(params *V1HostgroupsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostgroupsPostCreated, error) { +func (a *Client) V1HostGroupsPost(params *V1HostGroupsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostGroupsPostCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewV1HostgroupsPostParams() + params = NewV1HostGroupsPostParams() } op := &runtime.ClientOperation{ - ID: "v1.hostgroups.post", + ID: "v1.hostGroups.post", Method: "POST", - PathPattern: "/v1/hostgroups", + PathPattern: "/v1/host-groups", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &V1HostgroupsPostReader{formats: a.formats}, + Reader: &V1HostGroupsPostReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -238,13 +238,13 @@ func (a *Client) V1HostgroupsPost(params *V1HostgroupsPostParams, authInfo runti if err != nil { return nil, err } - success, ok := result.(*V1HostgroupsPostCreated) + 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) + 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) } @@ -288,7 +288,7 @@ func (a *Client) V1HostsGet(params *V1HostsGetParams, authInfo runtime.ClientAut } /* -V1HostsIDDelete releases a host from its hostgroup +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 @@ -405,7 +405,7 @@ func (a *Client) V1HostsIDPut(params *V1HostsIDPutParams, authInfo runtime.Clien } /* -V1HostsPost adds new host s to an existing hostgroup +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 diff --git a/power/client/hostgroups/v1_available_hosts_parameters.go b/power/client/host_groups/v1_available_hosts_parameters.go similarity index 99% rename from power/client/hostgroups/v1_available_hosts_parameters.go rename to power/client/host_groups/v1_available_hosts_parameters.go index f2c3babf..8a26b9cd 100644 --- a/power/client/hostgroups/v1_available_hosts_parameters.go +++ b/power/client/host_groups/v1_available_hosts_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +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 diff --git a/power/client/hostgroups/v1_available_hosts_responses.go b/power/client/host_groups/v1_available_hosts_responses.go similarity index 99% rename from power/client/hostgroups/v1_available_hosts_responses.go rename to power/client/host_groups/v1_available_hosts_responses.go index a591b6e1..8ef00909 100644 --- a/power/client/hostgroups/v1_available_hosts_responses.go +++ b/power/client/host_groups/v1_available_hosts_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +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 diff --git a/power/client/host_groups/v1_host_groups_get_parameters.go b/power/client/host_groups/v1_host_groups_get_parameters.go new file mode 100644 index 00000000..91bf33de --- /dev/null +++ b/power/client/host_groups/v1_host_groups_get_parameters.go @@ -0,0 +1,128 @@ +// 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 new file mode 100644 index 00000000..8801484f --- /dev/null +++ b/power/client/host_groups/v1_host_groups_get_responses.go @@ -0,0 +1,471 @@ +// 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" + "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 { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetOK %+v", 200, o.Payload) +} + +func (o *V1HostGroupsGetOK) String() string { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetOK %+v", 200, o.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 { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetBadRequest %+v", 400, o.Payload) +} + +func (o *V1HostGroupsGetBadRequest) String() string { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetBadRequest %+v", 400, o.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 { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetUnauthorized %+v", 401, o.Payload) +} + +func (o *V1HostGroupsGetUnauthorized) String() string { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetUnauthorized %+v", 401, o.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 { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetForbidden %+v", 403, o.Payload) +} + +func (o *V1HostGroupsGetForbidden) String() string { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetForbidden %+v", 403, o.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 { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetInternalServerError %+v", 500, o.Payload) +} + +func (o *V1HostGroupsGetInternalServerError) String() string { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetInternalServerError %+v", 500, o.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 { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetGatewayTimeout %+v", 504, o.Payload) +} + +func (o *V1HostGroupsGetGatewayTimeout) String() string { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetGatewayTimeout %+v", 504, o.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 new file mode 100644 index 00000000..2952b90a --- /dev/null +++ b/power/client/host_groups/v1_host_groups_id_get_parameters.go @@ -0,0 +1,151 @@ +// 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 new file mode 100644 index 00000000..72b372e7 --- /dev/null +++ b/power/client/host_groups/v1_host_groups_id_get_responses.go @@ -0,0 +1,547 @@ +// 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" + "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 { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetOK %+v", 200, o.Payload) +} + +func (o *V1HostGroupsIDGetOK) String() string { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetOK %+v", 200, o.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 { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetBadRequest %+v", 400, o.Payload) +} + +func (o *V1HostGroupsIDGetBadRequest) String() string { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetBadRequest %+v", 400, o.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 { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetUnauthorized %+v", 401, o.Payload) +} + +func (o *V1HostGroupsIDGetUnauthorized) String() string { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetUnauthorized %+v", 401, o.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 { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetForbidden %+v", 403, o.Payload) +} + +func (o *V1HostGroupsIDGetForbidden) String() string { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetForbidden %+v", 403, o.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 { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetNotFound %+v", 404, o.Payload) +} + +func (o *V1HostGroupsIDGetNotFound) String() string { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetNotFound %+v", 404, o.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 { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetInternalServerError %+v", 500, o.Payload) +} + +func (o *V1HostGroupsIDGetInternalServerError) String() string { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetInternalServerError %+v", 500, o.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 { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetGatewayTimeout %+v", 504, o.Payload) +} + +func (o *V1HostGroupsIDGetGatewayTimeout) String() string { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetGatewayTimeout %+v", 504, o.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 new file mode 100644 index 00000000..02a106c1 --- /dev/null +++ b/power/client/host_groups/v1_host_groups_id_put_parameters.go @@ -0,0 +1,175 @@ +// 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 new file mode 100644 index 00000000..126854de --- /dev/null +++ b/power/client/host_groups/v1_host_groups_id_put_responses.go @@ -0,0 +1,621 @@ +// 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" + "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 { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutOK %+v", 200, o.Payload) +} + +func (o *V1HostGroupsIDPutOK) String() string { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutOK %+v", 200, o.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 { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutBadRequest %+v", 400, o.Payload) +} + +func (o *V1HostGroupsIDPutBadRequest) String() string { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutBadRequest %+v", 400, o.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 { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutUnauthorized %+v", 401, o.Payload) +} + +func (o *V1HostGroupsIDPutUnauthorized) String() string { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutUnauthorized %+v", 401, o.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 { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutForbidden %+v", 403, o.Payload) +} + +func (o *V1HostGroupsIDPutForbidden) String() string { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutForbidden %+v", 403, o.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 { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutNotFound %+v", 404, o.Payload) +} + +func (o *V1HostGroupsIDPutNotFound) String() string { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutNotFound %+v", 404, o.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 { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutConflict %+v", 409, o.Payload) +} + +func (o *V1HostGroupsIDPutConflict) String() string { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutConflict %+v", 409, o.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 { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutInternalServerError %+v", 500, o.Payload) +} + +func (o *V1HostGroupsIDPutInternalServerError) String() string { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutInternalServerError %+v", 500, o.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 { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutGatewayTimeout %+v", 504, o.Payload) +} + +func (o *V1HostGroupsIDPutGatewayTimeout) String() string { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutGatewayTimeout %+v", 504, o.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 new file mode 100644 index 00000000..f75d2a3a --- /dev/null +++ b/power/client/host_groups/v1_host_groups_post_parameters.go @@ -0,0 +1,153 @@ +// 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 new file mode 100644 index 00000000..18415773 --- /dev/null +++ b/power/client/host_groups/v1_host_groups_post_responses.go @@ -0,0 +1,621 @@ +// 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" + "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 { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostCreated %+v", 201, o.Payload) +} + +func (o *V1HostGroupsPostCreated) String() string { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostCreated %+v", 201, o.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 { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostBadRequest %+v", 400, o.Payload) +} + +func (o *V1HostGroupsPostBadRequest) String() string { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostBadRequest %+v", 400, o.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 { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostUnauthorized %+v", 401, o.Payload) +} + +func (o *V1HostGroupsPostUnauthorized) String() string { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostUnauthorized %+v", 401, o.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 { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostForbidden %+v", 403, o.Payload) +} + +func (o *V1HostGroupsPostForbidden) String() string { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostForbidden %+v", 403, o.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 { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostConflict %+v", 409, o.Payload) +} + +func (o *V1HostGroupsPostConflict) String() string { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostConflict %+v", 409, o.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 { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *V1HostGroupsPostUnprocessableEntity) String() string { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostUnprocessableEntity %+v", 422, o.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 { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostInternalServerError %+v", 500, o.Payload) +} + +func (o *V1HostGroupsPostInternalServerError) String() string { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostInternalServerError %+v", 500, o.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 { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostGatewayTimeout %+v", 504, o.Payload) +} + +func (o *V1HostGroupsPostGatewayTimeout) String() string { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostGatewayTimeout %+v", 504, o.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/hostgroups/v1_hosts_get_parameters.go b/power/client/host_groups/v1_hosts_get_parameters.go similarity index 99% rename from power/client/hostgroups/v1_hosts_get_parameters.go rename to power/client/host_groups/v1_hosts_get_parameters.go index b2b9e6c7..b4139ea5 100644 --- a/power/client/hostgroups/v1_hosts_get_parameters.go +++ b/power/client/host_groups/v1_hosts_get_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +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 diff --git a/power/client/hostgroups/v1_hosts_get_responses.go b/power/client/host_groups/v1_hosts_get_responses.go similarity index 99% rename from power/client/hostgroups/v1_hosts_get_responses.go rename to power/client/host_groups/v1_hosts_get_responses.go index 80e385ed..ba907c0d 100644 --- a/power/client/hostgroups/v1_hosts_get_responses.go +++ b/power/client/host_groups/v1_hosts_get_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +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 diff --git a/power/client/hostgroups/v1_hosts_id_delete_parameters.go b/power/client/host_groups/v1_hosts_id_delete_parameters.go similarity index 99% rename from power/client/hostgroups/v1_hosts_id_delete_parameters.go rename to power/client/host_groups/v1_hosts_id_delete_parameters.go index e2508c8d..412fe32c 100644 --- a/power/client/hostgroups/v1_hosts_id_delete_parameters.go +++ b/power/client/host_groups/v1_hosts_id_delete_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +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 diff --git a/power/client/hostgroups/v1_hosts_id_delete_responses.go b/power/client/host_groups/v1_hosts_id_delete_responses.go similarity index 99% rename from power/client/hostgroups/v1_hosts_id_delete_responses.go rename to power/client/host_groups/v1_hosts_id_delete_responses.go index e41a8ea2..1681c9fe 100644 --- a/power/client/hostgroups/v1_hosts_id_delete_responses.go +++ b/power/client/host_groups/v1_hosts_id_delete_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +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 diff --git a/power/client/hostgroups/v1_hosts_id_get_parameters.go b/power/client/host_groups/v1_hosts_id_get_parameters.go similarity index 99% rename from power/client/hostgroups/v1_hosts_id_get_parameters.go rename to power/client/host_groups/v1_hosts_id_get_parameters.go index 73c5b368..422c12ff 100644 --- a/power/client/hostgroups/v1_hosts_id_get_parameters.go +++ b/power/client/host_groups/v1_hosts_id_get_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +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 diff --git a/power/client/hostgroups/v1_hosts_id_get_responses.go b/power/client/host_groups/v1_hosts_id_get_responses.go similarity index 99% rename from power/client/hostgroups/v1_hosts_id_get_responses.go rename to power/client/host_groups/v1_hosts_id_get_responses.go index f28f8270..42411024 100644 --- a/power/client/hostgroups/v1_hosts_id_get_responses.go +++ b/power/client/host_groups/v1_hosts_id_get_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +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 diff --git a/power/client/hostgroups/v1_hosts_id_put_parameters.go b/power/client/host_groups/v1_hosts_id_put_parameters.go similarity index 99% rename from power/client/hostgroups/v1_hosts_id_put_parameters.go rename to power/client/host_groups/v1_hosts_id_put_parameters.go index d1186ae9..557c18a4 100644 --- a/power/client/hostgroups/v1_hosts_id_put_parameters.go +++ b/power/client/host_groups/v1_hosts_id_put_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +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 diff --git a/power/client/hostgroups/v1_hosts_id_put_responses.go b/power/client/host_groups/v1_hosts_id_put_responses.go similarity index 99% rename from power/client/hostgroups/v1_hosts_id_put_responses.go rename to power/client/host_groups/v1_hosts_id_put_responses.go index 322ce86b..8723d370 100644 --- a/power/client/hostgroups/v1_hosts_id_put_responses.go +++ b/power/client/host_groups/v1_hosts_id_put_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +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 diff --git a/power/client/hostgroups/v1_hosts_post_parameters.go b/power/client/host_groups/v1_hosts_post_parameters.go similarity index 98% rename from power/client/hostgroups/v1_hosts_post_parameters.go rename to power/client/host_groups/v1_hosts_post_parameters.go index d44a5ff3..21437e7a 100644 --- a/power/client/hostgroups/v1_hosts_post_parameters.go +++ b/power/client/host_groups/v1_hosts_post_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +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 @@ -65,7 +65,7 @@ type V1HostsPostParams struct { /* Body. - Parameters to add a host to an existing hostgroup + Parameters to add a host to an existing host group */ Body *models.HostCreate diff --git a/power/client/hostgroups/v1_hosts_post_responses.go b/power/client/host_groups/v1_hosts_post_responses.go similarity index 98% rename from power/client/hostgroups/v1_hosts_post_responses.go rename to power/client/host_groups/v1_hosts_post_responses.go index 40dc82e7..2a62bb96 100644 --- a/power/client/hostgroups/v1_hosts_post_responses.go +++ b/power/client/host_groups/v1_hosts_post_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +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 @@ -81,7 +81,7 @@ V1HostsPostCreated describes a response with status code 201, with default heade Created */ type V1HostsPostCreated struct { - Payload *models.Host + Payload models.HostList } // IsSuccess returns true when this v1 hosts post created response has a 2xx status code @@ -122,16 +122,14 @@ func (o *V1HostsPostCreated) String() string { return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostCreated %+v", 201, o.Payload) } -func (o *V1HostsPostCreated) GetPayload() *models.Host { +func (o *V1HostsPostCreated) GetPayload() models.HostList { return o.Payload } func (o *V1HostsPostCreated) 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 { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { return err } diff --git a/power/client/hostgroups/v1_hostgroups_get_parameters.go b/power/client/hostgroups/v1_hostgroups_get_parameters.go deleted file mode 100644 index e4c9dcc2..00000000 --- a/power/client/hostgroups/v1_hostgroups_get_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package hostgroups - -// 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 hostgroups 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 hostgroups 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 hostgroups 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 hostgroups get params -func (o *V1HostgroupsGetParams) WithTimeout(timeout time.Duration) *V1HostgroupsGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 hostgroups get params -func (o *V1HostgroupsGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 hostgroups get params -func (o *V1HostgroupsGetParams) WithContext(ctx context.Context) *V1HostgroupsGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 hostgroups get params -func (o *V1HostgroupsGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 hostgroups get params -func (o *V1HostgroupsGetParams) WithHTTPClient(client *http.Client) *V1HostgroupsGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 hostgroups 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/hostgroups/v1_hostgroups_get_responses.go b/power/client/hostgroups/v1_hostgroups_get_responses.go deleted file mode 100644 index 6ee0eeca..00000000 --- a/power/client/hostgroups/v1_hostgroups_get_responses.go +++ /dev/null @@ -1,471 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package hostgroups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "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/hostgroups] 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 hostgroups get o k response has a 2xx status code -func (o *V1HostgroupsGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 hostgroups get o k response has a 3xx status code -func (o *V1HostgroupsGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups get o k response has a 4xx status code -func (o *V1HostgroupsGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups get o k response has a 5xx status code -func (o *V1HostgroupsGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups get o k response -func (o *V1HostgroupsGetOK) Code() int { - return 200 -} - -func (o *V1HostgroupsGetOK) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetOK %+v", 200, o.Payload) -} - -func (o *V1HostgroupsGetOK) String() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetOK %+v", 200, o.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 hostgroups get bad request response has a 2xx status code -func (o *V1HostgroupsGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups get bad request response has a 3xx status code -func (o *V1HostgroupsGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups get bad request response has a 4xx status code -func (o *V1HostgroupsGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups get bad request response has a 5xx status code -func (o *V1HostgroupsGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups get bad request response -func (o *V1HostgroupsGetBadRequest) Code() int { - return 400 -} - -func (o *V1HostgroupsGetBadRequest) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetBadRequest %+v", 400, o.Payload) -} - -func (o *V1HostgroupsGetBadRequest) String() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetBadRequest %+v", 400, o.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 hostgroups get unauthorized response has a 2xx status code -func (o *V1HostgroupsGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups get unauthorized response has a 3xx status code -func (o *V1HostgroupsGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups get unauthorized response has a 4xx status code -func (o *V1HostgroupsGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups get unauthorized response has a 5xx status code -func (o *V1HostgroupsGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups get unauthorized response -func (o *V1HostgroupsGetUnauthorized) Code() int { - return 401 -} - -func (o *V1HostgroupsGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetUnauthorized %+v", 401, o.Payload) -} - -func (o *V1HostgroupsGetUnauthorized) String() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetUnauthorized %+v", 401, o.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 hostgroups get forbidden response has a 2xx status code -func (o *V1HostgroupsGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups get forbidden response has a 3xx status code -func (o *V1HostgroupsGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups get forbidden response has a 4xx status code -func (o *V1HostgroupsGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups get forbidden response has a 5xx status code -func (o *V1HostgroupsGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups get forbidden response -func (o *V1HostgroupsGetForbidden) Code() int { - return 403 -} - -func (o *V1HostgroupsGetForbidden) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetForbidden %+v", 403, o.Payload) -} - -func (o *V1HostgroupsGetForbidden) String() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetForbidden %+v", 403, o.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 hostgroups get internal server error response has a 2xx status code -func (o *V1HostgroupsGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups get internal server error response has a 3xx status code -func (o *V1HostgroupsGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups get internal server error response has a 4xx status code -func (o *V1HostgroupsGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups get internal server error response has a 5xx status code -func (o *V1HostgroupsGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups get internal server error response -func (o *V1HostgroupsGetInternalServerError) Code() int { - return 500 -} - -func (o *V1HostgroupsGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetInternalServerError %+v", 500, o.Payload) -} - -func (o *V1HostgroupsGetInternalServerError) String() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetInternalServerError %+v", 500, o.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 hostgroups get gateway timeout response has a 2xx status code -func (o *V1HostgroupsGetGatewayTimeout) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups get gateway timeout response has a 3xx status code -func (o *V1HostgroupsGetGatewayTimeout) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups get gateway timeout response has a 4xx status code -func (o *V1HostgroupsGetGatewayTimeout) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups get gateway timeout response has a 5xx status code -func (o *V1HostgroupsGetGatewayTimeout) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups get gateway timeout response -func (o *V1HostgroupsGetGatewayTimeout) Code() int { - return 504 -} - -func (o *V1HostgroupsGetGatewayTimeout) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetGatewayTimeout %+v", 504, o.Payload) -} - -func (o *V1HostgroupsGetGatewayTimeout) String() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetGatewayTimeout %+v", 504, o.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/hostgroups/v1_hostgroups_id_get_parameters.go b/power/client/hostgroups/v1_hostgroups_id_get_parameters.go deleted file mode 100644 index f266f7eb..00000000 --- a/power/client/hostgroups/v1_hostgroups_id_get_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package hostgroups - -// 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 hostgroups 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 hostgroups 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 hostgroups 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 hostgroups id get params -func (o *V1HostgroupsIDGetParams) WithTimeout(timeout time.Duration) *V1HostgroupsIDGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 hostgroups id get params -func (o *V1HostgroupsIDGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 hostgroups id get params -func (o *V1HostgroupsIDGetParams) WithContext(ctx context.Context) *V1HostgroupsIDGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 hostgroups id get params -func (o *V1HostgroupsIDGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 hostgroups id get params -func (o *V1HostgroupsIDGetParams) WithHTTPClient(client *http.Client) *V1HostgroupsIDGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 hostgroups id get params -func (o *V1HostgroupsIDGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithHostgroupID adds the hostgroupID to the v1 hostgroups id get params -func (o *V1HostgroupsIDGetParams) WithHostgroupID(hostgroupID string) *V1HostgroupsIDGetParams { - o.SetHostgroupID(hostgroupID) - return o -} - -// SetHostgroupID adds the hostgroupId to the v1 hostgroups 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 hostgroup_id - if err := r.SetPathParam("hostgroup_id", o.HostgroupID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/hostgroups/v1_hostgroups_id_get_responses.go b/power/client/hostgroups/v1_hostgroups_id_get_responses.go deleted file mode 100644 index d458c4db..00000000 --- a/power/client/hostgroups/v1_hostgroups_id_get_responses.go +++ /dev/null @@ -1,547 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package hostgroups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "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/hostgroups/{hostgroup_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 hostgroups Id get o k response has a 2xx status code -func (o *V1HostgroupsIDGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 hostgroups Id get o k response has a 3xx status code -func (o *V1HostgroupsIDGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id get o k response has a 4xx status code -func (o *V1HostgroupsIDGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups Id get o k response has a 5xx status code -func (o *V1HostgroupsIDGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id get o k response -func (o *V1HostgroupsIDGetOK) Code() int { - return 200 -} - -func (o *V1HostgroupsIDGetOK) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetOK %+v", 200, o.Payload) -} - -func (o *V1HostgroupsIDGetOK) String() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetOK %+v", 200, o.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 hostgroups Id get bad request response has a 2xx status code -func (o *V1HostgroupsIDGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id get bad request response has a 3xx status code -func (o *V1HostgroupsIDGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id get bad request response has a 4xx status code -func (o *V1HostgroupsIDGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups Id get bad request response has a 5xx status code -func (o *V1HostgroupsIDGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id get bad request response -func (o *V1HostgroupsIDGetBadRequest) Code() int { - return 400 -} - -func (o *V1HostgroupsIDGetBadRequest) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetBadRequest %+v", 400, o.Payload) -} - -func (o *V1HostgroupsIDGetBadRequest) String() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetBadRequest %+v", 400, o.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 hostgroups Id get unauthorized response has a 2xx status code -func (o *V1HostgroupsIDGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id get unauthorized response has a 3xx status code -func (o *V1HostgroupsIDGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id get unauthorized response has a 4xx status code -func (o *V1HostgroupsIDGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups Id get unauthorized response has a 5xx status code -func (o *V1HostgroupsIDGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id get unauthorized response -func (o *V1HostgroupsIDGetUnauthorized) Code() int { - return 401 -} - -func (o *V1HostgroupsIDGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetUnauthorized %+v", 401, o.Payload) -} - -func (o *V1HostgroupsIDGetUnauthorized) String() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetUnauthorized %+v", 401, o.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 hostgroups Id get forbidden response has a 2xx status code -func (o *V1HostgroupsIDGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id get forbidden response has a 3xx status code -func (o *V1HostgroupsIDGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id get forbidden response has a 4xx status code -func (o *V1HostgroupsIDGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups Id get forbidden response has a 5xx status code -func (o *V1HostgroupsIDGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id get forbidden response -func (o *V1HostgroupsIDGetForbidden) Code() int { - return 403 -} - -func (o *V1HostgroupsIDGetForbidden) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetForbidden %+v", 403, o.Payload) -} - -func (o *V1HostgroupsIDGetForbidden) String() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetForbidden %+v", 403, o.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 hostgroups Id get not found response has a 2xx status code -func (o *V1HostgroupsIDGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id get not found response has a 3xx status code -func (o *V1HostgroupsIDGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id get not found response has a 4xx status code -func (o *V1HostgroupsIDGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups Id get not found response has a 5xx status code -func (o *V1HostgroupsIDGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id get not found response -func (o *V1HostgroupsIDGetNotFound) Code() int { - return 404 -} - -func (o *V1HostgroupsIDGetNotFound) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetNotFound %+v", 404, o.Payload) -} - -func (o *V1HostgroupsIDGetNotFound) String() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetNotFound %+v", 404, o.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 hostgroups Id get internal server error response has a 2xx status code -func (o *V1HostgroupsIDGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id get internal server error response has a 3xx status code -func (o *V1HostgroupsIDGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id get internal server error response has a 4xx status code -func (o *V1HostgroupsIDGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups Id get internal server error response has a 5xx status code -func (o *V1HostgroupsIDGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id get internal server error response -func (o *V1HostgroupsIDGetInternalServerError) Code() int { - return 500 -} - -func (o *V1HostgroupsIDGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetInternalServerError %+v", 500, o.Payload) -} - -func (o *V1HostgroupsIDGetInternalServerError) String() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetInternalServerError %+v", 500, o.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 hostgroups Id get gateway timeout response has a 2xx status code -func (o *V1HostgroupsIDGetGatewayTimeout) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id get gateway timeout response has a 3xx status code -func (o *V1HostgroupsIDGetGatewayTimeout) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id get gateway timeout response has a 4xx status code -func (o *V1HostgroupsIDGetGatewayTimeout) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups Id get gateway timeout response has a 5xx status code -func (o *V1HostgroupsIDGetGatewayTimeout) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id get gateway timeout response -func (o *V1HostgroupsIDGetGatewayTimeout) Code() int { - return 504 -} - -func (o *V1HostgroupsIDGetGatewayTimeout) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetGatewayTimeout %+v", 504, o.Payload) -} - -func (o *V1HostgroupsIDGetGatewayTimeout) String() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetGatewayTimeout %+v", 504, o.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/hostgroups/v1_hostgroups_id_put_parameters.go b/power/client/hostgroups/v1_hostgroups_id_put_parameters.go deleted file mode 100644 index 61e2d566..00000000 --- a/power/client/hostgroups/v1_hostgroups_id_put_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package hostgroups - -// 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 hostgroups id put operation. - - Typically these are written to a http.Request. -*/ -type V1HostgroupsIDPutParams struct { - - /* Body. - - Parameters to set the sharing status of the hostgroup - */ - Body *models.HostgroupShareOp - - /* HostgroupID. - - Hostgroup ID - */ - HostgroupID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 hostgroups 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 hostgroups 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 hostgroups id put params -func (o *V1HostgroupsIDPutParams) WithTimeout(timeout time.Duration) *V1HostgroupsIDPutParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 hostgroups id put params -func (o *V1HostgroupsIDPutParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 hostgroups id put params -func (o *V1HostgroupsIDPutParams) WithContext(ctx context.Context) *V1HostgroupsIDPutParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 hostgroups id put params -func (o *V1HostgroupsIDPutParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 hostgroups id put params -func (o *V1HostgroupsIDPutParams) WithHTTPClient(client *http.Client) *V1HostgroupsIDPutParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 hostgroups id put params -func (o *V1HostgroupsIDPutParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the v1 hostgroups id put params -func (o *V1HostgroupsIDPutParams) WithBody(body *models.HostgroupShareOp) *V1HostgroupsIDPutParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the v1 hostgroups id put params -func (o *V1HostgroupsIDPutParams) SetBody(body *models.HostgroupShareOp) { - o.Body = body -} - -// WithHostgroupID adds the hostgroupID to the v1 hostgroups id put params -func (o *V1HostgroupsIDPutParams) WithHostgroupID(hostgroupID string) *V1HostgroupsIDPutParams { - o.SetHostgroupID(hostgroupID) - return o -} - -// SetHostgroupID adds the hostgroupId to the v1 hostgroups 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 hostgroup_id - if err := r.SetPathParam("hostgroup_id", o.HostgroupID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/hostgroups/v1_hostgroups_id_put_responses.go b/power/client/hostgroups/v1_hostgroups_id_put_responses.go deleted file mode 100644 index 33b7c6b4..00000000 --- a/power/client/hostgroups/v1_hostgroups_id_put_responses.go +++ /dev/null @@ -1,621 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package hostgroups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "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/hostgroups/{hostgroup_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 hostgroups Id put o k response has a 2xx status code -func (o *V1HostgroupsIDPutOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 hostgroups Id put o k response has a 3xx status code -func (o *V1HostgroupsIDPutOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id put o k response has a 4xx status code -func (o *V1HostgroupsIDPutOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups Id put o k response has a 5xx status code -func (o *V1HostgroupsIDPutOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id put o k response -func (o *V1HostgroupsIDPutOK) Code() int { - return 200 -} - -func (o *V1HostgroupsIDPutOK) Error() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutOK %+v", 200, o.Payload) -} - -func (o *V1HostgroupsIDPutOK) String() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutOK %+v", 200, o.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 hostgroups Id put bad request response has a 2xx status code -func (o *V1HostgroupsIDPutBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id put bad request response has a 3xx status code -func (o *V1HostgroupsIDPutBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id put bad request response has a 4xx status code -func (o *V1HostgroupsIDPutBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups Id put bad request response has a 5xx status code -func (o *V1HostgroupsIDPutBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id put bad request response -func (o *V1HostgroupsIDPutBadRequest) Code() int { - return 400 -} - -func (o *V1HostgroupsIDPutBadRequest) Error() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutBadRequest %+v", 400, o.Payload) -} - -func (o *V1HostgroupsIDPutBadRequest) String() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutBadRequest %+v", 400, o.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 hostgroups Id put unauthorized response has a 2xx status code -func (o *V1HostgroupsIDPutUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id put unauthorized response has a 3xx status code -func (o *V1HostgroupsIDPutUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id put unauthorized response has a 4xx status code -func (o *V1HostgroupsIDPutUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups Id put unauthorized response has a 5xx status code -func (o *V1HostgroupsIDPutUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id put unauthorized response -func (o *V1HostgroupsIDPutUnauthorized) Code() int { - return 401 -} - -func (o *V1HostgroupsIDPutUnauthorized) Error() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutUnauthorized %+v", 401, o.Payload) -} - -func (o *V1HostgroupsIDPutUnauthorized) String() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutUnauthorized %+v", 401, o.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 hostgroups Id put forbidden response has a 2xx status code -func (o *V1HostgroupsIDPutForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id put forbidden response has a 3xx status code -func (o *V1HostgroupsIDPutForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id put forbidden response has a 4xx status code -func (o *V1HostgroupsIDPutForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups Id put forbidden response has a 5xx status code -func (o *V1HostgroupsIDPutForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id put forbidden response -func (o *V1HostgroupsIDPutForbidden) Code() int { - return 403 -} - -func (o *V1HostgroupsIDPutForbidden) Error() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutForbidden %+v", 403, o.Payload) -} - -func (o *V1HostgroupsIDPutForbidden) String() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutForbidden %+v", 403, o.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 hostgroups Id put not found response has a 2xx status code -func (o *V1HostgroupsIDPutNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id put not found response has a 3xx status code -func (o *V1HostgroupsIDPutNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id put not found response has a 4xx status code -func (o *V1HostgroupsIDPutNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups Id put not found response has a 5xx status code -func (o *V1HostgroupsIDPutNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id put not found response -func (o *V1HostgroupsIDPutNotFound) Code() int { - return 404 -} - -func (o *V1HostgroupsIDPutNotFound) Error() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutNotFound %+v", 404, o.Payload) -} - -func (o *V1HostgroupsIDPutNotFound) String() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutNotFound %+v", 404, o.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 hostgroups Id put conflict response has a 2xx status code -func (o *V1HostgroupsIDPutConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id put conflict response has a 3xx status code -func (o *V1HostgroupsIDPutConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id put conflict response has a 4xx status code -func (o *V1HostgroupsIDPutConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups Id put conflict response has a 5xx status code -func (o *V1HostgroupsIDPutConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id put conflict response -func (o *V1HostgroupsIDPutConflict) Code() int { - return 409 -} - -func (o *V1HostgroupsIDPutConflict) Error() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutConflict %+v", 409, o.Payload) -} - -func (o *V1HostgroupsIDPutConflict) String() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutConflict %+v", 409, o.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 hostgroups Id put internal server error response has a 2xx status code -func (o *V1HostgroupsIDPutInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id put internal server error response has a 3xx status code -func (o *V1HostgroupsIDPutInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id put internal server error response has a 4xx status code -func (o *V1HostgroupsIDPutInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups Id put internal server error response has a 5xx status code -func (o *V1HostgroupsIDPutInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id put internal server error response -func (o *V1HostgroupsIDPutInternalServerError) Code() int { - return 500 -} - -func (o *V1HostgroupsIDPutInternalServerError) Error() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutInternalServerError %+v", 500, o.Payload) -} - -func (o *V1HostgroupsIDPutInternalServerError) String() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutInternalServerError %+v", 500, o.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 hostgroups Id put gateway timeout response has a 2xx status code -func (o *V1HostgroupsIDPutGatewayTimeout) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id put gateway timeout response has a 3xx status code -func (o *V1HostgroupsIDPutGatewayTimeout) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id put gateway timeout response has a 4xx status code -func (o *V1HostgroupsIDPutGatewayTimeout) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups Id put gateway timeout response has a 5xx status code -func (o *V1HostgroupsIDPutGatewayTimeout) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id put gateway timeout response -func (o *V1HostgroupsIDPutGatewayTimeout) Code() int { - return 504 -} - -func (o *V1HostgroupsIDPutGatewayTimeout) Error() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutGatewayTimeout %+v", 504, o.Payload) -} - -func (o *V1HostgroupsIDPutGatewayTimeout) String() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutGatewayTimeout %+v", 504, o.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/hostgroups/v1_hostgroups_post_parameters.go b/power/client/hostgroups/v1_hostgroups_post_parameters.go deleted file mode 100644 index 56fe0baa..00000000 --- a/power/client/hostgroups/v1_hostgroups_post_parameters.go +++ /dev/null @@ -1,153 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package hostgroups - -// 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 hostgroups post operation. - - Typically these are written to a http.Request. -*/ -type V1HostgroupsPostParams struct { - - /* Body. - - Parameters for the creation of a new hostgroup - */ - Body *models.HostgroupCreate - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 hostgroups 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 hostgroups 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 hostgroups post params -func (o *V1HostgroupsPostParams) WithTimeout(timeout time.Duration) *V1HostgroupsPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 hostgroups post params -func (o *V1HostgroupsPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 hostgroups post params -func (o *V1HostgroupsPostParams) WithContext(ctx context.Context) *V1HostgroupsPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 hostgroups post params -func (o *V1HostgroupsPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 hostgroups post params -func (o *V1HostgroupsPostParams) WithHTTPClient(client *http.Client) *V1HostgroupsPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 hostgroups post params -func (o *V1HostgroupsPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the v1 hostgroups post params -func (o *V1HostgroupsPostParams) WithBody(body *models.HostgroupCreate) *V1HostgroupsPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the v1 hostgroups 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/hostgroups/v1_hostgroups_post_responses.go b/power/client/hostgroups/v1_hostgroups_post_responses.go deleted file mode 100644 index 81b051bb..00000000 --- a/power/client/hostgroups/v1_hostgroups_post_responses.go +++ /dev/null @@ -1,621 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package hostgroups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "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/hostgroups] 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 hostgroups post created response has a 2xx status code -func (o *V1HostgroupsPostCreated) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 hostgroups post created response has a 3xx status code -func (o *V1HostgroupsPostCreated) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups post created response has a 4xx status code -func (o *V1HostgroupsPostCreated) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups post created response has a 5xx status code -func (o *V1HostgroupsPostCreated) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups post created response -func (o *V1HostgroupsPostCreated) Code() int { - return 201 -} - -func (o *V1HostgroupsPostCreated) Error() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostCreated %+v", 201, o.Payload) -} - -func (o *V1HostgroupsPostCreated) String() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostCreated %+v", 201, o.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 hostgroups post bad request response has a 2xx status code -func (o *V1HostgroupsPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups post bad request response has a 3xx status code -func (o *V1HostgroupsPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups post bad request response has a 4xx status code -func (o *V1HostgroupsPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups post bad request response has a 5xx status code -func (o *V1HostgroupsPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups post bad request response -func (o *V1HostgroupsPostBadRequest) Code() int { - return 400 -} - -func (o *V1HostgroupsPostBadRequest) Error() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostBadRequest %+v", 400, o.Payload) -} - -func (o *V1HostgroupsPostBadRequest) String() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostBadRequest %+v", 400, o.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 hostgroups post unauthorized response has a 2xx status code -func (o *V1HostgroupsPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups post unauthorized response has a 3xx status code -func (o *V1HostgroupsPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups post unauthorized response has a 4xx status code -func (o *V1HostgroupsPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups post unauthorized response has a 5xx status code -func (o *V1HostgroupsPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups post unauthorized response -func (o *V1HostgroupsPostUnauthorized) Code() int { - return 401 -} - -func (o *V1HostgroupsPostUnauthorized) Error() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostUnauthorized %+v", 401, o.Payload) -} - -func (o *V1HostgroupsPostUnauthorized) String() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostUnauthorized %+v", 401, o.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 hostgroups post forbidden response has a 2xx status code -func (o *V1HostgroupsPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups post forbidden response has a 3xx status code -func (o *V1HostgroupsPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups post forbidden response has a 4xx status code -func (o *V1HostgroupsPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups post forbidden response has a 5xx status code -func (o *V1HostgroupsPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups post forbidden response -func (o *V1HostgroupsPostForbidden) Code() int { - return 403 -} - -func (o *V1HostgroupsPostForbidden) Error() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostForbidden %+v", 403, o.Payload) -} - -func (o *V1HostgroupsPostForbidden) String() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostForbidden %+v", 403, o.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 hostgroups post conflict response has a 2xx status code -func (o *V1HostgroupsPostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups post conflict response has a 3xx status code -func (o *V1HostgroupsPostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups post conflict response has a 4xx status code -func (o *V1HostgroupsPostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups post conflict response has a 5xx status code -func (o *V1HostgroupsPostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups post conflict response -func (o *V1HostgroupsPostConflict) Code() int { - return 409 -} - -func (o *V1HostgroupsPostConflict) Error() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostConflict %+v", 409, o.Payload) -} - -func (o *V1HostgroupsPostConflict) String() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostConflict %+v", 409, o.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 hostgroups post unprocessable entity response has a 2xx status code -func (o *V1HostgroupsPostUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups post unprocessable entity response has a 3xx status code -func (o *V1HostgroupsPostUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups post unprocessable entity response has a 4xx status code -func (o *V1HostgroupsPostUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups post unprocessable entity response has a 5xx status code -func (o *V1HostgroupsPostUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups post unprocessable entity response -func (o *V1HostgroupsPostUnprocessableEntity) Code() int { - return 422 -} - -func (o *V1HostgroupsPostUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *V1HostgroupsPostUnprocessableEntity) String() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostUnprocessableEntity %+v", 422, o.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 hostgroups post internal server error response has a 2xx status code -func (o *V1HostgroupsPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups post internal server error response has a 3xx status code -func (o *V1HostgroupsPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups post internal server error response has a 4xx status code -func (o *V1HostgroupsPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups post internal server error response has a 5xx status code -func (o *V1HostgroupsPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups post internal server error response -func (o *V1HostgroupsPostInternalServerError) Code() int { - return 500 -} - -func (o *V1HostgroupsPostInternalServerError) Error() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostInternalServerError %+v", 500, o.Payload) -} - -func (o *V1HostgroupsPostInternalServerError) String() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostInternalServerError %+v", 500, o.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 hostgroups post gateway timeout response has a 2xx status code -func (o *V1HostgroupsPostGatewayTimeout) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups post gateway timeout response has a 3xx status code -func (o *V1HostgroupsPostGatewayTimeout) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups post gateway timeout response has a 4xx status code -func (o *V1HostgroupsPostGatewayTimeout) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups post gateway timeout response has a 5xx status code -func (o *V1HostgroupsPostGatewayTimeout) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups post gateway timeout response -func (o *V1HostgroupsPostGatewayTimeout) Code() int { - return 504 -} - -func (o *V1HostgroupsPostGatewayTimeout) Error() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostGatewayTimeout %+v", 504, o.Payload) -} - -func (o *V1HostgroupsPostGatewayTimeout) String() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostGatewayTimeout %+v", 504, o.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/p_cloud_volumes/p_cloud_volumes_client.go b/power/client/p_cloud_volumes/p_cloud_volumes_client.go index c662828e..e2819358 100644 --- a/power/client/p_cloud_volumes/p_cloud_volumes_client.go +++ b/power/client/p_cloud_volumes/p_cloud_volumes_client.go @@ -519,7 +519,11 @@ func (a *Client) PcloudPvminstancesVolumesGetall(params *PcloudPvminstancesVolum } /* -PcloudPvminstancesVolumesPost attaches a volume to a p VM instance + PcloudPvminstancesVolumesPost attaches a volume to a p VM instance + + Attach a volume to a PVMInstance. + +>**Note**: In the case of VMRM, the first volume being attached will be converted to a bootable volume. */ func (a *Client) PcloudPvminstancesVolumesPost(params *PcloudPvminstancesVolumesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVolumesPostOK, error) { // TODO: Validate the params before sending @@ -597,7 +601,11 @@ func (a *Client) PcloudPvminstancesVolumesPut(params *PcloudPvminstancesVolumesP } /* -PcloudPvminstancesVolumesSetbootPut sets the p VM instance volume as the boot volume + 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 @@ -675,7 +683,11 @@ func (a *Client) PcloudV2PvminstancesVolumesDelete(params *PcloudV2PvminstancesV } /* -PcloudV2PvminstancesVolumesPost attaches all volumes to a p VM instance + 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 diff --git a/power/client/power_iaas_api_client.go b/power/client/power_iaas_api_client.go index 2b8c1a8c..fe13576c 100644 --- a/power/client/power_iaas_api_client.go +++ b/power/client/power_iaas_api_client.go @@ -15,7 +15,7 @@ import ( "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/hostgroups" + "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" @@ -102,7 +102,7 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *PowerIaasA cli.Catalog = catalog.New(transport, formats) cli.Datacenters = datacenters.New(transport, formats) cli.HardwarePlatforms = hardware_platforms.New(transport, formats) - cli.Hostgroups = hostgroups.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) @@ -194,7 +194,7 @@ type PowerIaasAPI struct { HardwarePlatforms hardware_platforms.ClientService - Hostgroups hostgroups.ClientService + HostGroups host_groups.ClientService IaasServiceBroker iaas_service_broker.ClientService @@ -281,7 +281,7 @@ func (c *PowerIaasAPI) SetTransport(transport runtime.ClientTransport) { c.Catalog.SetTransport(transport) c.Datacenters.SetTransport(transport) c.HardwarePlatforms.SetTransport(transport) - c.Hostgroups.SetTransport(transport) + c.HostGroups.SetTransport(transport) c.IaasServiceBroker.SetTransport(transport) c.InternalPowervsInstances.SetTransport(transport) c.InternalPowervsLocations.SetTransport(transport) diff --git a/power/models/add_host.go b/power/models/add_host.go index fb06e74e..b0e6358a 100644 --- a/power/models/add_host.go +++ b/power/models/add_host.go @@ -14,7 +14,7 @@ import ( "github.com/go-openapi/validate" ) -// AddHost Host to add to a hostgroup +// AddHost Host to add to a host group // // swagger:model AddHost type AddHost struct { diff --git a/power/models/available_host.go b/power/models/available_host.go index 35b33173..db8b23ba 100644 --- a/power/models/available_host.go +++ b/power/models/available_host.go @@ -19,7 +19,7 @@ import ( type AvailableHost struct { // Resource capacities for that system type and configuration - Capacity *HostAvailableCapacity `json:"capacity,omitempty"` + Capacity *AvailableHostCapacity `json:"capacity,omitempty"` // How many hosts of such type/capacities are available Count int64 `json:"count,omitempty"` diff --git a/power/models/available_host_capacity.go b/power/models/available_host_capacity.go new file mode 100644 index 00000000..1b4ec156 --- /dev/null +++ b/power/models/available_host_capacity.go @@ -0,0 +1,160 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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 MB) + 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_resource_capacity.go b/power/models/available_host_resource_capacity.go new file mode 100644 index 00000000..ba0e0591 --- /dev/null +++ b/power/models/available_host_resource_capacity.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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" +) + +// AvailableHostResourceCapacity available host resource capacity +// +// swagger:model AvailableHostResourceCapacity +type AvailableHostResourceCapacity struct { + + // available + Available float64 `json:"available,omitempty"` +} + +// Validate validates this available host resource capacity +func (m *AvailableHostResourceCapacity) Validate(formats strfmt.Registry) error { + 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/create_cos_image_import_job.go b/power/models/create_cos_image_import_job.go index 12186df3..7511771e 100644 --- a/power/models/create_cos_image_import_job.go +++ b/power/models/create_cos_image_import_job.go @@ -39,6 +39,9 @@ type CreateCosImageImportJob struct { // 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"` @@ -80,6 +83,10 @@ func (m *CreateCosImageImportJob) Validate(formats strfmt.Registry) error { 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) } @@ -167,6 +174,25 @@ func (m *CreateCosImageImportJob) validateImageName(formats strfmt.Registry) 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() { @@ -247,6 +273,10 @@ func (m *CreateCosImageImportJob) validateStorageAffinity(formats strfmt.Registr 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) } @@ -257,6 +287,27 @@ func (m *CreateCosImageImportJob) ContextValidate(ctx context.Context, formats s 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 { diff --git a/power/models/host.go b/power/models/host.go index d0ad65f7..51e2d4a4 100644 --- a/power/models/host.go +++ b/power/models/host.go @@ -24,8 +24,8 @@ type Host struct { // Name of the host (chosen by the user) DisplayName string `json:"displayName,omitempty"` - // Link to the owning hostgroup - Hostgroup HostgroupHref `json:"hostgroup,omitempty"` + // Information about the owning host group + HostGroup *HostGroupSummary `json:"hostGroup,omitempty"` // ID of the host ID string `json:"id,omitempty"` @@ -48,7 +48,7 @@ func (m *Host) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateHostgroup(formats); err != nil { + if err := m.validateHostGroup(formats); err != nil { res = append(res, err) } @@ -77,18 +77,20 @@ func (m *Host) validateCapacity(formats strfmt.Registry) error { return nil } -func (m *Host) validateHostgroup(formats strfmt.Registry) error { - if swag.IsZero(m.Hostgroup) { // not required +func (m *Host) validateHostGroup(formats strfmt.Registry) error { + if swag.IsZero(m.HostGroup) { // not required return 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") + 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 err } return nil @@ -102,7 +104,7 @@ func (m *Host) ContextValidate(ctx context.Context, formats strfmt.Registry) err res = append(res, err) } - if err := m.contextValidateHostgroup(ctx, formats); err != nil { + if err := m.contextValidateHostGroup(ctx, formats); err != nil { res = append(res, err) } @@ -133,19 +135,22 @@ func (m *Host) contextValidateCapacity(ctx context.Context, formats strfmt.Regis return nil } -func (m *Host) contextValidateHostgroup(ctx context.Context, formats strfmt.Registry) error { +func (m *Host) contextValidateHostGroup(ctx context.Context, formats strfmt.Registry) error { - if swag.IsZero(m.Hostgroup) { // not required - return nil - } + if m.HostGroup != 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") + 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 err } return nil diff --git a/power/models/host_available_capacity.go b/power/models/host_available_capacity.go deleted file mode 100644 index 4099a90f..00000000 --- a/power/models/host_available_capacity.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" -) - -// HostAvailableCapacity host available capacity -// -// swagger:model HostAvailableCapacity -type HostAvailableCapacity struct { - - // Number of cores available on the host - AvailableCore float64 `json:"availableCore,omitempty"` - - // Memory capacity available on the host (in MB) - AvailableMemory float64 `json:"availableMemory,omitempty"` -} - -// Validate validates this host available capacity -func (m *HostAvailableCapacity) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this host available capacity based on context it is used -func (m *HostAvailableCapacity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *HostAvailableCapacity) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *HostAvailableCapacity) UnmarshalBinary(b []byte) error { - var res HostAvailableCapacity - 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 index 1e822fb7..9ded7f72 100644 --- a/power/models/host_capacity.go +++ b/power/models/host_capacity.go @@ -8,6 +8,7 @@ package models import ( "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -17,38 +18,126 @@ import ( // swagger:model HostCapacity type HostCapacity struct { - // Number of cores currently available - AvailableCore float64 `json:"availableCore,omitempty"` + // Core capacity of the host + Cores *HostResourceCapacity `json:"cores,omitempty"` - // Amount of memory currently available (in MB) - AvailableMemory float64 `json:"availableMemory,omitempty"` + // Memory capacity of the host (in MB) + Memory *HostResourceCapacity `json:"memory,omitempty"` +} - // Number of cores reserved for system use - ReservedCore float64 `json:"reservedCore,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) + } - // Amount of memory reserved for system use (in MB) - ReservedMemory float64 `json:"reservedMemory,omitempty"` + if err := m.validateMemory(formats); err != nil { + res = append(res, err) + } - // Total number of cores of the host - TotalCore float64 `json:"totalCore,omitempty"` + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} - // Total amount of memory of the host (in MB) - TotalMemory float64 `json:"totalMemory,omitempty"` +func (m *HostCapacity) validateCores(formats strfmt.Registry) error { + if swag.IsZero(m.Cores) { // not required + return nil + } - // Number of cores in use on the host - UsedCore float64 `json:"usedCore,omitempty"` + 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 + } + } - // Amount of memory used on the host (in MB) - UsedMemory float64 `json:"usedMemory,omitempty"` + return nil } -// Validate validates this host capacity -func (m *HostCapacity) Validate(formats strfmt.Registry) error { +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 validates this host capacity based on context it is used +// 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 } diff --git a/power/models/host_create.go b/power/models/host_create.go index 0e7d68ee..8c256de8 100644 --- a/power/models/host_create.go +++ b/power/models/host_create.go @@ -7,6 +7,7 @@ package models import ( "context" + "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -14,29 +15,29 @@ import ( "github.com/go-openapi/validate" ) -// HostCreate Parameters to add a host to an existing hostgroup +// HostCreate Parameters to add a host to an existing host group // // swagger:model HostCreate type HostCreate struct { - // Host to be added + // ID of the host group to which the host should be added // Required: true - Host *AddHost `json:"host"` + HostGroupID *string `json:"hostGroupID"` - // ID of the hostgroup to which the host should be added + // Hosts to be added // Required: true - HostgroupID *string `json:"hostgroupID"` + Hosts []*AddHost `json:"hosts"` } // Validate validates this host create func (m *HostCreate) Validate(formats strfmt.Registry) error { var res []error - if err := m.validateHost(formats); err != nil { + if err := m.validateHostGroupID(formats); err != nil { res = append(res, err) } - if err := m.validateHostgroupID(formats); err != nil { + if err := m.validateHosts(formats); err != nil { res = append(res, err) } @@ -46,32 +47,39 @@ func (m *HostCreate) Validate(formats strfmt.Registry) error { return nil } -func (m *HostCreate) validateHost(formats strfmt.Registry) error { +func (m *HostCreate) validateHostGroupID(formats strfmt.Registry) error { - if err := validate.Required("host", "body", m.Host); err != nil { + if err := validate.Required("hostGroupID", "body", m.HostGroupID); err != nil { return err } - 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 *HostCreate) validateHostgroupID(formats strfmt.Registry) error { +func (m *HostCreate) validateHosts(formats strfmt.Registry) error { - if err := validate.Required("hostgroupID", "body", m.HostgroupID); err != nil { + 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 } @@ -79,7 +87,7 @@ func (m *HostCreate) validateHostgroupID(formats strfmt.Registry) error { func (m *HostCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error - if err := m.contextValidateHost(ctx, formats); err != nil { + if err := m.contextValidateHosts(ctx, formats); err != nil { res = append(res, err) } @@ -89,18 +97,26 @@ func (m *HostCreate) ContextValidate(ctx context.Context, formats strfmt.Registr return nil } -func (m *HostCreate) contextValidateHost(ctx context.Context, formats strfmt.Registry) error { +func (m *HostCreate) contextValidateHosts(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Hosts); i++ { - if m.Host != nil { + if m.Hosts[i] != 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") + 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 err } + } return nil diff --git a/power/models/hostgroup.go b/power/models/host_group.go similarity index 74% rename from power/models/hostgroup.go rename to power/models/host_group.go index 7ca1c07c..91c21cd7 100644 --- a/power/models/hostgroup.go +++ b/power/models/host_group.go @@ -15,33 +15,33 @@ import ( "github.com/go-openapi/validate" ) -// Hostgroup Description of a hostgroup +// HostGroup Description of a host group // -// swagger:model Hostgroup -type Hostgroup struct { +// swagger:model HostGroup +type HostGroup struct { - // Date/Time of hostgroup creation + // Date/Time of host group creation // Format: date-time CreationDate strfmt.DateTime `json:"creationDate,omitempty"` // List of hosts Hosts []HostHref `json:"hosts"` - // Hostgroup ID + // Host group ID ID string `json:"id,omitempty"` - // Name of the hostgroup + // Name of the host group Name string `json:"name,omitempty"` - // Name of the workspace owning the hostgroup + // Name of the workspace owning the host group Primary string `json:"primary,omitempty"` - // Names of workspaces the hostgroup has been shared with + // Names of workspaces the host group has been shared with Secondaries []string `json:"secondaries"` } -// Validate validates this hostgroup -func (m *Hostgroup) Validate(formats strfmt.Registry) error { +// Validate validates this host group +func (m *HostGroup) Validate(formats strfmt.Registry) error { var res []error if err := m.validateCreationDate(formats); err != nil { @@ -58,7 +58,7 @@ func (m *Hostgroup) Validate(formats strfmt.Registry) error { return nil } -func (m *Hostgroup) validateCreationDate(formats strfmt.Registry) error { +func (m *HostGroup) validateCreationDate(formats strfmt.Registry) error { if swag.IsZero(m.CreationDate) { // not required return nil } @@ -70,7 +70,7 @@ func (m *Hostgroup) validateCreationDate(formats strfmt.Registry) error { return nil } -func (m *Hostgroup) validateHosts(formats strfmt.Registry) error { +func (m *HostGroup) validateHosts(formats strfmt.Registry) error { if swag.IsZero(m.Hosts) { // not required return nil } @@ -91,8 +91,8 @@ func (m *Hostgroup) validateHosts(formats strfmt.Registry) error { return nil } -// ContextValidate validate this hostgroup based on the context it is used -func (m *Hostgroup) ContextValidate(ctx context.Context, formats strfmt.Registry) error { +// 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 { @@ -105,7 +105,7 @@ func (m *Hostgroup) ContextValidate(ctx context.Context, formats strfmt.Registry return nil } -func (m *Hostgroup) contextValidateHosts(ctx context.Context, formats strfmt.Registry) error { +func (m *HostGroup) contextValidateHosts(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Hosts); i++ { @@ -128,7 +128,7 @@ func (m *Hostgroup) contextValidateHosts(ctx context.Context, formats strfmt.Reg } // MarshalBinary interface implementation -func (m *Hostgroup) MarshalBinary() ([]byte, error) { +func (m *HostGroup) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -136,8 +136,8 @@ func (m *Hostgroup) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *Hostgroup) UnmarshalBinary(b []byte) error { - var res Hostgroup +func (m *HostGroup) UnmarshalBinary(b []byte) error { + var res HostGroup if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/power/models/hostgroup_create.go b/power/models/host_group_create.go similarity index 78% rename from power/models/hostgroup_create.go rename to power/models/host_group_create.go index b2c8b2cd..ddd5fc9f 100644 --- a/power/models/hostgroup_create.go +++ b/power/models/host_group_create.go @@ -15,25 +15,25 @@ import ( "github.com/go-openapi/validate" ) -// HostgroupCreate Parameters for the creation of a new hostgroup +// HostGroupCreate Parameters for the creation of a new host group // -// swagger:model HostgroupCreate -type HostgroupCreate struct { +// swagger:model HostGroupCreate +type HostGroupCreate struct { - // List of hosts to add to the group + // List of hosts to add to the host group // Required: true Hosts []*AddHost `json:"hosts"` - // Name of the hostgroup to create + // Name of the host group to create // Required: true Name *string `json:"name"` - // List of workspace names to share the hostgroup with (optional) + // List of workspace names to share the host group with (optional) Secondaries []*Secondary `json:"secondaries"` } -// Validate validates this hostgroup create -func (m *HostgroupCreate) Validate(formats strfmt.Registry) error { +// Validate validates this host group create +func (m *HostGroupCreate) Validate(formats strfmt.Registry) error { var res []error if err := m.validateHosts(formats); err != nil { @@ -54,7 +54,7 @@ func (m *HostgroupCreate) Validate(formats strfmt.Registry) error { return nil } -func (m *HostgroupCreate) validateHosts(formats strfmt.Registry) error { +func (m *HostGroupCreate) validateHosts(formats strfmt.Registry) error { if err := validate.Required("hosts", "body", m.Hosts); err != nil { return err @@ -81,7 +81,7 @@ func (m *HostgroupCreate) validateHosts(formats strfmt.Registry) error { return nil } -func (m *HostgroupCreate) validateName(formats strfmt.Registry) error { +func (m *HostGroupCreate) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { return err @@ -90,7 +90,7 @@ func (m *HostgroupCreate) validateName(formats strfmt.Registry) error { return nil } -func (m *HostgroupCreate) validateSecondaries(formats strfmt.Registry) error { +func (m *HostGroupCreate) validateSecondaries(formats strfmt.Registry) error { if swag.IsZero(m.Secondaries) { // not required return nil } @@ -116,8 +116,8 @@ func (m *HostgroupCreate) validateSecondaries(formats strfmt.Registry) error { return nil } -// ContextValidate validate this hostgroup create based on the context it is used -func (m *HostgroupCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { +// 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 { @@ -134,7 +134,7 @@ func (m *HostgroupCreate) ContextValidate(ctx context.Context, formats strfmt.Re return nil } -func (m *HostgroupCreate) contextValidateHosts(ctx context.Context, formats strfmt.Registry) error { +func (m *HostGroupCreate) contextValidateHosts(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Hosts); i++ { @@ -159,7 +159,7 @@ func (m *HostgroupCreate) contextValidateHosts(ctx context.Context, formats strf return nil } -func (m *HostgroupCreate) contextValidateSecondaries(ctx context.Context, formats strfmt.Registry) error { +func (m *HostGroupCreate) contextValidateSecondaries(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Secondaries); i++ { @@ -185,7 +185,7 @@ func (m *HostgroupCreate) contextValidateSecondaries(ctx context.Context, format } // MarshalBinary interface implementation -func (m *HostgroupCreate) MarshalBinary() ([]byte, error) { +func (m *HostGroupCreate) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -193,8 +193,8 @@ func (m *HostgroupCreate) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *HostgroupCreate) UnmarshalBinary(b []byte) error { - var res HostgroupCreate +func (m *HostGroupCreate) UnmarshalBinary(b []byte) error { + var res HostGroupCreate if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/power/models/hostgroup_list.go b/power/models/host_group_list.go similarity index 79% rename from power/models/hostgroup_list.go rename to power/models/host_group_list.go index bdcc2bb3..617cb02d 100644 --- a/power/models/hostgroup_list.go +++ b/power/models/host_group_list.go @@ -14,13 +14,13 @@ import ( "github.com/go-openapi/swag" ) -// HostgroupList hostgroup list +// HostGroupList host group list // -// swagger:model HostgroupList -type HostgroupList []*Hostgroup +// swagger:model HostGroupList +type HostGroupList []*HostGroup -// Validate validates this hostgroup list -func (m HostgroupList) Validate(formats strfmt.Registry) error { +// Validate validates this host group list +func (m HostGroupList) Validate(formats strfmt.Registry) error { var res []error for i := 0; i < len(m); i++ { @@ -47,8 +47,8 @@ func (m HostgroupList) Validate(formats strfmt.Registry) error { return nil } -// ContextValidate validate this hostgroup list based on the context it is used -func (m HostgroupList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { +// 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++ { diff --git a/power/models/hostgroup_share_op.go b/power/models/host_group_share_op.go similarity index 72% rename from power/models/hostgroup_share_op.go rename to power/models/host_group_share_op.go index ebd3fd75..fe1f2c99 100644 --- a/power/models/hostgroup_share_op.go +++ b/power/models/host_group_share_op.go @@ -14,20 +14,20 @@ import ( "github.com/go-openapi/swag" ) -// HostgroupShareOp Operation updating the sharing status (mutually exclusive) +// HostGroupShareOp Operation updating the sharing status (mutually exclusive) // -// swagger:model HostgroupShareOp -type HostgroupShareOp struct { +// swagger:model HostGroupShareOp +type HostGroupShareOp struct { - // List of workspace names to share the hostgroup with + // List of workspace names to share the host group with Add []*Secondary `json:"add"` - // A workspace name to stop sharing the hostgroup with + // A workspace name to stop sharing the host group with Remove string `json:"remove,omitempty"` } -// Validate validates this hostgroup share op -func (m *HostgroupShareOp) Validate(formats strfmt.Registry) error { +// 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 { @@ -40,7 +40,7 @@ func (m *HostgroupShareOp) Validate(formats strfmt.Registry) error { return nil } -func (m *HostgroupShareOp) validateAdd(formats strfmt.Registry) error { +func (m *HostGroupShareOp) validateAdd(formats strfmt.Registry) error { if swag.IsZero(m.Add) { // not required return nil } @@ -66,8 +66,8 @@ func (m *HostgroupShareOp) validateAdd(formats strfmt.Registry) error { return nil } -// ContextValidate validate this hostgroup share op based on the context it is used -func (m *HostgroupShareOp) ContextValidate(ctx context.Context, formats strfmt.Registry) error { +// 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 { @@ -80,7 +80,7 @@ func (m *HostgroupShareOp) ContextValidate(ctx context.Context, formats strfmt.R return nil } -func (m *HostgroupShareOp) contextValidateAdd(ctx context.Context, formats strfmt.Registry) error { +func (m *HostGroupShareOp) contextValidateAdd(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Add); i++ { @@ -106,7 +106,7 @@ func (m *HostgroupShareOp) contextValidateAdd(ctx context.Context, formats strfm } // MarshalBinary interface implementation -func (m *HostgroupShareOp) MarshalBinary() ([]byte, error) { +func (m *HostGroupShareOp) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -114,8 +114,8 @@ func (m *HostgroupShareOp) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *HostgroupShareOp) UnmarshalBinary(b []byte) error { - var res HostgroupShareOp +func (m *HostGroupShareOp) UnmarshalBinary(b []byte) error { + var res HostGroupShareOp if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/power/models/host_group_summary.go b/power/models/host_group_summary.go new file mode 100644 index 00000000..f4c345ed --- /dev/null +++ b/power/models/host_group_summary.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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_resource_capacity.go b/power/models/host_resource_capacity.go new file mode 100644 index 00000000..4814c505 --- /dev/null +++ b/power/models/host_resource_capacity.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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" +) + +// HostResourceCapacity host resource capacity +// +// swagger:model HostResourceCapacity +type HostResourceCapacity struct { + + // available + Available float64 `json:"available,omitempty"` + + // reserved + Reserved float64 `json:"reserved,omitempty"` + + // total + Total float64 `json:"total,omitempty"` + + // used + Used float64 `json:"used,omitempty"` +} + +// Validate validates this host resource capacity +func (m *HostResourceCapacity) Validate(formats strfmt.Registry) error { + 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/hostgroup_href.go b/power/models/hostgroup_href.go deleted file mode 100644 index 2733f00f..00000000 --- a/power/models/hostgroup_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" -) - -// HostgroupHref Link to hostgroup resource -// -// swagger:model HostgroupHref -type HostgroupHref string - -// Validate validates this hostgroup href -func (m HostgroupHref) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this hostgroup href based on context it is used -func (m HostgroupHref) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/power/models/image_import_details.go b/power/models/image_import_details.go new file mode 100644 index 00000000..59560a09 --- /dev/null +++ b/power/models/image_import_details.go @@ -0,0 +1,205 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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/p_vm_instance_create.go b/power/models/p_vm_instance_create.go index 013a094c..5023f322 100644 --- a/power/models/p_vm_instance_create.go +++ b/power/models/p_vm_instance_create.go @@ -21,7 +21,7 @@ import ( // swagger:model PVMInstanceCreate type PVMInstanceCreate struct { - // The name of the host or hostgroup where to deploy the VM + // The name of the host or host group where to deploy the VM DeployTarget string `json:"deployTarget,omitempty"` // The custom deployment type @@ -106,7 +106,7 @@ type PVMInstanceCreate struct { // System type used to host the instance SysType string `json:"sysType,omitempty"` - // Cloud init user defined data + // 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"` // The pvm instance virtual CPU information diff --git a/power/models/s_a_p_create.go b/power/models/s_a_p_create.go index e16ee442..632bc758 100644 --- a/power/models/s_a_p_create.go +++ b/power/models/s_a_p_create.go @@ -63,7 +63,7 @@ type SAPCreate struct { // System type used to host the instance. Only e880, e980, e1080 are supported SysType string `json:"sysType,omitempty"` - // Cloud init user defined data + // 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"` // List of Volume IDs to attach to the pvm-instance on creation diff --git a/power/models/s_a_p_profile.go b/power/models/s_a_p_profile.go index 73096fa6..6333b489 100644 --- a/power/models/s_a_p_profile.go +++ b/power/models/s_a_p_profile.go @@ -36,6 +36,9 @@ type SAPProfile struct { // Required: true ProfileID *string `json:"profileID"` + // List of supported systems + SupportedSystems []string `json:"supportedSystems"` + // Type of profile // Required: true // Enum: [balanced compute memory non-production ultra-memory] diff --git a/power/models/secondary.go b/power/models/secondary.go index 11c37f88..63bca7d5 100644 --- a/power/models/secondary.go +++ b/power/models/secondary.go @@ -14,15 +14,15 @@ import ( "github.com/go-openapi/validate" ) -// Secondary Information to create a secondary hostgroup +// Secondary Information to create a secondary host group // // swagger:model Secondary type Secondary struct { - // Name of the hostgroup to create in the secondary workspace + // Name of the host group to create in the secondary workspace Name string `json:"name,omitempty"` - // Name of the workspace to share the hostgroup with + // Name of the workspace to share the host group with // Required: true Workspace *string `json:"workspace"` } diff --git a/power/models/volumes_clone_async_request.go b/power/models/volumes_clone_async_request.go index 7c4628c2..1b0993a1 100644 --- a/power/models/volumes_clone_async_request.go +++ b/power/models/volumes_clone_async_request.go @@ -26,6 +26,7 @@ type VolumesCloneAsyncRequest struct { // 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"` diff --git a/power/models/volumes_clone_execute.go b/power/models/volumes_clone_execute.go index 1d880001..b470cb78 100644 --- a/power/models/volumes_clone_execute.go +++ b/power/models/volumes_clone_execute.go @@ -26,6 +26,7 @@ type VolumesCloneExecute struct { // 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"` diff --git a/power/models/volumes_clone_request.go b/power/models/volumes_clone_request.go index 7ed5f8c5..cb238678 100644 --- a/power/models/volumes_clone_request.go +++ b/power/models/volumes_clone_request.go @@ -25,6 +25,7 @@ type VolumesCloneRequest struct { // 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"` From 81cb5690d85e0737c8ce2067d364bc76997e7e25 Mon Sep 17 00:00:00 2001 From: powervs-ibm Date: Thu, 21 Mar 2024 16:08:24 +0000 Subject: [PATCH 045/118] Generated Swagger client from service-broker commit a9e6e612e2556e1c67678aebe155d22089a75639 --- .../host_groups_client.go} | 82 +-- .../v1_available_hosts_parameters.go | 2 +- .../v1_available_hosts_responses.go | 2 +- .../v1_host_groups_get_parameters.go | 128 ++++ .../v1_host_groups_get_responses.go | 471 +++++++++++++ .../v1_host_groups_id_get_parameters.go | 151 +++++ .../v1_host_groups_id_get_responses.go | 547 +++++++++++++++ .../v1_host_groups_id_put_parameters.go | 175 +++++ .../v1_host_groups_id_put_responses.go | 621 ++++++++++++++++++ .../v1_host_groups_post_parameters.go | 153 +++++ .../v1_host_groups_post_responses.go | 621 ++++++++++++++++++ .../v1_hosts_get_parameters.go | 2 +- .../v1_hosts_get_responses.go | 2 +- .../v1_hosts_id_delete_parameters.go | 2 +- .../v1_hosts_id_delete_responses.go | 2 +- .../v1_hosts_id_get_parameters.go | 2 +- .../v1_hosts_id_get_responses.go | 2 +- .../v1_hosts_id_put_parameters.go | 2 +- .../v1_hosts_id_put_responses.go | 2 +- .../v1_hosts_post_parameters.go | 4 +- .../v1_hosts_post_responses.go | 10 +- .../v1_hostgroups_get_parameters.go | 128 ---- .../hostgroups/v1_hostgroups_get_responses.go | 471 ------------- .../v1_hostgroups_id_get_parameters.go | 151 ----- .../v1_hostgroups_id_get_responses.go | 547 --------------- .../v1_hostgroups_id_put_parameters.go | 175 ----- .../v1_hostgroups_id_put_responses.go | 621 ------------------ .../v1_hostgroups_post_parameters.go | 153 ----- .../v1_hostgroups_post_responses.go | 621 ------------------ .../p_cloud_volumes/p_cloud_volumes_client.go | 18 +- power/client/power_iaas_api_client.go | 8 +- power/models/add_host.go | 2 +- power/models/available_host.go | 2 +- power/models/available_host_capacity.go | 160 +++++ .../available_host_resource_capacity.go | 50 ++ power/models/create_cos_image_import_job.go | 51 ++ power/models/deployment_target.go | 124 ++++ power/models/host.go | 49 +- power/models/host_available_capacity.go | 53 -- power/models/host_capacity.go | 127 +++- power/models/host_create.go | 78 ++- power/models/{hostgroup.go => host_group.go} | 36 +- ...stgroup_create.go => host_group_create.go} | 36 +- .../{hostgroup_list.go => host_group_list.go} | 14 +- ...oup_share_op.go => host_group_share_op.go} | 28 +- power/models/host_group_summary.go | 56 ++ power/models/host_resource_capacity.go | 59 ++ power/models/hostgroup_href.go | 27 - power/models/image_import_details.go | 205 ++++++ power/models/p_vm_instance_create.go | 55 +- power/models/s_a_p_create.go | 2 +- power/models/s_a_p_profile.go | 3 + power/models/secondary.go | 6 +- power/models/shared_processor_pool_create.go | 3 + power/models/volumes_clone_async_request.go | 1 + power/models/volumes_clone_execute.go | 1 + power/models/volumes_clone_request.go | 1 + 57 files changed, 3955 insertions(+), 3150 deletions(-) rename power/client/{hostgroups/hostgroups_client.go => host_groups/host_groups_client.go} (83%) rename power/client/{hostgroups => host_groups}/v1_available_hosts_parameters.go (99%) rename power/client/{hostgroups => host_groups}/v1_available_hosts_responses.go (99%) create mode 100644 power/client/host_groups/v1_host_groups_get_parameters.go create mode 100644 power/client/host_groups/v1_host_groups_get_responses.go create mode 100644 power/client/host_groups/v1_host_groups_id_get_parameters.go create mode 100644 power/client/host_groups/v1_host_groups_id_get_responses.go create mode 100644 power/client/host_groups/v1_host_groups_id_put_parameters.go create mode 100644 power/client/host_groups/v1_host_groups_id_put_responses.go create mode 100644 power/client/host_groups/v1_host_groups_post_parameters.go create mode 100644 power/client/host_groups/v1_host_groups_post_responses.go rename power/client/{hostgroups => host_groups}/v1_hosts_get_parameters.go (99%) rename power/client/{hostgroups => host_groups}/v1_hosts_get_responses.go (99%) rename power/client/{hostgroups => host_groups}/v1_hosts_id_delete_parameters.go (99%) rename power/client/{hostgroups => host_groups}/v1_hosts_id_delete_responses.go (99%) rename power/client/{hostgroups => host_groups}/v1_hosts_id_get_parameters.go (99%) rename power/client/{hostgroups => host_groups}/v1_hosts_id_get_responses.go (99%) rename power/client/{hostgroups => host_groups}/v1_hosts_id_put_parameters.go (99%) rename power/client/{hostgroups => host_groups}/v1_hosts_id_put_responses.go (99%) rename power/client/{hostgroups => host_groups}/v1_hosts_post_parameters.go (98%) rename power/client/{hostgroups => host_groups}/v1_hosts_post_responses.go (98%) delete mode 100644 power/client/hostgroups/v1_hostgroups_get_parameters.go delete mode 100644 power/client/hostgroups/v1_hostgroups_get_responses.go delete mode 100644 power/client/hostgroups/v1_hostgroups_id_get_parameters.go delete mode 100644 power/client/hostgroups/v1_hostgroups_id_get_responses.go delete mode 100644 power/client/hostgroups/v1_hostgroups_id_put_parameters.go delete mode 100644 power/client/hostgroups/v1_hostgroups_id_put_responses.go delete mode 100644 power/client/hostgroups/v1_hostgroups_post_parameters.go delete mode 100644 power/client/hostgroups/v1_hostgroups_post_responses.go create mode 100644 power/models/available_host_capacity.go create mode 100644 power/models/available_host_resource_capacity.go create mode 100644 power/models/deployment_target.go delete mode 100644 power/models/host_available_capacity.go rename power/models/{hostgroup.go => host_group.go} (74%) rename power/models/{hostgroup_create.go => host_group_create.go} (78%) rename power/models/{hostgroup_list.go => host_group_list.go} (79%) rename power/models/{hostgroup_share_op.go => host_group_share_op.go} (72%) create mode 100644 power/models/host_group_summary.go create mode 100644 power/models/host_resource_capacity.go delete mode 100644 power/models/hostgroup_href.go create mode 100644 power/models/image_import_details.go diff --git a/power/client/hostgroups/hostgroups_client.go b/power/client/host_groups/host_groups_client.go similarity index 83% rename from power/client/hostgroups/hostgroups_client.go rename to power/client/host_groups/host_groups_client.go index 19daf7c8..9ccc05d1 100644 --- a/power/client/hostgroups/hostgroups_client.go +++ b/power/client/host_groups/host_groups_client.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +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 @@ -12,13 +12,13 @@ import ( "github.com/go-openapi/strfmt" ) -// New creates a new hostgroups API client. +// New creates a new host groups API client. func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { return &Client{transport: transport, formats: formats} } /* -Client for hostgroups API +Client for host groups API */ type Client struct { transport runtime.ClientTransport @@ -32,13 +32,13 @@ type ClientOption func(*runtime.ClientOperation) type ClientService interface { V1AvailableHosts(params *V1AvailableHostsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1AvailableHostsOK, error) - V1HostgroupsGet(params *V1HostgroupsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostgroupsGetOK, error) + V1HostGroupsGet(params *V1HostGroupsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostGroupsGetOK, error) - V1HostgroupsIDGet(params *V1HostgroupsIDGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostgroupsIDGetOK, error) + V1HostGroupsIDGet(params *V1HostGroupsIDGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostGroupsIDGetOK, error) - V1HostgroupsIDPut(params *V1HostgroupsIDPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostgroupsIDPutOK, error) + V1HostGroupsIDPut(params *V1HostGroupsIDPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostGroupsIDPutOK, error) - V1HostgroupsPost(params *V1HostgroupsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostgroupsPostCreated, error) + V1HostGroupsPost(params *V1HostGroupsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostGroupsPostCreated, error) V1HostsGet(params *V1HostsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostsGetOK, error) @@ -93,22 +93,22 @@ func (a *Client) V1AvailableHosts(params *V1AvailableHostsParams, authInfo runti } /* -V1HostgroupsGet gets the list of hostgroups for the workspace +V1HostGroupsGet gets the list of host groups for the workspace */ -func (a *Client) V1HostgroupsGet(params *V1HostgroupsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostgroupsGetOK, error) { +func (a *Client) V1HostGroupsGet(params *V1HostGroupsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostGroupsGetOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewV1HostgroupsGetParams() + params = NewV1HostGroupsGetParams() } op := &runtime.ClientOperation{ - ID: "v1.hostgroups.get", + ID: "v1.hostGroups.get", Method: "GET", - PathPattern: "/v1/hostgroups", + PathPattern: "/v1/host-groups", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &V1HostgroupsGetReader{formats: a.formats}, + Reader: &V1HostGroupsGetReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -121,33 +121,33 @@ func (a *Client) V1HostgroupsGet(params *V1HostgroupsGetParams, authInfo runtime if err != nil { return nil, err } - success, ok := result.(*V1HostgroupsGetOK) + 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) + 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 hostgroup +V1HostGroupsIDGet gets the details of a host group */ -func (a *Client) V1HostgroupsIDGet(params *V1HostgroupsIDGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostgroupsIDGetOK, error) { +func (a *Client) V1HostGroupsIDGet(params *V1HostGroupsIDGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostGroupsIDGetOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewV1HostgroupsIDGetParams() + params = NewV1HostGroupsIDGetParams() } op := &runtime.ClientOperation{ - ID: "v1.hostgroups.id.get", + ID: "v1.hostGroups.id.get", Method: "GET", - PathPattern: "/v1/hostgroups/{hostgroup_id}", + 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}, + Reader: &V1HostGroupsIDGetReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -160,33 +160,33 @@ func (a *Client) V1HostgroupsIDGet(params *V1HostgroupsIDGetParams, authInfo run if err != nil { return nil, err } - success, ok := result.(*V1HostgroupsIDGetOK) + 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) + 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 hostgroup with another workspace +V1HostGroupsIDPut shares unshare a host group with another workspace */ -func (a *Client) V1HostgroupsIDPut(params *V1HostgroupsIDPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostgroupsIDPutOK, error) { +func (a *Client) V1HostGroupsIDPut(params *V1HostGroupsIDPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostGroupsIDPutOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewV1HostgroupsIDPutParams() + params = NewV1HostGroupsIDPutParams() } op := &runtime.ClientOperation{ - ID: "v1.hostgroups.id.put", + ID: "v1.hostGroups.id.put", Method: "PUT", - PathPattern: "/v1/hostgroups/{hostgroup_id}", + 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}, + Reader: &V1HostGroupsIDPutReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -199,33 +199,33 @@ func (a *Client) V1HostgroupsIDPut(params *V1HostgroupsIDPutParams, authInfo run if err != nil { return nil, err } - success, ok := result.(*V1HostgroupsIDPutOK) + 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) + 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 hostgroup with one or more host +V1HostGroupsPost creates a host group with one or more host */ -func (a *Client) V1HostgroupsPost(params *V1HostgroupsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostgroupsPostCreated, error) { +func (a *Client) V1HostGroupsPost(params *V1HostGroupsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostGroupsPostCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewV1HostgroupsPostParams() + params = NewV1HostGroupsPostParams() } op := &runtime.ClientOperation{ - ID: "v1.hostgroups.post", + ID: "v1.hostGroups.post", Method: "POST", - PathPattern: "/v1/hostgroups", + PathPattern: "/v1/host-groups", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &V1HostgroupsPostReader{formats: a.formats}, + Reader: &V1HostGroupsPostReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -238,13 +238,13 @@ func (a *Client) V1HostgroupsPost(params *V1HostgroupsPostParams, authInfo runti if err != nil { return nil, err } - success, ok := result.(*V1HostgroupsPostCreated) + 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) + 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) } @@ -288,7 +288,7 @@ func (a *Client) V1HostsGet(params *V1HostsGetParams, authInfo runtime.ClientAut } /* -V1HostsIDDelete releases a host from its hostgroup +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 @@ -405,7 +405,7 @@ func (a *Client) V1HostsIDPut(params *V1HostsIDPutParams, authInfo runtime.Clien } /* -V1HostsPost adds new host s to an existing hostgroup +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 diff --git a/power/client/hostgroups/v1_available_hosts_parameters.go b/power/client/host_groups/v1_available_hosts_parameters.go similarity index 99% rename from power/client/hostgroups/v1_available_hosts_parameters.go rename to power/client/host_groups/v1_available_hosts_parameters.go index f2c3babf..8a26b9cd 100644 --- a/power/client/hostgroups/v1_available_hosts_parameters.go +++ b/power/client/host_groups/v1_available_hosts_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +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 diff --git a/power/client/hostgroups/v1_available_hosts_responses.go b/power/client/host_groups/v1_available_hosts_responses.go similarity index 99% rename from power/client/hostgroups/v1_available_hosts_responses.go rename to power/client/host_groups/v1_available_hosts_responses.go index a591b6e1..8ef00909 100644 --- a/power/client/hostgroups/v1_available_hosts_responses.go +++ b/power/client/host_groups/v1_available_hosts_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +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 diff --git a/power/client/host_groups/v1_host_groups_get_parameters.go b/power/client/host_groups/v1_host_groups_get_parameters.go new file mode 100644 index 00000000..91bf33de --- /dev/null +++ b/power/client/host_groups/v1_host_groups_get_parameters.go @@ -0,0 +1,128 @@ +// 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 new file mode 100644 index 00000000..8801484f --- /dev/null +++ b/power/client/host_groups/v1_host_groups_get_responses.go @@ -0,0 +1,471 @@ +// 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" + "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 { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetOK %+v", 200, o.Payload) +} + +func (o *V1HostGroupsGetOK) String() string { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetOK %+v", 200, o.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 { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetBadRequest %+v", 400, o.Payload) +} + +func (o *V1HostGroupsGetBadRequest) String() string { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetBadRequest %+v", 400, o.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 { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetUnauthorized %+v", 401, o.Payload) +} + +func (o *V1HostGroupsGetUnauthorized) String() string { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetUnauthorized %+v", 401, o.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 { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetForbidden %+v", 403, o.Payload) +} + +func (o *V1HostGroupsGetForbidden) String() string { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetForbidden %+v", 403, o.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 { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetInternalServerError %+v", 500, o.Payload) +} + +func (o *V1HostGroupsGetInternalServerError) String() string { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetInternalServerError %+v", 500, o.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 { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetGatewayTimeout %+v", 504, o.Payload) +} + +func (o *V1HostGroupsGetGatewayTimeout) String() string { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetGatewayTimeout %+v", 504, o.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 new file mode 100644 index 00000000..2952b90a --- /dev/null +++ b/power/client/host_groups/v1_host_groups_id_get_parameters.go @@ -0,0 +1,151 @@ +// 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 new file mode 100644 index 00000000..72b372e7 --- /dev/null +++ b/power/client/host_groups/v1_host_groups_id_get_responses.go @@ -0,0 +1,547 @@ +// 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" + "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 { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetOK %+v", 200, o.Payload) +} + +func (o *V1HostGroupsIDGetOK) String() string { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetOK %+v", 200, o.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 { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetBadRequest %+v", 400, o.Payload) +} + +func (o *V1HostGroupsIDGetBadRequest) String() string { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetBadRequest %+v", 400, o.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 { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetUnauthorized %+v", 401, o.Payload) +} + +func (o *V1HostGroupsIDGetUnauthorized) String() string { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetUnauthorized %+v", 401, o.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 { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetForbidden %+v", 403, o.Payload) +} + +func (o *V1HostGroupsIDGetForbidden) String() string { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetForbidden %+v", 403, o.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 { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetNotFound %+v", 404, o.Payload) +} + +func (o *V1HostGroupsIDGetNotFound) String() string { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetNotFound %+v", 404, o.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 { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetInternalServerError %+v", 500, o.Payload) +} + +func (o *V1HostGroupsIDGetInternalServerError) String() string { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetInternalServerError %+v", 500, o.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 { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetGatewayTimeout %+v", 504, o.Payload) +} + +func (o *V1HostGroupsIDGetGatewayTimeout) String() string { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetGatewayTimeout %+v", 504, o.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 new file mode 100644 index 00000000..02a106c1 --- /dev/null +++ b/power/client/host_groups/v1_host_groups_id_put_parameters.go @@ -0,0 +1,175 @@ +// 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 new file mode 100644 index 00000000..126854de --- /dev/null +++ b/power/client/host_groups/v1_host_groups_id_put_responses.go @@ -0,0 +1,621 @@ +// 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" + "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 { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutOK %+v", 200, o.Payload) +} + +func (o *V1HostGroupsIDPutOK) String() string { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutOK %+v", 200, o.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 { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutBadRequest %+v", 400, o.Payload) +} + +func (o *V1HostGroupsIDPutBadRequest) String() string { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutBadRequest %+v", 400, o.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 { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutUnauthorized %+v", 401, o.Payload) +} + +func (o *V1HostGroupsIDPutUnauthorized) String() string { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutUnauthorized %+v", 401, o.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 { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutForbidden %+v", 403, o.Payload) +} + +func (o *V1HostGroupsIDPutForbidden) String() string { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutForbidden %+v", 403, o.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 { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutNotFound %+v", 404, o.Payload) +} + +func (o *V1HostGroupsIDPutNotFound) String() string { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutNotFound %+v", 404, o.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 { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutConflict %+v", 409, o.Payload) +} + +func (o *V1HostGroupsIDPutConflict) String() string { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutConflict %+v", 409, o.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 { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutInternalServerError %+v", 500, o.Payload) +} + +func (o *V1HostGroupsIDPutInternalServerError) String() string { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutInternalServerError %+v", 500, o.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 { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutGatewayTimeout %+v", 504, o.Payload) +} + +func (o *V1HostGroupsIDPutGatewayTimeout) String() string { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutGatewayTimeout %+v", 504, o.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 new file mode 100644 index 00000000..f75d2a3a --- /dev/null +++ b/power/client/host_groups/v1_host_groups_post_parameters.go @@ -0,0 +1,153 @@ +// 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 new file mode 100644 index 00000000..18415773 --- /dev/null +++ b/power/client/host_groups/v1_host_groups_post_responses.go @@ -0,0 +1,621 @@ +// 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" + "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 { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostCreated %+v", 201, o.Payload) +} + +func (o *V1HostGroupsPostCreated) String() string { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostCreated %+v", 201, o.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 { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostBadRequest %+v", 400, o.Payload) +} + +func (o *V1HostGroupsPostBadRequest) String() string { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostBadRequest %+v", 400, o.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 { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostUnauthorized %+v", 401, o.Payload) +} + +func (o *V1HostGroupsPostUnauthorized) String() string { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostUnauthorized %+v", 401, o.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 { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostForbidden %+v", 403, o.Payload) +} + +func (o *V1HostGroupsPostForbidden) String() string { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostForbidden %+v", 403, o.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 { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostConflict %+v", 409, o.Payload) +} + +func (o *V1HostGroupsPostConflict) String() string { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostConflict %+v", 409, o.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 { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *V1HostGroupsPostUnprocessableEntity) String() string { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostUnprocessableEntity %+v", 422, o.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 { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostInternalServerError %+v", 500, o.Payload) +} + +func (o *V1HostGroupsPostInternalServerError) String() string { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostInternalServerError %+v", 500, o.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 { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostGatewayTimeout %+v", 504, o.Payload) +} + +func (o *V1HostGroupsPostGatewayTimeout) String() string { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostGatewayTimeout %+v", 504, o.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/hostgroups/v1_hosts_get_parameters.go b/power/client/host_groups/v1_hosts_get_parameters.go similarity index 99% rename from power/client/hostgroups/v1_hosts_get_parameters.go rename to power/client/host_groups/v1_hosts_get_parameters.go index b2b9e6c7..b4139ea5 100644 --- a/power/client/hostgroups/v1_hosts_get_parameters.go +++ b/power/client/host_groups/v1_hosts_get_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +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 diff --git a/power/client/hostgroups/v1_hosts_get_responses.go b/power/client/host_groups/v1_hosts_get_responses.go similarity index 99% rename from power/client/hostgroups/v1_hosts_get_responses.go rename to power/client/host_groups/v1_hosts_get_responses.go index 80e385ed..ba907c0d 100644 --- a/power/client/hostgroups/v1_hosts_get_responses.go +++ b/power/client/host_groups/v1_hosts_get_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +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 diff --git a/power/client/hostgroups/v1_hosts_id_delete_parameters.go b/power/client/host_groups/v1_hosts_id_delete_parameters.go similarity index 99% rename from power/client/hostgroups/v1_hosts_id_delete_parameters.go rename to power/client/host_groups/v1_hosts_id_delete_parameters.go index e2508c8d..412fe32c 100644 --- a/power/client/hostgroups/v1_hosts_id_delete_parameters.go +++ b/power/client/host_groups/v1_hosts_id_delete_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +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 diff --git a/power/client/hostgroups/v1_hosts_id_delete_responses.go b/power/client/host_groups/v1_hosts_id_delete_responses.go similarity index 99% rename from power/client/hostgroups/v1_hosts_id_delete_responses.go rename to power/client/host_groups/v1_hosts_id_delete_responses.go index e41a8ea2..1681c9fe 100644 --- a/power/client/hostgroups/v1_hosts_id_delete_responses.go +++ b/power/client/host_groups/v1_hosts_id_delete_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +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 diff --git a/power/client/hostgroups/v1_hosts_id_get_parameters.go b/power/client/host_groups/v1_hosts_id_get_parameters.go similarity index 99% rename from power/client/hostgroups/v1_hosts_id_get_parameters.go rename to power/client/host_groups/v1_hosts_id_get_parameters.go index 73c5b368..422c12ff 100644 --- a/power/client/hostgroups/v1_hosts_id_get_parameters.go +++ b/power/client/host_groups/v1_hosts_id_get_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +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 diff --git a/power/client/hostgroups/v1_hosts_id_get_responses.go b/power/client/host_groups/v1_hosts_id_get_responses.go similarity index 99% rename from power/client/hostgroups/v1_hosts_id_get_responses.go rename to power/client/host_groups/v1_hosts_id_get_responses.go index f28f8270..42411024 100644 --- a/power/client/hostgroups/v1_hosts_id_get_responses.go +++ b/power/client/host_groups/v1_hosts_id_get_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +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 diff --git a/power/client/hostgroups/v1_hosts_id_put_parameters.go b/power/client/host_groups/v1_hosts_id_put_parameters.go similarity index 99% rename from power/client/hostgroups/v1_hosts_id_put_parameters.go rename to power/client/host_groups/v1_hosts_id_put_parameters.go index d1186ae9..557c18a4 100644 --- a/power/client/hostgroups/v1_hosts_id_put_parameters.go +++ b/power/client/host_groups/v1_hosts_id_put_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +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 diff --git a/power/client/hostgroups/v1_hosts_id_put_responses.go b/power/client/host_groups/v1_hosts_id_put_responses.go similarity index 99% rename from power/client/hostgroups/v1_hosts_id_put_responses.go rename to power/client/host_groups/v1_hosts_id_put_responses.go index 322ce86b..8723d370 100644 --- a/power/client/hostgroups/v1_hosts_id_put_responses.go +++ b/power/client/host_groups/v1_hosts_id_put_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +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 diff --git a/power/client/hostgroups/v1_hosts_post_parameters.go b/power/client/host_groups/v1_hosts_post_parameters.go similarity index 98% rename from power/client/hostgroups/v1_hosts_post_parameters.go rename to power/client/host_groups/v1_hosts_post_parameters.go index d44a5ff3..21437e7a 100644 --- a/power/client/hostgroups/v1_hosts_post_parameters.go +++ b/power/client/host_groups/v1_hosts_post_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +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 @@ -65,7 +65,7 @@ type V1HostsPostParams struct { /* Body. - Parameters to add a host to an existing hostgroup + Parameters to add a host to an existing host group */ Body *models.HostCreate diff --git a/power/client/hostgroups/v1_hosts_post_responses.go b/power/client/host_groups/v1_hosts_post_responses.go similarity index 98% rename from power/client/hostgroups/v1_hosts_post_responses.go rename to power/client/host_groups/v1_hosts_post_responses.go index 40dc82e7..2a62bb96 100644 --- a/power/client/hostgroups/v1_hosts_post_responses.go +++ b/power/client/host_groups/v1_hosts_post_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +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 @@ -81,7 +81,7 @@ V1HostsPostCreated describes a response with status code 201, with default heade Created */ type V1HostsPostCreated struct { - Payload *models.Host + Payload models.HostList } // IsSuccess returns true when this v1 hosts post created response has a 2xx status code @@ -122,16 +122,14 @@ func (o *V1HostsPostCreated) String() string { return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostCreated %+v", 201, o.Payload) } -func (o *V1HostsPostCreated) GetPayload() *models.Host { +func (o *V1HostsPostCreated) GetPayload() models.HostList { return o.Payload } func (o *V1HostsPostCreated) 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 { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { return err } diff --git a/power/client/hostgroups/v1_hostgroups_get_parameters.go b/power/client/hostgroups/v1_hostgroups_get_parameters.go deleted file mode 100644 index e4c9dcc2..00000000 --- a/power/client/hostgroups/v1_hostgroups_get_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package hostgroups - -// 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 hostgroups 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 hostgroups 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 hostgroups 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 hostgroups get params -func (o *V1HostgroupsGetParams) WithTimeout(timeout time.Duration) *V1HostgroupsGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 hostgroups get params -func (o *V1HostgroupsGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 hostgroups get params -func (o *V1HostgroupsGetParams) WithContext(ctx context.Context) *V1HostgroupsGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 hostgroups get params -func (o *V1HostgroupsGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 hostgroups get params -func (o *V1HostgroupsGetParams) WithHTTPClient(client *http.Client) *V1HostgroupsGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 hostgroups 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/hostgroups/v1_hostgroups_get_responses.go b/power/client/hostgroups/v1_hostgroups_get_responses.go deleted file mode 100644 index 6ee0eeca..00000000 --- a/power/client/hostgroups/v1_hostgroups_get_responses.go +++ /dev/null @@ -1,471 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package hostgroups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "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/hostgroups] 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 hostgroups get o k response has a 2xx status code -func (o *V1HostgroupsGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 hostgroups get o k response has a 3xx status code -func (o *V1HostgroupsGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups get o k response has a 4xx status code -func (o *V1HostgroupsGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups get o k response has a 5xx status code -func (o *V1HostgroupsGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups get o k response -func (o *V1HostgroupsGetOK) Code() int { - return 200 -} - -func (o *V1HostgroupsGetOK) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetOK %+v", 200, o.Payload) -} - -func (o *V1HostgroupsGetOK) String() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetOK %+v", 200, o.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 hostgroups get bad request response has a 2xx status code -func (o *V1HostgroupsGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups get bad request response has a 3xx status code -func (o *V1HostgroupsGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups get bad request response has a 4xx status code -func (o *V1HostgroupsGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups get bad request response has a 5xx status code -func (o *V1HostgroupsGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups get bad request response -func (o *V1HostgroupsGetBadRequest) Code() int { - return 400 -} - -func (o *V1HostgroupsGetBadRequest) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetBadRequest %+v", 400, o.Payload) -} - -func (o *V1HostgroupsGetBadRequest) String() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetBadRequest %+v", 400, o.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 hostgroups get unauthorized response has a 2xx status code -func (o *V1HostgroupsGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups get unauthorized response has a 3xx status code -func (o *V1HostgroupsGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups get unauthorized response has a 4xx status code -func (o *V1HostgroupsGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups get unauthorized response has a 5xx status code -func (o *V1HostgroupsGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups get unauthorized response -func (o *V1HostgroupsGetUnauthorized) Code() int { - return 401 -} - -func (o *V1HostgroupsGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetUnauthorized %+v", 401, o.Payload) -} - -func (o *V1HostgroupsGetUnauthorized) String() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetUnauthorized %+v", 401, o.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 hostgroups get forbidden response has a 2xx status code -func (o *V1HostgroupsGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups get forbidden response has a 3xx status code -func (o *V1HostgroupsGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups get forbidden response has a 4xx status code -func (o *V1HostgroupsGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups get forbidden response has a 5xx status code -func (o *V1HostgroupsGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups get forbidden response -func (o *V1HostgroupsGetForbidden) Code() int { - return 403 -} - -func (o *V1HostgroupsGetForbidden) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetForbidden %+v", 403, o.Payload) -} - -func (o *V1HostgroupsGetForbidden) String() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetForbidden %+v", 403, o.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 hostgroups get internal server error response has a 2xx status code -func (o *V1HostgroupsGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups get internal server error response has a 3xx status code -func (o *V1HostgroupsGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups get internal server error response has a 4xx status code -func (o *V1HostgroupsGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups get internal server error response has a 5xx status code -func (o *V1HostgroupsGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups get internal server error response -func (o *V1HostgroupsGetInternalServerError) Code() int { - return 500 -} - -func (o *V1HostgroupsGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetInternalServerError %+v", 500, o.Payload) -} - -func (o *V1HostgroupsGetInternalServerError) String() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetInternalServerError %+v", 500, o.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 hostgroups get gateway timeout response has a 2xx status code -func (o *V1HostgroupsGetGatewayTimeout) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups get gateway timeout response has a 3xx status code -func (o *V1HostgroupsGetGatewayTimeout) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups get gateway timeout response has a 4xx status code -func (o *V1HostgroupsGetGatewayTimeout) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups get gateway timeout response has a 5xx status code -func (o *V1HostgroupsGetGatewayTimeout) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups get gateway timeout response -func (o *V1HostgroupsGetGatewayTimeout) Code() int { - return 504 -} - -func (o *V1HostgroupsGetGatewayTimeout) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetGatewayTimeout %+v", 504, o.Payload) -} - -func (o *V1HostgroupsGetGatewayTimeout) String() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetGatewayTimeout %+v", 504, o.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/hostgroups/v1_hostgroups_id_get_parameters.go b/power/client/hostgroups/v1_hostgroups_id_get_parameters.go deleted file mode 100644 index f266f7eb..00000000 --- a/power/client/hostgroups/v1_hostgroups_id_get_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package hostgroups - -// 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 hostgroups 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 hostgroups 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 hostgroups 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 hostgroups id get params -func (o *V1HostgroupsIDGetParams) WithTimeout(timeout time.Duration) *V1HostgroupsIDGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 hostgroups id get params -func (o *V1HostgroupsIDGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 hostgroups id get params -func (o *V1HostgroupsIDGetParams) WithContext(ctx context.Context) *V1HostgroupsIDGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 hostgroups id get params -func (o *V1HostgroupsIDGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 hostgroups id get params -func (o *V1HostgroupsIDGetParams) WithHTTPClient(client *http.Client) *V1HostgroupsIDGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 hostgroups id get params -func (o *V1HostgroupsIDGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithHostgroupID adds the hostgroupID to the v1 hostgroups id get params -func (o *V1HostgroupsIDGetParams) WithHostgroupID(hostgroupID string) *V1HostgroupsIDGetParams { - o.SetHostgroupID(hostgroupID) - return o -} - -// SetHostgroupID adds the hostgroupId to the v1 hostgroups 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 hostgroup_id - if err := r.SetPathParam("hostgroup_id", o.HostgroupID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/hostgroups/v1_hostgroups_id_get_responses.go b/power/client/hostgroups/v1_hostgroups_id_get_responses.go deleted file mode 100644 index d458c4db..00000000 --- a/power/client/hostgroups/v1_hostgroups_id_get_responses.go +++ /dev/null @@ -1,547 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package hostgroups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "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/hostgroups/{hostgroup_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 hostgroups Id get o k response has a 2xx status code -func (o *V1HostgroupsIDGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 hostgroups Id get o k response has a 3xx status code -func (o *V1HostgroupsIDGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id get o k response has a 4xx status code -func (o *V1HostgroupsIDGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups Id get o k response has a 5xx status code -func (o *V1HostgroupsIDGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id get o k response -func (o *V1HostgroupsIDGetOK) Code() int { - return 200 -} - -func (o *V1HostgroupsIDGetOK) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetOK %+v", 200, o.Payload) -} - -func (o *V1HostgroupsIDGetOK) String() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetOK %+v", 200, o.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 hostgroups Id get bad request response has a 2xx status code -func (o *V1HostgroupsIDGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id get bad request response has a 3xx status code -func (o *V1HostgroupsIDGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id get bad request response has a 4xx status code -func (o *V1HostgroupsIDGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups Id get bad request response has a 5xx status code -func (o *V1HostgroupsIDGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id get bad request response -func (o *V1HostgroupsIDGetBadRequest) Code() int { - return 400 -} - -func (o *V1HostgroupsIDGetBadRequest) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetBadRequest %+v", 400, o.Payload) -} - -func (o *V1HostgroupsIDGetBadRequest) String() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetBadRequest %+v", 400, o.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 hostgroups Id get unauthorized response has a 2xx status code -func (o *V1HostgroupsIDGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id get unauthorized response has a 3xx status code -func (o *V1HostgroupsIDGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id get unauthorized response has a 4xx status code -func (o *V1HostgroupsIDGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups Id get unauthorized response has a 5xx status code -func (o *V1HostgroupsIDGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id get unauthorized response -func (o *V1HostgroupsIDGetUnauthorized) Code() int { - return 401 -} - -func (o *V1HostgroupsIDGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetUnauthorized %+v", 401, o.Payload) -} - -func (o *V1HostgroupsIDGetUnauthorized) String() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetUnauthorized %+v", 401, o.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 hostgroups Id get forbidden response has a 2xx status code -func (o *V1HostgroupsIDGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id get forbidden response has a 3xx status code -func (o *V1HostgroupsIDGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id get forbidden response has a 4xx status code -func (o *V1HostgroupsIDGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups Id get forbidden response has a 5xx status code -func (o *V1HostgroupsIDGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id get forbidden response -func (o *V1HostgroupsIDGetForbidden) Code() int { - return 403 -} - -func (o *V1HostgroupsIDGetForbidden) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetForbidden %+v", 403, o.Payload) -} - -func (o *V1HostgroupsIDGetForbidden) String() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetForbidden %+v", 403, o.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 hostgroups Id get not found response has a 2xx status code -func (o *V1HostgroupsIDGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id get not found response has a 3xx status code -func (o *V1HostgroupsIDGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id get not found response has a 4xx status code -func (o *V1HostgroupsIDGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups Id get not found response has a 5xx status code -func (o *V1HostgroupsIDGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id get not found response -func (o *V1HostgroupsIDGetNotFound) Code() int { - return 404 -} - -func (o *V1HostgroupsIDGetNotFound) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetNotFound %+v", 404, o.Payload) -} - -func (o *V1HostgroupsIDGetNotFound) String() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetNotFound %+v", 404, o.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 hostgroups Id get internal server error response has a 2xx status code -func (o *V1HostgroupsIDGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id get internal server error response has a 3xx status code -func (o *V1HostgroupsIDGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id get internal server error response has a 4xx status code -func (o *V1HostgroupsIDGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups Id get internal server error response has a 5xx status code -func (o *V1HostgroupsIDGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id get internal server error response -func (o *V1HostgroupsIDGetInternalServerError) Code() int { - return 500 -} - -func (o *V1HostgroupsIDGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetInternalServerError %+v", 500, o.Payload) -} - -func (o *V1HostgroupsIDGetInternalServerError) String() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetInternalServerError %+v", 500, o.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 hostgroups Id get gateway timeout response has a 2xx status code -func (o *V1HostgroupsIDGetGatewayTimeout) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id get gateway timeout response has a 3xx status code -func (o *V1HostgroupsIDGetGatewayTimeout) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id get gateway timeout response has a 4xx status code -func (o *V1HostgroupsIDGetGatewayTimeout) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups Id get gateway timeout response has a 5xx status code -func (o *V1HostgroupsIDGetGatewayTimeout) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id get gateway timeout response -func (o *V1HostgroupsIDGetGatewayTimeout) Code() int { - return 504 -} - -func (o *V1HostgroupsIDGetGatewayTimeout) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetGatewayTimeout %+v", 504, o.Payload) -} - -func (o *V1HostgroupsIDGetGatewayTimeout) String() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetGatewayTimeout %+v", 504, o.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/hostgroups/v1_hostgroups_id_put_parameters.go b/power/client/hostgroups/v1_hostgroups_id_put_parameters.go deleted file mode 100644 index 61e2d566..00000000 --- a/power/client/hostgroups/v1_hostgroups_id_put_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package hostgroups - -// 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 hostgroups id put operation. - - Typically these are written to a http.Request. -*/ -type V1HostgroupsIDPutParams struct { - - /* Body. - - Parameters to set the sharing status of the hostgroup - */ - Body *models.HostgroupShareOp - - /* HostgroupID. - - Hostgroup ID - */ - HostgroupID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 hostgroups 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 hostgroups 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 hostgroups id put params -func (o *V1HostgroupsIDPutParams) WithTimeout(timeout time.Duration) *V1HostgroupsIDPutParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 hostgroups id put params -func (o *V1HostgroupsIDPutParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 hostgroups id put params -func (o *V1HostgroupsIDPutParams) WithContext(ctx context.Context) *V1HostgroupsIDPutParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 hostgroups id put params -func (o *V1HostgroupsIDPutParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 hostgroups id put params -func (o *V1HostgroupsIDPutParams) WithHTTPClient(client *http.Client) *V1HostgroupsIDPutParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 hostgroups id put params -func (o *V1HostgroupsIDPutParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the v1 hostgroups id put params -func (o *V1HostgroupsIDPutParams) WithBody(body *models.HostgroupShareOp) *V1HostgroupsIDPutParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the v1 hostgroups id put params -func (o *V1HostgroupsIDPutParams) SetBody(body *models.HostgroupShareOp) { - o.Body = body -} - -// WithHostgroupID adds the hostgroupID to the v1 hostgroups id put params -func (o *V1HostgroupsIDPutParams) WithHostgroupID(hostgroupID string) *V1HostgroupsIDPutParams { - o.SetHostgroupID(hostgroupID) - return o -} - -// SetHostgroupID adds the hostgroupId to the v1 hostgroups 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 hostgroup_id - if err := r.SetPathParam("hostgroup_id", o.HostgroupID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/hostgroups/v1_hostgroups_id_put_responses.go b/power/client/hostgroups/v1_hostgroups_id_put_responses.go deleted file mode 100644 index 33b7c6b4..00000000 --- a/power/client/hostgroups/v1_hostgroups_id_put_responses.go +++ /dev/null @@ -1,621 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package hostgroups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "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/hostgroups/{hostgroup_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 hostgroups Id put o k response has a 2xx status code -func (o *V1HostgroupsIDPutOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 hostgroups Id put o k response has a 3xx status code -func (o *V1HostgroupsIDPutOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id put o k response has a 4xx status code -func (o *V1HostgroupsIDPutOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups Id put o k response has a 5xx status code -func (o *V1HostgroupsIDPutOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id put o k response -func (o *V1HostgroupsIDPutOK) Code() int { - return 200 -} - -func (o *V1HostgroupsIDPutOK) Error() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutOK %+v", 200, o.Payload) -} - -func (o *V1HostgroupsIDPutOK) String() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutOK %+v", 200, o.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 hostgroups Id put bad request response has a 2xx status code -func (o *V1HostgroupsIDPutBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id put bad request response has a 3xx status code -func (o *V1HostgroupsIDPutBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id put bad request response has a 4xx status code -func (o *V1HostgroupsIDPutBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups Id put bad request response has a 5xx status code -func (o *V1HostgroupsIDPutBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id put bad request response -func (o *V1HostgroupsIDPutBadRequest) Code() int { - return 400 -} - -func (o *V1HostgroupsIDPutBadRequest) Error() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutBadRequest %+v", 400, o.Payload) -} - -func (o *V1HostgroupsIDPutBadRequest) String() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutBadRequest %+v", 400, o.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 hostgroups Id put unauthorized response has a 2xx status code -func (o *V1HostgroupsIDPutUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id put unauthorized response has a 3xx status code -func (o *V1HostgroupsIDPutUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id put unauthorized response has a 4xx status code -func (o *V1HostgroupsIDPutUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups Id put unauthorized response has a 5xx status code -func (o *V1HostgroupsIDPutUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id put unauthorized response -func (o *V1HostgroupsIDPutUnauthorized) Code() int { - return 401 -} - -func (o *V1HostgroupsIDPutUnauthorized) Error() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutUnauthorized %+v", 401, o.Payload) -} - -func (o *V1HostgroupsIDPutUnauthorized) String() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutUnauthorized %+v", 401, o.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 hostgroups Id put forbidden response has a 2xx status code -func (o *V1HostgroupsIDPutForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id put forbidden response has a 3xx status code -func (o *V1HostgroupsIDPutForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id put forbidden response has a 4xx status code -func (o *V1HostgroupsIDPutForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups Id put forbidden response has a 5xx status code -func (o *V1HostgroupsIDPutForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id put forbidden response -func (o *V1HostgroupsIDPutForbidden) Code() int { - return 403 -} - -func (o *V1HostgroupsIDPutForbidden) Error() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutForbidden %+v", 403, o.Payload) -} - -func (o *V1HostgroupsIDPutForbidden) String() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutForbidden %+v", 403, o.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 hostgroups Id put not found response has a 2xx status code -func (o *V1HostgroupsIDPutNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id put not found response has a 3xx status code -func (o *V1HostgroupsIDPutNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id put not found response has a 4xx status code -func (o *V1HostgroupsIDPutNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups Id put not found response has a 5xx status code -func (o *V1HostgroupsIDPutNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id put not found response -func (o *V1HostgroupsIDPutNotFound) Code() int { - return 404 -} - -func (o *V1HostgroupsIDPutNotFound) Error() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutNotFound %+v", 404, o.Payload) -} - -func (o *V1HostgroupsIDPutNotFound) String() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutNotFound %+v", 404, o.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 hostgroups Id put conflict response has a 2xx status code -func (o *V1HostgroupsIDPutConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id put conflict response has a 3xx status code -func (o *V1HostgroupsIDPutConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id put conflict response has a 4xx status code -func (o *V1HostgroupsIDPutConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups Id put conflict response has a 5xx status code -func (o *V1HostgroupsIDPutConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id put conflict response -func (o *V1HostgroupsIDPutConflict) Code() int { - return 409 -} - -func (o *V1HostgroupsIDPutConflict) Error() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutConflict %+v", 409, o.Payload) -} - -func (o *V1HostgroupsIDPutConflict) String() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutConflict %+v", 409, o.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 hostgroups Id put internal server error response has a 2xx status code -func (o *V1HostgroupsIDPutInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id put internal server error response has a 3xx status code -func (o *V1HostgroupsIDPutInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id put internal server error response has a 4xx status code -func (o *V1HostgroupsIDPutInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups Id put internal server error response has a 5xx status code -func (o *V1HostgroupsIDPutInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id put internal server error response -func (o *V1HostgroupsIDPutInternalServerError) Code() int { - return 500 -} - -func (o *V1HostgroupsIDPutInternalServerError) Error() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutInternalServerError %+v", 500, o.Payload) -} - -func (o *V1HostgroupsIDPutInternalServerError) String() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutInternalServerError %+v", 500, o.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 hostgroups Id put gateway timeout response has a 2xx status code -func (o *V1HostgroupsIDPutGatewayTimeout) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id put gateway timeout response has a 3xx status code -func (o *V1HostgroupsIDPutGatewayTimeout) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id put gateway timeout response has a 4xx status code -func (o *V1HostgroupsIDPutGatewayTimeout) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups Id put gateway timeout response has a 5xx status code -func (o *V1HostgroupsIDPutGatewayTimeout) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups Id put gateway timeout response -func (o *V1HostgroupsIDPutGatewayTimeout) Code() int { - return 504 -} - -func (o *V1HostgroupsIDPutGatewayTimeout) Error() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutGatewayTimeout %+v", 504, o.Payload) -} - -func (o *V1HostgroupsIDPutGatewayTimeout) String() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutGatewayTimeout %+v", 504, o.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/hostgroups/v1_hostgroups_post_parameters.go b/power/client/hostgroups/v1_hostgroups_post_parameters.go deleted file mode 100644 index 56fe0baa..00000000 --- a/power/client/hostgroups/v1_hostgroups_post_parameters.go +++ /dev/null @@ -1,153 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package hostgroups - -// 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 hostgroups post operation. - - Typically these are written to a http.Request. -*/ -type V1HostgroupsPostParams struct { - - /* Body. - - Parameters for the creation of a new hostgroup - */ - Body *models.HostgroupCreate - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 hostgroups 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 hostgroups 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 hostgroups post params -func (o *V1HostgroupsPostParams) WithTimeout(timeout time.Duration) *V1HostgroupsPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 hostgroups post params -func (o *V1HostgroupsPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 hostgroups post params -func (o *V1HostgroupsPostParams) WithContext(ctx context.Context) *V1HostgroupsPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 hostgroups post params -func (o *V1HostgroupsPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 hostgroups post params -func (o *V1HostgroupsPostParams) WithHTTPClient(client *http.Client) *V1HostgroupsPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 hostgroups post params -func (o *V1HostgroupsPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the v1 hostgroups post params -func (o *V1HostgroupsPostParams) WithBody(body *models.HostgroupCreate) *V1HostgroupsPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the v1 hostgroups 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/hostgroups/v1_hostgroups_post_responses.go b/power/client/hostgroups/v1_hostgroups_post_responses.go deleted file mode 100644 index 81b051bb..00000000 --- a/power/client/hostgroups/v1_hostgroups_post_responses.go +++ /dev/null @@ -1,621 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package hostgroups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "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/hostgroups] 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 hostgroups post created response has a 2xx status code -func (o *V1HostgroupsPostCreated) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 hostgroups post created response has a 3xx status code -func (o *V1HostgroupsPostCreated) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups post created response has a 4xx status code -func (o *V1HostgroupsPostCreated) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups post created response has a 5xx status code -func (o *V1HostgroupsPostCreated) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups post created response -func (o *V1HostgroupsPostCreated) Code() int { - return 201 -} - -func (o *V1HostgroupsPostCreated) Error() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostCreated %+v", 201, o.Payload) -} - -func (o *V1HostgroupsPostCreated) String() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostCreated %+v", 201, o.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 hostgroups post bad request response has a 2xx status code -func (o *V1HostgroupsPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups post bad request response has a 3xx status code -func (o *V1HostgroupsPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups post bad request response has a 4xx status code -func (o *V1HostgroupsPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups post bad request response has a 5xx status code -func (o *V1HostgroupsPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups post bad request response -func (o *V1HostgroupsPostBadRequest) Code() int { - return 400 -} - -func (o *V1HostgroupsPostBadRequest) Error() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostBadRequest %+v", 400, o.Payload) -} - -func (o *V1HostgroupsPostBadRequest) String() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostBadRequest %+v", 400, o.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 hostgroups post unauthorized response has a 2xx status code -func (o *V1HostgroupsPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups post unauthorized response has a 3xx status code -func (o *V1HostgroupsPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups post unauthorized response has a 4xx status code -func (o *V1HostgroupsPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups post unauthorized response has a 5xx status code -func (o *V1HostgroupsPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups post unauthorized response -func (o *V1HostgroupsPostUnauthorized) Code() int { - return 401 -} - -func (o *V1HostgroupsPostUnauthorized) Error() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostUnauthorized %+v", 401, o.Payload) -} - -func (o *V1HostgroupsPostUnauthorized) String() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostUnauthorized %+v", 401, o.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 hostgroups post forbidden response has a 2xx status code -func (o *V1HostgroupsPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups post forbidden response has a 3xx status code -func (o *V1HostgroupsPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups post forbidden response has a 4xx status code -func (o *V1HostgroupsPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups post forbidden response has a 5xx status code -func (o *V1HostgroupsPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups post forbidden response -func (o *V1HostgroupsPostForbidden) Code() int { - return 403 -} - -func (o *V1HostgroupsPostForbidden) Error() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostForbidden %+v", 403, o.Payload) -} - -func (o *V1HostgroupsPostForbidden) String() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostForbidden %+v", 403, o.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 hostgroups post conflict response has a 2xx status code -func (o *V1HostgroupsPostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups post conflict response has a 3xx status code -func (o *V1HostgroupsPostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups post conflict response has a 4xx status code -func (o *V1HostgroupsPostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups post conflict response has a 5xx status code -func (o *V1HostgroupsPostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups post conflict response -func (o *V1HostgroupsPostConflict) Code() int { - return 409 -} - -func (o *V1HostgroupsPostConflict) Error() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostConflict %+v", 409, o.Payload) -} - -func (o *V1HostgroupsPostConflict) String() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostConflict %+v", 409, o.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 hostgroups post unprocessable entity response has a 2xx status code -func (o *V1HostgroupsPostUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups post unprocessable entity response has a 3xx status code -func (o *V1HostgroupsPostUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups post unprocessable entity response has a 4xx status code -func (o *V1HostgroupsPostUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups post unprocessable entity response has a 5xx status code -func (o *V1HostgroupsPostUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups post unprocessable entity response -func (o *V1HostgroupsPostUnprocessableEntity) Code() int { - return 422 -} - -func (o *V1HostgroupsPostUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *V1HostgroupsPostUnprocessableEntity) String() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostUnprocessableEntity %+v", 422, o.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 hostgroups post internal server error response has a 2xx status code -func (o *V1HostgroupsPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups post internal server error response has a 3xx status code -func (o *V1HostgroupsPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups post internal server error response has a 4xx status code -func (o *V1HostgroupsPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups post internal server error response has a 5xx status code -func (o *V1HostgroupsPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups post internal server error response -func (o *V1HostgroupsPostInternalServerError) Code() int { - return 500 -} - -func (o *V1HostgroupsPostInternalServerError) Error() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostInternalServerError %+v", 500, o.Payload) -} - -func (o *V1HostgroupsPostInternalServerError) String() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostInternalServerError %+v", 500, o.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 hostgroups post gateway timeout response has a 2xx status code -func (o *V1HostgroupsPostGatewayTimeout) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups post gateway timeout response has a 3xx status code -func (o *V1HostgroupsPostGatewayTimeout) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups post gateway timeout response has a 4xx status code -func (o *V1HostgroupsPostGatewayTimeout) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups post gateway timeout response has a 5xx status code -func (o *V1HostgroupsPostGatewayTimeout) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 hostgroups 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 hostgroups post gateway timeout response -func (o *V1HostgroupsPostGatewayTimeout) Code() int { - return 504 -} - -func (o *V1HostgroupsPostGatewayTimeout) Error() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostGatewayTimeout %+v", 504, o.Payload) -} - -func (o *V1HostgroupsPostGatewayTimeout) String() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostGatewayTimeout %+v", 504, o.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/p_cloud_volumes/p_cloud_volumes_client.go b/power/client/p_cloud_volumes/p_cloud_volumes_client.go index c662828e..e2819358 100644 --- a/power/client/p_cloud_volumes/p_cloud_volumes_client.go +++ b/power/client/p_cloud_volumes/p_cloud_volumes_client.go @@ -519,7 +519,11 @@ func (a *Client) PcloudPvminstancesVolumesGetall(params *PcloudPvminstancesVolum } /* -PcloudPvminstancesVolumesPost attaches a volume to a p VM instance + PcloudPvminstancesVolumesPost attaches a volume to a p VM instance + + Attach a volume to a PVMInstance. + +>**Note**: In the case of VMRM, the first volume being attached will be converted to a bootable volume. */ func (a *Client) PcloudPvminstancesVolumesPost(params *PcloudPvminstancesVolumesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVolumesPostOK, error) { // TODO: Validate the params before sending @@ -597,7 +601,11 @@ func (a *Client) PcloudPvminstancesVolumesPut(params *PcloudPvminstancesVolumesP } /* -PcloudPvminstancesVolumesSetbootPut sets the p VM instance volume as the boot volume + 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 @@ -675,7 +683,11 @@ func (a *Client) PcloudV2PvminstancesVolumesDelete(params *PcloudV2PvminstancesV } /* -PcloudV2PvminstancesVolumesPost attaches all volumes to a p VM instance + 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 diff --git a/power/client/power_iaas_api_client.go b/power/client/power_iaas_api_client.go index 2b8c1a8c..fe13576c 100644 --- a/power/client/power_iaas_api_client.go +++ b/power/client/power_iaas_api_client.go @@ -15,7 +15,7 @@ import ( "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/hostgroups" + "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" @@ -102,7 +102,7 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *PowerIaasA cli.Catalog = catalog.New(transport, formats) cli.Datacenters = datacenters.New(transport, formats) cli.HardwarePlatforms = hardware_platforms.New(transport, formats) - cli.Hostgroups = hostgroups.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) @@ -194,7 +194,7 @@ type PowerIaasAPI struct { HardwarePlatforms hardware_platforms.ClientService - Hostgroups hostgroups.ClientService + HostGroups host_groups.ClientService IaasServiceBroker iaas_service_broker.ClientService @@ -281,7 +281,7 @@ func (c *PowerIaasAPI) SetTransport(transport runtime.ClientTransport) { c.Catalog.SetTransport(transport) c.Datacenters.SetTransport(transport) c.HardwarePlatforms.SetTransport(transport) - c.Hostgroups.SetTransport(transport) + c.HostGroups.SetTransport(transport) c.IaasServiceBroker.SetTransport(transport) c.InternalPowervsInstances.SetTransport(transport) c.InternalPowervsLocations.SetTransport(transport) diff --git a/power/models/add_host.go b/power/models/add_host.go index fb06e74e..b0e6358a 100644 --- a/power/models/add_host.go +++ b/power/models/add_host.go @@ -14,7 +14,7 @@ import ( "github.com/go-openapi/validate" ) -// AddHost Host to add to a hostgroup +// AddHost Host to add to a host group // // swagger:model AddHost type AddHost struct { diff --git a/power/models/available_host.go b/power/models/available_host.go index 35b33173..db8b23ba 100644 --- a/power/models/available_host.go +++ b/power/models/available_host.go @@ -19,7 +19,7 @@ import ( type AvailableHost struct { // Resource capacities for that system type and configuration - Capacity *HostAvailableCapacity `json:"capacity,omitempty"` + Capacity *AvailableHostCapacity `json:"capacity,omitempty"` // How many hosts of such type/capacities are available Count int64 `json:"count,omitempty"` diff --git a/power/models/available_host_capacity.go b/power/models/available_host_capacity.go new file mode 100644 index 00000000..1b4ec156 --- /dev/null +++ b/power/models/available_host_capacity.go @@ -0,0 +1,160 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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 MB) + 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_resource_capacity.go b/power/models/available_host_resource_capacity.go new file mode 100644 index 00000000..ba0e0591 --- /dev/null +++ b/power/models/available_host_resource_capacity.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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" +) + +// AvailableHostResourceCapacity available host resource capacity +// +// swagger:model AvailableHostResourceCapacity +type AvailableHostResourceCapacity struct { + + // available + Available float64 `json:"available,omitempty"` +} + +// Validate validates this available host resource capacity +func (m *AvailableHostResourceCapacity) Validate(formats strfmt.Registry) error { + 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/create_cos_image_import_job.go b/power/models/create_cos_image_import_job.go index 12186df3..7511771e 100644 --- a/power/models/create_cos_image_import_job.go +++ b/power/models/create_cos_image_import_job.go @@ -39,6 +39,9 @@ type CreateCosImageImportJob struct { // 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"` @@ -80,6 +83,10 @@ func (m *CreateCosImageImportJob) Validate(formats strfmt.Registry) error { 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) } @@ -167,6 +174,25 @@ func (m *CreateCosImageImportJob) validateImageName(formats strfmt.Registry) 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() { @@ -247,6 +273,10 @@ func (m *CreateCosImageImportJob) validateStorageAffinity(formats strfmt.Registr 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) } @@ -257,6 +287,27 @@ func (m *CreateCosImageImportJob) ContextValidate(ctx context.Context, formats s 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 { diff --git a/power/models/deployment_target.go b/power/models/deployment_target.go new file mode 100644 index 00000000..25d52b67 --- /dev/null +++ b/power/models/deployment_target.go @@ -0,0 +1,124 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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/host.go b/power/models/host.go index d0ad65f7..51e2d4a4 100644 --- a/power/models/host.go +++ b/power/models/host.go @@ -24,8 +24,8 @@ type Host struct { // Name of the host (chosen by the user) DisplayName string `json:"displayName,omitempty"` - // Link to the owning hostgroup - Hostgroup HostgroupHref `json:"hostgroup,omitempty"` + // Information about the owning host group + HostGroup *HostGroupSummary `json:"hostGroup,omitempty"` // ID of the host ID string `json:"id,omitempty"` @@ -48,7 +48,7 @@ func (m *Host) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateHostgroup(formats); err != nil { + if err := m.validateHostGroup(formats); err != nil { res = append(res, err) } @@ -77,18 +77,20 @@ func (m *Host) validateCapacity(formats strfmt.Registry) error { return nil } -func (m *Host) validateHostgroup(formats strfmt.Registry) error { - if swag.IsZero(m.Hostgroup) { // not required +func (m *Host) validateHostGroup(formats strfmt.Registry) error { + if swag.IsZero(m.HostGroup) { // not required return 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") + 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 err } return nil @@ -102,7 +104,7 @@ func (m *Host) ContextValidate(ctx context.Context, formats strfmt.Registry) err res = append(res, err) } - if err := m.contextValidateHostgroup(ctx, formats); err != nil { + if err := m.contextValidateHostGroup(ctx, formats); err != nil { res = append(res, err) } @@ -133,19 +135,22 @@ func (m *Host) contextValidateCapacity(ctx context.Context, formats strfmt.Regis return nil } -func (m *Host) contextValidateHostgroup(ctx context.Context, formats strfmt.Registry) error { +func (m *Host) contextValidateHostGroup(ctx context.Context, formats strfmt.Registry) error { - if swag.IsZero(m.Hostgroup) { // not required - return nil - } + if m.HostGroup != 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") + 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 err } return nil diff --git a/power/models/host_available_capacity.go b/power/models/host_available_capacity.go deleted file mode 100644 index 4099a90f..00000000 --- a/power/models/host_available_capacity.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" -) - -// HostAvailableCapacity host available capacity -// -// swagger:model HostAvailableCapacity -type HostAvailableCapacity struct { - - // Number of cores available on the host - AvailableCore float64 `json:"availableCore,omitempty"` - - // Memory capacity available on the host (in MB) - AvailableMemory float64 `json:"availableMemory,omitempty"` -} - -// Validate validates this host available capacity -func (m *HostAvailableCapacity) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this host available capacity based on context it is used -func (m *HostAvailableCapacity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *HostAvailableCapacity) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *HostAvailableCapacity) UnmarshalBinary(b []byte) error { - var res HostAvailableCapacity - 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 index 1e822fb7..9ded7f72 100644 --- a/power/models/host_capacity.go +++ b/power/models/host_capacity.go @@ -8,6 +8,7 @@ package models import ( "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -17,38 +18,126 @@ import ( // swagger:model HostCapacity type HostCapacity struct { - // Number of cores currently available - AvailableCore float64 `json:"availableCore,omitempty"` + // Core capacity of the host + Cores *HostResourceCapacity `json:"cores,omitempty"` - // Amount of memory currently available (in MB) - AvailableMemory float64 `json:"availableMemory,omitempty"` + // Memory capacity of the host (in MB) + Memory *HostResourceCapacity `json:"memory,omitempty"` +} - // Number of cores reserved for system use - ReservedCore float64 `json:"reservedCore,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) + } - // Amount of memory reserved for system use (in MB) - ReservedMemory float64 `json:"reservedMemory,omitempty"` + if err := m.validateMemory(formats); err != nil { + res = append(res, err) + } - // Total number of cores of the host - TotalCore float64 `json:"totalCore,omitempty"` + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} - // Total amount of memory of the host (in MB) - TotalMemory float64 `json:"totalMemory,omitempty"` +func (m *HostCapacity) validateCores(formats strfmt.Registry) error { + if swag.IsZero(m.Cores) { // not required + return nil + } - // Number of cores in use on the host - UsedCore float64 `json:"usedCore,omitempty"` + 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 + } + } - // Amount of memory used on the host (in MB) - UsedMemory float64 `json:"usedMemory,omitempty"` + return nil } -// Validate validates this host capacity -func (m *HostCapacity) Validate(formats strfmt.Registry) error { +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 validates this host capacity based on context it is used +// 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 } diff --git a/power/models/host_create.go b/power/models/host_create.go index 0e7d68ee..8c256de8 100644 --- a/power/models/host_create.go +++ b/power/models/host_create.go @@ -7,6 +7,7 @@ package models import ( "context" + "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -14,29 +15,29 @@ import ( "github.com/go-openapi/validate" ) -// HostCreate Parameters to add a host to an existing hostgroup +// HostCreate Parameters to add a host to an existing host group // // swagger:model HostCreate type HostCreate struct { - // Host to be added + // ID of the host group to which the host should be added // Required: true - Host *AddHost `json:"host"` + HostGroupID *string `json:"hostGroupID"` - // ID of the hostgroup to which the host should be added + // Hosts to be added // Required: true - HostgroupID *string `json:"hostgroupID"` + Hosts []*AddHost `json:"hosts"` } // Validate validates this host create func (m *HostCreate) Validate(formats strfmt.Registry) error { var res []error - if err := m.validateHost(formats); err != nil { + if err := m.validateHostGroupID(formats); err != nil { res = append(res, err) } - if err := m.validateHostgroupID(formats); err != nil { + if err := m.validateHosts(formats); err != nil { res = append(res, err) } @@ -46,32 +47,39 @@ func (m *HostCreate) Validate(formats strfmt.Registry) error { return nil } -func (m *HostCreate) validateHost(formats strfmt.Registry) error { +func (m *HostCreate) validateHostGroupID(formats strfmt.Registry) error { - if err := validate.Required("host", "body", m.Host); err != nil { + if err := validate.Required("hostGroupID", "body", m.HostGroupID); err != nil { return err } - 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 *HostCreate) validateHostgroupID(formats strfmt.Registry) error { +func (m *HostCreate) validateHosts(formats strfmt.Registry) error { - if err := validate.Required("hostgroupID", "body", m.HostgroupID); err != nil { + 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 } @@ -79,7 +87,7 @@ func (m *HostCreate) validateHostgroupID(formats strfmt.Registry) error { func (m *HostCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error - if err := m.contextValidateHost(ctx, formats); err != nil { + if err := m.contextValidateHosts(ctx, formats); err != nil { res = append(res, err) } @@ -89,18 +97,26 @@ func (m *HostCreate) ContextValidate(ctx context.Context, formats strfmt.Registr return nil } -func (m *HostCreate) contextValidateHost(ctx context.Context, formats strfmt.Registry) error { +func (m *HostCreate) contextValidateHosts(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Hosts); i++ { - if m.Host != nil { + if m.Hosts[i] != 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") + 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 err } + } return nil diff --git a/power/models/hostgroup.go b/power/models/host_group.go similarity index 74% rename from power/models/hostgroup.go rename to power/models/host_group.go index 7ca1c07c..91c21cd7 100644 --- a/power/models/hostgroup.go +++ b/power/models/host_group.go @@ -15,33 +15,33 @@ import ( "github.com/go-openapi/validate" ) -// Hostgroup Description of a hostgroup +// HostGroup Description of a host group // -// swagger:model Hostgroup -type Hostgroup struct { +// swagger:model HostGroup +type HostGroup struct { - // Date/Time of hostgroup creation + // Date/Time of host group creation // Format: date-time CreationDate strfmt.DateTime `json:"creationDate,omitempty"` // List of hosts Hosts []HostHref `json:"hosts"` - // Hostgroup ID + // Host group ID ID string `json:"id,omitempty"` - // Name of the hostgroup + // Name of the host group Name string `json:"name,omitempty"` - // Name of the workspace owning the hostgroup + // Name of the workspace owning the host group Primary string `json:"primary,omitempty"` - // Names of workspaces the hostgroup has been shared with + // Names of workspaces the host group has been shared with Secondaries []string `json:"secondaries"` } -// Validate validates this hostgroup -func (m *Hostgroup) Validate(formats strfmt.Registry) error { +// Validate validates this host group +func (m *HostGroup) Validate(formats strfmt.Registry) error { var res []error if err := m.validateCreationDate(formats); err != nil { @@ -58,7 +58,7 @@ func (m *Hostgroup) Validate(formats strfmt.Registry) error { return nil } -func (m *Hostgroup) validateCreationDate(formats strfmt.Registry) error { +func (m *HostGroup) validateCreationDate(formats strfmt.Registry) error { if swag.IsZero(m.CreationDate) { // not required return nil } @@ -70,7 +70,7 @@ func (m *Hostgroup) validateCreationDate(formats strfmt.Registry) error { return nil } -func (m *Hostgroup) validateHosts(formats strfmt.Registry) error { +func (m *HostGroup) validateHosts(formats strfmt.Registry) error { if swag.IsZero(m.Hosts) { // not required return nil } @@ -91,8 +91,8 @@ func (m *Hostgroup) validateHosts(formats strfmt.Registry) error { return nil } -// ContextValidate validate this hostgroup based on the context it is used -func (m *Hostgroup) ContextValidate(ctx context.Context, formats strfmt.Registry) error { +// 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 { @@ -105,7 +105,7 @@ func (m *Hostgroup) ContextValidate(ctx context.Context, formats strfmt.Registry return nil } -func (m *Hostgroup) contextValidateHosts(ctx context.Context, formats strfmt.Registry) error { +func (m *HostGroup) contextValidateHosts(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Hosts); i++ { @@ -128,7 +128,7 @@ func (m *Hostgroup) contextValidateHosts(ctx context.Context, formats strfmt.Reg } // MarshalBinary interface implementation -func (m *Hostgroup) MarshalBinary() ([]byte, error) { +func (m *HostGroup) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -136,8 +136,8 @@ func (m *Hostgroup) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *Hostgroup) UnmarshalBinary(b []byte) error { - var res Hostgroup +func (m *HostGroup) UnmarshalBinary(b []byte) error { + var res HostGroup if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/power/models/hostgroup_create.go b/power/models/host_group_create.go similarity index 78% rename from power/models/hostgroup_create.go rename to power/models/host_group_create.go index b2c8b2cd..ddd5fc9f 100644 --- a/power/models/hostgroup_create.go +++ b/power/models/host_group_create.go @@ -15,25 +15,25 @@ import ( "github.com/go-openapi/validate" ) -// HostgroupCreate Parameters for the creation of a new hostgroup +// HostGroupCreate Parameters for the creation of a new host group // -// swagger:model HostgroupCreate -type HostgroupCreate struct { +// swagger:model HostGroupCreate +type HostGroupCreate struct { - // List of hosts to add to the group + // List of hosts to add to the host group // Required: true Hosts []*AddHost `json:"hosts"` - // Name of the hostgroup to create + // Name of the host group to create // Required: true Name *string `json:"name"` - // List of workspace names to share the hostgroup with (optional) + // List of workspace names to share the host group with (optional) Secondaries []*Secondary `json:"secondaries"` } -// Validate validates this hostgroup create -func (m *HostgroupCreate) Validate(formats strfmt.Registry) error { +// Validate validates this host group create +func (m *HostGroupCreate) Validate(formats strfmt.Registry) error { var res []error if err := m.validateHosts(formats); err != nil { @@ -54,7 +54,7 @@ func (m *HostgroupCreate) Validate(formats strfmt.Registry) error { return nil } -func (m *HostgroupCreate) validateHosts(formats strfmt.Registry) error { +func (m *HostGroupCreate) validateHosts(formats strfmt.Registry) error { if err := validate.Required("hosts", "body", m.Hosts); err != nil { return err @@ -81,7 +81,7 @@ func (m *HostgroupCreate) validateHosts(formats strfmt.Registry) error { return nil } -func (m *HostgroupCreate) validateName(formats strfmt.Registry) error { +func (m *HostGroupCreate) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { return err @@ -90,7 +90,7 @@ func (m *HostgroupCreate) validateName(formats strfmt.Registry) error { return nil } -func (m *HostgroupCreate) validateSecondaries(formats strfmt.Registry) error { +func (m *HostGroupCreate) validateSecondaries(formats strfmt.Registry) error { if swag.IsZero(m.Secondaries) { // not required return nil } @@ -116,8 +116,8 @@ func (m *HostgroupCreate) validateSecondaries(formats strfmt.Registry) error { return nil } -// ContextValidate validate this hostgroup create based on the context it is used -func (m *HostgroupCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { +// 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 { @@ -134,7 +134,7 @@ func (m *HostgroupCreate) ContextValidate(ctx context.Context, formats strfmt.Re return nil } -func (m *HostgroupCreate) contextValidateHosts(ctx context.Context, formats strfmt.Registry) error { +func (m *HostGroupCreate) contextValidateHosts(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Hosts); i++ { @@ -159,7 +159,7 @@ func (m *HostgroupCreate) contextValidateHosts(ctx context.Context, formats strf return nil } -func (m *HostgroupCreate) contextValidateSecondaries(ctx context.Context, formats strfmt.Registry) error { +func (m *HostGroupCreate) contextValidateSecondaries(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Secondaries); i++ { @@ -185,7 +185,7 @@ func (m *HostgroupCreate) contextValidateSecondaries(ctx context.Context, format } // MarshalBinary interface implementation -func (m *HostgroupCreate) MarshalBinary() ([]byte, error) { +func (m *HostGroupCreate) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -193,8 +193,8 @@ func (m *HostgroupCreate) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *HostgroupCreate) UnmarshalBinary(b []byte) error { - var res HostgroupCreate +func (m *HostGroupCreate) UnmarshalBinary(b []byte) error { + var res HostGroupCreate if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/power/models/hostgroup_list.go b/power/models/host_group_list.go similarity index 79% rename from power/models/hostgroup_list.go rename to power/models/host_group_list.go index bdcc2bb3..617cb02d 100644 --- a/power/models/hostgroup_list.go +++ b/power/models/host_group_list.go @@ -14,13 +14,13 @@ import ( "github.com/go-openapi/swag" ) -// HostgroupList hostgroup list +// HostGroupList host group list // -// swagger:model HostgroupList -type HostgroupList []*Hostgroup +// swagger:model HostGroupList +type HostGroupList []*HostGroup -// Validate validates this hostgroup list -func (m HostgroupList) Validate(formats strfmt.Registry) error { +// Validate validates this host group list +func (m HostGroupList) Validate(formats strfmt.Registry) error { var res []error for i := 0; i < len(m); i++ { @@ -47,8 +47,8 @@ func (m HostgroupList) Validate(formats strfmt.Registry) error { return nil } -// ContextValidate validate this hostgroup list based on the context it is used -func (m HostgroupList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { +// 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++ { diff --git a/power/models/hostgroup_share_op.go b/power/models/host_group_share_op.go similarity index 72% rename from power/models/hostgroup_share_op.go rename to power/models/host_group_share_op.go index ebd3fd75..fe1f2c99 100644 --- a/power/models/hostgroup_share_op.go +++ b/power/models/host_group_share_op.go @@ -14,20 +14,20 @@ import ( "github.com/go-openapi/swag" ) -// HostgroupShareOp Operation updating the sharing status (mutually exclusive) +// HostGroupShareOp Operation updating the sharing status (mutually exclusive) // -// swagger:model HostgroupShareOp -type HostgroupShareOp struct { +// swagger:model HostGroupShareOp +type HostGroupShareOp struct { - // List of workspace names to share the hostgroup with + // List of workspace names to share the host group with Add []*Secondary `json:"add"` - // A workspace name to stop sharing the hostgroup with + // A workspace name to stop sharing the host group with Remove string `json:"remove,omitempty"` } -// Validate validates this hostgroup share op -func (m *HostgroupShareOp) Validate(formats strfmt.Registry) error { +// 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 { @@ -40,7 +40,7 @@ func (m *HostgroupShareOp) Validate(formats strfmt.Registry) error { return nil } -func (m *HostgroupShareOp) validateAdd(formats strfmt.Registry) error { +func (m *HostGroupShareOp) validateAdd(formats strfmt.Registry) error { if swag.IsZero(m.Add) { // not required return nil } @@ -66,8 +66,8 @@ func (m *HostgroupShareOp) validateAdd(formats strfmt.Registry) error { return nil } -// ContextValidate validate this hostgroup share op based on the context it is used -func (m *HostgroupShareOp) ContextValidate(ctx context.Context, formats strfmt.Registry) error { +// 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 { @@ -80,7 +80,7 @@ func (m *HostgroupShareOp) ContextValidate(ctx context.Context, formats strfmt.R return nil } -func (m *HostgroupShareOp) contextValidateAdd(ctx context.Context, formats strfmt.Registry) error { +func (m *HostGroupShareOp) contextValidateAdd(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Add); i++ { @@ -106,7 +106,7 @@ func (m *HostgroupShareOp) contextValidateAdd(ctx context.Context, formats strfm } // MarshalBinary interface implementation -func (m *HostgroupShareOp) MarshalBinary() ([]byte, error) { +func (m *HostGroupShareOp) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -114,8 +114,8 @@ func (m *HostgroupShareOp) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *HostgroupShareOp) UnmarshalBinary(b []byte) error { - var res HostgroupShareOp +func (m *HostGroupShareOp) UnmarshalBinary(b []byte) error { + var res HostGroupShareOp if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/power/models/host_group_summary.go b/power/models/host_group_summary.go new file mode 100644 index 00000000..f4c345ed --- /dev/null +++ b/power/models/host_group_summary.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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_resource_capacity.go b/power/models/host_resource_capacity.go new file mode 100644 index 00000000..4814c505 --- /dev/null +++ b/power/models/host_resource_capacity.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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" +) + +// HostResourceCapacity host resource capacity +// +// swagger:model HostResourceCapacity +type HostResourceCapacity struct { + + // available + Available float64 `json:"available,omitempty"` + + // reserved + Reserved float64 `json:"reserved,omitempty"` + + // total + Total float64 `json:"total,omitempty"` + + // used + Used float64 `json:"used,omitempty"` +} + +// Validate validates this host resource capacity +func (m *HostResourceCapacity) Validate(formats strfmt.Registry) error { + 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/hostgroup_href.go b/power/models/hostgroup_href.go deleted file mode 100644 index 2733f00f..00000000 --- a/power/models/hostgroup_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" -) - -// HostgroupHref Link to hostgroup resource -// -// swagger:model HostgroupHref -type HostgroupHref string - -// Validate validates this hostgroup href -func (m HostgroupHref) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this hostgroup href based on context it is used -func (m HostgroupHref) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/power/models/image_import_details.go b/power/models/image_import_details.go new file mode 100644 index 00000000..59560a09 --- /dev/null +++ b/power/models/image_import_details.go @@ -0,0 +1,205 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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/p_vm_instance_create.go b/power/models/p_vm_instance_create.go index 013a094c..14852eb4 100644 --- a/power/models/p_vm_instance_create.go +++ b/power/models/p_vm_instance_create.go @@ -21,9 +21,12 @@ import ( // swagger:model PVMInstanceCreate type PVMInstanceCreate struct { - // The name of the host or hostgroup where to deploy the VM + // The name of the host or host group where to deploy the VM DeployTarget string `json:"deployTarget,omitempty"` + // The deployment of a dedicated host + DeploymentTarget *DeploymentTarget `json:"deploymentTarget,omitempty"` + // The custom deployment type DeploymentType string `json:"deploymentType,omitempty"` @@ -106,7 +109,7 @@ type PVMInstanceCreate struct { // System type used to host the instance SysType string `json:"sysType,omitempty"` - // Cloud init user defined data + // 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"` // The pvm instance virtual CPU information @@ -120,6 +123,10 @@ type PVMInstanceCreate struct { 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) } @@ -182,6 +189,25 @@ func (m *PVMInstanceCreate) Validate(formats strfmt.Registry) error { 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 { @@ -536,6 +562,10 @@ func (m *PVMInstanceCreate) validateVirtualCores(formats strfmt.Registry) error 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) } @@ -562,6 +592,27 @@ func (m *PVMInstanceCreate) ContextValidate(ctx context.Context, formats strfmt. 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++ { diff --git a/power/models/s_a_p_create.go b/power/models/s_a_p_create.go index e16ee442..632bc758 100644 --- a/power/models/s_a_p_create.go +++ b/power/models/s_a_p_create.go @@ -63,7 +63,7 @@ type SAPCreate struct { // System type used to host the instance. Only e880, e980, e1080 are supported SysType string `json:"sysType,omitempty"` - // Cloud init user defined data + // 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"` // List of Volume IDs to attach to the pvm-instance on creation diff --git a/power/models/s_a_p_profile.go b/power/models/s_a_p_profile.go index 73096fa6..6333b489 100644 --- a/power/models/s_a_p_profile.go +++ b/power/models/s_a_p_profile.go @@ -36,6 +36,9 @@ type SAPProfile struct { // Required: true ProfileID *string `json:"profileID"` + // List of supported systems + SupportedSystems []string `json:"supportedSystems"` + // Type of profile // Required: true // Enum: [balanced compute memory non-production ultra-memory] diff --git a/power/models/secondary.go b/power/models/secondary.go index 11c37f88..63bca7d5 100644 --- a/power/models/secondary.go +++ b/power/models/secondary.go @@ -14,15 +14,15 @@ import ( "github.com/go-openapi/validate" ) -// Secondary Information to create a secondary hostgroup +// Secondary Information to create a secondary host group // // swagger:model Secondary type Secondary struct { - // Name of the hostgroup to create in the secondary workspace + // Name of the host group to create in the secondary workspace Name string `json:"name,omitempty"` - // Name of the workspace to share the hostgroup with + // Name of the workspace to share the host group with // Required: true Workspace *string `json:"workspace"` } diff --git a/power/models/shared_processor_pool_create.go b/power/models/shared_processor_pool_create.go index 6818e700..a951586a 100644 --- a/power/models/shared_processor_pool_create.go +++ b/power/models/shared_processor_pool_create.go @@ -23,6 +23,9 @@ type SharedProcessorPoolCreate struct { // 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"` diff --git a/power/models/volumes_clone_async_request.go b/power/models/volumes_clone_async_request.go index 7c4628c2..1b0993a1 100644 --- a/power/models/volumes_clone_async_request.go +++ b/power/models/volumes_clone_async_request.go @@ -26,6 +26,7 @@ type VolumesCloneAsyncRequest struct { // 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"` diff --git a/power/models/volumes_clone_execute.go b/power/models/volumes_clone_execute.go index 1d880001..b470cb78 100644 --- a/power/models/volumes_clone_execute.go +++ b/power/models/volumes_clone_execute.go @@ -26,6 +26,7 @@ type VolumesCloneExecute struct { // 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"` diff --git a/power/models/volumes_clone_request.go b/power/models/volumes_clone_request.go index 7ed5f8c5..cb238678 100644 --- a/power/models/volumes_clone_request.go +++ b/power/models/volumes_clone_request.go @@ -25,6 +25,7 @@ type VolumesCloneRequest struct { // 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"` From e267fb35a4928b3122c2f4b2f4c72744f507f858 Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Tue, 26 Mar 2024 08:30:07 -0500 Subject: [PATCH 046/118] Generated Swagger client from service-broker commit 70b0722398f5a64ea1e7bf1fbd07c6b3e7f8c9fc (#360) --- power/models/hostgroup_summary.go | 56 ---------------------------- power/models/p_vm_instance_create.go | 3 -- 2 files changed, 59 deletions(-) delete mode 100644 power/models/hostgroup_summary.go diff --git a/power/models/hostgroup_summary.go b/power/models/hostgroup_summary.go deleted file mode 100644 index 6112fd1d..00000000 --- a/power/models/hostgroup_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 hostgroup summary -// -// swagger:model HostgroupSummary -type HostgroupSummary struct { - - // Whether the hostgroup is a primary or secondary hostgroup - Access string `json:"access,omitempty"` - - // Link to the hostgroup resource - Href string `json:"href,omitempty"` - - // Name of the hostgroup - Name string `json:"name,omitempty"` -} - -// Validate validates this hostgroup summary -func (m *HostgroupSummary) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this hostgroup 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/p_vm_instance_create.go b/power/models/p_vm_instance_create.go index 14852eb4..1528dc54 100644 --- a/power/models/p_vm_instance_create.go +++ b/power/models/p_vm_instance_create.go @@ -21,9 +21,6 @@ import ( // swagger:model PVMInstanceCreate type PVMInstanceCreate struct { - // The name of the host or host group where to deploy the VM - DeployTarget string `json:"deployTarget,omitempty"` - // The deployment of a dedicated host DeploymentTarget *DeploymentTarget `json:"deploymentTarget,omitempty"` From c629e2051ab85dda1615cdda4ab9c7a1c5f1e2b8 Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Thu, 28 Mar 2024 09:02:28 -0500 Subject: [PATCH 047/118] Generated Swagger client from service-broker commit 8ea7617cec1e857b8597b60c4db288df066295f8 (#363) --- .../pcloud_v2_images_export_post_responses.go | 2 +- .../power_edge_router_client.go | 80 +++ ..._poweredgerouter_action_post_parameters.go | 175 ++++++ ...1_poweredgerouter_action_post_responses.go | 545 ++++++++++++++++++ power/client/power_iaas_api_client.go | 5 + power/models/power_edge_router_action.go | 107 ++++ 6 files changed, 913 insertions(+), 1 deletion(-) create mode 100644 power/client/power_edge_router/power_edge_router_client.go create mode 100644 power/client/power_edge_router/v1_poweredgerouter_action_post_parameters.go create mode 100644 power/client/power_edge_router/v1_poweredgerouter_action_post_responses.go create mode 100644 power/models/power_edge_router_action.go 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 index 80ba815b..1778c794 100644 --- 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 @@ -356,7 +356,7 @@ func NewPcloudV2ImagesExportPostNotFound() *PcloudV2ImagesExportPostNotFound { /* PcloudV2ImagesExportPostNotFound describes a response with status code 404, with default header values. -image id not found +Not Found */ type PcloudV2ImagesExportPostNotFound struct { Payload *models.Error diff --git a/power/client/power_edge_router/power_edge_router_client.go b/power/client/power_edge_router/power_edge_router_client.go new file mode 100644 index 00000000..bf6c3505 --- /dev/null +++ b/power/client/power_edge_router/power_edge_router_client.go @@ -0,0 +1,80 @@ +// 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" + "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} +} + +/* +Client for power edge router API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for 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 an 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 new file mode 100644 index 00000000..3a945a3c --- /dev/null +++ b/power/client/power_edge_router/v1_poweredgerouter_action_post_parameters.go @@ -0,0 +1,175 @@ +// 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 new file mode 100644 index 00000000..8dfd54fb --- /dev/null +++ b/power/client/power_edge_router/v1_poweredgerouter_action_post_responses.go @@ -0,0 +1,545 @@ +// 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" + "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 { + return fmt.Sprintf("[POST /v1/workspaces/{workspace_id}/power-edge-router/action][%d] v1PoweredgerouterActionPostOK %+v", 200, o.Payload) +} + +func (o *V1PoweredgerouterActionPostOK) String() string { + return fmt.Sprintf("[POST /v1/workspaces/{workspace_id}/power-edge-router/action][%d] v1PoweredgerouterActionPostOK %+v", 200, o.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 { + return fmt.Sprintf("[POST /v1/workspaces/{workspace_id}/power-edge-router/action][%d] v1PoweredgerouterActionPostBadRequest %+v", 400, o.Payload) +} + +func (o *V1PoweredgerouterActionPostBadRequest) String() string { + return fmt.Sprintf("[POST /v1/workspaces/{workspace_id}/power-edge-router/action][%d] v1PoweredgerouterActionPostBadRequest %+v", 400, o.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 { + return fmt.Sprintf("[POST /v1/workspaces/{workspace_id}/power-edge-router/action][%d] v1PoweredgerouterActionPostUnauthorized %+v", 401, o.Payload) +} + +func (o *V1PoweredgerouterActionPostUnauthorized) String() string { + return fmt.Sprintf("[POST /v1/workspaces/{workspace_id}/power-edge-router/action][%d] v1PoweredgerouterActionPostUnauthorized %+v", 401, o.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 { + return fmt.Sprintf("[POST /v1/workspaces/{workspace_id}/power-edge-router/action][%d] v1PoweredgerouterActionPostForbidden %+v", 403, o.Payload) +} + +func (o *V1PoweredgerouterActionPostForbidden) String() string { + return fmt.Sprintf("[POST /v1/workspaces/{workspace_id}/power-edge-router/action][%d] v1PoweredgerouterActionPostForbidden %+v", 403, o.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 { + return fmt.Sprintf("[POST /v1/workspaces/{workspace_id}/power-edge-router/action][%d] v1PoweredgerouterActionPostNotFound %+v", 404, o.Payload) +} + +func (o *V1PoweredgerouterActionPostNotFound) String() string { + return fmt.Sprintf("[POST /v1/workspaces/{workspace_id}/power-edge-router/action][%d] v1PoweredgerouterActionPostNotFound %+v", 404, o.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 { + return fmt.Sprintf("[POST /v1/workspaces/{workspace_id}/power-edge-router/action][%d] v1PoweredgerouterActionPostConflict %+v", 409, o.Payload) +} + +func (o *V1PoweredgerouterActionPostConflict) String() string { + return fmt.Sprintf("[POST /v1/workspaces/{workspace_id}/power-edge-router/action][%d] v1PoweredgerouterActionPostConflict %+v", 409, o.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 { + return fmt.Sprintf("[POST /v1/workspaces/{workspace_id}/power-edge-router/action][%d] v1PoweredgerouterActionPostInternalServerError %+v", 500, o.Payload) +} + +func (o *V1PoweredgerouterActionPostInternalServerError) String() string { + return fmt.Sprintf("[POST /v1/workspaces/{workspace_id}/power-edge-router/action][%d] v1PoweredgerouterActionPostInternalServerError %+v", 500, o.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 index fe13576c..cbd707d0 100644 --- a/power/client/power_iaas_api_client.go +++ b/power/client/power_iaas_api_client.go @@ -48,6 +48,7 @@ import ( "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/storage_types" @@ -135,6 +136,7 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *PowerIaasA 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.StorageTypes = storage_types.New(transport, formats) @@ -260,6 +262,8 @@ type PowerIaasAPI struct { PCloudVolumes p_cloud_volumes.ClientService + PowerEdgeRouter power_edge_router.ClientService + ServiceBindings service_bindings.ClientService ServiceInstances service_instances.ClientService @@ -314,6 +318,7 @@ func (c *PowerIaasAPI) SetTransport(transport runtime.ClientTransport) { 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.StorageTypes.SetTransport(transport) diff --git a/power/models/power_edge_router_action.go b/power/models/power_edge_router_action.go new file mode 100644 index 00000000..ed427705 --- /dev/null +++ b/power/models/power_edge_router_action.go @@ -0,0 +1,107 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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 +} From 7634d3b1d3d40f3f191cf5adab9ac8b1b51f0b63 Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Thu, 28 Mar 2024 09:03:36 -0500 Subject: [PATCH 048/118] Generated Swagger client from service-broker commit 384961399c43e0ea945615662e92396491168189 (#362) From 4d896a25cef922f945724004c9725c8884241b88 Mon Sep 17 00:00:00 2001 From: michaelkad <45772690+michaelkad@users.noreply.github.com> Date: Thu, 28 Mar 2024 10:05:13 -0500 Subject: [PATCH 049/118] Update Hostgroup client and add stratos validation (#361) * Update Hostgroup client and add stratos validation * Update name to hostGroup pattern * Rename file --- ...pi-hostgroups.go => ibm-pi-host-groups.go} | 88 +++++++++++++------ examples/hostgroups/main.go | 2 +- 2 files changed, 60 insertions(+), 30 deletions(-) rename clients/instance/{ibm-pi-hostgroups.go => ibm-pi-host-groups.go} (54%) diff --git a/clients/instance/ibm-pi-hostgroups.go b/clients/instance/ibm-pi-host-groups.go similarity index 54% rename from clients/instance/ibm-pi-hostgroups.go rename to clients/instance/ibm-pi-host-groups.go index 4ded770e..7514abdd 100644 --- a/clients/instance/ibm-pi-hostgroups.go +++ b/clients/instance/ibm-pi-host-groups.go @@ -6,7 +6,7 @@ import ( "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/hostgroups" + "github.com/IBM-Cloud/power-go-client/power/client/host_groups" "github.com/IBM-Cloud/power-go-client/power/models" ) @@ -24,8 +24,11 @@ func NewIBMPHostgroupsClient(ctx context.Context, sess *ibmpisession.IBMPISessio // Get All available hosts func (f *IBMPIHostgroupsClient) GetAvailableHosts() (models.AvailableHostList, error) { - params := hostgroups.NewV1AvailableHostsParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut) - resp, err := f.session.Power.Hostgroups.V1AvailableHosts(params, f.session.AuthInfo(f.cloudInstanceID)) + if f.session.IsOnPrem() { + return nil, fmt.Errorf("operation not supported in satellite location, check documentation") + } + params := host_groups.NewV1AvailableHostsParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut) + resp, err := f.session.Power.HostGroups.V1AvailableHosts(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Get available hosts for %s: %w", f.cloudInstanceID, err)) } @@ -36,10 +39,13 @@ func (f *IBMPIHostgroupsClient) GetAvailableHosts() (models.AvailableHostList, e return resp.Payload, nil } -// Get all Hostgroups -func (f *IBMPIHostgroupsClient) GetHostgroups() (models.HostgroupList, error) { - params := hostgroups.NewV1HostgroupsGetParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut) - resp, err := f.session.Power.Hostgroups.V1HostgroupsGet(params, f.session.AuthInfo(f.cloudInstanceID)) +// Get all HostGroups +func (f *IBMPIHostgroupsClient) GetHostGroups() (models.HostGroupList, error) { + if f.session.IsOnPrem() { + return nil, fmt.Errorf("operation not supported in satellite location, check documentation") + } + params := host_groups.NewV1HostGroupsGetParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut) + resp, err := f.session.Power.HostGroups.V1HostGroupsGet(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Get Hostgroups for %s: %w", f.cloudInstanceID, err)) } @@ -50,10 +56,13 @@ func (f *IBMPIHostgroupsClient) GetHostgroups() (models.HostgroupList, error) { return resp.Payload, nil } -// Create a Hostgroup -func (f *IBMPIHostgroupsClient) CreateHostgroup(body *models.HostgroupCreate) (*models.Hostgroup, error) { - params := hostgroups.NewV1HostgroupsPostParams().WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).WithBody(body) - resp, err := f.session.Power.Hostgroups.V1HostgroupsPost(params, f.session.AuthInfo(f.cloudInstanceID)) +// Create a HostGroup +func (f *IBMPIHostgroupsClient) CreateHostGroup(body *models.HostGroupCreate) (*models.HostGroup, error) { + if f.session.IsOnPrem() { + return nil, fmt.Errorf("operation not supported in satellite location, check documentation") + } + params := host_groups.NewV1HostGroupsPostParams().WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).WithBody(body) + resp, err := f.session.Power.HostGroups.V1HostGroupsPost(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Create Hostgroup for %s: %w", f.cloudInstanceID, err)) } @@ -64,10 +73,13 @@ func (f *IBMPIHostgroupsClient) CreateHostgroup(body *models.HostgroupCreate) (* return resp.Payload, nil } -// Update a Hostgroup -func (f *IBMPIHostgroupsClient) UpdateHostgroup(body *models.HostgroupShareOp, id string) (*models.Hostgroup, error) { - params := hostgroups.NewV1HostgroupsIDPutParams().WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).WithBody(body).WithHostgroupID(id) - resp, err := f.session.Power.Hostgroups.V1HostgroupsIDPut(params, f.session.AuthInfo(f.cloudInstanceID)) +// Update a HostGroup +func (f *IBMPIHostgroupsClient) UpdateHostGroup(body *models.HostGroupShareOp, id string) (*models.HostGroup, error) { + if f.session.IsOnPrem() { + return nil, fmt.Errorf("operation not supported in satellite location, check documentation") + } + params := host_groups.NewV1HostGroupsIDPutParams().WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).WithBody(body).WithHostGroupID(id) + resp, err := f.session.Power.HostGroups.V1HostGroupsIDPut(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Update Hostgroup for %s: %w", f.cloudInstanceID, err)) } @@ -79,9 +91,12 @@ func (f *IBMPIHostgroupsClient) UpdateHostgroup(body *models.HostgroupShareOp, i } // Get a Hostgroup -func (f *IBMPIHostgroupsClient) GetHostgroup(id string) (*models.Hostgroup, error) { - params := hostgroups.NewV1HostgroupsIDGetParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).WithHostgroupID(id) - resp, err := f.session.Power.Hostgroups.V1HostgroupsIDGet(params, f.session.AuthInfo(f.cloudInstanceID)) +func (f *IBMPIHostgroupsClient) GetHostGroup(id string) (*models.HostGroup, error) { + if f.session.IsOnPrem() { + return nil, fmt.Errorf("operation not supported in satellite location, check documentation") + } + params := host_groups.NewV1HostGroupsIDGetParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).WithHostGroupID(id) + resp, err := f.session.Power.HostGroups.V1HostGroupsIDGet(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Get Hostgroup %s for %s: %w", id, f.cloudInstanceID, err)) } @@ -94,8 +109,11 @@ func (f *IBMPIHostgroupsClient) GetHostgroup(id string) (*models.Hostgroup, erro // Get All Hosts func (f *IBMPIHostgroupsClient) GetHosts() (models.HostList, error) { - params := hostgroups.NewV1HostsGetParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut) - resp, err := f.session.Power.Hostgroups.V1HostsGet(params, f.session.AuthInfo(f.cloudInstanceID)) + if f.session.IsOnPrem() { + return nil, fmt.Errorf("operation not supported in satellite location, check documentation") + } + params := host_groups.NewV1HostsGetParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut) + 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)) } @@ -107,9 +125,12 @@ func (f *IBMPIHostgroupsClient) GetHosts() (models.HostList, error) { } // Create a Host -func (f *IBMPIHostgroupsClient) CreateHost(body *models.HostCreate) (*models.Host, error) { - params := hostgroups.NewV1HostsPostParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).WithBody(body) - resp, err := f.session.Power.Hostgroups.V1HostsPost(params, f.session.AuthInfo(f.cloudInstanceID)) +func (f *IBMPIHostgroupsClient) CreateHost(body *models.HostCreate) (models.HostList, error) { + if f.session.IsOnPrem() { + return nil, fmt.Errorf("operation not supported in satellite location, check documentation") + } + params := host_groups.NewV1HostsPostParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).WithBody(body) + resp, err := f.session.Power.HostGroups.V1HostsPost(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Create Hosts for %s: %w", f.cloudInstanceID, err)) } @@ -122,8 +143,11 @@ func (f *IBMPIHostgroupsClient) CreateHost(body *models.HostCreate) (*models.Hos // Get a Host func (f *IBMPIHostgroupsClient) GetHost(id string) (*models.Host, error) { - params := hostgroups.NewV1HostsIDGetParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).WithHostID(id) - resp, err := f.session.Power.Hostgroups.V1HostsIDGet(params, f.session.AuthInfo(f.cloudInstanceID)) + if f.session.IsOnPrem() { + return nil, fmt.Errorf("operation not supported in satellite location, check documentation") + } + params := host_groups.NewV1HostsIDGetParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).WithHostID(id) + 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)) } @@ -136,8 +160,11 @@ func (f *IBMPIHostgroupsClient) GetHost(id string) (*models.Host, error) { // Update a Host func (f *IBMPIHostgroupsClient) UpdateHost(body *models.HostPut, id string) (*models.Host, error) { - params := hostgroups.NewV1HostsIDPutParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).WithHostID(id).WithBody(body) - resp, err := f.session.Power.Hostgroups.V1HostsIDPut(params, f.session.AuthInfo(f.cloudInstanceID)) + if f.session.IsOnPrem() { + return nil, fmt.Errorf("operation not supported in satellite location, check documentation") + } + params := host_groups.NewV1HostsIDPutParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).WithHostID(id).WithBody(body) + resp, err := f.session.Power.HostGroups.V1HostsIDPut(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Update Host %s for %s: %w", id, f.cloudInstanceID, err)) } @@ -150,8 +177,11 @@ func (f *IBMPIHostgroupsClient) UpdateHost(body *models.HostPut, id string) (*mo // Delete a Host func (f *IBMPIHostgroupsClient) DeleteHost(id string) error { - params := hostgroups.NewV1HostsIDDeleteParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).WithHostID(id) - resp, err := f.session.Power.Hostgroups.V1HostsIDDelete(params, f.session.AuthInfo(f.cloudInstanceID)) + if f.session.IsOnPrem() { + return fmt.Errorf("operation not supported in satellite location, check documentation") + } + params := host_groups.NewV1HostsIDDeleteParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).WithHostID(id) + resp, err := f.session.Power.HostGroups.V1HostsIDDelete(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Delete Host %s for %s: %w", id, f.cloudInstanceID, err)) } diff --git a/examples/hostgroups/main.go b/examples/hostgroups/main.go index d1ab8bfa..fbe1baeb 100644 --- a/examples/hostgroups/main.go +++ b/examples/hostgroups/main.go @@ -54,7 +54,7 @@ func main() { } log.Printf("***************[0]****************** %+v \n", getAllAvailableHost) - getHostgroups, err := powerClient.GetHostgroups() + getHostgroups, err := powerClient.GetHostGroups() if err != nil { log.Fatal(err) } From c62fbb15e724bd9cb57eb84fad087d5e5568c6ad Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Mon, 1 Apr 2024 13:07:36 -0500 Subject: [PATCH 050/118] Generated Swagger client from service-broker commit 125c585619c1c406c466dfae897cc2bff5faf797 (#364) --- power/client/p_cloud_volumes/p_cloud_volumes_client.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/power/client/p_cloud_volumes/p_cloud_volumes_client.go b/power/client/p_cloud_volumes/p_cloud_volumes_client.go index e2819358..7d7b84f2 100644 --- a/power/client/p_cloud_volumes/p_cloud_volumes_client.go +++ b/power/client/p_cloud_volumes/p_cloud_volumes_client.go @@ -519,11 +519,7 @@ func (a *Client) PcloudPvminstancesVolumesGetall(params *PcloudPvminstancesVolum } /* - PcloudPvminstancesVolumesPost attaches a volume to a p VM instance - - Attach a volume to a PVMInstance. - ->**Note**: In the case of VMRM, the first volume being attached will be converted to a bootable volume. +PcloudPvminstancesVolumesPost attaches a volume to a p VM instance */ func (a *Client) PcloudPvminstancesVolumesPost(params *PcloudPvminstancesVolumesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVolumesPostOK, error) { // TODO: Validate the params before sending From 75562d22a33d9828a3c618e67a0e8dfb1db8c42e Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Mon, 1 Apr 2024 13:08:23 -0500 Subject: [PATCH 051/118] Generated Swagger client from service-broker commit 6238c39937d5f7a63f07fba4fd83d5d18e18752b (#365) --- power/client/power_edge_router/power_edge_router_client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/power/client/power_edge_router/power_edge_router_client.go b/power/client/power_edge_router/power_edge_router_client.go index bf6c3505..6102abdf 100644 --- a/power/client/power_edge_router/power_edge_router_client.go +++ b/power/client/power_edge_router/power_edge_router_client.go @@ -36,7 +36,7 @@ type ClientService interface { } /* -V1PoweredgerouterActionPost performs an power edge router action migrate start migrate validate on a workspace +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 From 9535a83efda9016c2f398660af5679fdcbc95b76 Mon Sep 17 00:00:00 2001 From: michaelkad <45772690+michaelkad@users.noreply.github.com> Date: Wed, 3 Apr 2024 10:19:25 -0500 Subject: [PATCH 052/118] Refactor host group name (#367) --- clients/instance/ibm-pi-host-groups.go | 86 +++++++++++++------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/clients/instance/ibm-pi-host-groups.go b/clients/instance/ibm-pi-host-groups.go index 7514abdd..8532fe42 100644 --- a/clients/instance/ibm-pi-host-groups.go +++ b/clients/instance/ibm-pi-host-groups.go @@ -10,20 +10,20 @@ import ( "github.com/IBM-Cloud/power-go-client/power/models" ) -// IBMPIHostgroupsClient -type IBMPIHostgroupsClient struct { +// IBMPIHostGroupsClient +type IBMPIHostGroupsClient struct { IBMPIClient } -// NewIBMPIHostgroupsClient -func NewIBMPHostgroupsClient(ctx context.Context, sess *ibmpisession.IBMPISession, cloudInstanceID string) *IBMPIHostgroupsClient { - return &IBMPIHostgroupsClient{ +// NewIBMPIHostGroupsClient +func NewIBMPHostgroupsClient(ctx context.Context, sess *ibmpisession.IBMPISession, cloudInstanceID string) *IBMPIHostGroupsClient { + return &IBMPIHostGroupsClient{ *NewIBMPIClient(ctx, sess, cloudInstanceID), } } // Get All available hosts -func (f *IBMPIHostgroupsClient) GetAvailableHosts() (models.AvailableHostList, error) { +func (f *IBMPIHostGroupsClient) GetAvailableHosts() (models.AvailableHostList, error) { if f.session.IsOnPrem() { return nil, fmt.Errorf("operation not supported in satellite location, check documentation") } @@ -34,160 +34,160 @@ func (f *IBMPIHostgroupsClient) GetAvailableHosts() (models.AvailableHostList, e } if resp == nil || resp.Payload == nil { - return nil, fmt.Errorf("failed to Get Available hosts") + return nil, fmt.Errorf("failed to get available hosts") } return resp.Payload, nil } -// Get all HostGroups -func (f *IBMPIHostgroupsClient) GetHostGroups() (models.HostGroupList, error) { +// Get all host groups +func (f *IBMPIHostGroupsClient) GetHostGroups() (models.HostGroupList, error) { if f.session.IsOnPrem() { return nil, fmt.Errorf("operation not supported in satellite location, check documentation") } params := host_groups.NewV1HostGroupsGetParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut) resp, err := f.session.Power.HostGroups.V1HostGroupsGet(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { - return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Get Hostgroups for %s: %w", f.cloudInstanceID, err)) + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to get Host groups for %s: %w", f.cloudInstanceID, err)) } if resp == nil || resp.Payload == nil { - return nil, fmt.Errorf("failed to Get Hostgroups") + return nil, fmt.Errorf("failed to get host groups") } return resp.Payload, nil } -// Create a HostGroup -func (f *IBMPIHostgroupsClient) CreateHostGroup(body *models.HostGroupCreate) (*models.HostGroup, error) { +// Create a host group +func (f *IBMPIHostGroupsClient) CreateHostGroup(body *models.HostGroupCreate) (*models.HostGroup, error) { if f.session.IsOnPrem() { return nil, fmt.Errorf("operation not supported in satellite location, check documentation") } params := host_groups.NewV1HostGroupsPostParams().WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).WithBody(body) resp, err := f.session.Power.HostGroups.V1HostGroupsPost(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { - return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Create Hostgroup for %s: %w", f.cloudInstanceID, err)) + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to create host group for %s: %w", f.cloudInstanceID, err)) } if resp == nil || resp.Payload == nil { - return nil, fmt.Errorf("failed to Get Hostgroups") + return nil, fmt.Errorf("failed to create host groups") } return resp.Payload, nil } -// Update a HostGroup -func (f *IBMPIHostgroupsClient) UpdateHostGroup(body *models.HostGroupShareOp, id string) (*models.HostGroup, error) { +// Update a host group +func (f *IBMPIHostGroupsClient) UpdateHostGroup(body *models.HostGroupShareOp, id string) (*models.HostGroup, error) { if f.session.IsOnPrem() { return nil, fmt.Errorf("operation not supported in satellite location, check documentation") } params := host_groups.NewV1HostGroupsIDPutParams().WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).WithBody(body).WithHostGroupID(id) resp, err := f.session.Power.HostGroups.V1HostGroupsIDPut(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { - return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Update Hostgroup for %s: %w", f.cloudInstanceID, err)) + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to update host group for %s: %w", f.cloudInstanceID, err)) } if resp == nil || resp.Payload == nil { - return nil, fmt.Errorf("failed to Update Hostgroups") + return nil, fmt.Errorf("failed to update host groups") } return resp.Payload, nil } -// Get a Hostgroup -func (f *IBMPIHostgroupsClient) GetHostGroup(id string) (*models.HostGroup, error) { +// Get a host group +func (f *IBMPIHostGroupsClient) GetHostGroup(id string) (*models.HostGroup, error) { if f.session.IsOnPrem() { return nil, fmt.Errorf("operation not supported in satellite location, check documentation") } params := host_groups.NewV1HostGroupsIDGetParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).WithHostGroupID(id) resp, err := f.session.Power.HostGroups.V1HostGroupsIDGet(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { - return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Get Hostgroup %s for %s: %w", id, f.cloudInstanceID, err)) + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to get host group %s for %s: %w", id, f.cloudInstanceID, err)) } if resp == nil || resp.Payload == nil { - return nil, fmt.Errorf("failed to Get Hostgroup %s", id) + return nil, fmt.Errorf("failed to get host group %s", id) } return resp.Payload, nil } -// Get All Hosts -func (f *IBMPIHostgroupsClient) GetHosts() (models.HostList, error) { +// Get all hosts +func (f *IBMPIHostGroupsClient) GetHosts() (models.HostList, error) { if f.session.IsOnPrem() { return nil, fmt.Errorf("operation not supported in satellite location, check documentation") } params := host_groups.NewV1HostsGetParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut) 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)) + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to get hosts for %s: %w", f.cloudInstanceID, err)) } if resp == nil || resp.Payload == nil { - return nil, fmt.Errorf("failed to Get Hosts") + return nil, fmt.Errorf("failed to get hosts") } return resp.Payload, nil } -// Create a Host -func (f *IBMPIHostgroupsClient) CreateHost(body *models.HostCreate) (models.HostList, error) { +// Create a host +func (f *IBMPIHostGroupsClient) CreateHost(body *models.HostCreate) (models.HostList, error) { if f.session.IsOnPrem() { return nil, fmt.Errorf("operation not supported in satellite location, check documentation") } params := host_groups.NewV1HostsPostParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).WithBody(body) resp, err := f.session.Power.HostGroups.V1HostsPost(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { - return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Create Hosts for %s: %w", f.cloudInstanceID, err)) + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to create a host for %s: %w", f.cloudInstanceID, err)) } if resp == nil || resp.Payload == nil { - return nil, fmt.Errorf("failed to Create Hosts") + return nil, fmt.Errorf("failed to create a host") } return resp.Payload, nil } -// Get a Host -func (f *IBMPIHostgroupsClient) GetHost(id string) (*models.Host, error) { +// Get a host +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") } params := host_groups.NewV1HostsIDGetParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).WithHostID(id) 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)) + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to get host %s for %s: %w", id, f.cloudInstanceID, err)) } if resp == nil || resp.Payload == nil { - return nil, fmt.Errorf("failed to Get Host %s", id) + return nil, fmt.Errorf("failed to get host %s", id) } return resp.Payload, nil } -// Update a Host -func (f *IBMPIHostgroupsClient) UpdateHost(body *models.HostPut, id string) (*models.Host, error) { +// Update a host +func (f *IBMPIHostGroupsClient) UpdateHost(body *models.HostPut, id string) (*models.Host, error) { if f.session.IsOnPrem() { return nil, fmt.Errorf("operation not supported in satellite location, check documentation") } params := host_groups.NewV1HostsIDPutParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).WithHostID(id).WithBody(body) resp, err := f.session.Power.HostGroups.V1HostsIDPut(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { - return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Update Host %s for %s: %w", id, f.cloudInstanceID, err)) + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to update host %s for %s: %w", id, f.cloudInstanceID, err)) } if resp == nil || resp.Payload == nil { - return nil, fmt.Errorf("failed to Update Host %s", id) + return nil, fmt.Errorf("failed to update host %s", id) } return resp.Payload, nil } -// Delete a Host -func (f *IBMPIHostgroupsClient) DeleteHost(id string) error { +// Delete a host +func (f *IBMPIHostGroupsClient) DeleteHost(id string) error { if f.session.IsOnPrem() { return fmt.Errorf("operation not supported in satellite location, check documentation") } params := host_groups.NewV1HostsIDDeleteParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).WithHostID(id) resp, err := f.session.Power.HostGroups.V1HostsIDDelete(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { - return ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Delete Host %s for %s: %w", id, f.cloudInstanceID, err)) + return ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to delete host %s for %s: %w", id, f.cloudInstanceID, err)) } if resp == nil || resp.Payload == nil { - return fmt.Errorf("failed to Delete Host %s", id) + return fmt.Errorf("failed to delete host %s", id) } return nil } From 5397101fa455b3fae0c67e637a85d1e6de9762cd Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Wed, 3 Apr 2024 10:20:18 -0500 Subject: [PATCH 053/118] Generated Swagger client from service-broker commit 4c221d25789a0cbf90427cfb5e22509532cf4265 (#366) --- power/models/s_a_p_profile.go | 102 +++++++++++++++++++++++++++++++++- 1 file changed, 100 insertions(+), 2 deletions(-) diff --git a/power/models/s_a_p_profile.go b/power/models/s_a_p_profile.go index 6333b489..06ece94a 100644 --- a/power/models/s_a_p_profile.go +++ b/power/models/s_a_p_profile.go @@ -28,6 +28,10 @@ type SAPProfile struct { // Required: true Cores *int64 `json:"cores"` + // Requires full system for deployment + // Required: true + FullSystemProfile *bool `json:"fullSystemProfile"` + // Amount of memory (in GB) // Required: true Memory *int64 `json:"memory"` @@ -36,13 +40,22 @@ type SAPProfile struct { // Required: true ProfileID *string `json:"profileID"` + // SAP Application Performance Standard + // Required: true + Saps *int64 `json:"saps"` + // List of supported systems SupportedSystems []string `json:"supportedSystems"` // Type of profile // Required: true - // Enum: [balanced compute memory non-production ultra-memory] + // Enum: [balanced compute memory non-production ultra-memory small SAP Rise Optimized] Type *string `json:"type"` + + // Workload Type + // Required: true + // Enum: [N/A OLAP OLTP OLAP/OLTP] + WorkloadType *string `json:"workloadType"` } // Validate validates this s a p profile @@ -57,6 +70,10 @@ func (m *SAPProfile) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateFullSystemProfile(formats); err != nil { + res = append(res, err) + } + if err := m.validateMemory(formats); err != nil { res = append(res, err) } @@ -65,10 +82,18 @@ func (m *SAPProfile) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateSaps(formats); err != nil { + res = append(res, err) + } + if err := m.validateType(formats); err != nil { res = append(res, err) } + if err := m.validateWorkloadType(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -93,6 +118,15 @@ func (m *SAPProfile) validateCores(formats strfmt.Registry) error { return nil } +func (m *SAPProfile) validateFullSystemProfile(formats strfmt.Registry) error { + + if err := validate.Required("fullSystemProfile", "body", m.FullSystemProfile); err != nil { + return err + } + + return nil +} + func (m *SAPProfile) validateMemory(formats strfmt.Registry) error { if err := validate.Required("memory", "body", m.Memory); err != nil { @@ -111,11 +145,20 @@ func (m *SAPProfile) validateProfileID(formats strfmt.Registry) error { return nil } +func (m *SAPProfile) validateSaps(formats strfmt.Registry) error { + + if err := validate.Required("saps", "body", m.Saps); 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"]`), &res); err != nil { + 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 { @@ -139,6 +182,12 @@ const ( // 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 @@ -163,6 +212,55 @@ func (m *SAPProfile) validateType(formats strfmt.Registry) error { return nil } +var sAPProfileTypeWorkloadTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["N/A","OLAP","OLTP","OLAP/OLTP"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + sAPProfileTypeWorkloadTypePropEnum = append(sAPProfileTypeWorkloadTypePropEnum, v) + } +} + +const ( + + // SAPProfileWorkloadTypeNA captures enum value "N/A" + SAPProfileWorkloadTypeNA string = "N/A" + + // SAPProfileWorkloadTypeOLAP captures enum value "OLAP" + SAPProfileWorkloadTypeOLAP string = "OLAP" + + // SAPProfileWorkloadTypeOLTP captures enum value "OLTP" + SAPProfileWorkloadTypeOLTP string = "OLTP" + + // SAPProfileWorkloadTypeOLAPOLTP captures enum value "OLAP/OLTP" + SAPProfileWorkloadTypeOLAPOLTP string = "OLAP/OLTP" +) + +// prop value enum +func (m *SAPProfile) validateWorkloadTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, sAPProfileTypeWorkloadTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *SAPProfile) validateWorkloadType(formats strfmt.Registry) error { + + if err := validate.Required("workloadType", "body", m.WorkloadType); err != nil { + return err + } + + // value enum + if err := m.validateWorkloadTypeEnum("workloadType", "body", *m.WorkloadType); 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 From 197e0ec668f6e48747891f200431bf0206c5bb6b Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Wed, 3 Apr 2024 10:22:11 -0500 Subject: [PATCH 054/118] Generated Swagger client from service-broker commit 1efc6f47450f757d13cf5813a45212ed381b2b8d (#368) --- power/models/create_cos_image_import_job.go | 3 +++ power/models/export_image.go | 3 +++ power/models/p_vm_instance_capture.go | 3 +++ 3 files changed, 9 insertions(+) diff --git a/power/models/create_cos_image_import_job.go b/power/models/create_cos_image_import_job.go index 7511771e..c5e98fa2 100644 --- a/power/models/create_cos_image_import_job.go +++ b/power/models/create_cos_image_import_job.go @@ -31,6 +31,9 @@ type CreateCosImageImportJob struct { // 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"` diff --git a/power/models/export_image.go b/power/models/export_image.go index 1f8a17dd..2b5ff7f3 100644 --- a/power/models/export_image.go +++ b/power/models/export_image.go @@ -27,6 +27,9 @@ type ExportImage struct { // 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"` diff --git a/power/models/p_vm_instance_capture.go b/power/models/p_vm_instance_capture.go index 7f925c28..edac443a 100644 --- a/power/models/p_vm_instance_capture.go +++ b/power/models/p_vm_instance_capture.go @@ -32,6 +32,9 @@ type PVMInstanceCapture struct { // 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"` From 2c4ff67df2b8f28d4b82d968401904b887b826de Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Thu, 4 Apr 2024 09:25:32 -0500 Subject: [PATCH 055/118] Generated Swagger client from service-broker commit f627067b7cfb1a503a8fe46e15715957137676f5 (#370) --- power/models/p_vm_instance_update_response.go | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/power/models/p_vm_instance_update_response.go b/power/models/p_vm_instance_update_response.go index 1c8e9a76..07ccf955 100644 --- a/power/models/p_vm_instance_update_response.go +++ b/power/models/p_vm_instance_update_response.go @@ -41,6 +41,12 @@ type PVMInstanceUpdateResponse struct { // 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 @@ -55,6 +61,10 @@ func (m *PVMInstanceUpdateResponse) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateVirtualCores(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -123,6 +133,25 @@ func (m *PVMInstanceUpdateResponse) validateProcType(formats strfmt.Registry) er 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 @@ -131,6 +160,10 @@ func (m *PVMInstanceUpdateResponse) ContextValidate(ctx context.Context, formats res = append(res, err) } + if err := m.contextValidateVirtualCores(ctx, formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -155,6 +188,27 @@ func (m *PVMInstanceUpdateResponse) contextValidatePinPolicy(ctx context.Context 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 { From 1ae482aac963c675d5ca32eee20c3bc0d48d06f2 Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Thu, 4 Apr 2024 09:26:39 -0500 Subject: [PATCH 056/118] Generated Swagger client from service-broker commit e43ad9dd41dd11d0210c10b8ffa0104e1b74afd0 (#371) --- power/models/s_a_p_profile.go | 43 +++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/power/models/s_a_p_profile.go b/power/models/s_a_p_profile.go index 06ece94a..a964429a 100644 --- a/power/models/s_a_p_profile.go +++ b/power/models/s_a_p_profile.go @@ -44,6 +44,11 @@ type SAPProfile struct { // Required: true Saps *int64 `json:"saps"` + // Required smt mode for that profile + // Required: true + // Enum: [4 8] + SmtMode *int64 `json:"smtMode"` + // List of supported systems SupportedSystems []string `json:"supportedSystems"` @@ -86,6 +91,10 @@ func (m *SAPProfile) Validate(formats strfmt.Registry) error { 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) } @@ -154,6 +163,40 @@ func (m *SAPProfile) validateSaps(formats strfmt.Registry) error { 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 err := validate.Required("smtMode", "body", m.SmtMode); err != nil { + return err + } + + // value enum + if err := m.validateSmtModeEnum("smtMode", "body", *m.SmtMode); err != nil { + return err + } + + return nil +} + var sAPProfileTypeTypePropEnum []interface{} func init() { From cac5670e2a6503f4182da0f4c9c613f93cdc9a4b Mon Sep 17 00:00:00 2001 From: michaelkad <45772690+michaelkad@users.noreply.github.com> Date: Thu, 4 Apr 2024 09:27:37 -0500 Subject: [PATCH 057/118] [IBMPIHostGroupsClient]Fix typo (#369) * Refactor host group name * Fix typo * sync branch --- clients/instance/ibm-pi-host-groups.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clients/instance/ibm-pi-host-groups.go b/clients/instance/ibm-pi-host-groups.go index 8532fe42..4c6c2474 100644 --- a/clients/instance/ibm-pi-host-groups.go +++ b/clients/instance/ibm-pi-host-groups.go @@ -16,7 +16,7 @@ type IBMPIHostGroupsClient struct { } // NewIBMPIHostGroupsClient -func NewIBMPHostgroupsClient(ctx context.Context, sess *ibmpisession.IBMPISession, cloudInstanceID string) *IBMPIHostGroupsClient { +func NewIBMPIHostGroupsClient(ctx context.Context, sess *ibmpisession.IBMPISession, cloudInstanceID string) *IBMPIHostGroupsClient { return &IBMPIHostGroupsClient{ *NewIBMPIClient(ctx, sess, cloudInstanceID), } From a992fec8ad4c80110a885af8e179747b6f920334 Mon Sep 17 00:00:00 2001 From: ismirlia <90468712+ismirlia@users.noreply.github.com> Date: Fri, 5 Apr 2024 10:10:53 -0500 Subject: [PATCH 058/118] Add checksum gates for powervs (#372) --- clients/instance/ibm-pi-image.go | 8 ++++++++ clients/instance/ibm-pi-instance.go | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/clients/instance/ibm-pi-image.go b/clients/instance/ibm-pi-image.go index b93be950..9ac2796d 100644 --- a/clients/instance/ibm-pi-image.go +++ b/clients/instance/ibm-pi-image.go @@ -79,6 +79,10 @@ func (f *IBMPIImageClient) Create(body *models.CreateImage) (*models.Image, erro // Import an Image func (f *IBMPIImageClient) CreateCosImage(body *models.CreateCosImageImportJob) (imageJob *models.JobReference, err error) { + // Check for satellite differences in this endpoint + if !f.session.IsOnPrem() && body.Checksum { + return nil, fmt.Errorf("checksum parameter is not supported off-premise") + } params := p_cloud_images.NewPcloudV1CloudinstancesCosimagesPostParams(). WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithBody(body) @@ -94,6 +98,10 @@ func (f *IBMPIImageClient) CreateCosImage(body *models.CreateCosImageImportJob) // Export an Image func (f *IBMPIImageClient) ExportImage(id string, body *models.ExportImage) (*models.JobReference, error) { + // Check for satellite differences in this endpoint + if !f.session.IsOnPrem() && body.Checksum { + return nil, fmt.Errorf("checksum parameter is not supported off-premise") + } params := p_cloud_images.NewPcloudV2ImagesExportPostParams(). WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithImageID(id).WithBody(body) diff --git a/clients/instance/ibm-pi-instance.go b/clients/instance/ibm-pi-instance.go index 9eea9685..5c5ef5b5 100644 --- a/clients/instance/ibm-pi-instance.go +++ b/clients/instance/ibm-pi-instance.go @@ -176,6 +176,10 @@ func (f *IBMPIInstanceClient) UpdateConsoleLanguage(id string, body *models.Cons // Capture an Instance func (f *IBMPIInstanceClient) CaptureInstanceToImageCatalog(id string, body *models.PVMInstanceCapture) error { + // Check for satellite differences in this endpoint + if !f.session.IsOnPrem() && body.Checksum { + return fmt.Errorf("checksum parameter is not supported off-premise") + } params := p_cloud_p_vm_instances.NewPcloudPvminstancesCapturePostParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithPvmInstanceID(id). From bbb11c6e84bdf58585d4a215916af3df5f80af13 Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Mon, 8 Apr 2024 08:08:41 -0500 Subject: [PATCH 059/118] Generated Swagger client from service-broker commit 0562d1c6f66295c4ee5c4df5179dd6b2b41c0097 (#373) --- power/models/available_host_capacity.go | 2 +- .../available_host_resource_capacity.go | 25 ++++++- power/models/host_capacity.go | 2 +- power/models/host_group.go | 4 +- power/models/host_group_create.go | 2 +- power/models/host_group_share_op.go | 4 +- power/models/host_resource_capacity.go | 71 +++++++++++++++++-- power/models/secondary.go | 2 +- 8 files changed, 98 insertions(+), 14 deletions(-) diff --git a/power/models/available_host_capacity.go b/power/models/available_host_capacity.go index 1b4ec156..0aed652d 100644 --- a/power/models/available_host_capacity.go +++ b/power/models/available_host_capacity.go @@ -21,7 +21,7 @@ type AvailableHostCapacity struct { // Core capacity of the host Cores *AvailableHostResourceCapacity `json:"cores,omitempty"` - // Memory capacity of the host (in MB) + // Memory capacity of the host (in GB) Memory *AvailableHostResourceCapacity `json:"memory,omitempty"` } diff --git a/power/models/available_host_resource_capacity.go b/power/models/available_host_resource_capacity.go index ba0e0591..9f0f852d 100644 --- a/power/models/available_host_resource_capacity.go +++ b/power/models/available_host_resource_capacity.go @@ -8,8 +8,10 @@ package models 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 @@ -17,12 +19,31 @@ import ( // swagger:model AvailableHostResourceCapacity type AvailableHostResourceCapacity struct { - // available - Available float64 `json:"available,omitempty"` + // 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 } diff --git a/power/models/host_capacity.go b/power/models/host_capacity.go index 9ded7f72..506c43e5 100644 --- a/power/models/host_capacity.go +++ b/power/models/host_capacity.go @@ -21,7 +21,7 @@ type HostCapacity struct { // Core capacity of the host Cores *HostResourceCapacity `json:"cores,omitempty"` - // Memory capacity of the host (in MB) + // Memory capacity of the host (in GB) Memory *HostResourceCapacity `json:"memory,omitempty"` } diff --git a/power/models/host_group.go b/power/models/host_group.go index 91c21cd7..2effa932 100644 --- a/power/models/host_group.go +++ b/power/models/host_group.go @@ -33,10 +33,10 @@ type HostGroup struct { // Name of the host group Name string `json:"name,omitempty"` - // Name of the workspace owning the host group + // ID of the workspace owning the host group Primary string `json:"primary,omitempty"` - // Names of workspaces the host group has been shared with + // IDs of workspaces the host group has been shared with Secondaries []string `json:"secondaries"` } diff --git a/power/models/host_group_create.go b/power/models/host_group_create.go index ddd5fc9f..48f3e169 100644 --- a/power/models/host_group_create.go +++ b/power/models/host_group_create.go @@ -28,7 +28,7 @@ type HostGroupCreate struct { // Required: true Name *string `json:"name"` - // List of workspace names to share the host group with (optional) + // List of workspaces to share the host group with (optional) Secondaries []*Secondary `json:"secondaries"` } diff --git a/power/models/host_group_share_op.go b/power/models/host_group_share_op.go index fe1f2c99..f90d9d17 100644 --- a/power/models/host_group_share_op.go +++ b/power/models/host_group_share_op.go @@ -19,10 +19,10 @@ import ( // swagger:model HostGroupShareOp type HostGroupShareOp struct { - // List of workspace names to share the host group with + // List of workspaces to share the host group with Add []*Secondary `json:"add"` - // A workspace name to stop sharing the host group with + // A workspace ID to stop sharing the host group with Remove string `json:"remove,omitempty"` } diff --git a/power/models/host_resource_capacity.go b/power/models/host_resource_capacity.go index 4814c505..6f1943e7 100644 --- a/power/models/host_resource_capacity.go +++ b/power/models/host_resource_capacity.go @@ -8,8 +8,10 @@ package models 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 @@ -18,20 +20,81 @@ import ( type HostResourceCapacity struct { // available - Available float64 `json:"available,omitempty"` + // Required: true + Available *float64 `json:"available"` // reserved - Reserved float64 `json:"reserved,omitempty"` + // Required: true + Reserved *float64 `json:"reserved"` // total - Total float64 `json:"total,omitempty"` + // Required: true + Total *float64 `json:"total"` // used - Used float64 `json:"used,omitempty"` + // 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 } diff --git a/power/models/secondary.go b/power/models/secondary.go index 63bca7d5..a312c5ea 100644 --- a/power/models/secondary.go +++ b/power/models/secondary.go @@ -22,7 +22,7 @@ type Secondary struct { // Name of the host group to create in the secondary workspace Name string `json:"name,omitempty"` - // Name of the workspace to share the host group with + // ID of the workspace to share the host group with // Required: true Workspace *string `json:"workspace"` } From 31eecaaff557cf3d03cbbf7de7c2e204eb8e8d1f Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Mon, 8 Apr 2024 08:10:06 -0500 Subject: [PATCH 060/118] Generated Swagger client from service-broker commit c4cb98d889ffe37cd2324735bfc86efe4e1fdbb6 (#374) --- power/models/s_a_p_create.go | 51 ++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/power/models/s_a_p_create.go b/power/models/s_a_p_create.go index 632bc758..36187301 100644 --- a/power/models/s_a_p_create.go +++ b/power/models/s_a_p_create.go @@ -20,6 +20,9 @@ import ( // swagger:model SAPCreate type SAPCreate struct { + // 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"` @@ -74,6 +77,10 @@ type SAPCreate struct { 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) } @@ -108,6 +115,25 @@ func (m *SAPCreate) Validate(formats strfmt.Registry) error { 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 { @@ -221,6 +247,10 @@ func (m *SAPCreate) validateStorageAffinity(formats strfmt.Registry) error { 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) } @@ -243,6 +273,27 @@ func (m *SAPCreate) ContextValidate(ctx context.Context, formats strfmt.Registry 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 { From d7e5e4b1d5b2c06703a1c4af31aeabfe5dbb7f37 Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Fri, 12 Apr 2024 13:25:55 -0500 Subject: [PATCH 061/118] Generated Swagger client from service-broker commit 8f5f60718bab6db63d05bacb4fb30550762b50eb (#375) --- power/client/p_cloud_volumes/p_cloud_volumes_client.go | 6 +++++- power/models/p_vm_instance.go | 3 +++ power/models/p_vm_instance_reference.go | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/power/client/p_cloud_volumes/p_cloud_volumes_client.go b/power/client/p_cloud_volumes/p_cloud_volumes_client.go index 7d7b84f2..1a06cbc5 100644 --- a/power/client/p_cloud_volumes/p_cloud_volumes_client.go +++ b/power/client/p_cloud_volumes/p_cloud_volumes_client.go @@ -519,7 +519,11 @@ func (a *Client) PcloudPvminstancesVolumesGetall(params *PcloudPvminstancesVolum } /* -PcloudPvminstancesVolumesPost attaches a volume to a p VM instance + 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 diff --git a/power/models/p_vm_instance.go b/power/models/p_vm_instance.go index 1e968079..9f80286d 100644 --- a/power/models/p_vm_instance.go +++ b/power/models/p_vm_instance.go @@ -148,6 +148,9 @@ type PVMInstance struct { // 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"` diff --git a/power/models/p_vm_instance_reference.go b/power/models/p_vm_instance_reference.go index 94b236f8..03af3a5e 100644 --- a/power/models/p_vm_instance_reference.go +++ b/power/models/p_vm_instance_reference.go @@ -141,6 +141,9 @@ type PVMInstanceReference struct { // 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"` From 101ce1c9d6335d83bca1315bfe744a59dd0b1cd9 Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Mon, 15 Apr 2024 12:59:58 -0500 Subject: [PATCH 062/118] Generated Swagger client from service-broker commit b9bc7ab551a37f4cd3546c19757fe74b6eee179f (#380) --- power/models/s_a_p_profile.go | 51 ++++------------------------------- 1 file changed, 5 insertions(+), 46 deletions(-) diff --git a/power/models/s_a_p_profile.go b/power/models/s_a_p_profile.go index a964429a..6735e47b 100644 --- a/power/models/s_a_p_profile.go +++ b/power/models/s_a_p_profile.go @@ -57,10 +57,9 @@ type SAPProfile struct { // Enum: [balanced compute memory non-production ultra-memory small SAP Rise Optimized] Type *string `json:"type"` - // Workload Type + // List of supported workload types // Required: true - // Enum: [N/A OLAP OLTP OLAP/OLTP] - WorkloadType *string `json:"workloadType"` + WorkloadTypes []string `json:"workloadTypes"` } // Validate validates this s a p profile @@ -99,7 +98,7 @@ func (m *SAPProfile) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateWorkloadType(formats); err != nil { + if err := m.validateWorkloadTypes(formats); err != nil { res = append(res, err) } @@ -255,49 +254,9 @@ func (m *SAPProfile) validateType(formats strfmt.Registry) error { return nil } -var sAPProfileTypeWorkloadTypePropEnum []interface{} +func (m *SAPProfile) validateWorkloadTypes(formats strfmt.Registry) error { -func init() { - var res []string - if err := json.Unmarshal([]byte(`["N/A","OLAP","OLTP","OLAP/OLTP"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - sAPProfileTypeWorkloadTypePropEnum = append(sAPProfileTypeWorkloadTypePropEnum, v) - } -} - -const ( - - // SAPProfileWorkloadTypeNA captures enum value "N/A" - SAPProfileWorkloadTypeNA string = "N/A" - - // SAPProfileWorkloadTypeOLAP captures enum value "OLAP" - SAPProfileWorkloadTypeOLAP string = "OLAP" - - // SAPProfileWorkloadTypeOLTP captures enum value "OLTP" - SAPProfileWorkloadTypeOLTP string = "OLTP" - - // SAPProfileWorkloadTypeOLAPOLTP captures enum value "OLAP/OLTP" - SAPProfileWorkloadTypeOLAPOLTP string = "OLAP/OLTP" -) - -// prop value enum -func (m *SAPProfile) validateWorkloadTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, sAPProfileTypeWorkloadTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *SAPProfile) validateWorkloadType(formats strfmt.Registry) error { - - if err := validate.Required("workloadType", "body", m.WorkloadType); err != nil { - return err - } - - // value enum - if err := m.validateWorkloadTypeEnum("workloadType", "body", *m.WorkloadType); err != nil { + if err := validate.Required("workloadTypes", "body", m.WorkloadTypes); err != nil { return err } From 50af8de4378e9fbffc953dcf0e374f64b4f9f675 Mon Sep 17 00:00:00 2001 From: ismirlia <90468712+ismirlia@users.noreply.github.com> Date: Mon, 15 Apr 2024 15:09:13 -0500 Subject: [PATCH 063/118] Fix error in host-group example (#376) There appeared to be a typo in the client definition preventing the example from compiling. --- examples/{hostgroups => host-groups}/main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename examples/{hostgroups => host-groups}/main.go (90%) diff --git a/examples/hostgroups/main.go b/examples/host-groups/main.go similarity index 90% rename from examples/hostgroups/main.go rename to examples/host-groups/main.go index fbe1baeb..c20e6d77 100644 --- a/examples/hostgroups/main.go +++ b/examples/host-groups/main.go @@ -43,7 +43,7 @@ func main() { if err != nil { log.Fatal(err) } - powerClient := v.NewIBMPHostgroupsClient(context.Background(), session, piID) + powerClient := v.NewIBMPIHostGroupsClient(context.Background(), session, piID) if err != nil { log.Fatal(err) } @@ -54,9 +54,9 @@ func main() { } log.Printf("***************[0]****************** %+v \n", getAllAvailableHost) - getHostgroups, err := powerClient.GetHostGroups() + getHostGroups, err := powerClient.GetHostGroups() if err != nil { log.Fatal(err) } - log.Printf("***************[1]****************** %+v \n", getHostgroups) + log.Printf("***************[1]****************** %+v \n", getHostGroups) } From 7fb40d474d3eff92b3f04575d83d4a1cb7f0e2bd Mon Sep 17 00:00:00 2001 From: ismirlia <90468712+ismirlia@users.noreply.github.com> Date: Mon, 15 Apr 2024 15:19:50 -0500 Subject: [PATCH 064/118] Add deploymentTarget safeguard for Stratos (#378) * Add deploymentTarget safeguard This option is only available off-prem where dedicated host commands are supported. * Remove IBMi safeguard for stratos * Update instance create safeguard --- clients/instance/ibm-pi-instance.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clients/instance/ibm-pi-instance.go b/clients/instance/ibm-pi-instance.go index 5c5ef5b5..1bae5aef 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.SoftwareLicenses != nil || body.SharedProcessorPool != "") { - return nil, fmt.Errorf("software licenses and shared processor pool parameters are not supported in satellite location, check documentation") + if f.session.IsOnPrem() && body.DeploymentTarget != nil { + return nil, fmt.Errorf("deployment target parameter is not supported in satellite location, check documentation") } params := p_cloud_p_vm_instances.NewPcloudPvminstancesPostParams(). WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut). From 5db10f2083ce2fe2571dbd02b3574df769c7183d Mon Sep 17 00:00:00 2001 From: ismirlia <90468712+ismirlia@users.noreply.github.com> Date: Mon, 15 Apr 2024 15:20:01 -0500 Subject: [PATCH 065/118] Update spp safeguards for stratos (#379) * Update spp safeguards for stratos SPP commands will be supported for Q2 for stratos, but not the dedicated host-id option. * Update host-id error message --- .../instance/ibm-pi-shared-processor-pool.go | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/clients/instance/ibm-pi-shared-processor-pool.go b/clients/instance/ibm-pi-shared-processor-pool.go index 1722f9ac..0f5b3e9c 100644 --- a/clients/instance/ibm-pi-shared-processor-pool.go +++ b/clients/instance/ibm-pi-shared-processor-pool.go @@ -26,9 +26,6 @@ func NewIBMPISharedProcessorPoolClient(ctx context.Context, sess *ibmpisession.I // Get a PI Shared Processor Pool func (f *IBMPISharedProcessorPoolClient) Get(id string) (*models.SharedProcessorPoolDetail, error) { - if f.session.IsOnPrem() { - return nil, fmt.Errorf("operation not supported in satellite location, check documentation") - } params := p_cloud_shared_processor_pools.NewPcloudSharedprocessorpoolsGetParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithSharedProcessorPoolID(id) @@ -44,9 +41,6 @@ func (f *IBMPISharedProcessorPoolClient) Get(id string) (*models.SharedProcessor // Get All Shared Processor Pools func (f *IBMPISharedProcessorPoolClient) GetAll() (*models.SharedProcessorPools, error) { - if f.session.IsOnPrem() { - return nil, fmt.Errorf("operation not supported in satellite location, check documentation") - } params := p_cloud_shared_processor_pools.NewPcloudSharedprocessorpoolsGetallParams(). WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut). WithCloudInstanceID(f.cloudInstanceID) @@ -62,8 +56,9 @@ func (f *IBMPISharedProcessorPoolClient) GetAll() (*models.SharedProcessorPools, // Create a Shared Processor Pool func (f *IBMPISharedProcessorPoolClient) Create(body *models.SharedProcessorPoolCreate) (*models.SharedProcessorPool, error) { - if f.session.IsOnPrem() { - return nil, fmt.Errorf("operation not supported in satellite location, check documentation") + // Check for satellite differences in this endpoint + if f.session.IsOnPrem() && body.HostID != "" { + return nil, fmt.Errorf("host id parameter is not supported in satellite location, check documentation") } params := p_cloud_shared_processor_pools.NewPcloudSharedprocessorpoolsPostParams(). WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut). @@ -80,9 +75,6 @@ func (f *IBMPISharedProcessorPoolClient) Create(body *models.SharedProcessorPool // Delete a Shared Processor Pool func (f *IBMPISharedProcessorPoolClient) Delete(id string) error { - if f.session.IsOnPrem() { - return fmt.Errorf("operation not supported in satellite location, check documentation") - } params := p_cloud_shared_processor_pools.NewPcloudSharedprocessorpoolsDeleteParams(). WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithSharedProcessorPoolID(id) @@ -95,9 +87,6 @@ func (f *IBMPISharedProcessorPoolClient) Delete(id string) error { // Update a PI Shared Processor Pool func (f *IBMPISharedProcessorPoolClient) Update(id string, body *models.SharedProcessorPoolUpdate) (*models.SharedProcessorPool, error) { - if f.session.IsOnPrem() { - return nil, fmt.Errorf("operation not supported in satellite location, check documentation") - } params := p_cloud_shared_processor_pools.NewPcloudSharedprocessorpoolsPutParams(). WithContext(f.ctx).WithTimeout(helpers.PIUpdateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithBody(body).WithSharedProcessorPoolID(id) From 07a43c4958a5f86626660360cfab44be423fd015 Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Mon, 22 Apr 2024 09:48:02 -0500 Subject: [PATCH 066/118] Generated Swagger client from service-broker commit 2a7c3111d7d5c55678486f3cab44f3437796762c (#381) WorkspacePowerEdgeRouterDetails state addition --- power/models/workspace_power_edge_router_details.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/power/models/workspace_power_edge_router_details.go b/power/models/workspace_power_edge_router_details.go index 26bc396b..91e5d997 100644 --- a/power/models/workspace_power_edge_router_details.go +++ b/power/models/workspace_power_edge_router_details.go @@ -26,7 +26,7 @@ type WorkspacePowerEdgeRouterDetails struct { // The state of a Power Edge Router // Required: true - // Enum: [active error warning configuring removing inactive] + // Enum: [active error warning configuring removing inactive user-validation] State *string `json:"state"` // The Power Edge Router type @@ -109,7 +109,7 @@ var workspacePowerEdgeRouterDetailsTypeStatePropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["active","error","warning","configuring","removing","inactive"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["active","error","warning","configuring","removing","inactive","user-validation"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -136,6 +136,9 @@ const ( // WorkspacePowerEdgeRouterDetailsStateInactive captures enum value "inactive" WorkspacePowerEdgeRouterDetailsStateInactive string = "inactive" + + // WorkspacePowerEdgeRouterDetailsStateUserDashValidation captures enum value "user-validation" + WorkspacePowerEdgeRouterDetailsStateUserDashValidation string = "user-validation" ) // prop value enum From 111ed0b37c71a5fa8a6c0ba4df849fe0d6664354 Mon Sep 17 00:00:00 2001 From: michaelkad <45772690+michaelkad@users.noreply.github.com> Date: Tue, 23 Apr 2024 11:40:36 -0500 Subject: [PATCH 067/118] Bump golang.org/x/net from 0.20.0 to 0.23.0 (#384) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.20.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.20.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 66ea26ff..1208f872 100644 --- a/go.mod +++ b/go.mod @@ -43,9 +43,9 @@ require ( go.mongodb.org/mongo-driver v1.13.1 // indirect go.opentelemetry.io/otel v1.14.0 // indirect go.opentelemetry.io/otel/trace v1.14.0 // indirect - golang.org/x/crypto v0.18.0 // indirect - golang.org/x/net v0.20.0 // indirect - golang.org/x/sys v0.16.0 // indirect + golang.org/x/crypto v0.21.0 // indirect + golang.org/x/net v0.23.0 // indirect + golang.org/x/sys v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 56839574..28057c5e 100644 --- a/go.sum +++ b/go.sum @@ -99,15 +99,15 @@ go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+go golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= -golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= +golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= -golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= +golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= +golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -116,8 +116,8 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= -golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= From 07351e4ceab978e05bd2a06f764e114d75c01135 Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Fri, 26 Apr 2024 08:35:58 -0500 Subject: [PATCH 068/118] Generated Swagger client from service-broker commit a76fd7fb2c0026fa0c68c2a52417f395f801dd46 (#386) --- power/models/p_vm_instance_create.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/power/models/p_vm_instance_create.go b/power/models/p_vm_instance_create.go index 1528dc54..72d5e0cc 100644 --- a/power/models/p_vm_instance_create.go +++ b/power/models/p_vm_instance_create.go @@ -100,6 +100,9 @@ type PVMInstanceCreate struct { // 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"` From 6ba1f67250212a7de4ba1d84720d8d2bd935b6f6 Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Thu, 2 May 2024 08:36:31 -0500 Subject: [PATCH 069/118] Generated Swagger client from service-broker commit bfe8b85d361707cf82c025266813ecb7889a556c (#388) --- power/models/p_vm_instance_create.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/power/models/p_vm_instance_create.go b/power/models/p_vm_instance_create.go index 72d5e0cc..b01489d4 100644 --- a/power/models/p_vm_instance_create.go +++ b/power/models/p_vm_instance_create.go @@ -90,7 +90,7 @@ type PVMInstanceCreate struct { StorageAffinity *StorageAffinity `json:"storageAffinity,omitempty"` // The storage connection type - // Enum: [vSCSI] + // Enum: [vSCSI maxVolumeSupport] StorageConnection string `json:"storageConnection,omitempty"` // The storage connection type @@ -462,7 +462,7 @@ var pVmInstanceCreateTypeStorageConnectionPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["vSCSI"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["vSCSI","maxVolumeSupport"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -474,6 +474,9 @@ const ( // PVMInstanceCreateStorageConnectionVSCSI captures enum value "vSCSI" PVMInstanceCreateStorageConnectionVSCSI string = "vSCSI" + + // PVMInstanceCreateStorageConnectionMaxVolumeSupport captures enum value "maxVolumeSupport" + PVMInstanceCreateStorageConnectionMaxVolumeSupport string = "maxVolumeSupport" ) // prop value enum From c376f553a00df9850662351a6a9072f43397033c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Apr 2024 02:17:25 +0000 Subject: [PATCH 070/118] Bump golangci/golangci-lint-action from 4 to 5 Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 4 to 5. - [Release notes](https://github.com/golangci/golangci-lint-action/releases) - [Commits](https://github.com/golangci/golangci-lint-action/compare/v4...v5) --- updated-dependencies: - dependency-name: golangci/golangci-lint-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] (cherry picked from commit 2c275e78e830dc1584c26ee62271b3be8e71a3ee) --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index dd321b20..b475f774 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -21,7 +21,7 @@ jobs: go-version: '1.20' - name: Lint - uses: golangci/golangci-lint-action@v4 + uses: golangci/golangci-lint-action@v5 with: version: v1.56 args: --timeout=10m From f81bbe838438e617194c99a4fa5a7d7dc5a3cc9b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Apr 2024 02:17:25 +0000 Subject: [PATCH 071/118] Bump golangci/golangci-lint-action from 4 to 5 Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 4 to 5. - [Release notes](https://github.com/golangci/golangci-lint-action/releases) - [Commits](https://github.com/golangci/golangci-lint-action/compare/v4...v5) --- updated-dependencies: - dependency-name: golangci/golangci-lint-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] (cherry picked from commit 2c275e78e830dc1584c26ee62271b3be8e71a3ee) --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index dd321b20..b475f774 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -21,7 +21,7 @@ jobs: go-version: '1.20' - name: Lint - uses: golangci/golangci-lint-action@v4 + uses: golangci/golangci-lint-action@v5 with: version: v1.56 args: --timeout=10m From 36bbcae9611cb647e0db5bc34aaa2a0c84cc4770 Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Wed, 8 May 2024 10:30:19 -0500 Subject: [PATCH 072/118] Generated Swagger client from service-broker commit a433c612326d695146ca7953d6aef37ac709618f (#389) --- power/models/s_a_p_profile.go | 56 ++++------------------------------- 1 file changed, 6 insertions(+), 50 deletions(-) diff --git a/power/models/s_a_p_profile.go b/power/models/s_a_p_profile.go index 6735e47b..51bec76a 100644 --- a/power/models/s_a_p_profile.go +++ b/power/models/s_a_p_profile.go @@ -29,8 +29,7 @@ type SAPProfile struct { Cores *int64 `json:"cores"` // Requires full system for deployment - // Required: true - FullSystemProfile *bool `json:"fullSystemProfile"` + FullSystemProfile bool `json:"fullSystemProfile"` // Amount of memory (in GB) // Required: true @@ -41,13 +40,11 @@ type SAPProfile struct { ProfileID *string `json:"profileID"` // SAP Application Performance Standard - // Required: true - Saps *int64 `json:"saps"` + Saps int64 `json:"saps"` // Required smt mode for that profile - // Required: true // Enum: [4 8] - SmtMode *int64 `json:"smtMode"` + SmtMode int64 `json:"smtMode"` // List of supported systems SupportedSystems []string `json:"supportedSystems"` @@ -58,7 +55,6 @@ type SAPProfile struct { Type *string `json:"type"` // List of supported workload types - // Required: true WorkloadTypes []string `json:"workloadTypes"` } @@ -74,10 +70,6 @@ func (m *SAPProfile) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateFullSystemProfile(formats); err != nil { - res = append(res, err) - } - if err := m.validateMemory(formats); err != nil { res = append(res, err) } @@ -86,10 +78,6 @@ func (m *SAPProfile) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateSaps(formats); err != nil { - res = append(res, err) - } - if err := m.validateSmtMode(formats); err != nil { res = append(res, err) } @@ -98,10 +86,6 @@ func (m *SAPProfile) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateWorkloadTypes(formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -126,15 +110,6 @@ func (m *SAPProfile) validateCores(formats strfmt.Registry) error { return nil } -func (m *SAPProfile) validateFullSystemProfile(formats strfmt.Registry) error { - - if err := validate.Required("fullSystemProfile", "body", m.FullSystemProfile); err != nil { - return err - } - - return nil -} - func (m *SAPProfile) validateMemory(formats strfmt.Registry) error { if err := validate.Required("memory", "body", m.Memory); err != nil { @@ -153,15 +128,6 @@ func (m *SAPProfile) validateProfileID(formats strfmt.Registry) error { return nil } -func (m *SAPProfile) validateSaps(formats strfmt.Registry) error { - - if err := validate.Required("saps", "body", m.Saps); err != nil { - return err - } - - return nil -} - var sAPProfileTypeSmtModePropEnum []interface{} func init() { @@ -183,13 +149,12 @@ func (m *SAPProfile) validateSmtModeEnum(path, location string, value int64) err } func (m *SAPProfile) validateSmtMode(formats strfmt.Registry) error { - - if err := validate.Required("smtMode", "body", m.SmtMode); err != nil { - return err + if swag.IsZero(m.SmtMode) { // not required + return nil } // value enum - if err := m.validateSmtModeEnum("smtMode", "body", *m.SmtMode); err != nil { + if err := m.validateSmtModeEnum("smtMode", "body", m.SmtMode); err != nil { return err } @@ -254,15 +219,6 @@ func (m *SAPProfile) validateType(formats strfmt.Registry) error { return nil } -func (m *SAPProfile) validateWorkloadTypes(formats strfmt.Registry) error { - - if err := validate.Required("workloadTypes", "body", m.WorkloadTypes); 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 From 47f8502a3efeb0d84d5ba6c4e8c34aef665d6d8c Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Thu, 9 May 2024 11:56:27 -0500 Subject: [PATCH 073/118] Generated Swagger client from service-broker commit 6f9b593c228169c62a3b446bfc480cab28b91ed2 (#390) --- power/models/shared_processor_pool_update.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/power/models/shared_processor_pool_update.go b/power/models/shared_processor_pool_update.go index 2c5fb901..56ba68d7 100644 --- a/power/models/shared_processor_pool_update.go +++ b/power/models/shared_processor_pool_update.go @@ -21,7 +21,7 @@ type SharedProcessorPoolUpdate struct { 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"` + ReservedCores *int64 `json:"reservedCores,omitempty"` } // Validate validates this shared processor pool update From 5900ab6c2c5e5d59088da5e95d716040d7a672d6 Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Thu, 9 May 2024 11:58:57 -0500 Subject: [PATCH 074/118] Generated Swagger client from service-broker commit a08ee4720fe9268263f8c3bee59330454b619109 (#392) --- .../p_cloud_p_vm_instances/p_cloudp_vm_instances_client.go | 4 +++- .../p_cloud_volume_groups/p_cloud_volume_groups_client.go | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) 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 index f21fbd2d..92ba8969 100644 --- 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 @@ -78,7 +78,9 @@ type ClientService interface { } /* -PcloudPvminstancesActionPost performs an action start stop reboot immediate shutdown reset on a p VM instance +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 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 index 78d0d2bb..4f852524 100644 --- 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 @@ -54,7 +54,9 @@ type ClientService interface { } /* -PcloudVolumegroupsActionPost performs an action start stop reset on a volume group +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 From af13fb0b0da159a0a57317e652144e119115251c Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Mon, 13 May 2024 15:16:41 -0500 Subject: [PATCH 075/118] Generated Swagger client from service-broker commit bd9c5c4d29bd093067dd82a8dce8e5b746a0284b (#394) --- .../client/p_cloud_pod_capacity/p_cloud_pod_capacity_client.go | 2 ++ 1 file changed, 2 insertions(+) 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 index c1782ac2..0bcf4c97 100644 --- 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 @@ -37,6 +37,8 @@ type ClientService interface { /* 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 From 9f4ca24ec3412fb8189476c3e69060965446e305 Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Tue, 28 May 2024 16:12:12 -0500 Subject: [PATCH 076/118] Generated Swagger client from service-broker commit 1a54ea3efa13779bf08f2c162677acdd026001c9 (#399) --- .../authentication/authentication_client.go | 28 ++++++- .../service_broker_auth_callback_responses.go | 37 ++++++--- ..._broker_auth_device_code_post_responses.go | 37 ++++++--- ...broker_auth_device_token_post_responses.go | 43 ++++++---- ...ervice_broker_auth_info_token_responses.go | 37 ++++++--- ...service_broker_auth_info_user_responses.go | 37 ++++++--- .../service_broker_auth_login_responses.go | 37 ++++++--- .../service_broker_auth_logout_responses.go | 37 ++++++--- ...er_auth_registration_callback_responses.go | 37 ++++++--- ...vice_broker_auth_registration_responses.go | 37 ++++++--- ...ervice_broker_auth_token_post_responses.go | 43 ++++++---- .../bluemix_service_instance_get_responses.go | 31 +++++--- .../bluemix_service_instance_put_responses.go | 31 +++++--- .../bluemix_service_instances_client.go | 28 ++++++- power/client/catalog/catalog_client.go | 28 ++++++- power/client/catalog/catalog_get_responses.go | 31 +++++--- .../client/datacenters/datacenters_client.go | 28 ++++++- .../v1_datacenters_get_responses.go | 31 +++++--- .../v1_datacenters_getall_responses.go | 31 +++++--- .../hardware_platforms_client.go | 28 ++++++- ..._broker_hardwareplatforms_get_responses.go | 37 ++++++--- .../client/host_groups/host_groups_client.go | 28 ++++++- .../v1_available_hosts_responses.go | 37 ++++++--- .../v1_host_groups_get_responses.go | 37 ++++++--- .../v1_host_groups_id_get_responses.go | 43 ++++++---- .../v1_host_groups_id_put_responses.go | 49 ++++++++---- .../v1_host_groups_post_responses.go | 49 ++++++++---- .../host_groups/v1_hosts_get_responses.go | 37 ++++++--- .../v1_hosts_id_delete_responses.go | 43 ++++++---- .../host_groups/v1_hosts_id_get_responses.go | 43 ++++++---- .../host_groups/v1_hosts_id_put_responses.go | 49 ++++++++---- .../host_groups/v1_hosts_post_responses.go | 43 ++++++---- .../iaas_service_broker_client.go | 28 ++++++- .../service_broker_health_head_responses.go | 31 +++++--- .../service_broker_health_responses.go | 31 +++++--- .../service_broker_test_timeout_responses.go | 31 +++++--- .../service_broker_version_responses.go | 31 +++++--- .../internal_powervs_instances_client.go | 28 ++++++- ...rnal_v1_powervs_instances_get_responses.go | 19 +++-- .../internal_powervs_locations_client.go | 28 ++++++- ...owervs_locations_activate_put_responses.go | 31 +++++--- ..._powervs_locations_tag_delete_responses.go | 29 ++++--- ...v1_powervs_locations_tag_post_responses.go | 29 ++++--- ..._locations_transitgateway_get_responses.go | 19 +++-- .../internal_storage_regions_client.go | 28 ++++++- ...age_regions_storage_pools_get_responses.go | 31 +++++--- ..._regions_storage_pools_getall_responses.go | 31 +++++--- ...age_regions_storage_pools_put_responses.go | 37 ++++++--- ...torage_regions_thresholds_get_responses.go | 31 +++++--- ...torage_regions_thresholds_put_responses.go | 43 ++++++---- .../internal_transit_gateway_client.go | 28 ++++++- ...nternal_v1_transitgateway_get_responses.go | 13 ++- .../client/open_stacks/open_stacks_client.go | 28 ++++++- ...service_broker_openstacks_get_responses.go | 37 ++++++--- ...e_broker_openstacks_hosts_get_responses.go | 25 ++++-- ...oker_openstacks_openstack_get_responses.go | 37 ++++++--- ...ervice_broker_openstacks_post_responses.go | 55 ++++++++----- ...broker_openstacks_servers_get_responses.go | 37 ++++++--- .../p_cloud_cloud_connections_client.go | 28 ++++++- ...cloud_cloudconnections_delete_responses.go | 55 ++++++++----- .../pcloud_cloudconnections_get_responses.go | 43 ++++++---- ...cloud_cloudconnections_getall_responses.go | 43 ++++++---- ...udconnections_networks_delete_responses.go | 55 ++++++++----- ...cloudconnections_networks_put_responses.go | 55 ++++++++----- .../pcloud_cloudconnections_post_responses.go | 79 +++++++++++++------ .../pcloud_cloudconnections_put_responses.go | 73 +++++++++++------ ...s_virtualprivateclouds_getall_responses.go | 55 ++++++++----- .../p_cloud_disaster_recovery_client.go | 28 ++++++- ...ocations_disasterrecovery_get_responses.go | 37 ++++++--- ...tions_disasterrecovery_getall_responses.go | 37 ++++++--- .../p_cloud_events/p_cloud_events_client.go | 28 ++++++- .../pcloud_events_get_responses.go | 37 ++++++--- .../pcloud_events_getquery_responses.go | 37 ++++++--- .../p_cloud_images/p_cloud_images_client.go | 28 ++++++- ..._cloudinstances_images_delete_responses.go | 43 ++++++---- ...dinstances_images_export_post_responses.go | 43 ++++++---- ...oud_cloudinstances_images_get_responses.go | 37 ++++++--- ..._cloudinstances_images_getall_responses.go | 37 ++++++--- ...ud_cloudinstances_images_post_responses.go | 55 ++++++++----- ...loudinstances_stockimages_get_responses.go | 37 ++++++--- ...dinstances_stockimages_getall_responses.go | 37 ++++++--- .../pcloud_images_get_responses.go | 37 ++++++--- .../pcloud_images_getall_responses.go | 37 ++++++--- ..._cloudinstances_cosimages_get_responses.go | 37 ++++++--- ...cloudinstances_cosimages_post_responses.go | 49 ++++++++---- .../pcloud_v2_images_export_get_responses.go | 37 ++++++--- .../pcloud_v2_images_export_post_responses.go | 49 ++++++++---- .../p_cloud_instances_client.go | 28 ++++++- .../pcloud_cloudinstances_delete_responses.go | 43 ++++++---- .../pcloud_cloudinstances_get_responses.go | 37 ++++++--- .../pcloud_cloudinstances_put_responses.go | 43 ++++++---- .../p_cloud_jobs/p_cloud_jobs_client.go | 28 ++++++- ...ud_cloudinstances_jobs_delete_responses.go | 43 ++++++---- ...cloud_cloudinstances_jobs_get_responses.go | 37 ++++++--- ...ud_cloudinstances_jobs_getall_responses.go | 37 ++++++--- .../p_cloud_networks_client.go | 28 ++++++- .../pcloud_networks_delete_responses.go | 43 ++++++---- .../pcloud_networks_get_responses.go | 37 ++++++--- .../pcloud_networks_getall_responses.go | 37 ++++++--- .../pcloud_networks_ports_delete_responses.go | 43 ++++++---- .../pcloud_networks_ports_get_responses.go | 37 ++++++--- .../pcloud_networks_ports_getall_responses.go | 37 ++++++--- .../pcloud_networks_ports_post_responses.go | 49 ++++++++---- .../pcloud_networks_ports_put_responses.go | 43 ++++++---- .../pcloud_networks_post_responses.go | 61 +++++++++----- .../pcloud_networks_put_responses.go | 43 ++++++---- .../p_cloudp_vm_instances_client.go | 28 ++++++- ...loud_pvminstances_action_post_responses.go | 43 ++++++---- ...oud_pvminstances_capture_post_responses.go | 49 ++++++++---- ...cloud_pvminstances_clone_post_responses.go | 49 ++++++++---- ...loud_pvminstances_console_get_responses.go | 37 ++++++--- ...oud_pvminstances_console_post_responses.go | 43 ++++++---- ...loud_pvminstances_console_put_responses.go | 37 ++++++--- .../pcloud_pvminstances_delete_responses.go | 43 ++++++---- .../pcloud_pvminstances_get_responses.go | 37 ++++++--- .../pcloud_pvminstances_getall_responses.go | 43 ++++++---- ..._pvminstances_networks_delete_responses.go | 43 ++++++---- ...oud_pvminstances_networks_get_responses.go | 37 ++++++--- ..._pvminstances_networks_getall_responses.go | 37 ++++++--- ...ud_pvminstances_networks_post_responses.go | 49 ++++++++---- ..._pvminstances_operations_post_responses.go | 43 ++++++---- .../pcloud_pvminstances_post_responses.go | 67 ++++++++++------ .../pcloud_pvminstances_put_responses.go | 43 ++++++---- ...pvminstances_snapshots_getall_responses.go | 37 ++++++--- ...d_pvminstances_snapshots_post_responses.go | 49 ++++++++---- ...tances_snapshots_restore_post_responses.go | 43 ++++++---- ...d_v2_pvminstances_capture_get_responses.go | 37 ++++++--- ..._v2_pvminstances_capture_post_responses.go | 49 ++++++++---- ...pcloud_v2_pvminstances_getall_responses.go | 43 ++++++---- .../p_cloud_placement_groups_client.go | 28 ++++++- ...pcloud_placementgroups_delete_responses.go | 37 ++++++--- .../pcloud_placementgroups_get_responses.go | 37 ++++++--- ...pcloud_placementgroups_getall_responses.go | 37 ++++++--- ...lacementgroups_members_delete_responses.go | 49 ++++++++---- ..._placementgroups_members_post_responses.go | 49 ++++++++---- .../pcloud_placementgroups_post_responses.go | 49 ++++++++---- .../p_cloud_pod_capacity_client.go | 28 ++++++- .../pcloud_podcapacity_get_responses.go | 37 ++++++--- .../client/p_cloud_s_a_p/p_cloudsap_client.go | 28 ++++++- .../p_cloud_s_a_p/pcloud_sap_get_responses.go | 37 ++++++--- .../pcloud_sap_getall_responses.go | 37 ++++++--- .../pcloud_sap_post_responses.go | 61 +++++++++----- .../p_cloudspp_placement_groups_client.go | 28 ++++++- ...oud_sppplacementgroups_delete_responses.go | 43 ++++++---- ...pcloud_sppplacementgroups_get_responses.go | 37 ++++++--- ...oud_sppplacementgroups_getall_responses.go | 37 ++++++--- ...lacementgroups_members_delete_responses.go | 43 ++++++---- ...pplacementgroups_members_post_responses.go | 49 ++++++++---- ...cloud_sppplacementgroups_post_responses.go | 49 ++++++++---- .../p_cloud_servicedhcp_client.go | 28 ++++++- .../pcloud_dhcp_delete_responses.go | 31 +++++--- .../pcloud_dhcp_get_responses.go | 37 ++++++--- .../pcloud_dhcp_getall_responses.go | 37 ++++++--- .../pcloud_dhcp_post_responses.go | 37 ++++++--- .../p_cloud_shared_processor_pools_client.go | 28 ++++++- ...d_sharedprocessorpools_delete_responses.go | 43 ++++++---- ...loud_sharedprocessorpools_get_responses.go | 37 ++++++--- ...d_sharedprocessorpools_getall_responses.go | 37 ++++++--- ...oud_sharedprocessorpools_post_responses.go | 49 ++++++++---- ...loud_sharedprocessorpools_put_responses.go | 37 ++++++--- .../p_cloud_snapshots_client.go | 28 ++++++- ...oudinstances_snapshots_delete_responses.go | 43 ++++++---- ..._cloudinstances_snapshots_get_responses.go | 37 ++++++--- ...oudinstances_snapshots_getall_responses.go | 37 ++++++--- ..._cloudinstances_snapshots_put_responses.go | 37 ++++++--- .../p_cloud_storage_capacity_client.go | 28 ++++++- ...oud_storagecapacity_pools_get_responses.go | 37 ++++++--- ..._storagecapacity_pools_getall_responses.go | 37 ++++++--- ...oud_storagecapacity_types_get_responses.go | 37 ++++++--- ..._storagecapacity_types_getall_responses.go | 37 ++++++--- .../p_cloud_storage_tiers_client.go | 28 ++++++- ...instances_storagetiers_getall_responses.go | 37 ++++++--- .../p_cloud_system_pools_client.go | 28 ++++++- .../pcloud_systempools_get_responses.go | 37 ++++++--- .../p_cloud_tasks/p_cloud_tasks_client.go | 28 ++++++- .../pcloud_tasks_delete_responses.go | 43 ++++++---- .../pcloud_tasks_get_responses.go | 37 ++++++--- .../p_cloud_tenants/p_cloud_tenants_client.go | 28 ++++++- .../pcloud_tenants_get_responses.go | 37 ++++++--- .../pcloud_tenants_put_responses.go | 43 ++++++---- .../p_cloud_tenants_ssh_keys_client.go | 28 ++++++- ...pcloud_tenants_sshkeys_delete_responses.go | 43 ++++++---- .../pcloud_tenants_sshkeys_get_responses.go | 37 ++++++--- ...pcloud_tenants_sshkeys_getall_responses.go | 37 ++++++--- .../pcloud_tenants_sshkeys_post_responses.go | 55 ++++++++----- .../pcloud_tenants_sshkeys_put_responses.go | 43 ++++++---- .../p_cloudvpn_connections_client.go | 28 ++++++- .../pcloud_vpnconnections_delete_responses.go | 37 ++++++--- .../pcloud_vpnconnections_get_responses.go | 43 ++++++---- .../pcloud_vpnconnections_getall_responses.go | 37 ++++++--- ...pnconnections_networks_delete_responses.go | 43 ++++++---- ...d_vpnconnections_networks_get_responses.go | 37 ++++++--- ...d_vpnconnections_networks_put_responses.go | 43 ++++++---- ...onnections_peersubnets_delete_responses.go | 43 ++++++---- ...pnconnections_peersubnets_get_responses.go | 37 ++++++--- ...pnconnections_peersubnets_put_responses.go | 43 ++++++---- .../pcloud_vpnconnections_post_responses.go | 55 ++++++++----- .../pcloud_vpnconnections_put_responses.go | 43 ++++++---- .../p_cloudvpn_policies_client.go | 28 ++++++- .../pcloud_ikepolicies_delete_responses.go | 37 ++++++--- .../pcloud_ikepolicies_get_responses.go | 43 ++++++---- .../pcloud_ikepolicies_getall_responses.go | 37 ++++++--- .../pcloud_ikepolicies_post_responses.go | 43 ++++++---- .../pcloud_ikepolicies_put_responses.go | 43 ++++++---- .../pcloud_ipsecpolicies_delete_responses.go | 37 ++++++--- .../pcloud_ipsecpolicies_get_responses.go | 43 ++++++---- .../pcloud_ipsecpolicies_getall_responses.go | 37 ++++++--- .../pcloud_ipsecpolicies_post_responses.go | 49 ++++++++---- .../pcloud_ipsecpolicies_put_responses.go | 49 ++++++++---- .../p_cloud_volume_groups_client.go | 28 ++++++- ...loud_volumegroups_action_post_responses.go | 43 ++++++---- .../pcloud_volumegroups_delete_responses.go | 37 ++++++--- ...loud_volumegroups_get_details_responses.go | 37 ++++++--- .../pcloud_volumegroups_get_responses.go | 37 ++++++--- ...d_volumegroups_getall_details_responses.go | 37 ++++++--- .../pcloud_volumegroups_getall_responses.go | 37 ++++++--- .../pcloud_volumegroups_post_responses.go | 61 +++++++++----- .../pcloud_volumegroups_put_responses.go | 49 ++++++++---- ...remote_copy_relationships_get_responses.go | 43 ++++++---- ...umegroups_storage_details_get_responses.go | 43 ++++++---- .../p_cloud_volume_onboarding_client.go | 28 ++++++- .../pcloud_volume_onboarding_get_responses.go | 37 ++++++--- ...loud_volume_onboarding_getall_responses.go | 37 ++++++--- ...pcloud_volume_onboarding_post_responses.go | 43 ++++++---- .../p_cloud_volumes/p_cloud_volumes_client.go | 28 ++++++- ...instances_volumes_action_post_responses.go | 43 ++++++---- ...cloudinstances_volumes_delete_responses.go | 43 ++++++---- ...lumes_flash_copy_mappings_get_responses.go | 43 ++++++---- ...ud_cloudinstances_volumes_get_responses.go | 37 ++++++--- ...cloudinstances_volumes_getall_responses.go | 37 ++++++--- ...d_cloudinstances_volumes_post_responses.go | 49 ++++++++---- ...ud_cloudinstances_volumes_put_responses.go | 49 ++++++++---- ..._remote_copy_relationship_get_responses.go | 43 ++++++---- ...d_pvminstances_volumes_delete_responses.go | 43 ++++++---- ...loud_pvminstances_volumes_get_responses.go | 37 ++++++--- ...d_pvminstances_volumes_getall_responses.go | 37 ++++++--- ...oud_pvminstances_volumes_post_responses.go | 43 ++++++---- ...loud_pvminstances_volumes_put_responses.go | 37 ++++++--- ...instances_volumes_setboot_put_responses.go | 37 ++++++--- ...2_pvminstances_volumes_delete_responses.go | 43 ++++++---- ..._v2_pvminstances_volumes_post_responses.go | 43 ++++++---- .../pcloud_v2_volumes_clone_post_responses.go | 37 ++++++--- ...oud_v2_volumes_clonetasks_get_responses.go | 43 ++++++---- .../pcloud_v2_volumes_delete_responses.go | 49 ++++++++---- .../pcloud_v2_volumes_post_responses.go | 49 ++++++++---- ...d_v2_volumesclone_cancel_post_responses.go | 37 ++++++--- ...pcloud_v2_volumesclone_delete_responses.go | 37 ++++++--- ..._v2_volumesclone_execute_post_responses.go | 37 ++++++--- .../pcloud_v2_volumesclone_get_responses.go | 37 ++++++--- ...pcloud_v2_volumesclone_getall_responses.go | 37 ++++++--- .../pcloud_v2_volumesclone_post_responses.go | 37 ++++++--- ...ud_v2_volumesclone_start_post_responses.go | 37 ++++++--- .../pcloud_volumes_clone_post_responses.go | 43 ++++++---- .../power_edge_router_client.go | 28 ++++++- ...1_poweredgerouter_action_post_responses.go | 43 ++++++---- .../service_binding_binding_responses.go | 55 ++++++++----- .../service_binding_get_responses.go | 31 +++++--- ...ce_binding_last_operation_get_responses.go | 37 ++++++--- .../service_binding_unbinding_responses.go | 43 ++++++---- .../service_bindings_client.go | 28 ++++++- .../service_instance_deprovision_responses.go | 49 ++++++++---- .../service_instance_get_responses.go | 31 +++++--- ...e_instance_last_operation_get_responses.go | 37 ++++++--- .../service_instance_provision_responses.go | 55 ++++++++----- .../service_instance_update_responses.go | 43 ++++++---- .../service_instances_client.go | 28 ++++++- ...rvice_broker_storagetypes_get_responses.go | 43 ++++++---- .../storage_types/storage_types_client.go | 28 ++++++- .../service_broker_swaggerspec_responses.go | 31 +++++--- .../swagger_spec/swagger_spec_client.go | 28 ++++++- .../workspaces/v1_workspaces_get_responses.go | 43 ++++++---- .../v1_workspaces_getall_responses.go | 31 +++++--- power/client/workspaces/workspaces_client.go | 28 ++++++- power/models/clone_task_status.go | 2 +- power/models/cloud_connection_create.go | 2 +- power/models/cloud_connection_update.go | 2 +- power/models/cloud_initialization.go | 2 +- power/models/create_cos_image_import_job.go | 4 +- power/models/create_data_volume.go | 2 +- power/models/create_image.go | 4 +- power/models/datacenter.go | 4 +- power/models/dead_peer_detection.go | 2 +- power/models/deployment_target.go | 2 +- power/models/event.go | 2 +- power/models/i_k_e_policy.go | 6 +- power/models/i_k_e_policy_create.go | 6 +- power/models/i_k_e_policy_update.go | 20 ++--- power/models/image_import_details.go | 6 +- power/models/ip_sec_policy.go | 4 +- power/models/ip_sec_policy_create.go | 4 +- power/models/ip_sec_policy_update.go | 14 ++-- power/models/last_operation_resource.go | 2 +- power/models/multi_volumes_create.go | 2 +- power/models/network.go | 2 +- power/models/network_create.go | 2 +- power/models/network_reference.go | 2 +- power/models/operations.go | 6 +- power/models/p_vm_instance.go | 2 +- power/models/p_vm_instance_action.go | 2 +- power/models/p_vm_instance_address.go | 10 +++ power/models/p_vm_instance_capture.go | 2 +- power/models/p_vm_instance_clone.go | 2 +- power/models/p_vm_instance_create.go | 10 +-- power/models/p_vm_instance_multi_create.go | 4 +- power/models/p_vm_instance_operation.go | 2 +- power/models/p_vm_instance_reference.go | 2 +- power/models/p_vm_instance_update.go | 2 +- power/models/p_vm_instance_update_response.go | 2 +- power/models/p_vm_instance_v2_network_port.go | 4 +- power/models/placement_group.go | 2 +- power/models/placement_group_create.go | 2 +- power/models/power_edge_router_action.go | 2 +- power/models/pvm_instance_deployment.go | 2 +- power/models/s_a_p_profile.go | 4 +- power/models/s_p_p_placement_group_create.go | 2 +- power/models/service_binding_volume_mount.go | 4 +- power/models/shared_processor_pool_server.go | 4 +- power/models/storage_affinity.go | 2 +- power/models/storage_pool.go | 2 +- power/models/storage_tier.go | 2 +- power/models/storage_type.go | 2 +- power/models/token_request.go | 2 +- power/models/transit_gateway_location.go | 2 +- power/models/update_storage_pool.go | 2 +- power/models/v_p_n_connection.go | 4 +- power/models/v_p_n_connection_create.go | 2 +- power/models/v_p_n_connection_update.go | 2 +- power/models/volume.go | 2 +- power/models/volume_group_action.go | 4 +- power/models/volume_group_action_reset.go | 2 +- power/models/volume_group_action_start.go | 2 +- power/models/volume_reference.go | 2 +- power/models/workspace.go | 2 +- .../workspace_power_edge_router_details.go | 6 +- 334 files changed, 7588 insertions(+), 3177 deletions(-) diff --git a/power/client/authentication/authentication_client.go b/power/client/authentication/authentication_client.go index 33f0e028..175237cb 100644 --- a/power/client/authentication/authentication_client.go +++ b/power/client/authentication/authentication_client.go @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi 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 */ @@ -25,7 +51,7 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods diff --git a/power/client/authentication/service_broker_auth_callback_responses.go b/power/client/authentication/service_broker_auth_callback_responses.go index 94ed66f1..cb6002ee 100644 --- a/power/client/authentication/service_broker_auth_callback_responses.go +++ b/power/client/authentication/service_broker_auth_callback_responses.go @@ -6,6 +6,7 @@ package authentication // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *ServiceBrokerAuthCallbackOK) Code() int { } func (o *ServiceBrokerAuthCallbackOK) Error() string { - return fmt.Sprintf("[GET /auth/v1/callback][%d] serviceBrokerAuthCallbackOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/callback][%d] serviceBrokerAuthCallbackOK %s", 200, payload) } func (o *ServiceBrokerAuthCallbackOK) String() string { - return fmt.Sprintf("[GET /auth/v1/callback][%d] serviceBrokerAuthCallbackOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/callback][%d] serviceBrokerAuthCallbackOK %s", 200, payload) } func (o *ServiceBrokerAuthCallbackOK) GetPayload() *models.AccessToken { @@ -177,11 +180,13 @@ func (o *ServiceBrokerAuthCallbackBadRequest) Code() int { } func (o *ServiceBrokerAuthCallbackBadRequest) Error() string { - return fmt.Sprintf("[GET /auth/v1/callback][%d] serviceBrokerAuthCallbackBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/callback][%d] serviceBrokerAuthCallbackBadRequest %s", 400, payload) } func (o *ServiceBrokerAuthCallbackBadRequest) String() string { - return fmt.Sprintf("[GET /auth/v1/callback][%d] serviceBrokerAuthCallbackBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/callback][%d] serviceBrokerAuthCallbackBadRequest %s", 400, payload) } func (o *ServiceBrokerAuthCallbackBadRequest) GetPayload() *models.Error { @@ -245,11 +250,13 @@ func (o *ServiceBrokerAuthCallbackUnauthorized) Code() int { } func (o *ServiceBrokerAuthCallbackUnauthorized) Error() string { - return fmt.Sprintf("[GET /auth/v1/callback][%d] serviceBrokerAuthCallbackUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/callback][%d] serviceBrokerAuthCallbackUnauthorized %s", 401, payload) } func (o *ServiceBrokerAuthCallbackUnauthorized) String() string { - return fmt.Sprintf("[GET /auth/v1/callback][%d] serviceBrokerAuthCallbackUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/callback][%d] serviceBrokerAuthCallbackUnauthorized %s", 401, payload) } func (o *ServiceBrokerAuthCallbackUnauthorized) GetPayload() *models.Error { @@ -313,11 +320,13 @@ func (o *ServiceBrokerAuthCallbackForbidden) Code() int { } func (o *ServiceBrokerAuthCallbackForbidden) Error() string { - return fmt.Sprintf("[GET /auth/v1/callback][%d] serviceBrokerAuthCallbackForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/callback][%d] serviceBrokerAuthCallbackForbidden %s", 403, payload) } func (o *ServiceBrokerAuthCallbackForbidden) String() string { - return fmt.Sprintf("[GET /auth/v1/callback][%d] serviceBrokerAuthCallbackForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/callback][%d] serviceBrokerAuthCallbackForbidden %s", 403, payload) } func (o *ServiceBrokerAuthCallbackForbidden) GetPayload() *models.Error { @@ -381,11 +390,13 @@ func (o *ServiceBrokerAuthCallbackNotFound) Code() int { } func (o *ServiceBrokerAuthCallbackNotFound) Error() string { - return fmt.Sprintf("[GET /auth/v1/callback][%d] serviceBrokerAuthCallbackNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/callback][%d] serviceBrokerAuthCallbackNotFound %s", 404, payload) } func (o *ServiceBrokerAuthCallbackNotFound) String() string { - return fmt.Sprintf("[GET /auth/v1/callback][%d] serviceBrokerAuthCallbackNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/callback][%d] serviceBrokerAuthCallbackNotFound %s", 404, payload) } func (o *ServiceBrokerAuthCallbackNotFound) GetPayload() *models.Error { @@ -449,11 +460,13 @@ func (o *ServiceBrokerAuthCallbackInternalServerError) Code() int { } func (o *ServiceBrokerAuthCallbackInternalServerError) Error() string { - return fmt.Sprintf("[GET /auth/v1/callback][%d] serviceBrokerAuthCallbackInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/callback][%d] serviceBrokerAuthCallbackInternalServerError %s", 500, payload) } func (o *ServiceBrokerAuthCallbackInternalServerError) String() string { - return fmt.Sprintf("[GET /auth/v1/callback][%d] serviceBrokerAuthCallbackInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/callback][%d] serviceBrokerAuthCallbackInternalServerError %s", 500, payload) } func (o *ServiceBrokerAuthCallbackInternalServerError) GetPayload() *models.Error { 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 index 6834f289..273f5fcd 100644 --- a/power/client/authentication/service_broker_auth_device_code_post_responses.go +++ b/power/client/authentication/service_broker_auth_device_code_post_responses.go @@ -6,6 +6,7 @@ package authentication // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *ServiceBrokerAuthDeviceCodePostOK) Code() int { } func (o *ServiceBrokerAuthDeviceCodePostOK) Error() string { - return fmt.Sprintf("[POST /auth/v1/device/code][%d] serviceBrokerAuthDeviceCodePostOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /auth/v1/device/code][%d] serviceBrokerAuthDeviceCodePostOK %s", 200, payload) } func (o *ServiceBrokerAuthDeviceCodePostOK) String() string { - return fmt.Sprintf("[POST /auth/v1/device/code][%d] serviceBrokerAuthDeviceCodePostOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /auth/v1/device/code][%d] serviceBrokerAuthDeviceCodePostOK %s", 200, payload) } func (o *ServiceBrokerAuthDeviceCodePostOK) GetPayload() *models.DeviceCode { @@ -177,11 +180,13 @@ func (o *ServiceBrokerAuthDeviceCodePostBadRequest) Code() int { } func (o *ServiceBrokerAuthDeviceCodePostBadRequest) Error() string { - return fmt.Sprintf("[POST /auth/v1/device/code][%d] serviceBrokerAuthDeviceCodePostBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /auth/v1/device/code][%d] serviceBrokerAuthDeviceCodePostBadRequest %s", 400, payload) } func (o *ServiceBrokerAuthDeviceCodePostBadRequest) String() string { - return fmt.Sprintf("[POST /auth/v1/device/code][%d] serviceBrokerAuthDeviceCodePostBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /auth/v1/device/code][%d] serviceBrokerAuthDeviceCodePostBadRequest %s", 400, payload) } func (o *ServiceBrokerAuthDeviceCodePostBadRequest) GetPayload() *models.Error { @@ -245,11 +250,13 @@ func (o *ServiceBrokerAuthDeviceCodePostUnauthorized) Code() int { } func (o *ServiceBrokerAuthDeviceCodePostUnauthorized) Error() string { - return fmt.Sprintf("[POST /auth/v1/device/code][%d] serviceBrokerAuthDeviceCodePostUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /auth/v1/device/code][%d] serviceBrokerAuthDeviceCodePostUnauthorized %s", 401, payload) } func (o *ServiceBrokerAuthDeviceCodePostUnauthorized) String() string { - return fmt.Sprintf("[POST /auth/v1/device/code][%d] serviceBrokerAuthDeviceCodePostUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /auth/v1/device/code][%d] serviceBrokerAuthDeviceCodePostUnauthorized %s", 401, payload) } func (o *ServiceBrokerAuthDeviceCodePostUnauthorized) GetPayload() *models.Error { @@ -313,11 +320,13 @@ func (o *ServiceBrokerAuthDeviceCodePostForbidden) Code() int { } func (o *ServiceBrokerAuthDeviceCodePostForbidden) Error() string { - return fmt.Sprintf("[POST /auth/v1/device/code][%d] serviceBrokerAuthDeviceCodePostForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /auth/v1/device/code][%d] serviceBrokerAuthDeviceCodePostForbidden %s", 403, payload) } func (o *ServiceBrokerAuthDeviceCodePostForbidden) String() string { - return fmt.Sprintf("[POST /auth/v1/device/code][%d] serviceBrokerAuthDeviceCodePostForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /auth/v1/device/code][%d] serviceBrokerAuthDeviceCodePostForbidden %s", 403, payload) } func (o *ServiceBrokerAuthDeviceCodePostForbidden) GetPayload() *models.Error { @@ -381,11 +390,13 @@ func (o *ServiceBrokerAuthDeviceCodePostNotFound) Code() int { } func (o *ServiceBrokerAuthDeviceCodePostNotFound) Error() string { - return fmt.Sprintf("[POST /auth/v1/device/code][%d] serviceBrokerAuthDeviceCodePostNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /auth/v1/device/code][%d] serviceBrokerAuthDeviceCodePostNotFound %s", 404, payload) } func (o *ServiceBrokerAuthDeviceCodePostNotFound) String() string { - return fmt.Sprintf("[POST /auth/v1/device/code][%d] serviceBrokerAuthDeviceCodePostNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /auth/v1/device/code][%d] serviceBrokerAuthDeviceCodePostNotFound %s", 404, payload) } func (o *ServiceBrokerAuthDeviceCodePostNotFound) GetPayload() *models.Error { @@ -449,11 +460,13 @@ func (o *ServiceBrokerAuthDeviceCodePostInternalServerError) Code() int { } func (o *ServiceBrokerAuthDeviceCodePostInternalServerError) Error() string { - return fmt.Sprintf("[POST /auth/v1/device/code][%d] serviceBrokerAuthDeviceCodePostInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /auth/v1/device/code][%d] serviceBrokerAuthDeviceCodePostInternalServerError %s", 500, payload) } func (o *ServiceBrokerAuthDeviceCodePostInternalServerError) String() string { - return fmt.Sprintf("[POST /auth/v1/device/code][%d] serviceBrokerAuthDeviceCodePostInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /auth/v1/device/code][%d] serviceBrokerAuthDeviceCodePostInternalServerError %s", 500, payload) } func (o *ServiceBrokerAuthDeviceCodePostInternalServerError) GetPayload() *models.Error { 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 index 1fe6d724..511eb84b 100644 --- a/power/client/authentication/service_broker_auth_device_token_post_responses.go +++ b/power/client/authentication/service_broker_auth_device_token_post_responses.go @@ -7,6 +7,7 @@ package authentication import ( "context" + "encoding/json" "fmt" "io" @@ -117,11 +118,13 @@ func (o *ServiceBrokerAuthDeviceTokenPostOK) Code() int { } func (o *ServiceBrokerAuthDeviceTokenPostOK) Error() string { - return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostOK %s", 200, payload) } func (o *ServiceBrokerAuthDeviceTokenPostOK) String() string { - return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostOK %s", 200, payload) } func (o *ServiceBrokerAuthDeviceTokenPostOK) GetPayload() *models.Token { @@ -185,11 +188,13 @@ func (o *ServiceBrokerAuthDeviceTokenPostBadRequest) Code() int { } func (o *ServiceBrokerAuthDeviceTokenPostBadRequest) Error() string { - return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostBadRequest %s", 400, payload) } func (o *ServiceBrokerAuthDeviceTokenPostBadRequest) String() string { - return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostBadRequest %s", 400, payload) } func (o *ServiceBrokerAuthDeviceTokenPostBadRequest) GetPayload() *models.Error { @@ -253,11 +258,13 @@ func (o *ServiceBrokerAuthDeviceTokenPostUnauthorized) Code() int { } func (o *ServiceBrokerAuthDeviceTokenPostUnauthorized) Error() string { - return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostUnauthorized %s", 401, payload) } func (o *ServiceBrokerAuthDeviceTokenPostUnauthorized) String() string { - return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostUnauthorized %s", 401, payload) } func (o *ServiceBrokerAuthDeviceTokenPostUnauthorized) GetPayload() *models.Error { @@ -321,11 +328,13 @@ func (o *ServiceBrokerAuthDeviceTokenPostForbidden) Code() int { } func (o *ServiceBrokerAuthDeviceTokenPostForbidden) Error() string { - return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostForbidden %s", 403, payload) } func (o *ServiceBrokerAuthDeviceTokenPostForbidden) String() string { - return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostForbidden %s", 403, payload) } func (o *ServiceBrokerAuthDeviceTokenPostForbidden) GetPayload() *models.Error { @@ -389,11 +398,13 @@ func (o *ServiceBrokerAuthDeviceTokenPostNotFound) Code() int { } func (o *ServiceBrokerAuthDeviceTokenPostNotFound) Error() string { - return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostNotFound %s", 404, payload) } func (o *ServiceBrokerAuthDeviceTokenPostNotFound) String() string { - return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostNotFound %s", 404, payload) } func (o *ServiceBrokerAuthDeviceTokenPostNotFound) GetPayload() *models.Error { @@ -457,11 +468,13 @@ func (o *ServiceBrokerAuthDeviceTokenPostTooManyRequests) Code() int { } func (o *ServiceBrokerAuthDeviceTokenPostTooManyRequests) Error() string { - return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostTooManyRequests %+v", 429, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostTooManyRequests %s", 429, payload) } func (o *ServiceBrokerAuthDeviceTokenPostTooManyRequests) String() string { - return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostTooManyRequests %+v", 429, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostTooManyRequests %s", 429, payload) } func (o *ServiceBrokerAuthDeviceTokenPostTooManyRequests) GetPayload() *models.Error { @@ -525,11 +538,13 @@ func (o *ServiceBrokerAuthDeviceTokenPostInternalServerError) Code() int { } func (o *ServiceBrokerAuthDeviceTokenPostInternalServerError) Error() string { - return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostInternalServerError %s", 500, payload) } func (o *ServiceBrokerAuthDeviceTokenPostInternalServerError) String() string { - return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /auth/v1/device/token][%d] serviceBrokerAuthDeviceTokenPostInternalServerError %s", 500, payload) } func (o *ServiceBrokerAuthDeviceTokenPostInternalServerError) GetPayload() *models.Error { diff --git a/power/client/authentication/service_broker_auth_info_token_responses.go b/power/client/authentication/service_broker_auth_info_token_responses.go index 36886cd2..c9ad50f4 100644 --- a/power/client/authentication/service_broker_auth_info_token_responses.go +++ b/power/client/authentication/service_broker_auth_info_token_responses.go @@ -6,6 +6,7 @@ package authentication // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *ServiceBrokerAuthInfoTokenOK) Code() int { } func (o *ServiceBrokerAuthInfoTokenOK) Error() string { - return fmt.Sprintf("[GET /auth/v1/info/token][%d] serviceBrokerAuthInfoTokenOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/info/token][%d] serviceBrokerAuthInfoTokenOK %s", 200, payload) } func (o *ServiceBrokerAuthInfoTokenOK) String() string { - return fmt.Sprintf("[GET /auth/v1/info/token][%d] serviceBrokerAuthInfoTokenOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/info/token][%d] serviceBrokerAuthInfoTokenOK %s", 200, payload) } func (o *ServiceBrokerAuthInfoTokenOK) GetPayload() *models.TokenExtra { @@ -177,11 +180,13 @@ func (o *ServiceBrokerAuthInfoTokenBadRequest) Code() int { } func (o *ServiceBrokerAuthInfoTokenBadRequest) Error() string { - return fmt.Sprintf("[GET /auth/v1/info/token][%d] serviceBrokerAuthInfoTokenBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/info/token][%d] serviceBrokerAuthInfoTokenBadRequest %s", 400, payload) } func (o *ServiceBrokerAuthInfoTokenBadRequest) String() string { - return fmt.Sprintf("[GET /auth/v1/info/token][%d] serviceBrokerAuthInfoTokenBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/info/token][%d] serviceBrokerAuthInfoTokenBadRequest %s", 400, payload) } func (o *ServiceBrokerAuthInfoTokenBadRequest) GetPayload() *models.Error { @@ -245,11 +250,13 @@ func (o *ServiceBrokerAuthInfoTokenUnauthorized) Code() int { } func (o *ServiceBrokerAuthInfoTokenUnauthorized) Error() string { - return fmt.Sprintf("[GET /auth/v1/info/token][%d] serviceBrokerAuthInfoTokenUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/info/token][%d] serviceBrokerAuthInfoTokenUnauthorized %s", 401, payload) } func (o *ServiceBrokerAuthInfoTokenUnauthorized) String() string { - return fmt.Sprintf("[GET /auth/v1/info/token][%d] serviceBrokerAuthInfoTokenUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/info/token][%d] serviceBrokerAuthInfoTokenUnauthorized %s", 401, payload) } func (o *ServiceBrokerAuthInfoTokenUnauthorized) GetPayload() *models.Error { @@ -313,11 +320,13 @@ func (o *ServiceBrokerAuthInfoTokenForbidden) Code() int { } func (o *ServiceBrokerAuthInfoTokenForbidden) Error() string { - return fmt.Sprintf("[GET /auth/v1/info/token][%d] serviceBrokerAuthInfoTokenForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/info/token][%d] serviceBrokerAuthInfoTokenForbidden %s", 403, payload) } func (o *ServiceBrokerAuthInfoTokenForbidden) String() string { - return fmt.Sprintf("[GET /auth/v1/info/token][%d] serviceBrokerAuthInfoTokenForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/info/token][%d] serviceBrokerAuthInfoTokenForbidden %s", 403, payload) } func (o *ServiceBrokerAuthInfoTokenForbidden) GetPayload() *models.Error { @@ -381,11 +390,13 @@ func (o *ServiceBrokerAuthInfoTokenNotFound) Code() int { } func (o *ServiceBrokerAuthInfoTokenNotFound) Error() string { - return fmt.Sprintf("[GET /auth/v1/info/token][%d] serviceBrokerAuthInfoTokenNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/info/token][%d] serviceBrokerAuthInfoTokenNotFound %s", 404, payload) } func (o *ServiceBrokerAuthInfoTokenNotFound) String() string { - return fmt.Sprintf("[GET /auth/v1/info/token][%d] serviceBrokerAuthInfoTokenNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/info/token][%d] serviceBrokerAuthInfoTokenNotFound %s", 404, payload) } func (o *ServiceBrokerAuthInfoTokenNotFound) GetPayload() *models.Error { @@ -449,11 +460,13 @@ func (o *ServiceBrokerAuthInfoTokenInternalServerError) Code() int { } func (o *ServiceBrokerAuthInfoTokenInternalServerError) Error() string { - return fmt.Sprintf("[GET /auth/v1/info/token][%d] serviceBrokerAuthInfoTokenInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/info/token][%d] serviceBrokerAuthInfoTokenInternalServerError %s", 500, payload) } func (o *ServiceBrokerAuthInfoTokenInternalServerError) String() string { - return fmt.Sprintf("[GET /auth/v1/info/token][%d] serviceBrokerAuthInfoTokenInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/info/token][%d] serviceBrokerAuthInfoTokenInternalServerError %s", 500, payload) } func (o *ServiceBrokerAuthInfoTokenInternalServerError) GetPayload() *models.Error { diff --git a/power/client/authentication/service_broker_auth_info_user_responses.go b/power/client/authentication/service_broker_auth_info_user_responses.go index 5fffd210..672d5a39 100644 --- a/power/client/authentication/service_broker_auth_info_user_responses.go +++ b/power/client/authentication/service_broker_auth_info_user_responses.go @@ -6,6 +6,7 @@ package authentication // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *ServiceBrokerAuthInfoUserOK) Code() int { } func (o *ServiceBrokerAuthInfoUserOK) Error() string { - return fmt.Sprintf("[GET /auth/v1/info/user][%d] serviceBrokerAuthInfoUserOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/info/user][%d] serviceBrokerAuthInfoUserOK %s", 200, payload) } func (o *ServiceBrokerAuthInfoUserOK) String() string { - return fmt.Sprintf("[GET /auth/v1/info/user][%d] serviceBrokerAuthInfoUserOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/info/user][%d] serviceBrokerAuthInfoUserOK %s", 200, payload) } func (o *ServiceBrokerAuthInfoUserOK) GetPayload() *models.UserInfo { @@ -177,11 +180,13 @@ func (o *ServiceBrokerAuthInfoUserBadRequest) Code() int { } func (o *ServiceBrokerAuthInfoUserBadRequest) Error() string { - return fmt.Sprintf("[GET /auth/v1/info/user][%d] serviceBrokerAuthInfoUserBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/info/user][%d] serviceBrokerAuthInfoUserBadRequest %s", 400, payload) } func (o *ServiceBrokerAuthInfoUserBadRequest) String() string { - return fmt.Sprintf("[GET /auth/v1/info/user][%d] serviceBrokerAuthInfoUserBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/info/user][%d] serviceBrokerAuthInfoUserBadRequest %s", 400, payload) } func (o *ServiceBrokerAuthInfoUserBadRequest) GetPayload() *models.Error { @@ -245,11 +250,13 @@ func (o *ServiceBrokerAuthInfoUserUnauthorized) Code() int { } func (o *ServiceBrokerAuthInfoUserUnauthorized) Error() string { - return fmt.Sprintf("[GET /auth/v1/info/user][%d] serviceBrokerAuthInfoUserUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/info/user][%d] serviceBrokerAuthInfoUserUnauthorized %s", 401, payload) } func (o *ServiceBrokerAuthInfoUserUnauthorized) String() string { - return fmt.Sprintf("[GET /auth/v1/info/user][%d] serviceBrokerAuthInfoUserUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/info/user][%d] serviceBrokerAuthInfoUserUnauthorized %s", 401, payload) } func (o *ServiceBrokerAuthInfoUserUnauthorized) GetPayload() *models.Error { @@ -313,11 +320,13 @@ func (o *ServiceBrokerAuthInfoUserForbidden) Code() int { } func (o *ServiceBrokerAuthInfoUserForbidden) Error() string { - return fmt.Sprintf("[GET /auth/v1/info/user][%d] serviceBrokerAuthInfoUserForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/info/user][%d] serviceBrokerAuthInfoUserForbidden %s", 403, payload) } func (o *ServiceBrokerAuthInfoUserForbidden) String() string { - return fmt.Sprintf("[GET /auth/v1/info/user][%d] serviceBrokerAuthInfoUserForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/info/user][%d] serviceBrokerAuthInfoUserForbidden %s", 403, payload) } func (o *ServiceBrokerAuthInfoUserForbidden) GetPayload() *models.Error { @@ -381,11 +390,13 @@ func (o *ServiceBrokerAuthInfoUserNotFound) Code() int { } func (o *ServiceBrokerAuthInfoUserNotFound) Error() string { - return fmt.Sprintf("[GET /auth/v1/info/user][%d] serviceBrokerAuthInfoUserNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/info/user][%d] serviceBrokerAuthInfoUserNotFound %s", 404, payload) } func (o *ServiceBrokerAuthInfoUserNotFound) String() string { - return fmt.Sprintf("[GET /auth/v1/info/user][%d] serviceBrokerAuthInfoUserNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/info/user][%d] serviceBrokerAuthInfoUserNotFound %s", 404, payload) } func (o *ServiceBrokerAuthInfoUserNotFound) GetPayload() *models.Error { @@ -449,11 +460,13 @@ func (o *ServiceBrokerAuthInfoUserInternalServerError) Code() int { } func (o *ServiceBrokerAuthInfoUserInternalServerError) Error() string { - return fmt.Sprintf("[GET /auth/v1/info/user][%d] serviceBrokerAuthInfoUserInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/info/user][%d] serviceBrokerAuthInfoUserInternalServerError %s", 500, payload) } func (o *ServiceBrokerAuthInfoUserInternalServerError) String() string { - return fmt.Sprintf("[GET /auth/v1/info/user][%d] serviceBrokerAuthInfoUserInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/info/user][%d] serviceBrokerAuthInfoUserInternalServerError %s", 500, payload) } func (o *ServiceBrokerAuthInfoUserInternalServerError) GetPayload() *models.Error { diff --git a/power/client/authentication/service_broker_auth_login_responses.go b/power/client/authentication/service_broker_auth_login_responses.go index 7500d6e1..1836f4f9 100644 --- a/power/client/authentication/service_broker_auth_login_responses.go +++ b/power/client/authentication/service_broker_auth_login_responses.go @@ -6,6 +6,7 @@ package authentication // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *ServiceBrokerAuthLoginOK) Code() int { } func (o *ServiceBrokerAuthLoginOK) Error() string { - return fmt.Sprintf("[GET /auth/v1/login][%d] serviceBrokerAuthLoginOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/login][%d] serviceBrokerAuthLoginOK %s", 200, payload) } func (o *ServiceBrokerAuthLoginOK) String() string { - return fmt.Sprintf("[GET /auth/v1/login][%d] serviceBrokerAuthLoginOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/login][%d] serviceBrokerAuthLoginOK %s", 200, payload) } func (o *ServiceBrokerAuthLoginOK) GetPayload() *models.AccessToken { @@ -177,11 +180,13 @@ func (o *ServiceBrokerAuthLoginBadRequest) Code() int { } func (o *ServiceBrokerAuthLoginBadRequest) Error() string { - return fmt.Sprintf("[GET /auth/v1/login][%d] serviceBrokerAuthLoginBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/login][%d] serviceBrokerAuthLoginBadRequest %s", 400, payload) } func (o *ServiceBrokerAuthLoginBadRequest) String() string { - return fmt.Sprintf("[GET /auth/v1/login][%d] serviceBrokerAuthLoginBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/login][%d] serviceBrokerAuthLoginBadRequest %s", 400, payload) } func (o *ServiceBrokerAuthLoginBadRequest) GetPayload() *models.Error { @@ -245,11 +250,13 @@ func (o *ServiceBrokerAuthLoginUnauthorized) Code() int { } func (o *ServiceBrokerAuthLoginUnauthorized) Error() string { - return fmt.Sprintf("[GET /auth/v1/login][%d] serviceBrokerAuthLoginUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/login][%d] serviceBrokerAuthLoginUnauthorized %s", 401, payload) } func (o *ServiceBrokerAuthLoginUnauthorized) String() string { - return fmt.Sprintf("[GET /auth/v1/login][%d] serviceBrokerAuthLoginUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/login][%d] serviceBrokerAuthLoginUnauthorized %s", 401, payload) } func (o *ServiceBrokerAuthLoginUnauthorized) GetPayload() *models.Error { @@ -313,11 +320,13 @@ func (o *ServiceBrokerAuthLoginForbidden) Code() int { } func (o *ServiceBrokerAuthLoginForbidden) Error() string { - return fmt.Sprintf("[GET /auth/v1/login][%d] serviceBrokerAuthLoginForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/login][%d] serviceBrokerAuthLoginForbidden %s", 403, payload) } func (o *ServiceBrokerAuthLoginForbidden) String() string { - return fmt.Sprintf("[GET /auth/v1/login][%d] serviceBrokerAuthLoginForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/login][%d] serviceBrokerAuthLoginForbidden %s", 403, payload) } func (o *ServiceBrokerAuthLoginForbidden) GetPayload() *models.Error { @@ -381,11 +390,13 @@ func (o *ServiceBrokerAuthLoginNotFound) Code() int { } func (o *ServiceBrokerAuthLoginNotFound) Error() string { - return fmt.Sprintf("[GET /auth/v1/login][%d] serviceBrokerAuthLoginNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/login][%d] serviceBrokerAuthLoginNotFound %s", 404, payload) } func (o *ServiceBrokerAuthLoginNotFound) String() string { - return fmt.Sprintf("[GET /auth/v1/login][%d] serviceBrokerAuthLoginNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/login][%d] serviceBrokerAuthLoginNotFound %s", 404, payload) } func (o *ServiceBrokerAuthLoginNotFound) GetPayload() *models.Error { @@ -449,11 +460,13 @@ func (o *ServiceBrokerAuthLoginInternalServerError) Code() int { } func (o *ServiceBrokerAuthLoginInternalServerError) Error() string { - return fmt.Sprintf("[GET /auth/v1/login][%d] serviceBrokerAuthLoginInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/login][%d] serviceBrokerAuthLoginInternalServerError %s", 500, payload) } func (o *ServiceBrokerAuthLoginInternalServerError) String() string { - return fmt.Sprintf("[GET /auth/v1/login][%d] serviceBrokerAuthLoginInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/login][%d] serviceBrokerAuthLoginInternalServerError %s", 500, payload) } func (o *ServiceBrokerAuthLoginInternalServerError) GetPayload() *models.Error { diff --git a/power/client/authentication/service_broker_auth_logout_responses.go b/power/client/authentication/service_broker_auth_logout_responses.go index d1ef9e2c..fabf4561 100644 --- a/power/client/authentication/service_broker_auth_logout_responses.go +++ b/power/client/authentication/service_broker_auth_logout_responses.go @@ -6,6 +6,7 @@ package authentication // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *ServiceBrokerAuthLogoutOK) Code() int { } func (o *ServiceBrokerAuthLogoutOK) Error() string { - return fmt.Sprintf("[GET /auth/v1/logout][%d] serviceBrokerAuthLogoutOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/logout][%d] serviceBrokerAuthLogoutOK %s", 200, payload) } func (o *ServiceBrokerAuthLogoutOK) String() string { - return fmt.Sprintf("[GET /auth/v1/logout][%d] serviceBrokerAuthLogoutOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/logout][%d] serviceBrokerAuthLogoutOK %s", 200, payload) } func (o *ServiceBrokerAuthLogoutOK) GetPayload() models.Object { @@ -175,11 +178,13 @@ func (o *ServiceBrokerAuthLogoutBadRequest) Code() int { } func (o *ServiceBrokerAuthLogoutBadRequest) Error() string { - return fmt.Sprintf("[GET /auth/v1/logout][%d] serviceBrokerAuthLogoutBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/logout][%d] serviceBrokerAuthLogoutBadRequest %s", 400, payload) } func (o *ServiceBrokerAuthLogoutBadRequest) String() string { - return fmt.Sprintf("[GET /auth/v1/logout][%d] serviceBrokerAuthLogoutBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/logout][%d] serviceBrokerAuthLogoutBadRequest %s", 400, payload) } func (o *ServiceBrokerAuthLogoutBadRequest) GetPayload() *models.Error { @@ -243,11 +248,13 @@ func (o *ServiceBrokerAuthLogoutUnauthorized) Code() int { } func (o *ServiceBrokerAuthLogoutUnauthorized) Error() string { - return fmt.Sprintf("[GET /auth/v1/logout][%d] serviceBrokerAuthLogoutUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/logout][%d] serviceBrokerAuthLogoutUnauthorized %s", 401, payload) } func (o *ServiceBrokerAuthLogoutUnauthorized) String() string { - return fmt.Sprintf("[GET /auth/v1/logout][%d] serviceBrokerAuthLogoutUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/logout][%d] serviceBrokerAuthLogoutUnauthorized %s", 401, payload) } func (o *ServiceBrokerAuthLogoutUnauthorized) GetPayload() *models.Error { @@ -311,11 +318,13 @@ func (o *ServiceBrokerAuthLogoutForbidden) Code() int { } func (o *ServiceBrokerAuthLogoutForbidden) Error() string { - return fmt.Sprintf("[GET /auth/v1/logout][%d] serviceBrokerAuthLogoutForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/logout][%d] serviceBrokerAuthLogoutForbidden %s", 403, payload) } func (o *ServiceBrokerAuthLogoutForbidden) String() string { - return fmt.Sprintf("[GET /auth/v1/logout][%d] serviceBrokerAuthLogoutForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/logout][%d] serviceBrokerAuthLogoutForbidden %s", 403, payload) } func (o *ServiceBrokerAuthLogoutForbidden) GetPayload() *models.Error { @@ -379,11 +388,13 @@ func (o *ServiceBrokerAuthLogoutNotFound) Code() int { } func (o *ServiceBrokerAuthLogoutNotFound) Error() string { - return fmt.Sprintf("[GET /auth/v1/logout][%d] serviceBrokerAuthLogoutNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/logout][%d] serviceBrokerAuthLogoutNotFound %s", 404, payload) } func (o *ServiceBrokerAuthLogoutNotFound) String() string { - return fmt.Sprintf("[GET /auth/v1/logout][%d] serviceBrokerAuthLogoutNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/logout][%d] serviceBrokerAuthLogoutNotFound %s", 404, payload) } func (o *ServiceBrokerAuthLogoutNotFound) GetPayload() *models.Error { @@ -447,11 +458,13 @@ func (o *ServiceBrokerAuthLogoutInternalServerError) Code() int { } func (o *ServiceBrokerAuthLogoutInternalServerError) Error() string { - return fmt.Sprintf("[GET /auth/v1/logout][%d] serviceBrokerAuthLogoutInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/logout][%d] serviceBrokerAuthLogoutInternalServerError %s", 500, payload) } func (o *ServiceBrokerAuthLogoutInternalServerError) String() string { - return fmt.Sprintf("[GET /auth/v1/logout][%d] serviceBrokerAuthLogoutInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/logout][%d] serviceBrokerAuthLogoutInternalServerError %s", 500, payload) } func (o *ServiceBrokerAuthLogoutInternalServerError) GetPayload() *models.Error { diff --git a/power/client/authentication/service_broker_auth_registration_callback_responses.go b/power/client/authentication/service_broker_auth_registration_callback_responses.go index 2833807d..85f55348 100644 --- a/power/client/authentication/service_broker_auth_registration_callback_responses.go +++ b/power/client/authentication/service_broker_auth_registration_callback_responses.go @@ -6,6 +6,7 @@ package authentication // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *ServiceBrokerAuthRegistrationCallbackOK) Code() int { } func (o *ServiceBrokerAuthRegistrationCallbackOK) Error() string { - return fmt.Sprintf("[GET /auth/v1/callback-registration][%d] serviceBrokerAuthRegistrationCallbackOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/callback-registration][%d] serviceBrokerAuthRegistrationCallbackOK %s", 200, payload) } func (o *ServiceBrokerAuthRegistrationCallbackOK) String() string { - return fmt.Sprintf("[GET /auth/v1/callback-registration][%d] serviceBrokerAuthRegistrationCallbackOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/callback-registration][%d] serviceBrokerAuthRegistrationCallbackOK %s", 200, payload) } func (o *ServiceBrokerAuthRegistrationCallbackOK) GetPayload() *models.AccessToken { @@ -177,11 +180,13 @@ func (o *ServiceBrokerAuthRegistrationCallbackBadRequest) Code() int { } func (o *ServiceBrokerAuthRegistrationCallbackBadRequest) Error() string { - return fmt.Sprintf("[GET /auth/v1/callback-registration][%d] serviceBrokerAuthRegistrationCallbackBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/callback-registration][%d] serviceBrokerAuthRegistrationCallbackBadRequest %s", 400, payload) } func (o *ServiceBrokerAuthRegistrationCallbackBadRequest) String() string { - return fmt.Sprintf("[GET /auth/v1/callback-registration][%d] serviceBrokerAuthRegistrationCallbackBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/callback-registration][%d] serviceBrokerAuthRegistrationCallbackBadRequest %s", 400, payload) } func (o *ServiceBrokerAuthRegistrationCallbackBadRequest) GetPayload() *models.Error { @@ -245,11 +250,13 @@ func (o *ServiceBrokerAuthRegistrationCallbackUnauthorized) Code() int { } func (o *ServiceBrokerAuthRegistrationCallbackUnauthorized) Error() string { - return fmt.Sprintf("[GET /auth/v1/callback-registration][%d] serviceBrokerAuthRegistrationCallbackUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/callback-registration][%d] serviceBrokerAuthRegistrationCallbackUnauthorized %s", 401, payload) } func (o *ServiceBrokerAuthRegistrationCallbackUnauthorized) String() string { - return fmt.Sprintf("[GET /auth/v1/callback-registration][%d] serviceBrokerAuthRegistrationCallbackUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/callback-registration][%d] serviceBrokerAuthRegistrationCallbackUnauthorized %s", 401, payload) } func (o *ServiceBrokerAuthRegistrationCallbackUnauthorized) GetPayload() *models.Error { @@ -313,11 +320,13 @@ func (o *ServiceBrokerAuthRegistrationCallbackForbidden) Code() int { } func (o *ServiceBrokerAuthRegistrationCallbackForbidden) Error() string { - return fmt.Sprintf("[GET /auth/v1/callback-registration][%d] serviceBrokerAuthRegistrationCallbackForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/callback-registration][%d] serviceBrokerAuthRegistrationCallbackForbidden %s", 403, payload) } func (o *ServiceBrokerAuthRegistrationCallbackForbidden) String() string { - return fmt.Sprintf("[GET /auth/v1/callback-registration][%d] serviceBrokerAuthRegistrationCallbackForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/callback-registration][%d] serviceBrokerAuthRegistrationCallbackForbidden %s", 403, payload) } func (o *ServiceBrokerAuthRegistrationCallbackForbidden) GetPayload() *models.Error { @@ -381,11 +390,13 @@ func (o *ServiceBrokerAuthRegistrationCallbackNotFound) Code() int { } func (o *ServiceBrokerAuthRegistrationCallbackNotFound) Error() string { - return fmt.Sprintf("[GET /auth/v1/callback-registration][%d] serviceBrokerAuthRegistrationCallbackNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/callback-registration][%d] serviceBrokerAuthRegistrationCallbackNotFound %s", 404, payload) } func (o *ServiceBrokerAuthRegistrationCallbackNotFound) String() string { - return fmt.Sprintf("[GET /auth/v1/callback-registration][%d] serviceBrokerAuthRegistrationCallbackNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/callback-registration][%d] serviceBrokerAuthRegistrationCallbackNotFound %s", 404, payload) } func (o *ServiceBrokerAuthRegistrationCallbackNotFound) GetPayload() *models.Error { @@ -449,11 +460,13 @@ func (o *ServiceBrokerAuthRegistrationCallbackInternalServerError) Code() int { } func (o *ServiceBrokerAuthRegistrationCallbackInternalServerError) Error() string { - return fmt.Sprintf("[GET /auth/v1/callback-registration][%d] serviceBrokerAuthRegistrationCallbackInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/callback-registration][%d] serviceBrokerAuthRegistrationCallbackInternalServerError %s", 500, payload) } func (o *ServiceBrokerAuthRegistrationCallbackInternalServerError) String() string { - return fmt.Sprintf("[GET /auth/v1/callback-registration][%d] serviceBrokerAuthRegistrationCallbackInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/callback-registration][%d] serviceBrokerAuthRegistrationCallbackInternalServerError %s", 500, payload) } func (o *ServiceBrokerAuthRegistrationCallbackInternalServerError) GetPayload() *models.Error { diff --git a/power/client/authentication/service_broker_auth_registration_responses.go b/power/client/authentication/service_broker_auth_registration_responses.go index 48a0f28c..3df3f3f5 100644 --- a/power/client/authentication/service_broker_auth_registration_responses.go +++ b/power/client/authentication/service_broker_auth_registration_responses.go @@ -6,6 +6,7 @@ package authentication // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *ServiceBrokerAuthRegistrationOK) Code() int { } func (o *ServiceBrokerAuthRegistrationOK) Error() string { - return fmt.Sprintf("[GET /auth/v1/registration][%d] serviceBrokerAuthRegistrationOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/registration][%d] serviceBrokerAuthRegistrationOK %s", 200, payload) } func (o *ServiceBrokerAuthRegistrationOK) String() string { - return fmt.Sprintf("[GET /auth/v1/registration][%d] serviceBrokerAuthRegistrationOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/registration][%d] serviceBrokerAuthRegistrationOK %s", 200, payload) } func (o *ServiceBrokerAuthRegistrationOK) GetPayload() *models.AccessToken { @@ -177,11 +180,13 @@ func (o *ServiceBrokerAuthRegistrationBadRequest) Code() int { } func (o *ServiceBrokerAuthRegistrationBadRequest) Error() string { - return fmt.Sprintf("[GET /auth/v1/registration][%d] serviceBrokerAuthRegistrationBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/registration][%d] serviceBrokerAuthRegistrationBadRequest %s", 400, payload) } func (o *ServiceBrokerAuthRegistrationBadRequest) String() string { - return fmt.Sprintf("[GET /auth/v1/registration][%d] serviceBrokerAuthRegistrationBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/registration][%d] serviceBrokerAuthRegistrationBadRequest %s", 400, payload) } func (o *ServiceBrokerAuthRegistrationBadRequest) GetPayload() *models.Error { @@ -245,11 +250,13 @@ func (o *ServiceBrokerAuthRegistrationUnauthorized) Code() int { } func (o *ServiceBrokerAuthRegistrationUnauthorized) Error() string { - return fmt.Sprintf("[GET /auth/v1/registration][%d] serviceBrokerAuthRegistrationUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/registration][%d] serviceBrokerAuthRegistrationUnauthorized %s", 401, payload) } func (o *ServiceBrokerAuthRegistrationUnauthorized) String() string { - return fmt.Sprintf("[GET /auth/v1/registration][%d] serviceBrokerAuthRegistrationUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/registration][%d] serviceBrokerAuthRegistrationUnauthorized %s", 401, payload) } func (o *ServiceBrokerAuthRegistrationUnauthorized) GetPayload() *models.Error { @@ -313,11 +320,13 @@ func (o *ServiceBrokerAuthRegistrationForbidden) Code() int { } func (o *ServiceBrokerAuthRegistrationForbidden) Error() string { - return fmt.Sprintf("[GET /auth/v1/registration][%d] serviceBrokerAuthRegistrationForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/registration][%d] serviceBrokerAuthRegistrationForbidden %s", 403, payload) } func (o *ServiceBrokerAuthRegistrationForbidden) String() string { - return fmt.Sprintf("[GET /auth/v1/registration][%d] serviceBrokerAuthRegistrationForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/registration][%d] serviceBrokerAuthRegistrationForbidden %s", 403, payload) } func (o *ServiceBrokerAuthRegistrationForbidden) GetPayload() *models.Error { @@ -381,11 +390,13 @@ func (o *ServiceBrokerAuthRegistrationNotFound) Code() int { } func (o *ServiceBrokerAuthRegistrationNotFound) Error() string { - return fmt.Sprintf("[GET /auth/v1/registration][%d] serviceBrokerAuthRegistrationNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/registration][%d] serviceBrokerAuthRegistrationNotFound %s", 404, payload) } func (o *ServiceBrokerAuthRegistrationNotFound) String() string { - return fmt.Sprintf("[GET /auth/v1/registration][%d] serviceBrokerAuthRegistrationNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/registration][%d] serviceBrokerAuthRegistrationNotFound %s", 404, payload) } func (o *ServiceBrokerAuthRegistrationNotFound) GetPayload() *models.Error { @@ -449,11 +460,13 @@ func (o *ServiceBrokerAuthRegistrationInternalServerError) Code() int { } func (o *ServiceBrokerAuthRegistrationInternalServerError) Error() string { - return fmt.Sprintf("[GET /auth/v1/registration][%d] serviceBrokerAuthRegistrationInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/registration][%d] serviceBrokerAuthRegistrationInternalServerError %s", 500, payload) } func (o *ServiceBrokerAuthRegistrationInternalServerError) String() string { - return fmt.Sprintf("[GET /auth/v1/registration][%d] serviceBrokerAuthRegistrationInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /auth/v1/registration][%d] serviceBrokerAuthRegistrationInternalServerError %s", 500, payload) } func (o *ServiceBrokerAuthRegistrationInternalServerError) GetPayload() *models.Error { diff --git a/power/client/authentication/service_broker_auth_token_post_responses.go b/power/client/authentication/service_broker_auth_token_post_responses.go index dd493095..cc218ffb 100644 --- a/power/client/authentication/service_broker_auth_token_post_responses.go +++ b/power/client/authentication/service_broker_auth_token_post_responses.go @@ -6,6 +6,7 @@ package authentication // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *ServiceBrokerAuthTokenPostOK) Code() int { } func (o *ServiceBrokerAuthTokenPostOK) Error() string { - return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostOK %s", 200, payload) } func (o *ServiceBrokerAuthTokenPostOK) String() string { - return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostOK %s", 200, payload) } func (o *ServiceBrokerAuthTokenPostOK) GetPayload() *models.Token { @@ -183,11 +186,13 @@ func (o *ServiceBrokerAuthTokenPostBadRequest) Code() int { } func (o *ServiceBrokerAuthTokenPostBadRequest) Error() string { - return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostBadRequest %s", 400, payload) } func (o *ServiceBrokerAuthTokenPostBadRequest) String() string { - return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostBadRequest %s", 400, payload) } func (o *ServiceBrokerAuthTokenPostBadRequest) GetPayload() *models.Error { @@ -251,11 +256,13 @@ func (o *ServiceBrokerAuthTokenPostUnauthorized) Code() int { } func (o *ServiceBrokerAuthTokenPostUnauthorized) Error() string { - return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostUnauthorized %s", 401, payload) } func (o *ServiceBrokerAuthTokenPostUnauthorized) String() string { - return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostUnauthorized %s", 401, payload) } func (o *ServiceBrokerAuthTokenPostUnauthorized) GetPayload() *models.Error { @@ -319,11 +326,13 @@ func (o *ServiceBrokerAuthTokenPostForbidden) Code() int { } func (o *ServiceBrokerAuthTokenPostForbidden) Error() string { - return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostForbidden %s", 403, payload) } func (o *ServiceBrokerAuthTokenPostForbidden) String() string { - return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostForbidden %s", 403, payload) } func (o *ServiceBrokerAuthTokenPostForbidden) GetPayload() *models.Error { @@ -387,11 +396,13 @@ func (o *ServiceBrokerAuthTokenPostNotFound) Code() int { } func (o *ServiceBrokerAuthTokenPostNotFound) Error() string { - return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostNotFound %s", 404, payload) } func (o *ServiceBrokerAuthTokenPostNotFound) String() string { - return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostNotFound %s", 404, payload) } func (o *ServiceBrokerAuthTokenPostNotFound) GetPayload() *models.Error { @@ -455,11 +466,13 @@ func (o *ServiceBrokerAuthTokenPostTooManyRequests) Code() int { } func (o *ServiceBrokerAuthTokenPostTooManyRequests) Error() string { - return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostTooManyRequests %+v", 429, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostTooManyRequests %s", 429, payload) } func (o *ServiceBrokerAuthTokenPostTooManyRequests) String() string { - return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostTooManyRequests %+v", 429, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostTooManyRequests %s", 429, payload) } func (o *ServiceBrokerAuthTokenPostTooManyRequests) GetPayload() *models.Error { @@ -523,11 +536,13 @@ func (o *ServiceBrokerAuthTokenPostInternalServerError) Code() int { } func (o *ServiceBrokerAuthTokenPostInternalServerError) Error() string { - return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostInternalServerError %s", 500, payload) } func (o *ServiceBrokerAuthTokenPostInternalServerError) String() string { - return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /auth/v1/token][%d] serviceBrokerAuthTokenPostInternalServerError %s", 500, payload) } func (o *ServiceBrokerAuthTokenPostInternalServerError) GetPayload() *models.Error { 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 index 27f9fd56..b77f3a34 100644 --- a/power/client/bluemix_service_instances/bluemix_service_instance_get_responses.go +++ b/power/client/bluemix_service_instances/bluemix_service_instance_get_responses.go @@ -6,6 +6,7 @@ package bluemix_service_instances // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -103,11 +104,13 @@ func (o *BluemixServiceInstanceGetOK) Code() int { } func (o *BluemixServiceInstanceGetOK) Error() string { - return fmt.Sprintf("[GET /bluemix_v1/service_instances/{instance_id}][%d] bluemixServiceInstanceGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /bluemix_v1/service_instances/{instance_id}][%d] bluemixServiceInstanceGetOK %+v", 200, o.Payload) + 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 { @@ -171,11 +174,13 @@ func (o *BluemixServiceInstanceGetBadRequest) Code() int { } func (o *BluemixServiceInstanceGetBadRequest) Error() string { - return fmt.Sprintf("[GET /bluemix_v1/service_instances/{instance_id}][%d] bluemixServiceInstanceGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /bluemix_v1/service_instances/{instance_id}][%d] bluemixServiceInstanceGetBadRequest %+v", 400, o.Payload) + 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 { @@ -239,11 +244,13 @@ func (o *BluemixServiceInstanceGetUnauthorized) Code() int { } func (o *BluemixServiceInstanceGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /bluemix_v1/service_instances/{instance_id}][%d] bluemixServiceInstanceGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /bluemix_v1/service_instances/{instance_id}][%d] bluemixServiceInstanceGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -307,11 +314,13 @@ func (o *BluemixServiceInstanceGetForbidden) Code() int { } func (o *BluemixServiceInstanceGetForbidden) Error() string { - return fmt.Sprintf("[GET /bluemix_v1/service_instances/{instance_id}][%d] bluemixServiceInstanceGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /bluemix_v1/service_instances/{instance_id}][%d] bluemixServiceInstanceGetForbidden %+v", 403, o.Payload) + 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 { @@ -375,11 +384,13 @@ func (o *BluemixServiceInstanceGetNotFound) Code() int { } func (o *BluemixServiceInstanceGetNotFound) Error() string { - return fmt.Sprintf("[GET /bluemix_v1/service_instances/{instance_id}][%d] bluemixServiceInstanceGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /bluemix_v1/service_instances/{instance_id}][%d] bluemixServiceInstanceGetNotFound %+v", 404, o.Payload) + 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 { 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 index 1145f9fd..e930240a 100644 --- a/power/client/bluemix_service_instances/bluemix_service_instance_put_responses.go +++ b/power/client/bluemix_service_instances/bluemix_service_instance_put_responses.go @@ -6,6 +6,7 @@ package bluemix_service_instances // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -103,11 +104,13 @@ func (o *BluemixServiceInstancePutOK) Code() int { } func (o *BluemixServiceInstancePutOK) Error() string { - return fmt.Sprintf("[PUT /bluemix_v1/service_instances/{instance_id}][%d] bluemixServiceInstancePutOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[PUT /bluemix_v1/service_instances/{instance_id}][%d] bluemixServiceInstancePutOK %+v", 200, o.Payload) + 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 { @@ -171,11 +174,13 @@ func (o *BluemixServiceInstancePutBadRequest) Code() int { } func (o *BluemixServiceInstancePutBadRequest) Error() string { - return fmt.Sprintf("[PUT /bluemix_v1/service_instances/{instance_id}][%d] bluemixServiceInstancePutBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[PUT /bluemix_v1/service_instances/{instance_id}][%d] bluemixServiceInstancePutBadRequest %+v", 400, o.Payload) + 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 { @@ -239,11 +244,13 @@ func (o *BluemixServiceInstancePutUnauthorized) Code() int { } func (o *BluemixServiceInstancePutUnauthorized) Error() string { - return fmt.Sprintf("[PUT /bluemix_v1/service_instances/{instance_id}][%d] bluemixServiceInstancePutUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[PUT /bluemix_v1/service_instances/{instance_id}][%d] bluemixServiceInstancePutUnauthorized %+v", 401, o.Payload) + 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 { @@ -307,11 +314,13 @@ func (o *BluemixServiceInstancePutForbidden) Code() int { } func (o *BluemixServiceInstancePutForbidden) Error() string { - return fmt.Sprintf("[PUT /bluemix_v1/service_instances/{instance_id}][%d] bluemixServiceInstancePutForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[PUT /bluemix_v1/service_instances/{instance_id}][%d] bluemixServiceInstancePutForbidden %+v", 403, o.Payload) + 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 { @@ -375,11 +384,13 @@ func (o *BluemixServiceInstancePutNotFound) Code() int { } func (o *BluemixServiceInstancePutNotFound) Error() string { - return fmt.Sprintf("[PUT /bluemix_v1/service_instances/{instance_id}][%d] bluemixServiceInstancePutNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[PUT /bluemix_v1/service_instances/{instance_id}][%d] bluemixServiceInstancePutNotFound %+v", 404, o.Payload) + 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 { diff --git a/power/client/bluemix_service_instances/bluemix_service_instances_client.go b/power/client/bluemix_service_instances/bluemix_service_instances_client.go index 76f2c993..e6ac7174 100644 --- a/power/client/bluemix_service_instances/bluemix_service_instances_client.go +++ b/power/client/bluemix_service_instances/bluemix_service_instances_client.go @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi 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 */ @@ -25,7 +51,7 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods diff --git a/power/client/catalog/catalog_client.go b/power/client/catalog/catalog_client.go index 0641b3b1..dc74d0ae 100644 --- a/power/client/catalog/catalog_client.go +++ b/power/client/catalog/catalog_client.go @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi 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 */ @@ -25,7 +51,7 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods diff --git a/power/client/catalog/catalog_get_responses.go b/power/client/catalog/catalog_get_responses.go index f5845626..cb56dfa5 100644 --- a/power/client/catalog/catalog_get_responses.go +++ b/power/client/catalog/catalog_get_responses.go @@ -6,6 +6,7 @@ package catalog // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -103,11 +104,13 @@ func (o *CatalogGetOK) Code() int { } func (o *CatalogGetOK) Error() string { - return fmt.Sprintf("[GET /v2/catalog][%d] catalogGetOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v2/catalog][%d] catalogGetOK %s", 200, payload) } func (o *CatalogGetOK) String() string { - return fmt.Sprintf("[GET /v2/catalog][%d] catalogGetOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v2/catalog][%d] catalogGetOK %s", 200, payload) } func (o *CatalogGetOK) GetPayload() *models.Catalog { @@ -171,11 +174,13 @@ func (o *CatalogGetBadRequest) Code() int { } func (o *CatalogGetBadRequest) Error() string { - return fmt.Sprintf("[GET /v2/catalog][%d] catalogGetBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v2/catalog][%d] catalogGetBadRequest %s", 400, payload) } func (o *CatalogGetBadRequest) String() string { - return fmt.Sprintf("[GET /v2/catalog][%d] catalogGetBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v2/catalog][%d] catalogGetBadRequest %s", 400, payload) } func (o *CatalogGetBadRequest) GetPayload() *models.Error { @@ -239,11 +244,13 @@ func (o *CatalogGetUnauthorized) Code() int { } func (o *CatalogGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /v2/catalog][%d] catalogGetUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v2/catalog][%d] catalogGetUnauthorized %s", 401, payload) } func (o *CatalogGetUnauthorized) String() string { - return fmt.Sprintf("[GET /v2/catalog][%d] catalogGetUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v2/catalog][%d] catalogGetUnauthorized %s", 401, payload) } func (o *CatalogGetUnauthorized) GetPayload() *models.Error { @@ -307,11 +314,13 @@ func (o *CatalogGetForbidden) Code() int { } func (o *CatalogGetForbidden) Error() string { - return fmt.Sprintf("[GET /v2/catalog][%d] catalogGetForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v2/catalog][%d] catalogGetForbidden %s", 403, payload) } func (o *CatalogGetForbidden) String() string { - return fmt.Sprintf("[GET /v2/catalog][%d] catalogGetForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v2/catalog][%d] catalogGetForbidden %s", 403, payload) } func (o *CatalogGetForbidden) GetPayload() *models.Error { @@ -375,11 +384,13 @@ func (o *CatalogGetNotFound) Code() int { } func (o *CatalogGetNotFound) Error() string { - return fmt.Sprintf("[GET /v2/catalog][%d] catalogGetNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v2/catalog][%d] catalogGetNotFound %s", 404, payload) } func (o *CatalogGetNotFound) String() string { - return fmt.Sprintf("[GET /v2/catalog][%d] catalogGetNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v2/catalog][%d] catalogGetNotFound %s", 404, payload) } func (o *CatalogGetNotFound) GetPayload() *models.Error { diff --git a/power/client/datacenters/datacenters_client.go b/power/client/datacenters/datacenters_client.go index 4bde6516..9f9e449a 100644 --- a/power/client/datacenters/datacenters_client.go +++ b/power/client/datacenters/datacenters_client.go @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi 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 */ @@ -25,7 +51,7 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods diff --git a/power/client/datacenters/v1_datacenters_get_responses.go b/power/client/datacenters/v1_datacenters_get_responses.go index 2cc84f2e..8ddd956d 100644 --- a/power/client/datacenters/v1_datacenters_get_responses.go +++ b/power/client/datacenters/v1_datacenters_get_responses.go @@ -6,6 +6,7 @@ package datacenters // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -103,11 +104,13 @@ func (o *V1DatacentersGetOK) Code() int { } func (o *V1DatacentersGetOK) Error() string { - return fmt.Sprintf("[GET /v1/datacenters/{datacenter_region}][%d] v1DatacentersGetOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/datacenters/{datacenter_region}][%d] v1DatacentersGetOK %s", 200, payload) } func (o *V1DatacentersGetOK) String() string { - return fmt.Sprintf("[GET /v1/datacenters/{datacenter_region}][%d] v1DatacentersGetOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/datacenters/{datacenter_region}][%d] v1DatacentersGetOK %s", 200, payload) } func (o *V1DatacentersGetOK) GetPayload() *models.Datacenter { @@ -171,11 +174,13 @@ func (o *V1DatacentersGetBadRequest) Code() int { } func (o *V1DatacentersGetBadRequest) Error() string { - return fmt.Sprintf("[GET /v1/datacenters/{datacenter_region}][%d] v1DatacentersGetBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/datacenters/{datacenter_region}][%d] v1DatacentersGetBadRequest %s", 400, payload) } func (o *V1DatacentersGetBadRequest) String() string { - return fmt.Sprintf("[GET /v1/datacenters/{datacenter_region}][%d] v1DatacentersGetBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/datacenters/{datacenter_region}][%d] v1DatacentersGetBadRequest %s", 400, payload) } func (o *V1DatacentersGetBadRequest) GetPayload() *models.Error { @@ -239,11 +244,13 @@ func (o *V1DatacentersGetUnauthorized) Code() int { } func (o *V1DatacentersGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /v1/datacenters/{datacenter_region}][%d] v1DatacentersGetUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/datacenters/{datacenter_region}][%d] v1DatacentersGetUnauthorized %s", 401, payload) } func (o *V1DatacentersGetUnauthorized) String() string { - return fmt.Sprintf("[GET /v1/datacenters/{datacenter_region}][%d] v1DatacentersGetUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/datacenters/{datacenter_region}][%d] v1DatacentersGetUnauthorized %s", 401, payload) } func (o *V1DatacentersGetUnauthorized) GetPayload() *models.Error { @@ -307,11 +314,13 @@ func (o *V1DatacentersGetForbidden) Code() int { } func (o *V1DatacentersGetForbidden) Error() string { - return fmt.Sprintf("[GET /v1/datacenters/{datacenter_region}][%d] v1DatacentersGetForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/datacenters/{datacenter_region}][%d] v1DatacentersGetForbidden %s", 403, payload) } func (o *V1DatacentersGetForbidden) String() string { - return fmt.Sprintf("[GET /v1/datacenters/{datacenter_region}][%d] v1DatacentersGetForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/datacenters/{datacenter_region}][%d] v1DatacentersGetForbidden %s", 403, payload) } func (o *V1DatacentersGetForbidden) GetPayload() *models.Error { @@ -375,11 +384,13 @@ func (o *V1DatacentersGetInternalServerError) Code() int { } func (o *V1DatacentersGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /v1/datacenters/{datacenter_region}][%d] v1DatacentersGetInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/datacenters/{datacenter_region}][%d] v1DatacentersGetInternalServerError %s", 500, payload) } func (o *V1DatacentersGetInternalServerError) String() string { - return fmt.Sprintf("[GET /v1/datacenters/{datacenter_region}][%d] v1DatacentersGetInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/datacenters/{datacenter_region}][%d] v1DatacentersGetInternalServerError %s", 500, payload) } func (o *V1DatacentersGetInternalServerError) GetPayload() *models.Error { diff --git a/power/client/datacenters/v1_datacenters_getall_responses.go b/power/client/datacenters/v1_datacenters_getall_responses.go index 3bcf1f10..a088af4d 100644 --- a/power/client/datacenters/v1_datacenters_getall_responses.go +++ b/power/client/datacenters/v1_datacenters_getall_responses.go @@ -6,6 +6,7 @@ package datacenters // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -103,11 +104,13 @@ func (o *V1DatacentersGetallOK) Code() int { } func (o *V1DatacentersGetallOK) Error() string { - return fmt.Sprintf("[GET /v1/datacenters][%d] v1DatacentersGetallOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/datacenters][%d] v1DatacentersGetallOK %s", 200, payload) } func (o *V1DatacentersGetallOK) String() string { - return fmt.Sprintf("[GET /v1/datacenters][%d] v1DatacentersGetallOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/datacenters][%d] v1DatacentersGetallOK %s", 200, payload) } func (o *V1DatacentersGetallOK) GetPayload() *models.Datacenters { @@ -171,11 +174,13 @@ func (o *V1DatacentersGetallBadRequest) Code() int { } func (o *V1DatacentersGetallBadRequest) Error() string { - return fmt.Sprintf("[GET /v1/datacenters][%d] v1DatacentersGetallBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/datacenters][%d] v1DatacentersGetallBadRequest %s", 400, payload) } func (o *V1DatacentersGetallBadRequest) String() string { - return fmt.Sprintf("[GET /v1/datacenters][%d] v1DatacentersGetallBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/datacenters][%d] v1DatacentersGetallBadRequest %s", 400, payload) } func (o *V1DatacentersGetallBadRequest) GetPayload() *models.Error { @@ -239,11 +244,13 @@ func (o *V1DatacentersGetallUnauthorized) Code() int { } func (o *V1DatacentersGetallUnauthorized) Error() string { - return fmt.Sprintf("[GET /v1/datacenters][%d] v1DatacentersGetallUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/datacenters][%d] v1DatacentersGetallUnauthorized %s", 401, payload) } func (o *V1DatacentersGetallUnauthorized) String() string { - return fmt.Sprintf("[GET /v1/datacenters][%d] v1DatacentersGetallUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/datacenters][%d] v1DatacentersGetallUnauthorized %s", 401, payload) } func (o *V1DatacentersGetallUnauthorized) GetPayload() *models.Error { @@ -307,11 +314,13 @@ func (o *V1DatacentersGetallForbidden) Code() int { } func (o *V1DatacentersGetallForbidden) Error() string { - return fmt.Sprintf("[GET /v1/datacenters][%d] v1DatacentersGetallForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/datacenters][%d] v1DatacentersGetallForbidden %s", 403, payload) } func (o *V1DatacentersGetallForbidden) String() string { - return fmt.Sprintf("[GET /v1/datacenters][%d] v1DatacentersGetallForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/datacenters][%d] v1DatacentersGetallForbidden %s", 403, payload) } func (o *V1DatacentersGetallForbidden) GetPayload() *models.Error { @@ -375,11 +384,13 @@ func (o *V1DatacentersGetallInternalServerError) Code() int { } func (o *V1DatacentersGetallInternalServerError) Error() string { - return fmt.Sprintf("[GET /v1/datacenters][%d] v1DatacentersGetallInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/datacenters][%d] v1DatacentersGetallInternalServerError %s", 500, payload) } func (o *V1DatacentersGetallInternalServerError) String() string { - return fmt.Sprintf("[GET /v1/datacenters][%d] v1DatacentersGetallInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/datacenters][%d] v1DatacentersGetallInternalServerError %s", 500, payload) } func (o *V1DatacentersGetallInternalServerError) GetPayload() *models.Error { diff --git a/power/client/hardware_platforms/hardware_platforms_client.go b/power/client/hardware_platforms/hardware_platforms_client.go index 89412a25..893c2aa4 100644 --- a/power/client/hardware_platforms/hardware_platforms_client.go +++ b/power/client/hardware_platforms/hardware_platforms_client.go @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi 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 */ @@ -25,7 +51,7 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods diff --git a/power/client/hardware_platforms/service_broker_hardwareplatforms_get_responses.go b/power/client/hardware_platforms/service_broker_hardwareplatforms_get_responses.go index d9573a44..a269f65f 100644 --- a/power/client/hardware_platforms/service_broker_hardwareplatforms_get_responses.go +++ b/power/client/hardware_platforms/service_broker_hardwareplatforms_get_responses.go @@ -6,6 +6,7 @@ package hardware_platforms // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *ServiceBrokerHardwareplatformsGetOK) Code() int { } func (o *ServiceBrokerHardwareplatformsGetOK) Error() string { - return fmt.Sprintf("[GET /broker/v1/hardware-platforms][%d] serviceBrokerHardwareplatformsGetOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/hardware-platforms][%d] serviceBrokerHardwareplatformsGetOK %s", 200, payload) } func (o *ServiceBrokerHardwareplatformsGetOK) String() string { - return fmt.Sprintf("[GET /broker/v1/hardware-platforms][%d] serviceBrokerHardwareplatformsGetOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/hardware-platforms][%d] serviceBrokerHardwareplatformsGetOK %s", 200, payload) } func (o *ServiceBrokerHardwareplatformsGetOK) GetPayload() models.HardwarePlatforms { @@ -175,11 +178,13 @@ func (o *ServiceBrokerHardwareplatformsGetBadRequest) Code() int { } func (o *ServiceBrokerHardwareplatformsGetBadRequest) Error() string { - return fmt.Sprintf("[GET /broker/v1/hardware-platforms][%d] serviceBrokerHardwareplatformsGetBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/hardware-platforms][%d] serviceBrokerHardwareplatformsGetBadRequest %s", 400, payload) } func (o *ServiceBrokerHardwareplatformsGetBadRequest) String() string { - return fmt.Sprintf("[GET /broker/v1/hardware-platforms][%d] serviceBrokerHardwareplatformsGetBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/hardware-platforms][%d] serviceBrokerHardwareplatformsGetBadRequest %s", 400, payload) } func (o *ServiceBrokerHardwareplatformsGetBadRequest) GetPayload() *models.Error { @@ -243,11 +248,13 @@ func (o *ServiceBrokerHardwareplatformsGetUnauthorized) Code() int { } func (o *ServiceBrokerHardwareplatformsGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /broker/v1/hardware-platforms][%d] serviceBrokerHardwareplatformsGetUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/hardware-platforms][%d] serviceBrokerHardwareplatformsGetUnauthorized %s", 401, payload) } func (o *ServiceBrokerHardwareplatformsGetUnauthorized) String() string { - return fmt.Sprintf("[GET /broker/v1/hardware-platforms][%d] serviceBrokerHardwareplatformsGetUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/hardware-platforms][%d] serviceBrokerHardwareplatformsGetUnauthorized %s", 401, payload) } func (o *ServiceBrokerHardwareplatformsGetUnauthorized) GetPayload() *models.Error { @@ -311,11 +318,13 @@ func (o *ServiceBrokerHardwareplatformsGetForbidden) Code() int { } func (o *ServiceBrokerHardwareplatformsGetForbidden) Error() string { - return fmt.Sprintf("[GET /broker/v1/hardware-platforms][%d] serviceBrokerHardwareplatformsGetForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/hardware-platforms][%d] serviceBrokerHardwareplatformsGetForbidden %s", 403, payload) } func (o *ServiceBrokerHardwareplatformsGetForbidden) String() string { - return fmt.Sprintf("[GET /broker/v1/hardware-platforms][%d] serviceBrokerHardwareplatformsGetForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/hardware-platforms][%d] serviceBrokerHardwareplatformsGetForbidden %s", 403, payload) } func (o *ServiceBrokerHardwareplatformsGetForbidden) GetPayload() *models.Error { @@ -379,11 +388,13 @@ func (o *ServiceBrokerHardwareplatformsGetNotFound) Code() int { } func (o *ServiceBrokerHardwareplatformsGetNotFound) Error() string { - return fmt.Sprintf("[GET /broker/v1/hardware-platforms][%d] serviceBrokerHardwareplatformsGetNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/hardware-platforms][%d] serviceBrokerHardwareplatformsGetNotFound %s", 404, payload) } func (o *ServiceBrokerHardwareplatformsGetNotFound) String() string { - return fmt.Sprintf("[GET /broker/v1/hardware-platforms][%d] serviceBrokerHardwareplatformsGetNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/hardware-platforms][%d] serviceBrokerHardwareplatformsGetNotFound %s", 404, payload) } func (o *ServiceBrokerHardwareplatformsGetNotFound) GetPayload() *models.Error { @@ -447,11 +458,13 @@ func (o *ServiceBrokerHardwareplatformsGetInternalServerError) Code() int { } func (o *ServiceBrokerHardwareplatformsGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /broker/v1/hardware-platforms][%d] serviceBrokerHardwareplatformsGetInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/hardware-platforms][%d] serviceBrokerHardwareplatformsGetInternalServerError %s", 500, payload) } func (o *ServiceBrokerHardwareplatformsGetInternalServerError) String() string { - return fmt.Sprintf("[GET /broker/v1/hardware-platforms][%d] serviceBrokerHardwareplatformsGetInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/hardware-platforms][%d] serviceBrokerHardwareplatformsGetInternalServerError %s", 500, payload) } func (o *ServiceBrokerHardwareplatformsGetInternalServerError) GetPayload() *models.Error { diff --git a/power/client/host_groups/host_groups_client.go b/power/client/host_groups/host_groups_client.go index 9ccc05d1..e7fd62b2 100644 --- a/power/client/host_groups/host_groups_client.go +++ b/power/client/host_groups/host_groups_client.go @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi 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 */ @@ -25,7 +51,7 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods diff --git a/power/client/host_groups/v1_available_hosts_responses.go b/power/client/host_groups/v1_available_hosts_responses.go index 8ef00909..eee83893 100644 --- a/power/client/host_groups/v1_available_hosts_responses.go +++ b/power/client/host_groups/v1_available_hosts_responses.go @@ -6,6 +6,7 @@ package host_groups // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *V1AvailableHostsOK) Code() int { } func (o *V1AvailableHostsOK) Error() string { - return fmt.Sprintf("[GET /v1/available-hosts][%d] v1AvailableHostsOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/available-hosts][%d] v1AvailableHostsOK %s", 200, payload) } func (o *V1AvailableHostsOK) String() string { - return fmt.Sprintf("[GET /v1/available-hosts][%d] v1AvailableHostsOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/available-hosts][%d] v1AvailableHostsOK %s", 200, payload) } func (o *V1AvailableHostsOK) GetPayload() models.AvailableHostList { @@ -175,11 +178,13 @@ func (o *V1AvailableHostsBadRequest) Code() int { } func (o *V1AvailableHostsBadRequest) Error() string { - return fmt.Sprintf("[GET /v1/available-hosts][%d] v1AvailableHostsBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/available-hosts][%d] v1AvailableHostsBadRequest %s", 400, payload) } func (o *V1AvailableHostsBadRequest) String() string { - return fmt.Sprintf("[GET /v1/available-hosts][%d] v1AvailableHostsBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/available-hosts][%d] v1AvailableHostsBadRequest %s", 400, payload) } func (o *V1AvailableHostsBadRequest) GetPayload() *models.Error { @@ -243,11 +248,13 @@ func (o *V1AvailableHostsUnauthorized) Code() int { } func (o *V1AvailableHostsUnauthorized) Error() string { - return fmt.Sprintf("[GET /v1/available-hosts][%d] v1AvailableHostsUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/available-hosts][%d] v1AvailableHostsUnauthorized %s", 401, payload) } func (o *V1AvailableHostsUnauthorized) String() string { - return fmt.Sprintf("[GET /v1/available-hosts][%d] v1AvailableHostsUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/available-hosts][%d] v1AvailableHostsUnauthorized %s", 401, payload) } func (o *V1AvailableHostsUnauthorized) GetPayload() *models.Error { @@ -311,11 +318,13 @@ func (o *V1AvailableHostsForbidden) Code() int { } func (o *V1AvailableHostsForbidden) Error() string { - return fmt.Sprintf("[GET /v1/available-hosts][%d] v1AvailableHostsForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/available-hosts][%d] v1AvailableHostsForbidden %s", 403, payload) } func (o *V1AvailableHostsForbidden) String() string { - return fmt.Sprintf("[GET /v1/available-hosts][%d] v1AvailableHostsForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/available-hosts][%d] v1AvailableHostsForbidden %s", 403, payload) } func (o *V1AvailableHostsForbidden) GetPayload() *models.Error { @@ -379,11 +388,13 @@ func (o *V1AvailableHostsInternalServerError) Code() int { } func (o *V1AvailableHostsInternalServerError) Error() string { - return fmt.Sprintf("[GET /v1/available-hosts][%d] v1AvailableHostsInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/available-hosts][%d] v1AvailableHostsInternalServerError %s", 500, payload) } func (o *V1AvailableHostsInternalServerError) String() string { - return fmt.Sprintf("[GET /v1/available-hosts][%d] v1AvailableHostsInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/available-hosts][%d] v1AvailableHostsInternalServerError %s", 500, payload) } func (o *V1AvailableHostsInternalServerError) GetPayload() *models.Error { @@ -447,11 +458,13 @@ func (o *V1AvailableHostsGatewayTimeout) Code() int { } func (o *V1AvailableHostsGatewayTimeout) Error() string { - return fmt.Sprintf("[GET /v1/available-hosts][%d] v1AvailableHostsGatewayTimeout %+v", 504, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/available-hosts][%d] v1AvailableHostsGatewayTimeout %s", 504, payload) } func (o *V1AvailableHostsGatewayTimeout) String() string { - return fmt.Sprintf("[GET /v1/available-hosts][%d] v1AvailableHostsGatewayTimeout %+v", 504, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/available-hosts][%d] v1AvailableHostsGatewayTimeout %s", 504, payload) } func (o *V1AvailableHostsGatewayTimeout) GetPayload() *models.Error { diff --git a/power/client/host_groups/v1_host_groups_get_responses.go b/power/client/host_groups/v1_host_groups_get_responses.go index 8801484f..e112020b 100644 --- a/power/client/host_groups/v1_host_groups_get_responses.go +++ b/power/client/host_groups/v1_host_groups_get_responses.go @@ -6,6 +6,7 @@ package host_groups // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *V1HostGroupsGetOK) Code() int { } func (o *V1HostGroupsGetOK) Error() string { - return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetOK %s", 200, payload) } func (o *V1HostGroupsGetOK) String() string { - return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetOK %s", 200, payload) } func (o *V1HostGroupsGetOK) GetPayload() models.HostGroupList { @@ -175,11 +178,13 @@ func (o *V1HostGroupsGetBadRequest) Code() int { } func (o *V1HostGroupsGetBadRequest) Error() string { - return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetBadRequest %s", 400, payload) } func (o *V1HostGroupsGetBadRequest) String() string { - return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetBadRequest %s", 400, payload) } func (o *V1HostGroupsGetBadRequest) GetPayload() *models.Error { @@ -243,11 +248,13 @@ func (o *V1HostGroupsGetUnauthorized) Code() int { } func (o *V1HostGroupsGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetUnauthorized %s", 401, payload) } func (o *V1HostGroupsGetUnauthorized) String() string { - return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetUnauthorized %s", 401, payload) } func (o *V1HostGroupsGetUnauthorized) GetPayload() *models.Error { @@ -311,11 +318,13 @@ func (o *V1HostGroupsGetForbidden) Code() int { } func (o *V1HostGroupsGetForbidden) Error() string { - return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetForbidden %s", 403, payload) } func (o *V1HostGroupsGetForbidden) String() string { - return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetForbidden %s", 403, payload) } func (o *V1HostGroupsGetForbidden) GetPayload() *models.Error { @@ -379,11 +388,13 @@ func (o *V1HostGroupsGetInternalServerError) Code() int { } func (o *V1HostGroupsGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetInternalServerError %s", 500, payload) } func (o *V1HostGroupsGetInternalServerError) String() string { - return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetInternalServerError %s", 500, payload) } func (o *V1HostGroupsGetInternalServerError) GetPayload() *models.Error { @@ -447,11 +458,13 @@ func (o *V1HostGroupsGetGatewayTimeout) Code() int { } func (o *V1HostGroupsGetGatewayTimeout) Error() string { - return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetGatewayTimeout %+v", 504, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetGatewayTimeout %s", 504, payload) } func (o *V1HostGroupsGetGatewayTimeout) String() string { - return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetGatewayTimeout %+v", 504, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetGatewayTimeout %s", 504, payload) } func (o *V1HostGroupsGetGatewayTimeout) GetPayload() *models.Error { 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 index 72b372e7..0aa259da 100644 --- a/power/client/host_groups/v1_host_groups_id_get_responses.go +++ b/power/client/host_groups/v1_host_groups_id_get_responses.go @@ -6,6 +6,7 @@ package host_groups // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *V1HostGroupsIDGetOK) Code() int { } func (o *V1HostGroupsIDGetOK) Error() string { - return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetOK %+v", 200, o.Payload) + 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 { @@ -183,11 +186,13 @@ func (o *V1HostGroupsIDGetBadRequest) Code() int { } func (o *V1HostGroupsIDGetBadRequest) Error() string { - return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetBadRequest %+v", 400, o.Payload) + 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 { @@ -251,11 +256,13 @@ func (o *V1HostGroupsIDGetUnauthorized) Code() int { } func (o *V1HostGroupsIDGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -319,11 +326,13 @@ func (o *V1HostGroupsIDGetForbidden) Code() int { } func (o *V1HostGroupsIDGetForbidden) Error() string { - return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetForbidden %+v", 403, o.Payload) + 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 { @@ -387,11 +396,13 @@ func (o *V1HostGroupsIDGetNotFound) Code() int { } func (o *V1HostGroupsIDGetNotFound) Error() string { - return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetNotFound %+v", 404, o.Payload) + 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 { @@ -455,11 +466,13 @@ func (o *V1HostGroupsIDGetInternalServerError) Code() int { } func (o *V1HostGroupsIDGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetInternalServerError %+v", 500, o.Payload) + 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 { @@ -523,11 +536,13 @@ func (o *V1HostGroupsIDGetGatewayTimeout) Code() int { } func (o *V1HostGroupsIDGetGatewayTimeout) Error() string { - return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetGatewayTimeout %+v", 504, o.Payload) + 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 { - return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetGatewayTimeout %+v", 504, o.Payload) + 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 { 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 index 126854de..0afb7f05 100644 --- a/power/client/host_groups/v1_host_groups_id_put_responses.go +++ b/power/client/host_groups/v1_host_groups_id_put_responses.go @@ -6,6 +6,7 @@ package host_groups // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -121,11 +122,13 @@ func (o *V1HostGroupsIDPutOK) Code() int { } func (o *V1HostGroupsIDPutOK) Error() string { - return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutOK %+v", 200, o.Payload) + 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 { @@ -189,11 +192,13 @@ func (o *V1HostGroupsIDPutBadRequest) Code() int { } func (o *V1HostGroupsIDPutBadRequest) Error() string { - return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutBadRequest %+v", 400, o.Payload) + 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 { @@ -257,11 +262,13 @@ func (o *V1HostGroupsIDPutUnauthorized) Code() int { } func (o *V1HostGroupsIDPutUnauthorized) Error() string { - return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutUnauthorized %+v", 401, o.Payload) + 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 { @@ -325,11 +332,13 @@ func (o *V1HostGroupsIDPutForbidden) Code() int { } func (o *V1HostGroupsIDPutForbidden) Error() string { - return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutForbidden %+v", 403, o.Payload) + 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 { @@ -393,11 +402,13 @@ func (o *V1HostGroupsIDPutNotFound) Code() int { } func (o *V1HostGroupsIDPutNotFound) Error() string { - return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutNotFound %+v", 404, o.Payload) + 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 { @@ -461,11 +472,13 @@ func (o *V1HostGroupsIDPutConflict) Code() int { } func (o *V1HostGroupsIDPutConflict) Error() string { - return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutConflict %+v", 409, o.Payload) + 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 { @@ -529,11 +542,13 @@ func (o *V1HostGroupsIDPutInternalServerError) Code() int { } func (o *V1HostGroupsIDPutInternalServerError) Error() string { - return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutInternalServerError %+v", 500, o.Payload) + 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 { @@ -597,11 +612,13 @@ func (o *V1HostGroupsIDPutGatewayTimeout) Code() int { } func (o *V1HostGroupsIDPutGatewayTimeout) Error() string { - return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutGatewayTimeout %+v", 504, o.Payload) + 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 { - return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutGatewayTimeout %+v", 504, o.Payload) + 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 { diff --git a/power/client/host_groups/v1_host_groups_post_responses.go b/power/client/host_groups/v1_host_groups_post_responses.go index 18415773..f20ccba9 100644 --- a/power/client/host_groups/v1_host_groups_post_responses.go +++ b/power/client/host_groups/v1_host_groups_post_responses.go @@ -6,6 +6,7 @@ package host_groups // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -121,11 +122,13 @@ func (o *V1HostGroupsPostCreated) Code() int { } func (o *V1HostGroupsPostCreated) Error() string { - return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostCreated %+v", 201, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostCreated %s", 201, payload) } func (o *V1HostGroupsPostCreated) String() string { - return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostCreated %+v", 201, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostCreated %s", 201, payload) } func (o *V1HostGroupsPostCreated) GetPayload() *models.HostGroup { @@ -189,11 +192,13 @@ func (o *V1HostGroupsPostBadRequest) Code() int { } func (o *V1HostGroupsPostBadRequest) Error() string { - return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostBadRequest %s", 400, payload) } func (o *V1HostGroupsPostBadRequest) String() string { - return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostBadRequest %s", 400, payload) } func (o *V1HostGroupsPostBadRequest) GetPayload() *models.Error { @@ -257,11 +262,13 @@ func (o *V1HostGroupsPostUnauthorized) Code() int { } func (o *V1HostGroupsPostUnauthorized) Error() string { - return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostUnauthorized %s", 401, payload) } func (o *V1HostGroupsPostUnauthorized) String() string { - return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostUnauthorized %s", 401, payload) } func (o *V1HostGroupsPostUnauthorized) GetPayload() *models.Error { @@ -325,11 +332,13 @@ func (o *V1HostGroupsPostForbidden) Code() int { } func (o *V1HostGroupsPostForbidden) Error() string { - return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostForbidden %s", 403, payload) } func (o *V1HostGroupsPostForbidden) String() string { - return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostForbidden %s", 403, payload) } func (o *V1HostGroupsPostForbidden) GetPayload() *models.Error { @@ -393,11 +402,13 @@ func (o *V1HostGroupsPostConflict) Code() int { } func (o *V1HostGroupsPostConflict) Error() string { - return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostConflict %+v", 409, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostConflict %s", 409, payload) } func (o *V1HostGroupsPostConflict) String() string { - return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostConflict %+v", 409, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostConflict %s", 409, payload) } func (o *V1HostGroupsPostConflict) GetPayload() *models.Error { @@ -461,11 +472,13 @@ func (o *V1HostGroupsPostUnprocessableEntity) Code() int { } func (o *V1HostGroupsPostUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostUnprocessableEntity %+v", 422, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostUnprocessableEntity %s", 422, payload) } func (o *V1HostGroupsPostUnprocessableEntity) String() string { - return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostUnprocessableEntity %+v", 422, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostUnprocessableEntity %s", 422, payload) } func (o *V1HostGroupsPostUnprocessableEntity) GetPayload() *models.Error { @@ -529,11 +542,13 @@ func (o *V1HostGroupsPostInternalServerError) Code() int { } func (o *V1HostGroupsPostInternalServerError) Error() string { - return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostInternalServerError %s", 500, payload) } func (o *V1HostGroupsPostInternalServerError) String() string { - return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostInternalServerError %s", 500, payload) } func (o *V1HostGroupsPostInternalServerError) GetPayload() *models.Error { @@ -597,11 +612,13 @@ func (o *V1HostGroupsPostGatewayTimeout) Code() int { } func (o *V1HostGroupsPostGatewayTimeout) Error() string { - return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostGatewayTimeout %+v", 504, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostGatewayTimeout %s", 504, payload) } func (o *V1HostGroupsPostGatewayTimeout) String() string { - return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostGatewayTimeout %+v", 504, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostGatewayTimeout %s", 504, payload) } func (o *V1HostGroupsPostGatewayTimeout) GetPayload() *models.Error { diff --git a/power/client/host_groups/v1_hosts_get_responses.go b/power/client/host_groups/v1_hosts_get_responses.go index ba907c0d..632109b8 100644 --- a/power/client/host_groups/v1_hosts_get_responses.go +++ b/power/client/host_groups/v1_hosts_get_responses.go @@ -6,6 +6,7 @@ package host_groups // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *V1HostsGetOK) Code() int { } func (o *V1HostsGetOK) Error() string { - return fmt.Sprintf("[GET /v1/hosts][%d] v1HostsGetOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/hosts][%d] v1HostsGetOK %s", 200, payload) } func (o *V1HostsGetOK) String() string { - return fmt.Sprintf("[GET /v1/hosts][%d] v1HostsGetOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/hosts][%d] v1HostsGetOK %s", 200, payload) } func (o *V1HostsGetOK) GetPayload() models.HostList { @@ -175,11 +178,13 @@ func (o *V1HostsGetBadRequest) Code() int { } func (o *V1HostsGetBadRequest) Error() string { - return fmt.Sprintf("[GET /v1/hosts][%d] v1HostsGetBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/hosts][%d] v1HostsGetBadRequest %s", 400, payload) } func (o *V1HostsGetBadRequest) String() string { - return fmt.Sprintf("[GET /v1/hosts][%d] v1HostsGetBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/hosts][%d] v1HostsGetBadRequest %s", 400, payload) } func (o *V1HostsGetBadRequest) GetPayload() *models.Error { @@ -243,11 +248,13 @@ func (o *V1HostsGetUnauthorized) Code() int { } func (o *V1HostsGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /v1/hosts][%d] v1HostsGetUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/hosts][%d] v1HostsGetUnauthorized %s", 401, payload) } func (o *V1HostsGetUnauthorized) String() string { - return fmt.Sprintf("[GET /v1/hosts][%d] v1HostsGetUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/hosts][%d] v1HostsGetUnauthorized %s", 401, payload) } func (o *V1HostsGetUnauthorized) GetPayload() *models.Error { @@ -311,11 +318,13 @@ func (o *V1HostsGetForbidden) Code() int { } func (o *V1HostsGetForbidden) Error() string { - return fmt.Sprintf("[GET /v1/hosts][%d] v1HostsGetForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/hosts][%d] v1HostsGetForbidden %s", 403, payload) } func (o *V1HostsGetForbidden) String() string { - return fmt.Sprintf("[GET /v1/hosts][%d] v1HostsGetForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/hosts][%d] v1HostsGetForbidden %s", 403, payload) } func (o *V1HostsGetForbidden) GetPayload() *models.Error { @@ -379,11 +388,13 @@ func (o *V1HostsGetInternalServerError) Code() int { } func (o *V1HostsGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /v1/hosts][%d] v1HostsGetInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/hosts][%d] v1HostsGetInternalServerError %s", 500, payload) } func (o *V1HostsGetInternalServerError) String() string { - return fmt.Sprintf("[GET /v1/hosts][%d] v1HostsGetInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/hosts][%d] v1HostsGetInternalServerError %s", 500, payload) } func (o *V1HostsGetInternalServerError) GetPayload() *models.Error { @@ -447,11 +458,13 @@ func (o *V1HostsGetGatewayTimeout) Code() int { } func (o *V1HostsGetGatewayTimeout) Error() string { - return fmt.Sprintf("[GET /v1/hosts][%d] v1HostsGetGatewayTimeout %+v", 504, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/hosts][%d] v1HostsGetGatewayTimeout %s", 504, payload) } func (o *V1HostsGetGatewayTimeout) String() string { - return fmt.Sprintf("[GET /v1/hosts][%d] v1HostsGetGatewayTimeout %+v", 504, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/hosts][%d] v1HostsGetGatewayTimeout %s", 504, payload) } func (o *V1HostsGetGatewayTimeout) GetPayload() *models.Error { diff --git a/power/client/host_groups/v1_hosts_id_delete_responses.go b/power/client/host_groups/v1_hosts_id_delete_responses.go index 1681c9fe..afda9239 100644 --- a/power/client/host_groups/v1_hosts_id_delete_responses.go +++ b/power/client/host_groups/v1_hosts_id_delete_responses.go @@ -6,6 +6,7 @@ package host_groups // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *V1HostsIDDeleteAccepted) Code() int { } func (o *V1HostsIDDeleteAccepted) Error() string { - return fmt.Sprintf("[DELETE /v1/hosts/{host_id}][%d] v1HostsIdDeleteAccepted %+v", 202, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v1/hosts/{host_id}][%d] v1HostsIdDeleteAccepted %s", 202, payload) } func (o *V1HostsIDDeleteAccepted) String() string { - return fmt.Sprintf("[DELETE /v1/hosts/{host_id}][%d] v1HostsIdDeleteAccepted %+v", 202, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v1/hosts/{host_id}][%d] v1HostsIdDeleteAccepted %s", 202, payload) } func (o *V1HostsIDDeleteAccepted) GetPayload() models.Object { @@ -181,11 +184,13 @@ func (o *V1HostsIDDeleteBadRequest) Code() int { } func (o *V1HostsIDDeleteBadRequest) Error() string { - return fmt.Sprintf("[DELETE /v1/hosts/{host_id}][%d] v1HostsIdDeleteBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v1/hosts/{host_id}][%d] v1HostsIdDeleteBadRequest %s", 400, payload) } func (o *V1HostsIDDeleteBadRequest) String() string { - return fmt.Sprintf("[DELETE /v1/hosts/{host_id}][%d] v1HostsIdDeleteBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v1/hosts/{host_id}][%d] v1HostsIdDeleteBadRequest %s", 400, payload) } func (o *V1HostsIDDeleteBadRequest) GetPayload() *models.Error { @@ -249,11 +254,13 @@ func (o *V1HostsIDDeleteUnauthorized) Code() int { } func (o *V1HostsIDDeleteUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /v1/hosts/{host_id}][%d] v1HostsIdDeleteUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v1/hosts/{host_id}][%d] v1HostsIdDeleteUnauthorized %s", 401, payload) } func (o *V1HostsIDDeleteUnauthorized) String() string { - return fmt.Sprintf("[DELETE /v1/hosts/{host_id}][%d] v1HostsIdDeleteUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v1/hosts/{host_id}][%d] v1HostsIdDeleteUnauthorized %s", 401, payload) } func (o *V1HostsIDDeleteUnauthorized) GetPayload() *models.Error { @@ -317,11 +324,13 @@ func (o *V1HostsIDDeleteForbidden) Code() int { } func (o *V1HostsIDDeleteForbidden) Error() string { - return fmt.Sprintf("[DELETE /v1/hosts/{host_id}][%d] v1HostsIdDeleteForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v1/hosts/{host_id}][%d] v1HostsIdDeleteForbidden %s", 403, payload) } func (o *V1HostsIDDeleteForbidden) String() string { - return fmt.Sprintf("[DELETE /v1/hosts/{host_id}][%d] v1HostsIdDeleteForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v1/hosts/{host_id}][%d] v1HostsIdDeleteForbidden %s", 403, payload) } func (o *V1HostsIDDeleteForbidden) GetPayload() *models.Error { @@ -385,11 +394,13 @@ func (o *V1HostsIDDeleteNotFound) Code() int { } func (o *V1HostsIDDeleteNotFound) Error() string { - return fmt.Sprintf("[DELETE /v1/hosts/{host_id}][%d] v1HostsIdDeleteNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v1/hosts/{host_id}][%d] v1HostsIdDeleteNotFound %s", 404, payload) } func (o *V1HostsIDDeleteNotFound) String() string { - return fmt.Sprintf("[DELETE /v1/hosts/{host_id}][%d] v1HostsIdDeleteNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v1/hosts/{host_id}][%d] v1HostsIdDeleteNotFound %s", 404, payload) } func (o *V1HostsIDDeleteNotFound) GetPayload() *models.Error { @@ -453,11 +464,13 @@ func (o *V1HostsIDDeleteInternalServerError) Code() int { } func (o *V1HostsIDDeleteInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /v1/hosts/{host_id}][%d] v1HostsIdDeleteInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v1/hosts/{host_id}][%d] v1HostsIdDeleteInternalServerError %s", 500, payload) } func (o *V1HostsIDDeleteInternalServerError) String() string { - return fmt.Sprintf("[DELETE /v1/hosts/{host_id}][%d] v1HostsIdDeleteInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v1/hosts/{host_id}][%d] v1HostsIdDeleteInternalServerError %s", 500, payload) } func (o *V1HostsIDDeleteInternalServerError) GetPayload() *models.Error { @@ -521,11 +534,13 @@ func (o *V1HostsIDDeleteGatewayTimeout) Code() int { } func (o *V1HostsIDDeleteGatewayTimeout) Error() string { - return fmt.Sprintf("[DELETE /v1/hosts/{host_id}][%d] v1HostsIdDeleteGatewayTimeout %+v", 504, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v1/hosts/{host_id}][%d] v1HostsIdDeleteGatewayTimeout %s", 504, payload) } func (o *V1HostsIDDeleteGatewayTimeout) String() string { - return fmt.Sprintf("[DELETE /v1/hosts/{host_id}][%d] v1HostsIdDeleteGatewayTimeout %+v", 504, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v1/hosts/{host_id}][%d] v1HostsIdDeleteGatewayTimeout %s", 504, payload) } func (o *V1HostsIDDeleteGatewayTimeout) GetPayload() *models.Error { diff --git a/power/client/host_groups/v1_hosts_id_get_responses.go b/power/client/host_groups/v1_hosts_id_get_responses.go index 42411024..3ea59092 100644 --- a/power/client/host_groups/v1_hosts_id_get_responses.go +++ b/power/client/host_groups/v1_hosts_id_get_responses.go @@ -6,6 +6,7 @@ package host_groups // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *V1HostsIDGetOK) Code() int { } func (o *V1HostsIDGetOK) Error() string { - return fmt.Sprintf("[GET /v1/hosts/{host_id}][%d] v1HostsIdGetOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/hosts/{host_id}][%d] v1HostsIdGetOK %s", 200, payload) } func (o *V1HostsIDGetOK) String() string { - return fmt.Sprintf("[GET /v1/hosts/{host_id}][%d] v1HostsIdGetOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/hosts/{host_id}][%d] v1HostsIdGetOK %s", 200, payload) } func (o *V1HostsIDGetOK) GetPayload() *models.Host { @@ -183,11 +186,13 @@ func (o *V1HostsIDGetBadRequest) Code() int { } func (o *V1HostsIDGetBadRequest) Error() string { - return fmt.Sprintf("[GET /v1/hosts/{host_id}][%d] v1HostsIdGetBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/hosts/{host_id}][%d] v1HostsIdGetBadRequest %s", 400, payload) } func (o *V1HostsIDGetBadRequest) String() string { - return fmt.Sprintf("[GET /v1/hosts/{host_id}][%d] v1HostsIdGetBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/hosts/{host_id}][%d] v1HostsIdGetBadRequest %s", 400, payload) } func (o *V1HostsIDGetBadRequest) GetPayload() *models.Error { @@ -251,11 +256,13 @@ func (o *V1HostsIDGetUnauthorized) Code() int { } func (o *V1HostsIDGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /v1/hosts/{host_id}][%d] v1HostsIdGetUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/hosts/{host_id}][%d] v1HostsIdGetUnauthorized %s", 401, payload) } func (o *V1HostsIDGetUnauthorized) String() string { - return fmt.Sprintf("[GET /v1/hosts/{host_id}][%d] v1HostsIdGetUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/hosts/{host_id}][%d] v1HostsIdGetUnauthorized %s", 401, payload) } func (o *V1HostsIDGetUnauthorized) GetPayload() *models.Error { @@ -319,11 +326,13 @@ func (o *V1HostsIDGetForbidden) Code() int { } func (o *V1HostsIDGetForbidden) Error() string { - return fmt.Sprintf("[GET /v1/hosts/{host_id}][%d] v1HostsIdGetForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/hosts/{host_id}][%d] v1HostsIdGetForbidden %s", 403, payload) } func (o *V1HostsIDGetForbidden) String() string { - return fmt.Sprintf("[GET /v1/hosts/{host_id}][%d] v1HostsIdGetForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/hosts/{host_id}][%d] v1HostsIdGetForbidden %s", 403, payload) } func (o *V1HostsIDGetForbidden) GetPayload() *models.Error { @@ -387,11 +396,13 @@ func (o *V1HostsIDGetNotFound) Code() int { } func (o *V1HostsIDGetNotFound) Error() string { - return fmt.Sprintf("[GET /v1/hosts/{host_id}][%d] v1HostsIdGetNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/hosts/{host_id}][%d] v1HostsIdGetNotFound %s", 404, payload) } func (o *V1HostsIDGetNotFound) String() string { - return fmt.Sprintf("[GET /v1/hosts/{host_id}][%d] v1HostsIdGetNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/hosts/{host_id}][%d] v1HostsIdGetNotFound %s", 404, payload) } func (o *V1HostsIDGetNotFound) GetPayload() *models.Error { @@ -455,11 +466,13 @@ func (o *V1HostsIDGetInternalServerError) Code() int { } func (o *V1HostsIDGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /v1/hosts/{host_id}][%d] v1HostsIdGetInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/hosts/{host_id}][%d] v1HostsIdGetInternalServerError %s", 500, payload) } func (o *V1HostsIDGetInternalServerError) String() string { - return fmt.Sprintf("[GET /v1/hosts/{host_id}][%d] v1HostsIdGetInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/hosts/{host_id}][%d] v1HostsIdGetInternalServerError %s", 500, payload) } func (o *V1HostsIDGetInternalServerError) GetPayload() *models.Error { @@ -523,11 +536,13 @@ func (o *V1HostsIDGetGatewayTimeout) Code() int { } func (o *V1HostsIDGetGatewayTimeout) Error() string { - return fmt.Sprintf("[GET /v1/hosts/{host_id}][%d] v1HostsIdGetGatewayTimeout %+v", 504, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/hosts/{host_id}][%d] v1HostsIdGetGatewayTimeout %s", 504, payload) } func (o *V1HostsIDGetGatewayTimeout) String() string { - return fmt.Sprintf("[GET /v1/hosts/{host_id}][%d] v1HostsIdGetGatewayTimeout %+v", 504, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/hosts/{host_id}][%d] v1HostsIdGetGatewayTimeout %s", 504, payload) } func (o *V1HostsIDGetGatewayTimeout) GetPayload() *models.Error { diff --git a/power/client/host_groups/v1_hosts_id_put_responses.go b/power/client/host_groups/v1_hosts_id_put_responses.go index 8723d370..d71402c9 100644 --- a/power/client/host_groups/v1_hosts_id_put_responses.go +++ b/power/client/host_groups/v1_hosts_id_put_responses.go @@ -6,6 +6,7 @@ package host_groups // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -121,11 +122,13 @@ func (o *V1HostsIDPutOK) Code() int { } func (o *V1HostsIDPutOK) Error() string { - return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutOK %s", 200, payload) } func (o *V1HostsIDPutOK) String() string { - return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutOK %s", 200, payload) } func (o *V1HostsIDPutOK) GetPayload() *models.Host { @@ -189,11 +192,13 @@ func (o *V1HostsIDPutBadRequest) Code() int { } func (o *V1HostsIDPutBadRequest) Error() string { - return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutBadRequest %s", 400, payload) } func (o *V1HostsIDPutBadRequest) String() string { - return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutBadRequest %s", 400, payload) } func (o *V1HostsIDPutBadRequest) GetPayload() *models.Error { @@ -257,11 +262,13 @@ func (o *V1HostsIDPutUnauthorized) Code() int { } func (o *V1HostsIDPutUnauthorized) Error() string { - return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutUnauthorized %s", 401, payload) } func (o *V1HostsIDPutUnauthorized) String() string { - return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutUnauthorized %s", 401, payload) } func (o *V1HostsIDPutUnauthorized) GetPayload() *models.Error { @@ -325,11 +332,13 @@ func (o *V1HostsIDPutForbidden) Code() int { } func (o *V1HostsIDPutForbidden) Error() string { - return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutForbidden %s", 403, payload) } func (o *V1HostsIDPutForbidden) String() string { - return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutForbidden %s", 403, payload) } func (o *V1HostsIDPutForbidden) GetPayload() *models.Error { @@ -393,11 +402,13 @@ func (o *V1HostsIDPutNotFound) Code() int { } func (o *V1HostsIDPutNotFound) Error() string { - return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutNotFound %s", 404, payload) } func (o *V1HostsIDPutNotFound) String() string { - return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutNotFound %s", 404, payload) } func (o *V1HostsIDPutNotFound) GetPayload() *models.Error { @@ -461,11 +472,13 @@ func (o *V1HostsIDPutUnprocessableEntity) Code() int { } func (o *V1HostsIDPutUnprocessableEntity) Error() string { - return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutUnprocessableEntity %+v", 422, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutUnprocessableEntity %s", 422, payload) } func (o *V1HostsIDPutUnprocessableEntity) String() string { - return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutUnprocessableEntity %+v", 422, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutUnprocessableEntity %s", 422, payload) } func (o *V1HostsIDPutUnprocessableEntity) GetPayload() *models.Error { @@ -529,11 +542,13 @@ func (o *V1HostsIDPutInternalServerError) Code() int { } func (o *V1HostsIDPutInternalServerError) Error() string { - return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutInternalServerError %s", 500, payload) } func (o *V1HostsIDPutInternalServerError) String() string { - return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutInternalServerError %s", 500, payload) } func (o *V1HostsIDPutInternalServerError) GetPayload() *models.Error { @@ -597,11 +612,13 @@ func (o *V1HostsIDPutGatewayTimeout) Code() int { } func (o *V1HostsIDPutGatewayTimeout) Error() string { - return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutGatewayTimeout %+v", 504, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutGatewayTimeout %s", 504, payload) } func (o *V1HostsIDPutGatewayTimeout) String() string { - return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutGatewayTimeout %+v", 504, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /v1/hosts/{host_id}][%d] v1HostsIdPutGatewayTimeout %s", 504, payload) } func (o *V1HostsIDPutGatewayTimeout) GetPayload() *models.Error { diff --git a/power/client/host_groups/v1_hosts_post_responses.go b/power/client/host_groups/v1_hosts_post_responses.go index 2a62bb96..55d71133 100644 --- a/power/client/host_groups/v1_hosts_post_responses.go +++ b/power/client/host_groups/v1_hosts_post_responses.go @@ -6,6 +6,7 @@ package host_groups // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *V1HostsPostCreated) Code() int { } func (o *V1HostsPostCreated) Error() string { - return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostCreated %+v", 201, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostCreated %s", 201, payload) } func (o *V1HostsPostCreated) String() string { - return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostCreated %+v", 201, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostCreated %s", 201, payload) } func (o *V1HostsPostCreated) GetPayload() models.HostList { @@ -181,11 +184,13 @@ func (o *V1HostsPostBadRequest) Code() int { } func (o *V1HostsPostBadRequest) Error() string { - return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostBadRequest %s", 400, payload) } func (o *V1HostsPostBadRequest) String() string { - return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostBadRequest %s", 400, payload) } func (o *V1HostsPostBadRequest) GetPayload() *models.Error { @@ -249,11 +254,13 @@ func (o *V1HostsPostUnauthorized) Code() int { } func (o *V1HostsPostUnauthorized) Error() string { - return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostUnauthorized %s", 401, payload) } func (o *V1HostsPostUnauthorized) String() string { - return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostUnauthorized %s", 401, payload) } func (o *V1HostsPostUnauthorized) GetPayload() *models.Error { @@ -317,11 +324,13 @@ func (o *V1HostsPostForbidden) Code() int { } func (o *V1HostsPostForbidden) Error() string { - return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostForbidden %s", 403, payload) } func (o *V1HostsPostForbidden) String() string { - return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostForbidden %s", 403, payload) } func (o *V1HostsPostForbidden) GetPayload() *models.Error { @@ -385,11 +394,13 @@ func (o *V1HostsPostUnprocessableEntity) Code() int { } func (o *V1HostsPostUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostUnprocessableEntity %+v", 422, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostUnprocessableEntity %s", 422, payload) } func (o *V1HostsPostUnprocessableEntity) String() string { - return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostUnprocessableEntity %+v", 422, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostUnprocessableEntity %s", 422, payload) } func (o *V1HostsPostUnprocessableEntity) GetPayload() *models.Error { @@ -453,11 +464,13 @@ func (o *V1HostsPostInternalServerError) Code() int { } func (o *V1HostsPostInternalServerError) Error() string { - return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostInternalServerError %s", 500, payload) } func (o *V1HostsPostInternalServerError) String() string { - return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostInternalServerError %s", 500, payload) } func (o *V1HostsPostInternalServerError) GetPayload() *models.Error { @@ -521,11 +534,13 @@ func (o *V1HostsPostGatewayTimeout) Code() int { } func (o *V1HostsPostGatewayTimeout) Error() string { - return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostGatewayTimeout %+v", 504, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostGatewayTimeout %s", 504, payload) } func (o *V1HostsPostGatewayTimeout) String() string { - return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostGatewayTimeout %+v", 504, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostGatewayTimeout %s", 504, payload) } func (o *V1HostsPostGatewayTimeout) GetPayload() *models.Error { diff --git a/power/client/iaas_service_broker/iaas_service_broker_client.go b/power/client/iaas_service_broker/iaas_service_broker_client.go index 8b177881..cefa48c3 100644 --- a/power/client/iaas_service_broker/iaas_service_broker_client.go +++ b/power/client/iaas_service_broker/iaas_service_broker_client.go @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi 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 */ @@ -25,7 +51,7 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods 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 index 53719cfa..de2604f7 100644 --- a/power/client/iaas_service_broker/service_broker_health_head_responses.go +++ b/power/client/iaas_service_broker/service_broker_health_head_responses.go @@ -6,6 +6,7 @@ package iaas_service_broker // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -103,11 +104,13 @@ func (o *ServiceBrokerHealthHeadOK) Code() int { } func (o *ServiceBrokerHealthHeadOK) Error() string { - return fmt.Sprintf("[HEAD /broker/v1/health][%d] serviceBrokerHealthHeadOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[HEAD /broker/v1/health][%d] serviceBrokerHealthHeadOK %s", 200, payload) } func (o *ServiceBrokerHealthHeadOK) String() string { - return fmt.Sprintf("[HEAD /broker/v1/health][%d] serviceBrokerHealthHeadOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[HEAD /broker/v1/health][%d] serviceBrokerHealthHeadOK %s", 200, payload) } func (o *ServiceBrokerHealthHeadOK) GetPayload() *models.Health { @@ -171,11 +174,13 @@ func (o *ServiceBrokerHealthHeadBadRequest) Code() int { } func (o *ServiceBrokerHealthHeadBadRequest) Error() string { - return fmt.Sprintf("[HEAD /broker/v1/health][%d] serviceBrokerHealthHeadBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[HEAD /broker/v1/health][%d] serviceBrokerHealthHeadBadRequest %s", 400, payload) } func (o *ServiceBrokerHealthHeadBadRequest) String() string { - return fmt.Sprintf("[HEAD /broker/v1/health][%d] serviceBrokerHealthHeadBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[HEAD /broker/v1/health][%d] serviceBrokerHealthHeadBadRequest %s", 400, payload) } func (o *ServiceBrokerHealthHeadBadRequest) GetPayload() *models.Error { @@ -239,11 +244,13 @@ func (o *ServiceBrokerHealthHeadUnauthorized) Code() int { } func (o *ServiceBrokerHealthHeadUnauthorized) Error() string { - return fmt.Sprintf("[HEAD /broker/v1/health][%d] serviceBrokerHealthHeadUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[HEAD /broker/v1/health][%d] serviceBrokerHealthHeadUnauthorized %s", 401, payload) } func (o *ServiceBrokerHealthHeadUnauthorized) String() string { - return fmt.Sprintf("[HEAD /broker/v1/health][%d] serviceBrokerHealthHeadUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[HEAD /broker/v1/health][%d] serviceBrokerHealthHeadUnauthorized %s", 401, payload) } func (o *ServiceBrokerHealthHeadUnauthorized) GetPayload() *models.Error { @@ -307,11 +314,13 @@ func (o *ServiceBrokerHealthHeadForbidden) Code() int { } func (o *ServiceBrokerHealthHeadForbidden) Error() string { - return fmt.Sprintf("[HEAD /broker/v1/health][%d] serviceBrokerHealthHeadForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[HEAD /broker/v1/health][%d] serviceBrokerHealthHeadForbidden %s", 403, payload) } func (o *ServiceBrokerHealthHeadForbidden) String() string { - return fmt.Sprintf("[HEAD /broker/v1/health][%d] serviceBrokerHealthHeadForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[HEAD /broker/v1/health][%d] serviceBrokerHealthHeadForbidden %s", 403, payload) } func (o *ServiceBrokerHealthHeadForbidden) GetPayload() *models.Error { @@ -375,11 +384,13 @@ func (o *ServiceBrokerHealthHeadNotFound) Code() int { } func (o *ServiceBrokerHealthHeadNotFound) Error() string { - return fmt.Sprintf("[HEAD /broker/v1/health][%d] serviceBrokerHealthHeadNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[HEAD /broker/v1/health][%d] serviceBrokerHealthHeadNotFound %s", 404, payload) } func (o *ServiceBrokerHealthHeadNotFound) String() string { - return fmt.Sprintf("[HEAD /broker/v1/health][%d] serviceBrokerHealthHeadNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[HEAD /broker/v1/health][%d] serviceBrokerHealthHeadNotFound %s", 404, payload) } func (o *ServiceBrokerHealthHeadNotFound) GetPayload() *models.Error { diff --git a/power/client/iaas_service_broker/service_broker_health_responses.go b/power/client/iaas_service_broker/service_broker_health_responses.go index e5a1f2fa..e89666a8 100644 --- a/power/client/iaas_service_broker/service_broker_health_responses.go +++ b/power/client/iaas_service_broker/service_broker_health_responses.go @@ -6,6 +6,7 @@ package iaas_service_broker // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -103,11 +104,13 @@ func (o *ServiceBrokerHealthOK) Code() int { } func (o *ServiceBrokerHealthOK) Error() string { - return fmt.Sprintf("[GET /broker/v1/health][%d] serviceBrokerHealthOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/health][%d] serviceBrokerHealthOK %s", 200, payload) } func (o *ServiceBrokerHealthOK) String() string { - return fmt.Sprintf("[GET /broker/v1/health][%d] serviceBrokerHealthOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/health][%d] serviceBrokerHealthOK %s", 200, payload) } func (o *ServiceBrokerHealthOK) GetPayload() *models.Health { @@ -171,11 +174,13 @@ func (o *ServiceBrokerHealthBadRequest) Code() int { } func (o *ServiceBrokerHealthBadRequest) Error() string { - return fmt.Sprintf("[GET /broker/v1/health][%d] serviceBrokerHealthBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/health][%d] serviceBrokerHealthBadRequest %s", 400, payload) } func (o *ServiceBrokerHealthBadRequest) String() string { - return fmt.Sprintf("[GET /broker/v1/health][%d] serviceBrokerHealthBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/health][%d] serviceBrokerHealthBadRequest %s", 400, payload) } func (o *ServiceBrokerHealthBadRequest) GetPayload() *models.Error { @@ -239,11 +244,13 @@ func (o *ServiceBrokerHealthUnauthorized) Code() int { } func (o *ServiceBrokerHealthUnauthorized) Error() string { - return fmt.Sprintf("[GET /broker/v1/health][%d] serviceBrokerHealthUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/health][%d] serviceBrokerHealthUnauthorized %s", 401, payload) } func (o *ServiceBrokerHealthUnauthorized) String() string { - return fmt.Sprintf("[GET /broker/v1/health][%d] serviceBrokerHealthUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/health][%d] serviceBrokerHealthUnauthorized %s", 401, payload) } func (o *ServiceBrokerHealthUnauthorized) GetPayload() *models.Error { @@ -307,11 +314,13 @@ func (o *ServiceBrokerHealthForbidden) Code() int { } func (o *ServiceBrokerHealthForbidden) Error() string { - return fmt.Sprintf("[GET /broker/v1/health][%d] serviceBrokerHealthForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/health][%d] serviceBrokerHealthForbidden %s", 403, payload) } func (o *ServiceBrokerHealthForbidden) String() string { - return fmt.Sprintf("[GET /broker/v1/health][%d] serviceBrokerHealthForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/health][%d] serviceBrokerHealthForbidden %s", 403, payload) } func (o *ServiceBrokerHealthForbidden) GetPayload() *models.Error { @@ -375,11 +384,13 @@ func (o *ServiceBrokerHealthNotFound) Code() int { } func (o *ServiceBrokerHealthNotFound) Error() string { - return fmt.Sprintf("[GET /broker/v1/health][%d] serviceBrokerHealthNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/health][%d] serviceBrokerHealthNotFound %s", 404, payload) } func (o *ServiceBrokerHealthNotFound) String() string { - return fmt.Sprintf("[GET /broker/v1/health][%d] serviceBrokerHealthNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/health][%d] serviceBrokerHealthNotFound %s", 404, payload) } func (o *ServiceBrokerHealthNotFound) GetPayload() *models.Error { 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 index 5660b04c..b2304c38 100644 --- a/power/client/iaas_service_broker/service_broker_test_timeout_responses.go +++ b/power/client/iaas_service_broker/service_broker_test_timeout_responses.go @@ -6,6 +6,7 @@ package iaas_service_broker // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -103,11 +104,13 @@ func (o *ServiceBrokerTestTimeoutOK) Code() int { } func (o *ServiceBrokerTestTimeoutOK) Error() string { - return fmt.Sprintf("[GET /broker/v1/test/timeout][%d] serviceBrokerTestTimeoutOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/test/timeout][%d] serviceBrokerTestTimeoutOK %s", 200, payload) } func (o *ServiceBrokerTestTimeoutOK) String() string { - return fmt.Sprintf("[GET /broker/v1/test/timeout][%d] serviceBrokerTestTimeoutOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/test/timeout][%d] serviceBrokerTestTimeoutOK %s", 200, payload) } func (o *ServiceBrokerTestTimeoutOK) GetPayload() models.Object { @@ -169,11 +172,13 @@ func (o *ServiceBrokerTestTimeoutBadRequest) Code() int { } func (o *ServiceBrokerTestTimeoutBadRequest) Error() string { - return fmt.Sprintf("[GET /broker/v1/test/timeout][%d] serviceBrokerTestTimeoutBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/test/timeout][%d] serviceBrokerTestTimeoutBadRequest %s", 400, payload) } func (o *ServiceBrokerTestTimeoutBadRequest) String() string { - return fmt.Sprintf("[GET /broker/v1/test/timeout][%d] serviceBrokerTestTimeoutBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/test/timeout][%d] serviceBrokerTestTimeoutBadRequest %s", 400, payload) } func (o *ServiceBrokerTestTimeoutBadRequest) GetPayload() *models.Error { @@ -237,11 +242,13 @@ func (o *ServiceBrokerTestTimeoutUnauthorized) Code() int { } func (o *ServiceBrokerTestTimeoutUnauthorized) Error() string { - return fmt.Sprintf("[GET /broker/v1/test/timeout][%d] serviceBrokerTestTimeoutUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/test/timeout][%d] serviceBrokerTestTimeoutUnauthorized %s", 401, payload) } func (o *ServiceBrokerTestTimeoutUnauthorized) String() string { - return fmt.Sprintf("[GET /broker/v1/test/timeout][%d] serviceBrokerTestTimeoutUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/test/timeout][%d] serviceBrokerTestTimeoutUnauthorized %s", 401, payload) } func (o *ServiceBrokerTestTimeoutUnauthorized) GetPayload() *models.Error { @@ -305,11 +312,13 @@ func (o *ServiceBrokerTestTimeoutForbidden) Code() int { } func (o *ServiceBrokerTestTimeoutForbidden) Error() string { - return fmt.Sprintf("[GET /broker/v1/test/timeout][%d] serviceBrokerTestTimeoutForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/test/timeout][%d] serviceBrokerTestTimeoutForbidden %s", 403, payload) } func (o *ServiceBrokerTestTimeoutForbidden) String() string { - return fmt.Sprintf("[GET /broker/v1/test/timeout][%d] serviceBrokerTestTimeoutForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/test/timeout][%d] serviceBrokerTestTimeoutForbidden %s", 403, payload) } func (o *ServiceBrokerTestTimeoutForbidden) GetPayload() *models.Error { @@ -373,11 +382,13 @@ func (o *ServiceBrokerTestTimeoutNotFound) Code() int { } func (o *ServiceBrokerTestTimeoutNotFound) Error() string { - return fmt.Sprintf("[GET /broker/v1/test/timeout][%d] serviceBrokerTestTimeoutNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/test/timeout][%d] serviceBrokerTestTimeoutNotFound %s", 404, payload) } func (o *ServiceBrokerTestTimeoutNotFound) String() string { - return fmt.Sprintf("[GET /broker/v1/test/timeout][%d] serviceBrokerTestTimeoutNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/test/timeout][%d] serviceBrokerTestTimeoutNotFound %s", 404, payload) } func (o *ServiceBrokerTestTimeoutNotFound) GetPayload() *models.Error { diff --git a/power/client/iaas_service_broker/service_broker_version_responses.go b/power/client/iaas_service_broker/service_broker_version_responses.go index 23b0bf2a..04859bcc 100644 --- a/power/client/iaas_service_broker/service_broker_version_responses.go +++ b/power/client/iaas_service_broker/service_broker_version_responses.go @@ -6,6 +6,7 @@ package iaas_service_broker // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -103,11 +104,13 @@ func (o *ServiceBrokerVersionOK) Code() int { } func (o *ServiceBrokerVersionOK) Error() string { - return fmt.Sprintf("[GET /broker/v1/version][%d] serviceBrokerVersionOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/version][%d] serviceBrokerVersionOK %s", 200, payload) } func (o *ServiceBrokerVersionOK) String() string { - return fmt.Sprintf("[GET /broker/v1/version][%d] serviceBrokerVersionOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/version][%d] serviceBrokerVersionOK %s", 200, payload) } func (o *ServiceBrokerVersionOK) GetPayload() *models.Version { @@ -171,11 +174,13 @@ func (o *ServiceBrokerVersionBadRequest) Code() int { } func (o *ServiceBrokerVersionBadRequest) Error() string { - return fmt.Sprintf("[GET /broker/v1/version][%d] serviceBrokerVersionBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/version][%d] serviceBrokerVersionBadRequest %s", 400, payload) } func (o *ServiceBrokerVersionBadRequest) String() string { - return fmt.Sprintf("[GET /broker/v1/version][%d] serviceBrokerVersionBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/version][%d] serviceBrokerVersionBadRequest %s", 400, payload) } func (o *ServiceBrokerVersionBadRequest) GetPayload() *models.Error { @@ -239,11 +244,13 @@ func (o *ServiceBrokerVersionUnauthorized) Code() int { } func (o *ServiceBrokerVersionUnauthorized) Error() string { - return fmt.Sprintf("[GET /broker/v1/version][%d] serviceBrokerVersionUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/version][%d] serviceBrokerVersionUnauthorized %s", 401, payload) } func (o *ServiceBrokerVersionUnauthorized) String() string { - return fmt.Sprintf("[GET /broker/v1/version][%d] serviceBrokerVersionUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/version][%d] serviceBrokerVersionUnauthorized %s", 401, payload) } func (o *ServiceBrokerVersionUnauthorized) GetPayload() *models.Error { @@ -307,11 +314,13 @@ func (o *ServiceBrokerVersionForbidden) Code() int { } func (o *ServiceBrokerVersionForbidden) Error() string { - return fmt.Sprintf("[GET /broker/v1/version][%d] serviceBrokerVersionForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/version][%d] serviceBrokerVersionForbidden %s", 403, payload) } func (o *ServiceBrokerVersionForbidden) String() string { - return fmt.Sprintf("[GET /broker/v1/version][%d] serviceBrokerVersionForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/version][%d] serviceBrokerVersionForbidden %s", 403, payload) } func (o *ServiceBrokerVersionForbidden) GetPayload() *models.Error { @@ -375,11 +384,13 @@ func (o *ServiceBrokerVersionNotFound) Code() int { } func (o *ServiceBrokerVersionNotFound) Error() string { - return fmt.Sprintf("[GET /broker/v1/version][%d] serviceBrokerVersionNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/version][%d] serviceBrokerVersionNotFound %s", 404, payload) } func (o *ServiceBrokerVersionNotFound) String() string { - return fmt.Sprintf("[GET /broker/v1/version][%d] serviceBrokerVersionNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/version][%d] serviceBrokerVersionNotFound %s", 404, payload) } func (o *ServiceBrokerVersionNotFound) GetPayload() *models.Error { 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 index 3c26fc52..4cf2e690 100644 --- 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 @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi 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 */ @@ -25,7 +51,7 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods 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 index b84da6e3..a7d7ff74 100644 --- 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 @@ -6,6 +6,7 @@ package internal_power_v_s_instances // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -91,11 +92,13 @@ func (o *InternalV1PowervsInstancesGetOK) Code() int { } func (o *InternalV1PowervsInstancesGetOK) Error() string { - return fmt.Sprintf("[GET /internal/v1/powervs/instances][%d] internalV1PowervsInstancesGetOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /internal/v1/powervs/instances][%d] internalV1PowervsInstancesGetOK %s", 200, payload) } func (o *InternalV1PowervsInstancesGetOK) String() string { - return fmt.Sprintf("[GET /internal/v1/powervs/instances][%d] internalV1PowervsInstancesGetOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /internal/v1/powervs/instances][%d] internalV1PowervsInstancesGetOK %s", 200, payload) } func (o *InternalV1PowervsInstancesGetOK) GetPayload() *models.PowerVSInstances { @@ -159,11 +162,13 @@ func (o *InternalV1PowervsInstancesGetForbidden) Code() int { } func (o *InternalV1PowervsInstancesGetForbidden) Error() string { - return fmt.Sprintf("[GET /internal/v1/powervs/instances][%d] internalV1PowervsInstancesGetForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /internal/v1/powervs/instances][%d] internalV1PowervsInstancesGetForbidden %s", 403, payload) } func (o *InternalV1PowervsInstancesGetForbidden) String() string { - return fmt.Sprintf("[GET /internal/v1/powervs/instances][%d] internalV1PowervsInstancesGetForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /internal/v1/powervs/instances][%d] internalV1PowervsInstancesGetForbidden %s", 403, payload) } func (o *InternalV1PowervsInstancesGetForbidden) GetPayload() *models.Error { @@ -227,11 +232,13 @@ func (o *InternalV1PowervsInstancesGetInternalServerError) Code() int { } func (o *InternalV1PowervsInstancesGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /internal/v1/powervs/instances][%d] internalV1PowervsInstancesGetInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /internal/v1/powervs/instances][%d] internalV1PowervsInstancesGetInternalServerError %s", 500, payload) } func (o *InternalV1PowervsInstancesGetInternalServerError) String() string { - return fmt.Sprintf("[GET /internal/v1/powervs/instances][%d] internalV1PowervsInstancesGetInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /internal/v1/powervs/instances][%d] internalV1PowervsInstancesGetInternalServerError %s", 500, payload) } func (o *InternalV1PowervsInstancesGetInternalServerError) GetPayload() *models.Error { 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 index 1eb10428..a5b26b2b 100644 --- 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 @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi 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 */ @@ -25,7 +51,7 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods 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 index 1210de96..a9674327 100644 --- 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 @@ -6,6 +6,7 @@ package internal_power_v_s_locations // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -103,11 +104,13 @@ func (o *InternalV1PowervsLocationsActivatePutOK) Code() int { } func (o *InternalV1PowervsLocationsActivatePutOK) Error() string { - return fmt.Sprintf("[PUT /internal/v1/powervs/locations/activate][%d] internalV1PowervsLocationsActivatePutOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /internal/v1/powervs/locations/activate][%d] internalV1PowervsLocationsActivatePutOK %s", 200, payload) } func (o *InternalV1PowervsLocationsActivatePutOK) String() string { - return fmt.Sprintf("[PUT /internal/v1/powervs/locations/activate][%d] internalV1PowervsLocationsActivatePutOK %+v", 200, o.Payload) + 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 { @@ -171,11 +174,13 @@ func (o *InternalV1PowervsLocationsActivatePutBadRequest) Code() int { } func (o *InternalV1PowervsLocationsActivatePutBadRequest) Error() string { - return fmt.Sprintf("[PUT /internal/v1/powervs/locations/activate][%d] internalV1PowervsLocationsActivatePutBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /internal/v1/powervs/locations/activate][%d] internalV1PowervsLocationsActivatePutBadRequest %s", 400, payload) } func (o *InternalV1PowervsLocationsActivatePutBadRequest) String() string { - return fmt.Sprintf("[PUT /internal/v1/powervs/locations/activate][%d] internalV1PowervsLocationsActivatePutBadRequest %+v", 400, o.Payload) + 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 { @@ -239,11 +244,13 @@ func (o *InternalV1PowervsLocationsActivatePutUnauthorized) Code() int { } func (o *InternalV1PowervsLocationsActivatePutUnauthorized) Error() string { - return fmt.Sprintf("[PUT /internal/v1/powervs/locations/activate][%d] internalV1PowervsLocationsActivatePutUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /internal/v1/powervs/locations/activate][%d] internalV1PowervsLocationsActivatePutUnauthorized %s", 401, payload) } func (o *InternalV1PowervsLocationsActivatePutUnauthorized) String() string { - return fmt.Sprintf("[PUT /internal/v1/powervs/locations/activate][%d] internalV1PowervsLocationsActivatePutUnauthorized %+v", 401, o.Payload) + 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 { @@ -307,11 +314,13 @@ func (o *InternalV1PowervsLocationsActivatePutUnprocessableEntity) Code() int { } func (o *InternalV1PowervsLocationsActivatePutUnprocessableEntity) Error() string { - return fmt.Sprintf("[PUT /internal/v1/powervs/locations/activate][%d] internalV1PowervsLocationsActivatePutUnprocessableEntity %+v", 422, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /internal/v1/powervs/locations/activate][%d] internalV1PowervsLocationsActivatePutUnprocessableEntity %s", 422, payload) } func (o *InternalV1PowervsLocationsActivatePutUnprocessableEntity) String() string { - return fmt.Sprintf("[PUT /internal/v1/powervs/locations/activate][%d] internalV1PowervsLocationsActivatePutUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -375,11 +384,13 @@ func (o *InternalV1PowervsLocationsActivatePutInternalServerError) Code() int { } func (o *InternalV1PowervsLocationsActivatePutInternalServerError) Error() string { - return fmt.Sprintf("[PUT /internal/v1/powervs/locations/activate][%d] internalV1PowervsLocationsActivatePutInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /internal/v1/powervs/locations/activate][%d] internalV1PowervsLocationsActivatePutInternalServerError %s", 500, payload) } func (o *InternalV1PowervsLocationsActivatePutInternalServerError) String() string { - return fmt.Sprintf("[PUT /internal/v1/powervs/locations/activate][%d] internalV1PowervsLocationsActivatePutInternalServerError %+v", 500, o.Payload) + 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 { 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 index 78c51d96..e9775fcf 100644 --- 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 @@ -6,6 +6,7 @@ package internal_power_v_s_locations // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -102,11 +103,11 @@ func (o *InternalV1PowervsLocationsTagDeleteOK) Code() int { } func (o *InternalV1PowervsLocationsTagDeleteOK) Error() string { - return fmt.Sprintf("[DELETE /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagDeleteOK ", 200) + 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) + 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 { @@ -159,11 +160,13 @@ func (o *InternalV1PowervsLocationsTagDeleteBadRequest) Code() int { } func (o *InternalV1PowervsLocationsTagDeleteBadRequest) Error() string { - return fmt.Sprintf("[DELETE /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagDeleteBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagDeleteBadRequest %s", 400, payload) } func (o *InternalV1PowervsLocationsTagDeleteBadRequest) String() string { - return fmt.Sprintf("[DELETE /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagDeleteBadRequest %+v", 400, o.Payload) + 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 { @@ -227,11 +230,13 @@ func (o *InternalV1PowervsLocationsTagDeleteUnauthorized) Code() int { } func (o *InternalV1PowervsLocationsTagDeleteUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagDeleteUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagDeleteUnauthorized %s", 401, payload) } func (o *InternalV1PowervsLocationsTagDeleteUnauthorized) String() string { - return fmt.Sprintf("[DELETE /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagDeleteUnauthorized %+v", 401, o.Payload) + 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 { @@ -295,11 +300,13 @@ func (o *InternalV1PowervsLocationsTagDeleteUnprocessableEntity) Code() int { } func (o *InternalV1PowervsLocationsTagDeleteUnprocessableEntity) Error() string { - return fmt.Sprintf("[DELETE /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagDeleteUnprocessableEntity %+v", 422, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagDeleteUnprocessableEntity %s", 422, payload) } func (o *InternalV1PowervsLocationsTagDeleteUnprocessableEntity) String() string { - return fmt.Sprintf("[DELETE /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagDeleteUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -363,11 +370,13 @@ func (o *InternalV1PowervsLocationsTagDeleteInternalServerError) Code() int { } func (o *InternalV1PowervsLocationsTagDeleteInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagDeleteInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagDeleteInternalServerError %s", 500, payload) } func (o *InternalV1PowervsLocationsTagDeleteInternalServerError) String() string { - return fmt.Sprintf("[DELETE /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagDeleteInternalServerError %+v", 500, o.Payload) + 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 { 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 index 938e531a..7b1e8cb0 100644 --- 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 @@ -6,6 +6,7 @@ package internal_power_v_s_locations // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -102,11 +103,11 @@ func (o *InternalV1PowervsLocationsTagPostOK) Code() int { } func (o *InternalV1PowervsLocationsTagPostOK) Error() string { - return fmt.Sprintf("[POST /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagPostOK ", 200) + 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) + 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 { @@ -159,11 +160,13 @@ func (o *InternalV1PowervsLocationsTagPostBadRequest) Code() int { } func (o *InternalV1PowervsLocationsTagPostBadRequest) Error() string { - return fmt.Sprintf("[POST /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagPostBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagPostBadRequest %s", 400, payload) } func (o *InternalV1PowervsLocationsTagPostBadRequest) String() string { - return fmt.Sprintf("[POST /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagPostBadRequest %+v", 400, o.Payload) + 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 { @@ -227,11 +230,13 @@ func (o *InternalV1PowervsLocationsTagPostUnauthorized) Code() int { } func (o *InternalV1PowervsLocationsTagPostUnauthorized) Error() string { - return fmt.Sprintf("[POST /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagPostUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagPostUnauthorized %s", 401, payload) } func (o *InternalV1PowervsLocationsTagPostUnauthorized) String() string { - return fmt.Sprintf("[POST /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagPostUnauthorized %+v", 401, o.Payload) + 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 { @@ -295,11 +300,13 @@ func (o *InternalV1PowervsLocationsTagPostUnprocessableEntity) Code() int { } func (o *InternalV1PowervsLocationsTagPostUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagPostUnprocessableEntity %+v", 422, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagPostUnprocessableEntity %s", 422, payload) } func (o *InternalV1PowervsLocationsTagPostUnprocessableEntity) String() string { - return fmt.Sprintf("[POST /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagPostUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -363,11 +370,13 @@ func (o *InternalV1PowervsLocationsTagPostInternalServerError) Code() int { } func (o *InternalV1PowervsLocationsTagPostInternalServerError) Error() string { - return fmt.Sprintf("[POST /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagPostInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagPostInternalServerError %s", 500, payload) } func (o *InternalV1PowervsLocationsTagPostInternalServerError) String() string { - return fmt.Sprintf("[POST /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagPostInternalServerError %+v", 500, o.Payload) + 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 { 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 index a65dc9f3..dca379c2 100644 --- 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 @@ -6,6 +6,7 @@ package internal_power_v_s_locations // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -91,11 +92,13 @@ func (o *InternalV1PowervsLocationsTransitgatewayGetOK) Code() int { } func (o *InternalV1PowervsLocationsTransitgatewayGetOK) Error() string { - return fmt.Sprintf("[GET /internal/v1/powervs/locations/transit-gateway][%d] internalV1PowervsLocationsTransitgatewayGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /internal/v1/powervs/locations/transit-gateway][%d] internalV1PowervsLocationsTransitgatewayGetOK %+v", 200, o.Payload) + 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 { @@ -159,11 +162,13 @@ func (o *InternalV1PowervsLocationsTransitgatewayGetForbidden) Code() int { } func (o *InternalV1PowervsLocationsTransitgatewayGetForbidden) Error() string { - return fmt.Sprintf("[GET /internal/v1/powervs/locations/transit-gateway][%d] internalV1PowervsLocationsTransitgatewayGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /internal/v1/powervs/locations/transit-gateway][%d] internalV1PowervsLocationsTransitgatewayGetForbidden %+v", 403, o.Payload) + 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 { @@ -227,11 +232,13 @@ func (o *InternalV1PowervsLocationsTransitgatewayGetInternalServerError) Code() } func (o *InternalV1PowervsLocationsTransitgatewayGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /internal/v1/powervs/locations/transit-gateway][%d] internalV1PowervsLocationsTransitgatewayGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /internal/v1/powervs/locations/transit-gateway][%d] internalV1PowervsLocationsTransitgatewayGetInternalServerError %+v", 500, o.Payload) + 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 { diff --git a/power/client/internal_storage_regions/internal_storage_regions_client.go b/power/client/internal_storage_regions/internal_storage_regions_client.go index 6c57756c..82b0960b 100644 --- a/power/client/internal_storage_regions/internal_storage_regions_client.go +++ b/power/client/internal_storage_regions/internal_storage_regions_client.go @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi 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 */ @@ -25,7 +51,7 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods 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 index 8bf2e4d2..97315bc5 100644 --- 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 @@ -6,6 +6,7 @@ package internal_storage_regions // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -103,11 +104,13 @@ func (o *InternalV1StorageRegionsStoragePoolsGetOK) Code() int { } func (o *InternalV1StorageRegionsStoragePoolsGetOK) Error() string { - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsGetOK %+v", 200, o.Payload) + 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 { @@ -169,11 +172,13 @@ func (o *InternalV1StorageRegionsStoragePoolsGetUnauthorized) Code() int { } func (o *InternalV1StorageRegionsStoragePoolsGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -237,11 +242,13 @@ func (o *InternalV1StorageRegionsStoragePoolsGetForbidden) Code() int { } func (o *InternalV1StorageRegionsStoragePoolsGetForbidden) Error() string { - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsGetForbidden %+v", 403, o.Payload) + 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 { @@ -305,11 +312,13 @@ func (o *InternalV1StorageRegionsStoragePoolsGetNotFound) Code() int { } func (o *InternalV1StorageRegionsStoragePoolsGetNotFound) Error() string { - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsGetNotFound %+v", 404, o.Payload) + 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 { @@ -373,11 +382,13 @@ func (o *InternalV1StorageRegionsStoragePoolsGetInternalServerError) Code() int } func (o *InternalV1StorageRegionsStoragePoolsGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsGetInternalServerError %+v", 500, o.Payload) + 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 { 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 index 43e5acda..ce6a4ac2 100644 --- 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 @@ -6,6 +6,7 @@ package internal_storage_regions // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -103,11 +104,13 @@ func (o *InternalV1StorageRegionsStoragePoolsGetallOK) Code() int { } func (o *InternalV1StorageRegionsStoragePoolsGetallOK) Error() string { - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools][%d] internalV1StorageRegionsStoragePoolsGetallOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools][%d] internalV1StorageRegionsStoragePoolsGetallOK %+v", 200, o.Payload) + 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 { @@ -169,11 +172,13 @@ func (o *InternalV1StorageRegionsStoragePoolsGetallUnauthorized) Code() int { } func (o *InternalV1StorageRegionsStoragePoolsGetallUnauthorized) Error() string { - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools][%d] internalV1StorageRegionsStoragePoolsGetallUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools][%d] internalV1StorageRegionsStoragePoolsGetallUnauthorized %+v", 401, o.Payload) + 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 { @@ -237,11 +242,13 @@ func (o *InternalV1StorageRegionsStoragePoolsGetallForbidden) Code() int { } func (o *InternalV1StorageRegionsStoragePoolsGetallForbidden) Error() string { - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools][%d] internalV1StorageRegionsStoragePoolsGetallForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools][%d] internalV1StorageRegionsStoragePoolsGetallForbidden %+v", 403, o.Payload) + 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 { @@ -305,11 +312,13 @@ func (o *InternalV1StorageRegionsStoragePoolsGetallNotFound) Code() int { } func (o *InternalV1StorageRegionsStoragePoolsGetallNotFound) Error() string { - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools][%d] internalV1StorageRegionsStoragePoolsGetallNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools][%d] internalV1StorageRegionsStoragePoolsGetallNotFound %+v", 404, o.Payload) + 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 { @@ -373,11 +382,13 @@ func (o *InternalV1StorageRegionsStoragePoolsGetallInternalServerError) Code() i } func (o *InternalV1StorageRegionsStoragePoolsGetallInternalServerError) Error() string { - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools][%d] internalV1StorageRegionsStoragePoolsGetallInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/storage-pools][%d] internalV1StorageRegionsStoragePoolsGetallInternalServerError %+v", 500, o.Payload) + 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 { 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 index 6df8bdf3..f2957229 100644 --- 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 @@ -6,6 +6,7 @@ package internal_storage_regions // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *InternalV1StorageRegionsStoragePoolsPutOK) Code() int { } func (o *InternalV1StorageRegionsStoragePoolsPutOK) Error() string { - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsPutOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsPutOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *InternalV1StorageRegionsStoragePoolsPutBadRequest) Code() int { } func (o *InternalV1StorageRegionsStoragePoolsPutBadRequest) Error() string { - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsPutBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsPutBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *InternalV1StorageRegionsStoragePoolsPutUnauthorized) Code() int { } func (o *InternalV1StorageRegionsStoragePoolsPutUnauthorized) Error() string { - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsPutUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsPutUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *InternalV1StorageRegionsStoragePoolsPutForbidden) Code() int { } func (o *InternalV1StorageRegionsStoragePoolsPutForbidden) Error() string { - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsPutForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsPutForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *InternalV1StorageRegionsStoragePoolsPutNotFound) Code() int { } func (o *InternalV1StorageRegionsStoragePoolsPutNotFound) Error() string { - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsPutNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsPutNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *InternalV1StorageRegionsStoragePoolsPutInternalServerError) Code() int } func (o *InternalV1StorageRegionsStoragePoolsPutInternalServerError) Error() string { - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsPutInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/storage-pools/{storage_pool_name}][%d] internalV1StorageRegionsStoragePoolsPutInternalServerError %+v", 500, o.Payload) + 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 { 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 index 0dd69444..84e6ef2f 100644 --- 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 @@ -6,6 +6,7 @@ package internal_storage_regions // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -103,11 +104,13 @@ func (o *InternalV1StorageRegionsThresholdsGetOK) Code() int { } func (o *InternalV1StorageRegionsThresholdsGetOK) Error() string { - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsGetOK %+v", 200, o.Payload) + 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 { @@ -171,11 +174,13 @@ func (o *InternalV1StorageRegionsThresholdsGetUnauthorized) Code() int { } func (o *InternalV1StorageRegionsThresholdsGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -239,11 +244,13 @@ func (o *InternalV1StorageRegionsThresholdsGetForbidden) Code() int { } func (o *InternalV1StorageRegionsThresholdsGetForbidden) Error() string { - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsGetForbidden %+v", 403, o.Payload) + 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 { @@ -307,11 +314,13 @@ func (o *InternalV1StorageRegionsThresholdsGetNotFound) Code() int { } func (o *InternalV1StorageRegionsThresholdsGetNotFound) Error() string { - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsGetNotFound %+v", 404, o.Payload) + 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 { @@ -375,11 +384,13 @@ func (o *InternalV1StorageRegionsThresholdsGetInternalServerError) Code() int { } func (o *InternalV1StorageRegionsThresholdsGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsGetInternalServerError %+v", 500, o.Payload) + 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 { 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 index c52a3f2b..bdb8682e 100644 --- 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 @@ -6,6 +6,7 @@ package internal_storage_regions // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *InternalV1StorageRegionsThresholdsPutAccepted) Code() int { } func (o *InternalV1StorageRegionsThresholdsPutAccepted) Error() string { - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsPutAccepted %+v", 202, o.Payload) + 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 { - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsPutAccepted %+v", 202, o.Payload) + 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 { @@ -183,11 +186,13 @@ func (o *InternalV1StorageRegionsThresholdsPutBadRequest) Code() int { } func (o *InternalV1StorageRegionsThresholdsPutBadRequest) Error() string { - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsPutBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsPutBadRequest %+v", 400, o.Payload) + 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 { @@ -251,11 +256,13 @@ func (o *InternalV1StorageRegionsThresholdsPutUnauthorized) Code() int { } func (o *InternalV1StorageRegionsThresholdsPutUnauthorized) Error() string { - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsPutUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsPutUnauthorized %+v", 401, o.Payload) + 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 { @@ -319,11 +326,13 @@ func (o *InternalV1StorageRegionsThresholdsPutForbidden) Code() int { } func (o *InternalV1StorageRegionsThresholdsPutForbidden) Error() string { - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsPutForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsPutForbidden %+v", 403, o.Payload) + 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 { @@ -387,11 +396,13 @@ func (o *InternalV1StorageRegionsThresholdsPutConflict) Code() int { } func (o *InternalV1StorageRegionsThresholdsPutConflict) Error() string { - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsPutConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsPutConflict %+v", 409, o.Payload) + 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 { @@ -455,11 +466,13 @@ func (o *InternalV1StorageRegionsThresholdsPutUnprocessableEntity) Code() int { } func (o *InternalV1StorageRegionsThresholdsPutUnprocessableEntity) Error() string { - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsPutUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsPutUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -523,11 +536,13 @@ func (o *InternalV1StorageRegionsThresholdsPutInternalServerError) Code() int { } func (o *InternalV1StorageRegionsThresholdsPutInternalServerError) Error() string { - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsPutInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[PUT /internal/v1/storage/regions/{region_zone_id}/thresholds][%d] internalV1StorageRegionsThresholdsPutInternalServerError %+v", 500, o.Payload) + 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 { diff --git a/power/client/internal_transit_gateway/internal_transit_gateway_client.go b/power/client/internal_transit_gateway/internal_transit_gateway_client.go index 7e54f6c3..98f09bfb 100644 --- a/power/client/internal_transit_gateway/internal_transit_gateway_client.go +++ b/power/client/internal_transit_gateway/internal_transit_gateway_client.go @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi 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 */ @@ -25,7 +51,7 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods 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 index e39c82b9..bfb08462 100644 --- a/power/client/internal_transit_gateway/internal_v1_transitgateway_get_responses.go +++ b/power/client/internal_transit_gateway/internal_v1_transitgateway_get_responses.go @@ -6,6 +6,7 @@ package internal_transit_gateway // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -85,11 +86,13 @@ func (o *InternalV1TransitgatewayGetOK) Code() int { } func (o *InternalV1TransitgatewayGetOK) Error() string { - return fmt.Sprintf("[GET /internal/v1/transit-gateway/{powervs_service_crn}][%d] internalV1TransitgatewayGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /internal/v1/transit-gateway/{powervs_service_crn}][%d] internalV1TransitgatewayGetOK %+v", 200, o.Payload) + 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 { @@ -153,11 +156,13 @@ func (o *InternalV1TransitgatewayGetForbidden) Code() int { } func (o *InternalV1TransitgatewayGetForbidden) Error() string { - return fmt.Sprintf("[GET /internal/v1/transit-gateway/{powervs_service_crn}][%d] internalV1TransitgatewayGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /internal/v1/transit-gateway/{powervs_service_crn}][%d] internalV1TransitgatewayGetForbidden %+v", 403, o.Payload) + 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 { diff --git a/power/client/open_stacks/open_stacks_client.go b/power/client/open_stacks/open_stacks_client.go index 7cce851e..2d2f3f66 100644 --- a/power/client/open_stacks/open_stacks_client.go +++ b/power/client/open_stacks/open_stacks_client.go @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi 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 */ @@ -25,7 +51,7 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods diff --git a/power/client/open_stacks/service_broker_openstacks_get_responses.go b/power/client/open_stacks/service_broker_openstacks_get_responses.go index 4dc173d8..f60ec26e 100644 --- a/power/client/open_stacks/service_broker_openstacks_get_responses.go +++ b/power/client/open_stacks/service_broker_openstacks_get_responses.go @@ -6,6 +6,7 @@ package open_stacks // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *ServiceBrokerOpenstacksGetOK) Code() int { } func (o *ServiceBrokerOpenstacksGetOK) Error() string { - return fmt.Sprintf("[GET /broker/v1/openstacks][%d] serviceBrokerOpenstacksGetOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/openstacks][%d] serviceBrokerOpenstacksGetOK %s", 200, payload) } func (o *ServiceBrokerOpenstacksGetOK) String() string { - return fmt.Sprintf("[GET /broker/v1/openstacks][%d] serviceBrokerOpenstacksGetOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/openstacks][%d] serviceBrokerOpenstacksGetOK %s", 200, payload) } func (o *ServiceBrokerOpenstacksGetOK) GetPayload() *models.OpenStacks { @@ -177,11 +180,13 @@ func (o *ServiceBrokerOpenstacksGetBadRequest) Code() int { } func (o *ServiceBrokerOpenstacksGetBadRequest) Error() string { - return fmt.Sprintf("[GET /broker/v1/openstacks][%d] serviceBrokerOpenstacksGetBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/openstacks][%d] serviceBrokerOpenstacksGetBadRequest %s", 400, payload) } func (o *ServiceBrokerOpenstacksGetBadRequest) String() string { - return fmt.Sprintf("[GET /broker/v1/openstacks][%d] serviceBrokerOpenstacksGetBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/openstacks][%d] serviceBrokerOpenstacksGetBadRequest %s", 400, payload) } func (o *ServiceBrokerOpenstacksGetBadRequest) GetPayload() *models.Error { @@ -245,11 +250,13 @@ func (o *ServiceBrokerOpenstacksGetUnauthorized) Code() int { } func (o *ServiceBrokerOpenstacksGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /broker/v1/openstacks][%d] serviceBrokerOpenstacksGetUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/openstacks][%d] serviceBrokerOpenstacksGetUnauthorized %s", 401, payload) } func (o *ServiceBrokerOpenstacksGetUnauthorized) String() string { - return fmt.Sprintf("[GET /broker/v1/openstacks][%d] serviceBrokerOpenstacksGetUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/openstacks][%d] serviceBrokerOpenstacksGetUnauthorized %s", 401, payload) } func (o *ServiceBrokerOpenstacksGetUnauthorized) GetPayload() *models.Error { @@ -313,11 +320,13 @@ func (o *ServiceBrokerOpenstacksGetForbidden) Code() int { } func (o *ServiceBrokerOpenstacksGetForbidden) Error() string { - return fmt.Sprintf("[GET /broker/v1/openstacks][%d] serviceBrokerOpenstacksGetForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/openstacks][%d] serviceBrokerOpenstacksGetForbidden %s", 403, payload) } func (o *ServiceBrokerOpenstacksGetForbidden) String() string { - return fmt.Sprintf("[GET /broker/v1/openstacks][%d] serviceBrokerOpenstacksGetForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/openstacks][%d] serviceBrokerOpenstacksGetForbidden %s", 403, payload) } func (o *ServiceBrokerOpenstacksGetForbidden) GetPayload() *models.Error { @@ -381,11 +390,13 @@ func (o *ServiceBrokerOpenstacksGetNotFound) Code() int { } func (o *ServiceBrokerOpenstacksGetNotFound) Error() string { - return fmt.Sprintf("[GET /broker/v1/openstacks][%d] serviceBrokerOpenstacksGetNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/openstacks][%d] serviceBrokerOpenstacksGetNotFound %s", 404, payload) } func (o *ServiceBrokerOpenstacksGetNotFound) String() string { - return fmt.Sprintf("[GET /broker/v1/openstacks][%d] serviceBrokerOpenstacksGetNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/openstacks][%d] serviceBrokerOpenstacksGetNotFound %s", 404, payload) } func (o *ServiceBrokerOpenstacksGetNotFound) GetPayload() *models.Error { @@ -449,11 +460,13 @@ func (o *ServiceBrokerOpenstacksGetInternalServerError) Code() int { } func (o *ServiceBrokerOpenstacksGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /broker/v1/openstacks][%d] serviceBrokerOpenstacksGetInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/openstacks][%d] serviceBrokerOpenstacksGetInternalServerError %s", 500, payload) } func (o *ServiceBrokerOpenstacksGetInternalServerError) String() string { - return fmt.Sprintf("[GET /broker/v1/openstacks][%d] serviceBrokerOpenstacksGetInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/openstacks][%d] serviceBrokerOpenstacksGetInternalServerError %s", 500, payload) } func (o *ServiceBrokerOpenstacksGetInternalServerError) GetPayload() *models.Error { 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 index b7fa6312..fa1ef4d3 100644 --- a/power/client/open_stacks/service_broker_openstacks_hosts_get_responses.go +++ b/power/client/open_stacks/service_broker_openstacks_hosts_get_responses.go @@ -6,6 +6,7 @@ package open_stacks // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -97,11 +98,13 @@ func (o *ServiceBrokerOpenstacksHostsGetOK) Code() int { } func (o *ServiceBrokerOpenstacksHostsGetOK) Error() string { - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/hosts/{hostname}][%d] serviceBrokerOpenstacksHostsGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/hosts/{hostname}][%d] serviceBrokerOpenstacksHostsGetOK %+v", 200, o.Payload) + 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 { @@ -165,11 +168,13 @@ func (o *ServiceBrokerOpenstacksHostsGetBadRequest) Code() int { } func (o *ServiceBrokerOpenstacksHostsGetBadRequest) Error() string { - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/hosts/{hostname}][%d] serviceBrokerOpenstacksHostsGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/hosts/{hostname}][%d] serviceBrokerOpenstacksHostsGetBadRequest %+v", 400, o.Payload) + 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 { @@ -233,11 +238,13 @@ func (o *ServiceBrokerOpenstacksHostsGetNotFound) Code() int { } func (o *ServiceBrokerOpenstacksHostsGetNotFound) Error() string { - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/hosts/{hostname}][%d] serviceBrokerOpenstacksHostsGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/hosts/{hostname}][%d] serviceBrokerOpenstacksHostsGetNotFound %+v", 404, o.Payload) + 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 { @@ -301,11 +308,13 @@ func (o *ServiceBrokerOpenstacksHostsGetInternalServerError) Code() int { } func (o *ServiceBrokerOpenstacksHostsGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/hosts/{hostname}][%d] serviceBrokerOpenstacksHostsGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/hosts/{hostname}][%d] serviceBrokerOpenstacksHostsGetInternalServerError %+v", 500, o.Payload) + 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 { 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 index ea4ea262..1586beb5 100644 --- a/power/client/open_stacks/service_broker_openstacks_openstack_get_responses.go +++ b/power/client/open_stacks/service_broker_openstacks_openstack_get_responses.go @@ -6,6 +6,7 @@ package open_stacks // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *ServiceBrokerOpenstacksOpenstackGetOK) Code() int { } func (o *ServiceBrokerOpenstacksOpenstackGetOK) Error() string { - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}][%d] serviceBrokerOpenstacksOpenstackGetOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}][%d] serviceBrokerOpenstacksOpenstackGetOK %s", 200, payload) } func (o *ServiceBrokerOpenstacksOpenstackGetOK) String() string { - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}][%d] serviceBrokerOpenstacksOpenstackGetOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *ServiceBrokerOpenstacksOpenstackGetBadRequest) Code() int { } func (o *ServiceBrokerOpenstacksOpenstackGetBadRequest) Error() string { - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}][%d] serviceBrokerOpenstacksOpenstackGetBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}][%d] serviceBrokerOpenstacksOpenstackGetBadRequest %s", 400, payload) } func (o *ServiceBrokerOpenstacksOpenstackGetBadRequest) String() string { - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}][%d] serviceBrokerOpenstacksOpenstackGetBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *ServiceBrokerOpenstacksOpenstackGetUnauthorized) Code() int { } func (o *ServiceBrokerOpenstacksOpenstackGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}][%d] serviceBrokerOpenstacksOpenstackGetUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}][%d] serviceBrokerOpenstacksOpenstackGetUnauthorized %s", 401, payload) } func (o *ServiceBrokerOpenstacksOpenstackGetUnauthorized) String() string { - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}][%d] serviceBrokerOpenstacksOpenstackGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *ServiceBrokerOpenstacksOpenstackGetForbidden) Code() int { } func (o *ServiceBrokerOpenstacksOpenstackGetForbidden) Error() string { - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}][%d] serviceBrokerOpenstacksOpenstackGetForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}][%d] serviceBrokerOpenstacksOpenstackGetForbidden %s", 403, payload) } func (o *ServiceBrokerOpenstacksOpenstackGetForbidden) String() string { - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}][%d] serviceBrokerOpenstacksOpenstackGetForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *ServiceBrokerOpenstacksOpenstackGetNotFound) Code() int { } func (o *ServiceBrokerOpenstacksOpenstackGetNotFound) Error() string { - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}][%d] serviceBrokerOpenstacksOpenstackGetNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}][%d] serviceBrokerOpenstacksOpenstackGetNotFound %s", 404, payload) } func (o *ServiceBrokerOpenstacksOpenstackGetNotFound) String() string { - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}][%d] serviceBrokerOpenstacksOpenstackGetNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *ServiceBrokerOpenstacksOpenstackGetInternalServerError) Code() int { } func (o *ServiceBrokerOpenstacksOpenstackGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}][%d] serviceBrokerOpenstacksOpenstackGetInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}][%d] serviceBrokerOpenstacksOpenstackGetInternalServerError %s", 500, payload) } func (o *ServiceBrokerOpenstacksOpenstackGetInternalServerError) String() string { - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}][%d] serviceBrokerOpenstacksOpenstackGetInternalServerError %+v", 500, o.Payload) + 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 { diff --git a/power/client/open_stacks/service_broker_openstacks_post_responses.go b/power/client/open_stacks/service_broker_openstacks_post_responses.go index e7021aaa..5ad6d9ea 100644 --- a/power/client/open_stacks/service_broker_openstacks_post_responses.go +++ b/power/client/open_stacks/service_broker_openstacks_post_responses.go @@ -6,6 +6,7 @@ package open_stacks // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -127,11 +128,13 @@ func (o *ServiceBrokerOpenstacksPostOK) Code() int { } func (o *ServiceBrokerOpenstacksPostOK) Error() string { - return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostOK %s", 200, payload) } func (o *ServiceBrokerOpenstacksPostOK) String() string { - return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostOK %s", 200, payload) } func (o *ServiceBrokerOpenstacksPostOK) GetPayload() *models.OpenStack { @@ -195,11 +198,13 @@ func (o *ServiceBrokerOpenstacksPostCreated) Code() int { } func (o *ServiceBrokerOpenstacksPostCreated) Error() string { - return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostCreated %+v", 201, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostCreated %s", 201, payload) } func (o *ServiceBrokerOpenstacksPostCreated) String() string { - return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostCreated %+v", 201, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostCreated %s", 201, payload) } func (o *ServiceBrokerOpenstacksPostCreated) GetPayload() *models.OpenStack { @@ -263,11 +268,13 @@ func (o *ServiceBrokerOpenstacksPostBadRequest) Code() int { } func (o *ServiceBrokerOpenstacksPostBadRequest) Error() string { - return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostBadRequest %s", 400, payload) } func (o *ServiceBrokerOpenstacksPostBadRequest) String() string { - return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostBadRequest %s", 400, payload) } func (o *ServiceBrokerOpenstacksPostBadRequest) GetPayload() *models.Error { @@ -331,11 +338,13 @@ func (o *ServiceBrokerOpenstacksPostUnauthorized) Code() int { } func (o *ServiceBrokerOpenstacksPostUnauthorized) Error() string { - return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostUnauthorized %s", 401, payload) } func (o *ServiceBrokerOpenstacksPostUnauthorized) String() string { - return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostUnauthorized %s", 401, payload) } func (o *ServiceBrokerOpenstacksPostUnauthorized) GetPayload() *models.Error { @@ -399,11 +408,13 @@ func (o *ServiceBrokerOpenstacksPostForbidden) Code() int { } func (o *ServiceBrokerOpenstacksPostForbidden) Error() string { - return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostForbidden %s", 403, payload) } func (o *ServiceBrokerOpenstacksPostForbidden) String() string { - return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostForbidden %s", 403, payload) } func (o *ServiceBrokerOpenstacksPostForbidden) GetPayload() *models.Error { @@ -467,11 +478,13 @@ func (o *ServiceBrokerOpenstacksPostNotFound) Code() int { } func (o *ServiceBrokerOpenstacksPostNotFound) Error() string { - return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostNotFound %s", 404, payload) } func (o *ServiceBrokerOpenstacksPostNotFound) String() string { - return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostNotFound %s", 404, payload) } func (o *ServiceBrokerOpenstacksPostNotFound) GetPayload() *models.Error { @@ -535,11 +548,13 @@ func (o *ServiceBrokerOpenstacksPostConflict) Code() int { } func (o *ServiceBrokerOpenstacksPostConflict) Error() string { - return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostConflict %+v", 409, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostConflict %s", 409, payload) } func (o *ServiceBrokerOpenstacksPostConflict) String() string { - return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostConflict %+v", 409, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostConflict %s", 409, payload) } func (o *ServiceBrokerOpenstacksPostConflict) GetPayload() *models.Error { @@ -603,11 +618,13 @@ func (o *ServiceBrokerOpenstacksPostUnprocessableEntity) Code() int { } func (o *ServiceBrokerOpenstacksPostUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostUnprocessableEntity %+v", 422, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostUnprocessableEntity %s", 422, payload) } func (o *ServiceBrokerOpenstacksPostUnprocessableEntity) String() string { - return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostUnprocessableEntity %+v", 422, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostUnprocessableEntity %s", 422, payload) } func (o *ServiceBrokerOpenstacksPostUnprocessableEntity) GetPayload() *models.Error { @@ -671,11 +688,13 @@ func (o *ServiceBrokerOpenstacksPostInternalServerError) Code() int { } func (o *ServiceBrokerOpenstacksPostInternalServerError) Error() string { - return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostInternalServerError %s", 500, payload) } func (o *ServiceBrokerOpenstacksPostInternalServerError) String() string { - return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /broker/v1/openstacks][%d] serviceBrokerOpenstacksPostInternalServerError %s", 500, payload) } func (o *ServiceBrokerOpenstacksPostInternalServerError) GetPayload() *models.Error { 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 index 38e73206..46465a5d 100644 --- a/power/client/open_stacks/service_broker_openstacks_servers_get_responses.go +++ b/power/client/open_stacks/service_broker_openstacks_servers_get_responses.go @@ -6,6 +6,7 @@ package open_stacks // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *ServiceBrokerOpenstacksServersGetOK) Code() int { } func (o *ServiceBrokerOpenstacksServersGetOK) Error() string { - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/servers/{pvm_instance_id}][%d] serviceBrokerOpenstacksServersGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/servers/{pvm_instance_id}][%d] serviceBrokerOpenstacksServersGetOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *ServiceBrokerOpenstacksServersGetBadRequest) Code() int { } func (o *ServiceBrokerOpenstacksServersGetBadRequest) Error() string { - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/servers/{pvm_instance_id}][%d] serviceBrokerOpenstacksServersGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/servers/{pvm_instance_id}][%d] serviceBrokerOpenstacksServersGetBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *ServiceBrokerOpenstacksServersGetUnauthorized) Code() int { } func (o *ServiceBrokerOpenstacksServersGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/servers/{pvm_instance_id}][%d] serviceBrokerOpenstacksServersGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/servers/{pvm_instance_id}][%d] serviceBrokerOpenstacksServersGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *ServiceBrokerOpenstacksServersGetForbidden) Code() int { } func (o *ServiceBrokerOpenstacksServersGetForbidden) Error() string { - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/servers/{pvm_instance_id}][%d] serviceBrokerOpenstacksServersGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/servers/{pvm_instance_id}][%d] serviceBrokerOpenstacksServersGetForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *ServiceBrokerOpenstacksServersGetNotFound) Code() int { } func (o *ServiceBrokerOpenstacksServersGetNotFound) Error() string { - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/servers/{pvm_instance_id}][%d] serviceBrokerOpenstacksServersGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/servers/{pvm_instance_id}][%d] serviceBrokerOpenstacksServersGetNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *ServiceBrokerOpenstacksServersGetInternalServerError) Code() int { } func (o *ServiceBrokerOpenstacksServersGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/servers/{pvm_instance_id}][%d] serviceBrokerOpenstacksServersGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /broker/v1/openstacks/{openstack_id}/servers/{pvm_instance_id}][%d] serviceBrokerOpenstacksServersGetInternalServerError %+v", 500, o.Payload) + 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 { 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 index 864741d5..d89d215e 100644 --- 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 @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi 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 */ @@ -25,7 +51,7 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods 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 index 1cc559d2..bd961338 100644 --- a/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_delete_responses.go +++ b/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_delete_responses.go @@ -6,6 +6,7 @@ package p_cloud_cloud_connections // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -127,11 +128,13 @@ func (o *PcloudCloudconnectionsDeleteOK) Code() int { } func (o *PcloudCloudconnectionsDeleteOK) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsDeleteOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsDeleteOK %+v", 200, o.Payload) + 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 { @@ -193,11 +196,13 @@ func (o *PcloudCloudconnectionsDeleteAccepted) Code() int { } func (o *PcloudCloudconnectionsDeleteAccepted) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsDeleteAccepted %+v", 202, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsDeleteAccepted %+v", 202, o.Payload) + 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 { @@ -261,11 +266,13 @@ func (o *PcloudCloudconnectionsDeleteBadRequest) Code() int { } func (o *PcloudCloudconnectionsDeleteBadRequest) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsDeleteBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsDeleteBadRequest %+v", 400, o.Payload) + 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 { @@ -329,11 +336,13 @@ func (o *PcloudCloudconnectionsDeleteUnauthorized) Code() int { } func (o *PcloudCloudconnectionsDeleteUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsDeleteUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsDeleteUnauthorized %+v", 401, o.Payload) + 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 { @@ -397,11 +406,13 @@ func (o *PcloudCloudconnectionsDeleteForbidden) Code() int { } func (o *PcloudCloudconnectionsDeleteForbidden) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsDeleteForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsDeleteForbidden %+v", 403, o.Payload) + 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 { @@ -465,11 +476,13 @@ func (o *PcloudCloudconnectionsDeleteNotFound) Code() int { } func (o *PcloudCloudconnectionsDeleteNotFound) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsDeleteNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsDeleteNotFound %+v", 404, o.Payload) + 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 { @@ -533,11 +546,13 @@ func (o *PcloudCloudconnectionsDeleteRequestTimeout) Code() int { } func (o *PcloudCloudconnectionsDeleteRequestTimeout) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsDeleteRequestTimeout %+v", 408, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsDeleteRequestTimeout %+v", 408, o.Payload) + 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 { @@ -601,11 +616,13 @@ func (o *PcloudCloudconnectionsDeleteGone) Code() int { } func (o *PcloudCloudconnectionsDeleteGone) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsDeleteGone %+v", 410, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsDeleteGone %+v", 410, o.Payload) + 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 { @@ -669,11 +686,13 @@ func (o *PcloudCloudconnectionsDeleteInternalServerError) Code() int { } func (o *PcloudCloudconnectionsDeleteInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsDeleteInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsDeleteInternalServerError %+v", 500, o.Payload) + 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 { 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 index f4b8e64a..cd751b72 100644 --- a/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_get_responses.go +++ b/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_get_responses.go @@ -6,6 +6,7 @@ package p_cloud_cloud_connections // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudCloudconnectionsGetOK) Code() int { } func (o *PcloudCloudconnectionsGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetOK %+v", 200, o.Payload) + 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 { @@ -183,11 +186,13 @@ func (o *PcloudCloudconnectionsGetBadRequest) Code() int { } func (o *PcloudCloudconnectionsGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetBadRequest %+v", 400, o.Payload) + 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 { @@ -251,11 +256,13 @@ func (o *PcloudCloudconnectionsGetUnauthorized) Code() int { } func (o *PcloudCloudconnectionsGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -319,11 +326,13 @@ func (o *PcloudCloudconnectionsGetForbidden) Code() int { } func (o *PcloudCloudconnectionsGetForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetForbidden %+v", 403, o.Payload) + 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 { @@ -387,11 +396,13 @@ func (o *PcloudCloudconnectionsGetNotFound) Code() int { } func (o *PcloudCloudconnectionsGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetNotFound %+v", 404, o.Payload) + 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 { @@ -455,11 +466,13 @@ func (o *PcloudCloudconnectionsGetRequestTimeout) Code() int { } func (o *PcloudCloudconnectionsGetRequestTimeout) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetRequestTimeout %+v", 408, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetRequestTimeout %+v", 408, o.Payload) + 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 { @@ -523,11 +536,13 @@ func (o *PcloudCloudconnectionsGetInternalServerError) Code() int { } func (o *PcloudCloudconnectionsGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsGetInternalServerError %+v", 500, o.Payload) + 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 { 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 index 4cc11e81..e28902dd 100644 --- a/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_getall_responses.go +++ b/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_getall_responses.go @@ -6,6 +6,7 @@ package p_cloud_cloud_connections // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudCloudconnectionsGetallOK) Code() int { } func (o *PcloudCloudconnectionsGetallOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsGetallOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsGetallOK %+v", 200, o.Payload) + 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 { @@ -183,11 +186,13 @@ func (o *PcloudCloudconnectionsGetallBadRequest) Code() int { } func (o *PcloudCloudconnectionsGetallBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsGetallBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsGetallBadRequest %+v", 400, o.Payload) + 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 { @@ -251,11 +256,13 @@ func (o *PcloudCloudconnectionsGetallUnauthorized) Code() int { } func (o *PcloudCloudconnectionsGetallUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsGetallUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsGetallUnauthorized %+v", 401, o.Payload) + 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 { @@ -319,11 +326,13 @@ func (o *PcloudCloudconnectionsGetallForbidden) Code() int { } func (o *PcloudCloudconnectionsGetallForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsGetallForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsGetallForbidden %+v", 403, o.Payload) + 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 { @@ -387,11 +396,13 @@ func (o *PcloudCloudconnectionsGetallNotFound) Code() int { } func (o *PcloudCloudconnectionsGetallNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsGetallNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsGetallNotFound %+v", 404, o.Payload) + 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 { @@ -455,11 +466,13 @@ func (o *PcloudCloudconnectionsGetallRequestTimeout) Code() int { } func (o *PcloudCloudconnectionsGetallRequestTimeout) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsGetallRequestTimeout %+v", 408, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsGetallRequestTimeout %+v", 408, o.Payload) + 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 { @@ -523,11 +536,13 @@ func (o *PcloudCloudconnectionsGetallInternalServerError) Code() int { } func (o *PcloudCloudconnectionsGetallInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsGetallInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsGetallInternalServerError %+v", 500, o.Payload) + 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 { 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 index 4ca9cca7..1a632f6b 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_cloud_connections // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -127,11 +128,13 @@ func (o *PcloudCloudconnectionsNetworksDeleteOK) Code() int { } func (o *PcloudCloudconnectionsNetworksDeleteOK) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksDeleteOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksDeleteOK %+v", 200, o.Payload) + 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 { @@ -193,11 +196,13 @@ func (o *PcloudCloudconnectionsNetworksDeleteAccepted) Code() int { } func (o *PcloudCloudconnectionsNetworksDeleteAccepted) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksDeleteAccepted %+v", 202, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksDeleteAccepted %+v", 202, o.Payload) + 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 { @@ -261,11 +266,13 @@ func (o *PcloudCloudconnectionsNetworksDeleteBadRequest) Code() int { } func (o *PcloudCloudconnectionsNetworksDeleteBadRequest) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksDeleteBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksDeleteBadRequest %+v", 400, o.Payload) + 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 { @@ -329,11 +336,13 @@ func (o *PcloudCloudconnectionsNetworksDeleteUnauthorized) Code() int { } func (o *PcloudCloudconnectionsNetworksDeleteUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksDeleteUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksDeleteUnauthorized %+v", 401, o.Payload) + 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 { @@ -397,11 +406,13 @@ func (o *PcloudCloudconnectionsNetworksDeleteForbidden) Code() int { } func (o *PcloudCloudconnectionsNetworksDeleteForbidden) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksDeleteForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksDeleteForbidden %+v", 403, o.Payload) + 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 { @@ -465,11 +476,13 @@ func (o *PcloudCloudconnectionsNetworksDeleteNotFound) Code() int { } func (o *PcloudCloudconnectionsNetworksDeleteNotFound) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksDeleteNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksDeleteNotFound %+v", 404, o.Payload) + 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 { @@ -533,11 +546,13 @@ func (o *PcloudCloudconnectionsNetworksDeleteRequestTimeout) Code() int { } func (o *PcloudCloudconnectionsNetworksDeleteRequestTimeout) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksDeleteRequestTimeout %+v", 408, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksDeleteRequestTimeout %+v", 408, o.Payload) + 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 { @@ -601,11 +616,13 @@ func (o *PcloudCloudconnectionsNetworksDeleteGone) Code() int { } func (o *PcloudCloudconnectionsNetworksDeleteGone) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksDeleteGone %+v", 410, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksDeleteGone %+v", 410, o.Payload) + 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 { @@ -669,11 +686,13 @@ func (o *PcloudCloudconnectionsNetworksDeleteInternalServerError) Code() int { } func (o *PcloudCloudconnectionsNetworksDeleteInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksDeleteInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksDeleteInternalServerError %+v", 500, o.Payload) + 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 { 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 index afa8d478..7e35af74 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_cloud_connections // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -127,11 +128,13 @@ func (o *PcloudCloudconnectionsNetworksPutOK) Code() int { } func (o *PcloudCloudconnectionsNetworksPutOK) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksPutOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksPutOK %+v", 200, o.Payload) + 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 { @@ -193,11 +196,13 @@ func (o *PcloudCloudconnectionsNetworksPutAccepted) Code() int { } func (o *PcloudCloudconnectionsNetworksPutAccepted) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksPutAccepted %+v", 202, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksPutAccepted %+v", 202, o.Payload) + 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 { @@ -261,11 +266,13 @@ func (o *PcloudCloudconnectionsNetworksPutBadRequest) Code() int { } func (o *PcloudCloudconnectionsNetworksPutBadRequest) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksPutBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksPutBadRequest %+v", 400, o.Payload) + 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 { @@ -329,11 +336,13 @@ func (o *PcloudCloudconnectionsNetworksPutUnauthorized) Code() int { } func (o *PcloudCloudconnectionsNetworksPutUnauthorized) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksPutUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksPutUnauthorized %+v", 401, o.Payload) + 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 { @@ -397,11 +406,13 @@ func (o *PcloudCloudconnectionsNetworksPutForbidden) Code() int { } func (o *PcloudCloudconnectionsNetworksPutForbidden) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksPutForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksPutForbidden %+v", 403, o.Payload) + 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 { @@ -465,11 +476,13 @@ func (o *PcloudCloudconnectionsNetworksPutNotFound) Code() int { } func (o *PcloudCloudconnectionsNetworksPutNotFound) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksPutNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksPutNotFound %+v", 404, o.Payload) + 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 { @@ -533,11 +546,13 @@ func (o *PcloudCloudconnectionsNetworksPutRequestTimeout) Code() int { } func (o *PcloudCloudconnectionsNetworksPutRequestTimeout) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksPutRequestTimeout %+v", 408, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksPutRequestTimeout %+v", 408, o.Payload) + 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 { @@ -601,11 +616,13 @@ func (o *PcloudCloudconnectionsNetworksPutUnprocessableEntity) Code() int { } func (o *PcloudCloudconnectionsNetworksPutUnprocessableEntity) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksPutUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksPutUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -669,11 +686,13 @@ func (o *PcloudCloudconnectionsNetworksPutInternalServerError) Code() int { } func (o *PcloudCloudconnectionsNetworksPutInternalServerError) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksPutInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}/networks/{network_id}][%d] pcloudCloudconnectionsNetworksPutInternalServerError %+v", 500, o.Payload) + 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 { 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 index aa886b9b..485b02fb 100644 --- a/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_post_responses.go +++ b/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_post_responses.go @@ -6,6 +6,7 @@ package p_cloud_cloud_connections // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -151,11 +152,13 @@ func (o *PcloudCloudconnectionsPostOK) Code() int { } func (o *PcloudCloudconnectionsPostOK) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostOK %+v", 200, o.Payload) + 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 { @@ -219,11 +222,13 @@ func (o *PcloudCloudconnectionsPostCreated) Code() int { } func (o *PcloudCloudconnectionsPostCreated) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostCreated %+v", 201, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostCreated %+v", 201, o.Payload) + 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 { @@ -287,11 +292,13 @@ func (o *PcloudCloudconnectionsPostAccepted) Code() int { } func (o *PcloudCloudconnectionsPostAccepted) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostAccepted %+v", 202, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostAccepted %+v", 202, o.Payload) + 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 { @@ -355,11 +362,13 @@ func (o *PcloudCloudconnectionsPostBadRequest) Code() int { } func (o *PcloudCloudconnectionsPostBadRequest) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostBadRequest %+v", 400, o.Payload) + 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 { @@ -423,11 +432,13 @@ func (o *PcloudCloudconnectionsPostUnauthorized) Code() int { } func (o *PcloudCloudconnectionsPostUnauthorized) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostUnauthorized %+v", 401, o.Payload) + 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 { @@ -491,11 +502,13 @@ func (o *PcloudCloudconnectionsPostForbidden) Code() int { } func (o *PcloudCloudconnectionsPostForbidden) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostForbidden %+v", 403, o.Payload) + 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 { @@ -559,11 +572,13 @@ func (o *PcloudCloudconnectionsPostNotFound) Code() int { } func (o *PcloudCloudconnectionsPostNotFound) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostNotFound %+v", 404, o.Payload) + 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 { @@ -627,11 +642,13 @@ func (o *PcloudCloudconnectionsPostRequestTimeout) Code() int { } func (o *PcloudCloudconnectionsPostRequestTimeout) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostRequestTimeout %+v", 408, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostRequestTimeout %+v", 408, o.Payload) + 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 { @@ -695,11 +712,13 @@ func (o *PcloudCloudconnectionsPostConflict) Code() int { } func (o *PcloudCloudconnectionsPostConflict) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostConflict %+v", 409, o.Payload) + 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 { @@ -763,11 +782,13 @@ func (o *PcloudCloudconnectionsPostUnprocessableEntity) Code() int { } func (o *PcloudCloudconnectionsPostUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -831,11 +852,13 @@ func (o *PcloudCloudconnectionsPostInternalServerError) Code() int { } func (o *PcloudCloudconnectionsPostInternalServerError) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostInternalServerError %+v", 500, o.Payload) + 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 { @@ -899,11 +922,13 @@ func (o *PcloudCloudconnectionsPostServiceUnavailable) Code() int { } func (o *PcloudCloudconnectionsPostServiceUnavailable) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostServiceUnavailable %+v", 503, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostServiceUnavailable %+v", 503, o.Payload) + 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 { @@ -967,11 +992,13 @@ func (o *PcloudCloudconnectionsPostGatewayTimeout) Code() int { } func (o *PcloudCloudconnectionsPostGatewayTimeout) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostGatewayTimeout %+v", 504, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections][%d] pcloudCloudconnectionsPostGatewayTimeout %+v", 504, o.Payload) + 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 { 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 index df515672..e2ba3d91 100644 --- a/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_put_responses.go +++ b/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_put_responses.go @@ -6,6 +6,7 @@ package p_cloud_cloud_connections // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -145,11 +146,13 @@ func (o *PcloudCloudconnectionsPutOK) Code() int { } func (o *PcloudCloudconnectionsPutOK) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutOK %+v", 200, o.Payload) + 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 { @@ -213,11 +216,13 @@ func (o *PcloudCloudconnectionsPutAccepted) Code() int { } func (o *PcloudCloudconnectionsPutAccepted) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutAccepted %+v", 202, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutAccepted %+v", 202, o.Payload) + 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 { @@ -281,11 +286,13 @@ func (o *PcloudCloudconnectionsPutBadRequest) Code() int { } func (o *PcloudCloudconnectionsPutBadRequest) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutBadRequest %+v", 400, o.Payload) + 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 { @@ -349,11 +356,13 @@ func (o *PcloudCloudconnectionsPutUnauthorized) Code() int { } func (o *PcloudCloudconnectionsPutUnauthorized) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutUnauthorized %+v", 401, o.Payload) + 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 { @@ -417,11 +426,13 @@ func (o *PcloudCloudconnectionsPutForbidden) Code() int { } func (o *PcloudCloudconnectionsPutForbidden) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutForbidden %+v", 403, o.Payload) + 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 { @@ -485,11 +496,13 @@ func (o *PcloudCloudconnectionsPutNotFound) Code() int { } func (o *PcloudCloudconnectionsPutNotFound) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutNotFound %+v", 404, o.Payload) + 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 { @@ -553,11 +566,13 @@ func (o *PcloudCloudconnectionsPutMethodNotAllowed) Code() int { } func (o *PcloudCloudconnectionsPutMethodNotAllowed) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutMethodNotAllowed %+v", 405, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutMethodNotAllowed %+v", 405, o.Payload) + 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 { @@ -621,11 +636,13 @@ func (o *PcloudCloudconnectionsPutRequestTimeout) Code() int { } func (o *PcloudCloudconnectionsPutRequestTimeout) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutRequestTimeout %+v", 408, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutRequestTimeout %+v", 408, o.Payload) + 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 { @@ -689,11 +706,13 @@ func (o *PcloudCloudconnectionsPutConflict) Code() int { } func (o *PcloudCloudconnectionsPutConflict) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutConflict %+v", 409, o.Payload) + 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 { @@ -757,11 +776,13 @@ func (o *PcloudCloudconnectionsPutUnprocessableEntity) Code() int { } func (o *PcloudCloudconnectionsPutUnprocessableEntity) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -825,11 +846,13 @@ func (o *PcloudCloudconnectionsPutInternalServerError) Code() int { } func (o *PcloudCloudconnectionsPutInternalServerError) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutInternalServerError %+v", 500, o.Payload) + 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 { @@ -893,11 +916,13 @@ func (o *PcloudCloudconnectionsPutServiceUnavailable) Code() int { } func (o *PcloudCloudconnectionsPutServiceUnavailable) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutServiceUnavailable %+v", 503, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}][%d] pcloudCloudconnectionsPutServiceUnavailable %+v", 503, o.Payload) + 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 { 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 index 164c7838..f106b3e8 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_cloud_connections // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -127,11 +128,13 @@ func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallOK) Code() int { } func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections-virtual-private-clouds][%d] pcloudCloudconnectionsVirtualprivatecloudsGetallOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections-virtual-private-clouds][%d] pcloudCloudconnectionsVirtualprivatecloudsGetallOK %+v", 200, o.Payload) + 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 { @@ -195,11 +198,13 @@ func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallBadRequest) Code() int } func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections-virtual-private-clouds][%d] pcloudCloudconnectionsVirtualprivatecloudsGetallBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections-virtual-private-clouds][%d] pcloudCloudconnectionsVirtualprivatecloudsGetallBadRequest %+v", 400, o.Payload) + 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 { @@ -263,11 +268,13 @@ func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized) Code() in } func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections-virtual-private-clouds][%d] pcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections-virtual-private-clouds][%d] pcloudCloudconnectionsVirtualprivatecloudsGetallUnauthorized %+v", 401, o.Payload) + 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 { @@ -331,11 +338,13 @@ func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallForbidden) Code() int { } func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections-virtual-private-clouds][%d] pcloudCloudconnectionsVirtualprivatecloudsGetallForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections-virtual-private-clouds][%d] pcloudCloudconnectionsVirtualprivatecloudsGetallForbidden %+v", 403, o.Payload) + 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 { @@ -399,11 +408,13 @@ func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallNotFound) Code() int { } func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections-virtual-private-clouds][%d] pcloudCloudconnectionsVirtualprivatecloudsGetallNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections-virtual-private-clouds][%d] pcloudCloudconnectionsVirtualprivatecloudsGetallNotFound %+v", 404, o.Payload) + 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 { @@ -467,11 +478,13 @@ func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallRequestTimeout) Code() } func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallRequestTimeout) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections-virtual-private-clouds][%d] pcloudCloudconnectionsVirtualprivatecloudsGetallRequestTimeout %+v", 408, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections-virtual-private-clouds][%d] pcloudCloudconnectionsVirtualprivatecloudsGetallRequestTimeout %+v", 408, o.Payload) + 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 { @@ -535,11 +548,13 @@ func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallInternalServerError) Co } func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections-virtual-private-clouds][%d] pcloudCloudconnectionsVirtualprivatecloudsGetallInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections-virtual-private-clouds][%d] pcloudCloudconnectionsVirtualprivatecloudsGetallInternalServerError %+v", 500, o.Payload) + 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 { @@ -603,11 +618,13 @@ func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallServiceUnavailable) Cod } func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallServiceUnavailable) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections-virtual-private-clouds][%d] pcloudCloudconnectionsVirtualprivatecloudsGetallServiceUnavailable %+v", 503, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections-virtual-private-clouds][%d] pcloudCloudconnectionsVirtualprivatecloudsGetallServiceUnavailable %+v", 503, o.Payload) + 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 { @@ -671,11 +688,13 @@ func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallGatewayTimeout) Code() } func (o *PcloudCloudconnectionsVirtualprivatecloudsGetallGatewayTimeout) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections-virtual-private-clouds][%d] pcloudCloudconnectionsVirtualprivatecloudsGetallGatewayTimeout %+v", 504, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections-virtual-private-clouds][%d] pcloudCloudconnectionsVirtualprivatecloudsGetallGatewayTimeout %+v", 504, o.Payload) + 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 { 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 index bdcf215f..c3a51368 100644 --- 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 @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi 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 */ @@ -25,7 +51,7 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods 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 index 735176d8..b66efb7a 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_disaster_recovery // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudLocationsDisasterrecoveryGetOK) Code() int { } func (o *PcloudLocationsDisasterrecoveryGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudLocationsDisasterrecoveryGetBadRequest) Code() int { } func (o *PcloudLocationsDisasterrecoveryGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudLocationsDisasterrecoveryGetUnauthorized) Code() int { } func (o *PcloudLocationsDisasterrecoveryGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudLocationsDisasterrecoveryGetForbidden) Code() int { } func (o *PcloudLocationsDisasterrecoveryGetForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudLocationsDisasterrecoveryGetNotFound) Code() int { } func (o *PcloudLocationsDisasterrecoveryGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudLocationsDisasterrecoveryGetInternalServerError) Code() int { } func (o *PcloudLocationsDisasterrecoveryGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetInternalServerError %+v", 500, o.Payload) + 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 { 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 index d83e4ff4..92ef9589 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_disaster_recovery // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudLocationsDisasterrecoveryGetallOK) Code() int { } func (o *PcloudLocationsDisasterrecoveryGetallOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetallOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetallOK %s", 200, payload) } func (o *PcloudLocationsDisasterrecoveryGetallOK) String() string { - return fmt.Sprintf("[GET /pcloud/v1/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetallOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudLocationsDisasterrecoveryGetallBadRequest) Code() int { } func (o *PcloudLocationsDisasterrecoveryGetallBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetallBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetallBadRequest %s", 400, payload) } func (o *PcloudLocationsDisasterrecoveryGetallBadRequest) String() string { - return fmt.Sprintf("[GET /pcloud/v1/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetallBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudLocationsDisasterrecoveryGetallUnauthorized) Code() int { } func (o *PcloudLocationsDisasterrecoveryGetallUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetallUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetallUnauthorized %s", 401, payload) } func (o *PcloudLocationsDisasterrecoveryGetallUnauthorized) String() string { - return fmt.Sprintf("[GET /pcloud/v1/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetallUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudLocationsDisasterrecoveryGetallForbidden) Code() int { } func (o *PcloudLocationsDisasterrecoveryGetallForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetallForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetallForbidden %s", 403, payload) } func (o *PcloudLocationsDisasterrecoveryGetallForbidden) String() string { - return fmt.Sprintf("[GET /pcloud/v1/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetallForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudLocationsDisasterrecoveryGetallNotFound) Code() int { } func (o *PcloudLocationsDisasterrecoveryGetallNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetallNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetallNotFound %s", 404, payload) } func (o *PcloudLocationsDisasterrecoveryGetallNotFound) String() string { - return fmt.Sprintf("[GET /pcloud/v1/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetallNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudLocationsDisasterrecoveryGetallInternalServerError) Code() int { } func (o *PcloudLocationsDisasterrecoveryGetallInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetallInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetallInternalServerError %s", 500, payload) } func (o *PcloudLocationsDisasterrecoveryGetallInternalServerError) String() string { - return fmt.Sprintf("[GET /pcloud/v1/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetallInternalServerError %+v", 500, o.Payload) + 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 { diff --git a/power/client/p_cloud_events/p_cloud_events_client.go b/power/client/p_cloud_events/p_cloud_events_client.go index 567b869d..62289661 100644 --- a/power/client/p_cloud_events/p_cloud_events_client.go +++ b/power/client/p_cloud_events/p_cloud_events_client.go @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi 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 */ @@ -25,7 +51,7 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods diff --git a/power/client/p_cloud_events/pcloud_events_get_responses.go b/power/client/p_cloud_events/pcloud_events_get_responses.go index b332e0ec..5e7e5971 100644 --- a/power/client/p_cloud_events/pcloud_events_get_responses.go +++ b/power/client/p_cloud_events/pcloud_events_get_responses.go @@ -6,6 +6,7 @@ package p_cloud_events // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudEventsGetOK) Code() int { } func (o *PcloudEventsGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events/{event_id}][%d] pcloudEventsGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events/{event_id}][%d] pcloudEventsGetOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudEventsGetBadRequest) Code() int { } func (o *PcloudEventsGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events/{event_id}][%d] pcloudEventsGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events/{event_id}][%d] pcloudEventsGetBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudEventsGetUnauthorized) Code() int { } func (o *PcloudEventsGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events/{event_id}][%d] pcloudEventsGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events/{event_id}][%d] pcloudEventsGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudEventsGetForbidden) Code() int { } func (o *PcloudEventsGetForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events/{event_id}][%d] pcloudEventsGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events/{event_id}][%d] pcloudEventsGetForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudEventsGetNotFound) Code() int { } func (o *PcloudEventsGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events/{event_id}][%d] pcloudEventsGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events/{event_id}][%d] pcloudEventsGetNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudEventsGetInternalServerError) Code() int { } func (o *PcloudEventsGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events/{event_id}][%d] pcloudEventsGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events/{event_id}][%d] pcloudEventsGetInternalServerError %+v", 500, o.Payload) + 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 { diff --git a/power/client/p_cloud_events/pcloud_events_getquery_responses.go b/power/client/p_cloud_events/pcloud_events_getquery_responses.go index 97369cbf..8140ed86 100644 --- a/power/client/p_cloud_events/pcloud_events_getquery_responses.go +++ b/power/client/p_cloud_events/pcloud_events_getquery_responses.go @@ -6,6 +6,7 @@ package p_cloud_events // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudEventsGetqueryOK) Code() int { } func (o *PcloudEventsGetqueryOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events][%d] pcloudEventsGetqueryOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events][%d] pcloudEventsGetqueryOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudEventsGetqueryBadRequest) Code() int { } func (o *PcloudEventsGetqueryBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events][%d] pcloudEventsGetqueryBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events][%d] pcloudEventsGetqueryBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudEventsGetqueryUnauthorized) Code() int { } func (o *PcloudEventsGetqueryUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events][%d] pcloudEventsGetqueryUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events][%d] pcloudEventsGetqueryUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudEventsGetqueryForbidden) Code() int { } func (o *PcloudEventsGetqueryForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events][%d] pcloudEventsGetqueryForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events][%d] pcloudEventsGetqueryForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudEventsGetqueryNotFound) Code() int { } func (o *PcloudEventsGetqueryNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events][%d] pcloudEventsGetqueryNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events][%d] pcloudEventsGetqueryNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudEventsGetqueryInternalServerError) Code() int { } func (o *PcloudEventsGetqueryInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events][%d] pcloudEventsGetqueryInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/events][%d] pcloudEventsGetqueryInternalServerError %+v", 500, o.Payload) + 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 { diff --git a/power/client/p_cloud_images/p_cloud_images_client.go b/power/client/p_cloud_images/p_cloud_images_client.go index d8853ee3..4fbd54d5 100644 --- a/power/client/p_cloud_images/p_cloud_images_client.go +++ b/power/client/p_cloud_images/p_cloud_images_client.go @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi 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 */ @@ -25,7 +51,7 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods 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 index 5c288720..d7ad65ac 100644 --- a/power/client/p_cloud_images/pcloud_cloudinstances_images_delete_responses.go +++ b/power/client/p_cloud_images/pcloud_cloudinstances_images_delete_responses.go @@ -6,6 +6,7 @@ package p_cloud_images // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudCloudinstancesImagesDeleteOK) Code() int { } func (o *PcloudCloudinstancesImagesDeleteOK) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesDeleteOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesDeleteOK %+v", 200, o.Payload) + 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 { @@ -181,11 +184,13 @@ func (o *PcloudCloudinstancesImagesDeleteBadRequest) Code() int { } func (o *PcloudCloudinstancesImagesDeleteBadRequest) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesDeleteBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesDeleteBadRequest %+v", 400, o.Payload) + 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 { @@ -249,11 +254,13 @@ func (o *PcloudCloudinstancesImagesDeleteUnauthorized) Code() int { } func (o *PcloudCloudinstancesImagesDeleteUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesDeleteUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesDeleteUnauthorized %+v", 401, o.Payload) + 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 { @@ -317,11 +324,13 @@ func (o *PcloudCloudinstancesImagesDeleteForbidden) Code() int { } func (o *PcloudCloudinstancesImagesDeleteForbidden) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesDeleteForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesDeleteForbidden %+v", 403, o.Payload) + 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 { @@ -385,11 +394,13 @@ func (o *PcloudCloudinstancesImagesDeleteNotFound) Code() int { } func (o *PcloudCloudinstancesImagesDeleteNotFound) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesDeleteNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesDeleteNotFound %+v", 404, o.Payload) + 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 { @@ -453,11 +464,13 @@ func (o *PcloudCloudinstancesImagesDeleteGone) Code() int { } func (o *PcloudCloudinstancesImagesDeleteGone) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesDeleteGone %+v", 410, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesDeleteGone %+v", 410, o.Payload) + 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 { @@ -521,11 +534,13 @@ func (o *PcloudCloudinstancesImagesDeleteInternalServerError) Code() int { } func (o *PcloudCloudinstancesImagesDeleteInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesDeleteInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesDeleteInternalServerError %+v", 500, o.Payload) + 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 { 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 index 8505c878..713448c3 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_images // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudCloudinstancesImagesExportPostAccepted) Code() int { } func (o *PcloudCloudinstancesImagesExportPostAccepted) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudCloudinstancesImagesExportPostAccepted %+v", 202, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudCloudinstancesImagesExportPostAccepted %+v", 202, o.Payload) + 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 { @@ -181,11 +184,13 @@ func (o *PcloudCloudinstancesImagesExportPostBadRequest) Code() int { } func (o *PcloudCloudinstancesImagesExportPostBadRequest) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudCloudinstancesImagesExportPostBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudCloudinstancesImagesExportPostBadRequest %+v", 400, o.Payload) + 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 { @@ -249,11 +254,13 @@ func (o *PcloudCloudinstancesImagesExportPostUnauthorized) Code() int { } func (o *PcloudCloudinstancesImagesExportPostUnauthorized) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudCloudinstancesImagesExportPostUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudCloudinstancesImagesExportPostUnauthorized %+v", 401, o.Payload) + 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 { @@ -317,11 +324,13 @@ func (o *PcloudCloudinstancesImagesExportPostForbidden) Code() int { } func (o *PcloudCloudinstancesImagesExportPostForbidden) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudCloudinstancesImagesExportPostForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudCloudinstancesImagesExportPostForbidden %+v", 403, o.Payload) + 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 { @@ -385,11 +394,13 @@ func (o *PcloudCloudinstancesImagesExportPostNotFound) Code() int { } func (o *PcloudCloudinstancesImagesExportPostNotFound) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudCloudinstancesImagesExportPostNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudCloudinstancesImagesExportPostNotFound %+v", 404, o.Payload) + 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 { @@ -453,11 +464,13 @@ func (o *PcloudCloudinstancesImagesExportPostUnprocessableEntity) Code() int { } func (o *PcloudCloudinstancesImagesExportPostUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudCloudinstancesImagesExportPostUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudCloudinstancesImagesExportPostUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -521,11 +534,13 @@ func (o *PcloudCloudinstancesImagesExportPostInternalServerError) Code() int { } func (o *PcloudCloudinstancesImagesExportPostInternalServerError) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudCloudinstancesImagesExportPostInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudCloudinstancesImagesExportPostInternalServerError %+v", 500, o.Payload) + 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 { 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 index d652ae89..386dd1db 100644 --- a/power/client/p_cloud_images/pcloud_cloudinstances_images_get_responses.go +++ b/power/client/p_cloud_images/pcloud_cloudinstances_images_get_responses.go @@ -6,6 +6,7 @@ package p_cloud_images // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudCloudinstancesImagesGetOK) Code() int { } func (o *PcloudCloudinstancesImagesGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesGetOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudCloudinstancesImagesGetBadRequest) Code() int { } func (o *PcloudCloudinstancesImagesGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesGetBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudCloudinstancesImagesGetUnauthorized) Code() int { } func (o *PcloudCloudinstancesImagesGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudCloudinstancesImagesGetForbidden) Code() int { } func (o *PcloudCloudinstancesImagesGetForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesGetForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudCloudinstancesImagesGetNotFound) Code() int { } func (o *PcloudCloudinstancesImagesGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesGetNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudCloudinstancesImagesGetInternalServerError) Code() int { } func (o *PcloudCloudinstancesImagesGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images/{image_id}][%d] pcloudCloudinstancesImagesGetInternalServerError %+v", 500, o.Payload) + 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 { 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 index 0cfce049..2d7b4d17 100644 --- a/power/client/p_cloud_images/pcloud_cloudinstances_images_getall_responses.go +++ b/power/client/p_cloud_images/pcloud_cloudinstances_images_getall_responses.go @@ -6,6 +6,7 @@ package p_cloud_images // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudCloudinstancesImagesGetallOK) Code() int { } func (o *PcloudCloudinstancesImagesGetallOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesGetallOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesGetallOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudCloudinstancesImagesGetallBadRequest) Code() int { } func (o *PcloudCloudinstancesImagesGetallBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesGetallBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesGetallBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudCloudinstancesImagesGetallUnauthorized) Code() int { } func (o *PcloudCloudinstancesImagesGetallUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesGetallUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesGetallUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudCloudinstancesImagesGetallForbidden) Code() int { } func (o *PcloudCloudinstancesImagesGetallForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesGetallForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesGetallForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudCloudinstancesImagesGetallNotFound) Code() int { } func (o *PcloudCloudinstancesImagesGetallNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesGetallNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesGetallNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudCloudinstancesImagesGetallInternalServerError) Code() int { } func (o *PcloudCloudinstancesImagesGetallInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesGetallInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesGetallInternalServerError %+v", 500, o.Payload) + 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 { 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 index 1dfd822e..86cc15e7 100644 --- a/power/client/p_cloud_images/pcloud_cloudinstances_images_post_responses.go +++ b/power/client/p_cloud_images/pcloud_cloudinstances_images_post_responses.go @@ -6,6 +6,7 @@ package p_cloud_images // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -127,11 +128,13 @@ func (o *PcloudCloudinstancesImagesPostOK) Code() int { } func (o *PcloudCloudinstancesImagesPostOK) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesPostOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesPostOK %+v", 200, o.Payload) + 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 { @@ -195,11 +198,13 @@ func (o *PcloudCloudinstancesImagesPostCreated) Code() int { } func (o *PcloudCloudinstancesImagesPostCreated) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesPostCreated %+v", 201, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesPostCreated %+v", 201, o.Payload) + 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 { @@ -263,11 +268,13 @@ func (o *PcloudCloudinstancesImagesPostBadRequest) Code() int { } func (o *PcloudCloudinstancesImagesPostBadRequest) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesPostBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesPostBadRequest %+v", 400, o.Payload) + 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 { @@ -331,11 +338,13 @@ func (o *PcloudCloudinstancesImagesPostUnauthorized) Code() int { } func (o *PcloudCloudinstancesImagesPostUnauthorized) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesPostUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesPostUnauthorized %+v", 401, o.Payload) + 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 { @@ -399,11 +408,13 @@ func (o *PcloudCloudinstancesImagesPostForbidden) Code() int { } func (o *PcloudCloudinstancesImagesPostForbidden) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesPostForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesPostForbidden %+v", 403, o.Payload) + 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 { @@ -467,11 +478,13 @@ func (o *PcloudCloudinstancesImagesPostNotFound) Code() int { } func (o *PcloudCloudinstancesImagesPostNotFound) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesPostNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesPostNotFound %+v", 404, o.Payload) + 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 { @@ -535,11 +548,13 @@ func (o *PcloudCloudinstancesImagesPostConflict) Code() int { } func (o *PcloudCloudinstancesImagesPostConflict) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesPostConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesPostConflict %+v", 409, o.Payload) + 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 { @@ -603,11 +618,13 @@ func (o *PcloudCloudinstancesImagesPostUnprocessableEntity) Code() int { } func (o *PcloudCloudinstancesImagesPostUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesPostUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesPostUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -671,11 +688,13 @@ func (o *PcloudCloudinstancesImagesPostInternalServerError) Code() int { } func (o *PcloudCloudinstancesImagesPostInternalServerError) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesPostInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/images][%d] pcloudCloudinstancesImagesPostInternalServerError %+v", 500, o.Payload) + 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 { 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 index 0758f724..23c3616f 100644 --- a/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_get_responses.go +++ b/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_get_responses.go @@ -6,6 +6,7 @@ package p_cloud_images // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudCloudinstancesStockimagesGetOK) Code() int { } func (o *PcloudCloudinstancesStockimagesGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images/{image_id}][%d] pcloudCloudinstancesStockimagesGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images/{image_id}][%d] pcloudCloudinstancesStockimagesGetOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudCloudinstancesStockimagesGetBadRequest) Code() int { } func (o *PcloudCloudinstancesStockimagesGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images/{image_id}][%d] pcloudCloudinstancesStockimagesGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images/{image_id}][%d] pcloudCloudinstancesStockimagesGetBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudCloudinstancesStockimagesGetUnauthorized) Code() int { } func (o *PcloudCloudinstancesStockimagesGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images/{image_id}][%d] pcloudCloudinstancesStockimagesGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images/{image_id}][%d] pcloudCloudinstancesStockimagesGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudCloudinstancesStockimagesGetForbidden) Code() int { } func (o *PcloudCloudinstancesStockimagesGetForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images/{image_id}][%d] pcloudCloudinstancesStockimagesGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images/{image_id}][%d] pcloudCloudinstancesStockimagesGetForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudCloudinstancesStockimagesGetNotFound) Code() int { } func (o *PcloudCloudinstancesStockimagesGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images/{image_id}][%d] pcloudCloudinstancesStockimagesGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images/{image_id}][%d] pcloudCloudinstancesStockimagesGetNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudCloudinstancesStockimagesGetInternalServerError) Code() int { } func (o *PcloudCloudinstancesStockimagesGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images/{image_id}][%d] pcloudCloudinstancesStockimagesGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images/{image_id}][%d] pcloudCloudinstancesStockimagesGetInternalServerError %+v", 500, o.Payload) + 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 { 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 index f758bd3a..793017a3 100644 --- a/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_getall_responses.go +++ b/power/client/p_cloud_images/pcloud_cloudinstances_stockimages_getall_responses.go @@ -6,6 +6,7 @@ package p_cloud_images // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudCloudinstancesStockimagesGetallOK) Code() int { } func (o *PcloudCloudinstancesStockimagesGetallOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images][%d] pcloudCloudinstancesStockimagesGetallOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images][%d] pcloudCloudinstancesStockimagesGetallOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudCloudinstancesStockimagesGetallBadRequest) Code() int { } func (o *PcloudCloudinstancesStockimagesGetallBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images][%d] pcloudCloudinstancesStockimagesGetallBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images][%d] pcloudCloudinstancesStockimagesGetallBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudCloudinstancesStockimagesGetallUnauthorized) Code() int { } func (o *PcloudCloudinstancesStockimagesGetallUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images][%d] pcloudCloudinstancesStockimagesGetallUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images][%d] pcloudCloudinstancesStockimagesGetallUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudCloudinstancesStockimagesGetallForbidden) Code() int { } func (o *PcloudCloudinstancesStockimagesGetallForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images][%d] pcloudCloudinstancesStockimagesGetallForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images][%d] pcloudCloudinstancesStockimagesGetallForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudCloudinstancesStockimagesGetallNotFound) Code() int { } func (o *PcloudCloudinstancesStockimagesGetallNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images][%d] pcloudCloudinstancesStockimagesGetallNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images][%d] pcloudCloudinstancesStockimagesGetallNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudCloudinstancesStockimagesGetallInternalServerError) Code() int { } func (o *PcloudCloudinstancesStockimagesGetallInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images][%d] pcloudCloudinstancesStockimagesGetallInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images][%d] pcloudCloudinstancesStockimagesGetallInternalServerError %+v", 500, o.Payload) + 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 { diff --git a/power/client/p_cloud_images/pcloud_images_get_responses.go b/power/client/p_cloud_images/pcloud_images_get_responses.go index 3a216875..a502fc2f 100644 --- a/power/client/p_cloud_images/pcloud_images_get_responses.go +++ b/power/client/p_cloud_images/pcloud_images_get_responses.go @@ -6,6 +6,7 @@ package p_cloud_images // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudImagesGetOK) Code() int { } func (o *PcloudImagesGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/images/{image_id}][%d] pcloudImagesGetOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/images/{image_id}][%d] pcloudImagesGetOK %s", 200, payload) } func (o *PcloudImagesGetOK) String() string { - return fmt.Sprintf("[GET /pcloud/v1/images/{image_id}][%d] pcloudImagesGetOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudImagesGetBadRequest) Code() int { } func (o *PcloudImagesGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/images/{image_id}][%d] pcloudImagesGetBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/images/{image_id}][%d] pcloudImagesGetBadRequest %s", 400, payload) } func (o *PcloudImagesGetBadRequest) String() string { - return fmt.Sprintf("[GET /pcloud/v1/images/{image_id}][%d] pcloudImagesGetBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudImagesGetUnauthorized) Code() int { } func (o *PcloudImagesGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/images/{image_id}][%d] pcloudImagesGetUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/images/{image_id}][%d] pcloudImagesGetUnauthorized %s", 401, payload) } func (o *PcloudImagesGetUnauthorized) String() string { - return fmt.Sprintf("[GET /pcloud/v1/images/{image_id}][%d] pcloudImagesGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudImagesGetForbidden) Code() int { } func (o *PcloudImagesGetForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/images/{image_id}][%d] pcloudImagesGetForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/images/{image_id}][%d] pcloudImagesGetForbidden %s", 403, payload) } func (o *PcloudImagesGetForbidden) String() string { - return fmt.Sprintf("[GET /pcloud/v1/images/{image_id}][%d] pcloudImagesGetForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudImagesGetNotFound) Code() int { } func (o *PcloudImagesGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/images/{image_id}][%d] pcloudImagesGetNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/images/{image_id}][%d] pcloudImagesGetNotFound %s", 404, payload) } func (o *PcloudImagesGetNotFound) String() string { - return fmt.Sprintf("[GET /pcloud/v1/images/{image_id}][%d] pcloudImagesGetNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudImagesGetInternalServerError) Code() int { } func (o *PcloudImagesGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/images/{image_id}][%d] pcloudImagesGetInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/images/{image_id}][%d] pcloudImagesGetInternalServerError %s", 500, payload) } func (o *PcloudImagesGetInternalServerError) String() string { - return fmt.Sprintf("[GET /pcloud/v1/images/{image_id}][%d] pcloudImagesGetInternalServerError %+v", 500, o.Payload) + 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 { diff --git a/power/client/p_cloud_images/pcloud_images_getall_responses.go b/power/client/p_cloud_images/pcloud_images_getall_responses.go index 6da20510..2b50824c 100644 --- a/power/client/p_cloud_images/pcloud_images_getall_responses.go +++ b/power/client/p_cloud_images/pcloud_images_getall_responses.go @@ -6,6 +6,7 @@ package p_cloud_images // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudImagesGetallOK) Code() int { } func (o *PcloudImagesGetallOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/images][%d] pcloudImagesGetallOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/images][%d] pcloudImagesGetallOK %s", 200, payload) } func (o *PcloudImagesGetallOK) String() string { - return fmt.Sprintf("[GET /pcloud/v1/images][%d] pcloudImagesGetallOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/images][%d] pcloudImagesGetallOK %s", 200, payload) } func (o *PcloudImagesGetallOK) GetPayload() *models.Images { @@ -177,11 +180,13 @@ func (o *PcloudImagesGetallBadRequest) Code() int { } func (o *PcloudImagesGetallBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/images][%d] pcloudImagesGetallBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/images][%d] pcloudImagesGetallBadRequest %s", 400, payload) } func (o *PcloudImagesGetallBadRequest) String() string { - return fmt.Sprintf("[GET /pcloud/v1/images][%d] pcloudImagesGetallBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/images][%d] pcloudImagesGetallBadRequest %s", 400, payload) } func (o *PcloudImagesGetallBadRequest) GetPayload() *models.Error { @@ -245,11 +250,13 @@ func (o *PcloudImagesGetallUnauthorized) Code() int { } func (o *PcloudImagesGetallUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/images][%d] pcloudImagesGetallUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/images][%d] pcloudImagesGetallUnauthorized %s", 401, payload) } func (o *PcloudImagesGetallUnauthorized) String() string { - return fmt.Sprintf("[GET /pcloud/v1/images][%d] pcloudImagesGetallUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/images][%d] pcloudImagesGetallUnauthorized %s", 401, payload) } func (o *PcloudImagesGetallUnauthorized) GetPayload() *models.Error { @@ -313,11 +320,13 @@ func (o *PcloudImagesGetallForbidden) Code() int { } func (o *PcloudImagesGetallForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/images][%d] pcloudImagesGetallForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/images][%d] pcloudImagesGetallForbidden %s", 403, payload) } func (o *PcloudImagesGetallForbidden) String() string { - return fmt.Sprintf("[GET /pcloud/v1/images][%d] pcloudImagesGetallForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/images][%d] pcloudImagesGetallForbidden %s", 403, payload) } func (o *PcloudImagesGetallForbidden) GetPayload() *models.Error { @@ -381,11 +390,13 @@ func (o *PcloudImagesGetallNotFound) Code() int { } func (o *PcloudImagesGetallNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/images][%d] pcloudImagesGetallNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/images][%d] pcloudImagesGetallNotFound %s", 404, payload) } func (o *PcloudImagesGetallNotFound) String() string { - return fmt.Sprintf("[GET /pcloud/v1/images][%d] pcloudImagesGetallNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/images][%d] pcloudImagesGetallNotFound %s", 404, payload) } func (o *PcloudImagesGetallNotFound) GetPayload() *models.Error { @@ -449,11 +460,13 @@ func (o *PcloudImagesGetallInternalServerError) Code() int { } func (o *PcloudImagesGetallInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/images][%d] pcloudImagesGetallInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/images][%d] pcloudImagesGetallInternalServerError %s", 500, payload) } func (o *PcloudImagesGetallInternalServerError) String() string { - return fmt.Sprintf("[GET /pcloud/v1/images][%d] pcloudImagesGetallInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/images][%d] pcloudImagesGetallInternalServerError %s", 500, payload) } func (o *PcloudImagesGetallInternalServerError) GetPayload() *models.Error { 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 index 01351d96..b8da793b 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_images // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudV1CloudinstancesCosimagesGetOK) Code() int { } func (o *PcloudV1CloudinstancesCosimagesGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesGetOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudV1CloudinstancesCosimagesGetBadRequest) Code() int { } func (o *PcloudV1CloudinstancesCosimagesGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesGetBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudV1CloudinstancesCosimagesGetUnauthorized) Code() int { } func (o *PcloudV1CloudinstancesCosimagesGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudV1CloudinstancesCosimagesGetForbidden) Code() int { } func (o *PcloudV1CloudinstancesCosimagesGetForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesGetForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudV1CloudinstancesCosimagesGetNotFound) Code() int { } func (o *PcloudV1CloudinstancesCosimagesGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesGetNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudV1CloudinstancesCosimagesGetInternalServerError) Code() int { } func (o *PcloudV1CloudinstancesCosimagesGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesGetInternalServerError %+v", 500, o.Payload) + 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 { 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 index 4e96b47b..036bbb66 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_images // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -121,11 +122,13 @@ func (o *PcloudV1CloudinstancesCosimagesPostAccepted) Code() int { } func (o *PcloudV1CloudinstancesCosimagesPostAccepted) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesPostAccepted %+v", 202, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesPostAccepted %+v", 202, o.Payload) + 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 { @@ -189,11 +192,13 @@ func (o *PcloudV1CloudinstancesCosimagesPostBadRequest) Code() int { } func (o *PcloudV1CloudinstancesCosimagesPostBadRequest) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesPostBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesPostBadRequest %+v", 400, o.Payload) + 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 { @@ -257,11 +262,13 @@ func (o *PcloudV1CloudinstancesCosimagesPostUnauthorized) Code() int { } func (o *PcloudV1CloudinstancesCosimagesPostUnauthorized) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesPostUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesPostUnauthorized %+v", 401, o.Payload) + 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 { @@ -325,11 +332,13 @@ func (o *PcloudV1CloudinstancesCosimagesPostForbidden) Code() int { } func (o *PcloudV1CloudinstancesCosimagesPostForbidden) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesPostForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesPostForbidden %+v", 403, o.Payload) + 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 { @@ -393,11 +402,13 @@ func (o *PcloudV1CloudinstancesCosimagesPostNotFound) Code() int { } func (o *PcloudV1CloudinstancesCosimagesPostNotFound) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesPostNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesPostNotFound %+v", 404, o.Payload) + 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 { @@ -461,11 +472,13 @@ func (o *PcloudV1CloudinstancesCosimagesPostConflict) Code() int { } func (o *PcloudV1CloudinstancesCosimagesPostConflict) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesPostConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesPostConflict %+v", 409, o.Payload) + 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 { @@ -529,11 +542,13 @@ func (o *PcloudV1CloudinstancesCosimagesPostUnprocessableEntity) Code() int { } func (o *PcloudV1CloudinstancesCosimagesPostUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesPostUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesPostUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -597,11 +612,13 @@ func (o *PcloudV1CloudinstancesCosimagesPostInternalServerError) Code() int { } func (o *PcloudV1CloudinstancesCosimagesPostInternalServerError) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesPostInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/cos-images][%d] pcloudV1CloudinstancesCosimagesPostInternalServerError %+v", 500, o.Payload) + 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 { 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 index d1004447..27e8d1e4 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_images // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudV2ImagesExportGetOK) Code() int { } func (o *PcloudV2ImagesExportGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportGetOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudV2ImagesExportGetBadRequest) Code() int { } func (o *PcloudV2ImagesExportGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportGetBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudV2ImagesExportGetUnauthorized) Code() int { } func (o *PcloudV2ImagesExportGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudV2ImagesExportGetForbidden) Code() int { } func (o *PcloudV2ImagesExportGetForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportGetForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudV2ImagesExportGetNotFound) Code() int { } func (o *PcloudV2ImagesExportGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportGetNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudV2ImagesExportGetInternalServerError) Code() int { } func (o *PcloudV2ImagesExportGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportGetInternalServerError %+v", 500, o.Payload) + 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 { 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 index 1778c794..6abf0058 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_images // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -121,11 +122,13 @@ func (o *PcloudV2ImagesExportPostAccepted) Code() int { } func (o *PcloudV2ImagesExportPostAccepted) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportPostAccepted %+v", 202, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportPostAccepted %+v", 202, o.Payload) + 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 { @@ -189,11 +192,13 @@ func (o *PcloudV2ImagesExportPostBadRequest) Code() int { } func (o *PcloudV2ImagesExportPostBadRequest) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportPostBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportPostBadRequest %+v", 400, o.Payload) + 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 { @@ -257,11 +262,13 @@ func (o *PcloudV2ImagesExportPostUnauthorized) Code() int { } func (o *PcloudV2ImagesExportPostUnauthorized) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportPostUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportPostUnauthorized %+v", 401, o.Payload) + 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 { @@ -325,11 +332,13 @@ func (o *PcloudV2ImagesExportPostForbidden) Code() int { } func (o *PcloudV2ImagesExportPostForbidden) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportPostForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportPostForbidden %+v", 403, o.Payload) + 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 { @@ -393,11 +402,13 @@ func (o *PcloudV2ImagesExportPostNotFound) Code() int { } func (o *PcloudV2ImagesExportPostNotFound) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportPostNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportPostNotFound %+v", 404, o.Payload) + 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 { @@ -461,11 +472,13 @@ func (o *PcloudV2ImagesExportPostConflict) Code() int { } func (o *PcloudV2ImagesExportPostConflict) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportPostConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportPostConflict %+v", 409, o.Payload) + 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 { @@ -529,11 +542,13 @@ func (o *PcloudV2ImagesExportPostUnprocessableEntity) Code() int { } func (o *PcloudV2ImagesExportPostUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportPostUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportPostUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -597,11 +612,13 @@ func (o *PcloudV2ImagesExportPostInternalServerError) Code() int { } func (o *PcloudV2ImagesExportPostInternalServerError) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportPostInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/images/{image_id}/export][%d] pcloudV2ImagesExportPostInternalServerError %+v", 500, o.Payload) + 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 { diff --git a/power/client/p_cloud_instances/p_cloud_instances_client.go b/power/client/p_cloud_instances/p_cloud_instances_client.go index 7a43f878..8f7720ee 100644 --- a/power/client/p_cloud_instances/p_cloud_instances_client.go +++ b/power/client/p_cloud_instances/p_cloud_instances_client.go @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi 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 */ @@ -25,7 +51,7 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods diff --git a/power/client/p_cloud_instances/pcloud_cloudinstances_delete_responses.go b/power/client/p_cloud_instances/pcloud_cloudinstances_delete_responses.go index 220add32..380e0d18 100644 --- a/power/client/p_cloud_instances/pcloud_cloudinstances_delete_responses.go +++ b/power/client/p_cloud_instances/pcloud_cloudinstances_delete_responses.go @@ -6,6 +6,7 @@ package p_cloud_instances // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudCloudinstancesDeleteOK) Code() int { } func (o *PcloudCloudinstancesDeleteOK) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesDeleteOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesDeleteOK %+v", 200, o.Payload) + 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 { @@ -181,11 +184,13 @@ func (o *PcloudCloudinstancesDeleteBadRequest) Code() int { } func (o *PcloudCloudinstancesDeleteBadRequest) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesDeleteBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesDeleteBadRequest %+v", 400, o.Payload) + 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 { @@ -249,11 +254,13 @@ func (o *PcloudCloudinstancesDeleteUnauthorized) Code() int { } func (o *PcloudCloudinstancesDeleteUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesDeleteUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesDeleteUnauthorized %+v", 401, o.Payload) + 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 { @@ -317,11 +324,13 @@ func (o *PcloudCloudinstancesDeleteForbidden) Code() int { } func (o *PcloudCloudinstancesDeleteForbidden) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesDeleteForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesDeleteForbidden %+v", 403, o.Payload) + 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 { @@ -385,11 +394,13 @@ func (o *PcloudCloudinstancesDeleteNotFound) Code() int { } func (o *PcloudCloudinstancesDeleteNotFound) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesDeleteNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesDeleteNotFound %+v", 404, o.Payload) + 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 { @@ -453,11 +464,13 @@ func (o *PcloudCloudinstancesDeleteGone) Code() int { } func (o *PcloudCloudinstancesDeleteGone) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesDeleteGone %+v", 410, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesDeleteGone %+v", 410, o.Payload) + 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 { @@ -521,11 +534,13 @@ func (o *PcloudCloudinstancesDeleteInternalServerError) Code() int { } func (o *PcloudCloudinstancesDeleteInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesDeleteInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesDeleteInternalServerError %+v", 500, o.Payload) + 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 { diff --git a/power/client/p_cloud_instances/pcloud_cloudinstances_get_responses.go b/power/client/p_cloud_instances/pcloud_cloudinstances_get_responses.go index 37be0bd2..0c968e37 100644 --- a/power/client/p_cloud_instances/pcloud_cloudinstances_get_responses.go +++ b/power/client/p_cloud_instances/pcloud_cloudinstances_get_responses.go @@ -6,6 +6,7 @@ package p_cloud_instances // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudCloudinstancesGetOK) Code() int { } func (o *PcloudCloudinstancesGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesGetOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudCloudinstancesGetBadRequest) Code() int { } func (o *PcloudCloudinstancesGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesGetBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudCloudinstancesGetUnauthorized) Code() int { } func (o *PcloudCloudinstancesGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudCloudinstancesGetForbidden) Code() int { } func (o *PcloudCloudinstancesGetForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesGetForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudCloudinstancesGetNotFound) Code() int { } func (o *PcloudCloudinstancesGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesGetNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudCloudinstancesGetInternalServerError) Code() int { } func (o *PcloudCloudinstancesGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesGetInternalServerError %+v", 500, o.Payload) + 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 { diff --git a/power/client/p_cloud_instances/pcloud_cloudinstances_put_responses.go b/power/client/p_cloud_instances/pcloud_cloudinstances_put_responses.go index 23f5465c..98f67611 100644 --- a/power/client/p_cloud_instances/pcloud_cloudinstances_put_responses.go +++ b/power/client/p_cloud_instances/pcloud_cloudinstances_put_responses.go @@ -6,6 +6,7 @@ package p_cloud_instances // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudCloudinstancesPutOK) Code() int { } func (o *PcloudCloudinstancesPutOK) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesPutOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesPutOK %+v", 200, o.Payload) + 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 { @@ -183,11 +186,13 @@ func (o *PcloudCloudinstancesPutBadRequest) Code() int { } func (o *PcloudCloudinstancesPutBadRequest) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesPutBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesPutBadRequest %+v", 400, o.Payload) + 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 { @@ -251,11 +256,13 @@ func (o *PcloudCloudinstancesPutUnauthorized) Code() int { } func (o *PcloudCloudinstancesPutUnauthorized) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesPutUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesPutUnauthorized %+v", 401, o.Payload) + 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 { @@ -319,11 +326,13 @@ func (o *PcloudCloudinstancesPutForbidden) Code() int { } func (o *PcloudCloudinstancesPutForbidden) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesPutForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesPutForbidden %+v", 403, o.Payload) + 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 { @@ -387,11 +396,13 @@ func (o *PcloudCloudinstancesPutNotFound) Code() int { } func (o *PcloudCloudinstancesPutNotFound) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesPutNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesPutNotFound %+v", 404, o.Payload) + 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 { @@ -455,11 +466,13 @@ func (o *PcloudCloudinstancesPutUnprocessableEntity) Code() int { } func (o *PcloudCloudinstancesPutUnprocessableEntity) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesPutUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesPutUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -523,11 +536,13 @@ func (o *PcloudCloudinstancesPutInternalServerError) Code() int { } func (o *PcloudCloudinstancesPutInternalServerError) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesPutInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}][%d] pcloudCloudinstancesPutInternalServerError %+v", 500, o.Payload) + 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 { diff --git a/power/client/p_cloud_jobs/p_cloud_jobs_client.go b/power/client/p_cloud_jobs/p_cloud_jobs_client.go index 37612074..d0231988 100644 --- a/power/client/p_cloud_jobs/p_cloud_jobs_client.go +++ b/power/client/p_cloud_jobs/p_cloud_jobs_client.go @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi 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 */ @@ -25,7 +51,7 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods 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 index eac90dc7..615f8e86 100644 --- a/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_delete_responses.go +++ b/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_delete_responses.go @@ -6,6 +6,7 @@ package p_cloud_jobs // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudCloudinstancesJobsDeleteOK) Code() int { } func (o *PcloudCloudinstancesJobsDeleteOK) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsDeleteOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsDeleteOK %+v", 200, o.Payload) + 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 { @@ -181,11 +184,13 @@ func (o *PcloudCloudinstancesJobsDeleteBadRequest) Code() int { } func (o *PcloudCloudinstancesJobsDeleteBadRequest) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsDeleteBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsDeleteBadRequest %+v", 400, o.Payload) + 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 { @@ -249,11 +254,13 @@ func (o *PcloudCloudinstancesJobsDeleteUnauthorized) Code() int { } func (o *PcloudCloudinstancesJobsDeleteUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsDeleteUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsDeleteUnauthorized %+v", 401, o.Payload) + 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 { @@ -317,11 +324,13 @@ func (o *PcloudCloudinstancesJobsDeleteForbidden) Code() int { } func (o *PcloudCloudinstancesJobsDeleteForbidden) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsDeleteForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsDeleteForbidden %+v", 403, o.Payload) + 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 { @@ -385,11 +394,13 @@ func (o *PcloudCloudinstancesJobsDeleteNotFound) Code() int { } func (o *PcloudCloudinstancesJobsDeleteNotFound) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsDeleteNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsDeleteNotFound %+v", 404, o.Payload) + 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 { @@ -453,11 +464,13 @@ func (o *PcloudCloudinstancesJobsDeleteConflict) Code() int { } func (o *PcloudCloudinstancesJobsDeleteConflict) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsDeleteConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsDeleteConflict %+v", 409, o.Payload) + 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 { @@ -521,11 +534,13 @@ func (o *PcloudCloudinstancesJobsDeleteInternalServerError) Code() int { } func (o *PcloudCloudinstancesJobsDeleteInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsDeleteInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsDeleteInternalServerError %+v", 500, o.Payload) + 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 { 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 index 06a8875f..21e1563b 100644 --- a/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_get_responses.go +++ b/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_get_responses.go @@ -6,6 +6,7 @@ package p_cloud_jobs // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudCloudinstancesJobsGetOK) Code() int { } func (o *PcloudCloudinstancesJobsGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsGetOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudCloudinstancesJobsGetBadRequest) Code() int { } func (o *PcloudCloudinstancesJobsGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsGetBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudCloudinstancesJobsGetUnauthorized) Code() int { } func (o *PcloudCloudinstancesJobsGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudCloudinstancesJobsGetForbidden) Code() int { } func (o *PcloudCloudinstancesJobsGetForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsGetForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudCloudinstancesJobsGetNotFound) Code() int { } func (o *PcloudCloudinstancesJobsGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsGetNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudCloudinstancesJobsGetInternalServerError) Code() int { } func (o *PcloudCloudinstancesJobsGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs/{job_id}][%d] pcloudCloudinstancesJobsGetInternalServerError %+v", 500, o.Payload) + 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 { 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 index 543855da..c5dfea04 100644 --- a/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_getall_responses.go +++ b/power/client/p_cloud_jobs/pcloud_cloudinstances_jobs_getall_responses.go @@ -6,6 +6,7 @@ package p_cloud_jobs // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudCloudinstancesJobsGetallOK) Code() int { } func (o *PcloudCloudinstancesJobsGetallOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs][%d] pcloudCloudinstancesJobsGetallOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs][%d] pcloudCloudinstancesJobsGetallOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudCloudinstancesJobsGetallBadRequest) Code() int { } func (o *PcloudCloudinstancesJobsGetallBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs][%d] pcloudCloudinstancesJobsGetallBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs][%d] pcloudCloudinstancesJobsGetallBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudCloudinstancesJobsGetallUnauthorized) Code() int { } func (o *PcloudCloudinstancesJobsGetallUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs][%d] pcloudCloudinstancesJobsGetallUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs][%d] pcloudCloudinstancesJobsGetallUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudCloudinstancesJobsGetallForbidden) Code() int { } func (o *PcloudCloudinstancesJobsGetallForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs][%d] pcloudCloudinstancesJobsGetallForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs][%d] pcloudCloudinstancesJobsGetallForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudCloudinstancesJobsGetallNotFound) Code() int { } func (o *PcloudCloudinstancesJobsGetallNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs][%d] pcloudCloudinstancesJobsGetallNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs][%d] pcloudCloudinstancesJobsGetallNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudCloudinstancesJobsGetallInternalServerError) Code() int { } func (o *PcloudCloudinstancesJobsGetallInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs][%d] pcloudCloudinstancesJobsGetallInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/jobs][%d] pcloudCloudinstancesJobsGetallInternalServerError %+v", 500, o.Payload) + 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 { diff --git a/power/client/p_cloud_networks/p_cloud_networks_client.go b/power/client/p_cloud_networks/p_cloud_networks_client.go index 438b0652..3b57844d 100644 --- a/power/client/p_cloud_networks/p_cloud_networks_client.go +++ b/power/client/p_cloud_networks/p_cloud_networks_client.go @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi 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 */ @@ -25,7 +51,7 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods diff --git a/power/client/p_cloud_networks/pcloud_networks_delete_responses.go b/power/client/p_cloud_networks/pcloud_networks_delete_responses.go index 817554ec..e16ec779 100644 --- a/power/client/p_cloud_networks/pcloud_networks_delete_responses.go +++ b/power/client/p_cloud_networks/pcloud_networks_delete_responses.go @@ -6,6 +6,7 @@ package p_cloud_networks // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudNetworksDeleteOK) Code() int { } func (o *PcloudNetworksDeleteOK) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksDeleteOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksDeleteOK %+v", 200, o.Payload) + 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 { @@ -181,11 +184,13 @@ func (o *PcloudNetworksDeleteBadRequest) Code() int { } func (o *PcloudNetworksDeleteBadRequest) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksDeleteBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksDeleteBadRequest %+v", 400, o.Payload) + 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 { @@ -249,11 +254,13 @@ func (o *PcloudNetworksDeleteUnauthorized) Code() int { } func (o *PcloudNetworksDeleteUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksDeleteUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksDeleteUnauthorized %+v", 401, o.Payload) + 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 { @@ -317,11 +324,13 @@ func (o *PcloudNetworksDeleteForbidden) Code() int { } func (o *PcloudNetworksDeleteForbidden) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksDeleteForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksDeleteForbidden %+v", 403, o.Payload) + 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 { @@ -385,11 +394,13 @@ func (o *PcloudNetworksDeleteNotFound) Code() int { } func (o *PcloudNetworksDeleteNotFound) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksDeleteNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksDeleteNotFound %+v", 404, o.Payload) + 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 { @@ -453,11 +464,13 @@ func (o *PcloudNetworksDeleteGone) Code() int { } func (o *PcloudNetworksDeleteGone) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksDeleteGone %+v", 410, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksDeleteGone %+v", 410, o.Payload) + 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 { @@ -521,11 +534,13 @@ func (o *PcloudNetworksDeleteInternalServerError) Code() int { } func (o *PcloudNetworksDeleteInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksDeleteInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksDeleteInternalServerError %+v", 500, o.Payload) + 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 { diff --git a/power/client/p_cloud_networks/pcloud_networks_get_responses.go b/power/client/p_cloud_networks/pcloud_networks_get_responses.go index 246ae8e3..ab247e2e 100644 --- a/power/client/p_cloud_networks/pcloud_networks_get_responses.go +++ b/power/client/p_cloud_networks/pcloud_networks_get_responses.go @@ -6,6 +6,7 @@ package p_cloud_networks // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudNetworksGetOK) Code() int { } func (o *PcloudNetworksGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksGetOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudNetworksGetBadRequest) Code() int { } func (o *PcloudNetworksGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksGetBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudNetworksGetUnauthorized) Code() int { } func (o *PcloudNetworksGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudNetworksGetForbidden) Code() int { } func (o *PcloudNetworksGetForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksGetForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudNetworksGetNotFound) Code() int { } func (o *PcloudNetworksGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksGetNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudNetworksGetInternalServerError) Code() int { } func (o *PcloudNetworksGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksGetInternalServerError %+v", 500, o.Payload) + 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 { diff --git a/power/client/p_cloud_networks/pcloud_networks_getall_responses.go b/power/client/p_cloud_networks/pcloud_networks_getall_responses.go index 4be69f48..fbb2e47c 100644 --- a/power/client/p_cloud_networks/pcloud_networks_getall_responses.go +++ b/power/client/p_cloud_networks/pcloud_networks_getall_responses.go @@ -6,6 +6,7 @@ package p_cloud_networks // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudNetworksGetallOK) Code() int { } func (o *PcloudNetworksGetallOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksGetallOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksGetallOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudNetworksGetallBadRequest) Code() int { } func (o *PcloudNetworksGetallBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksGetallBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksGetallBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudNetworksGetallUnauthorized) Code() int { } func (o *PcloudNetworksGetallUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksGetallUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksGetallUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudNetworksGetallForbidden) Code() int { } func (o *PcloudNetworksGetallForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksGetallForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksGetallForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudNetworksGetallNotFound) Code() int { } func (o *PcloudNetworksGetallNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksGetallNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksGetallNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudNetworksGetallInternalServerError) Code() int { } func (o *PcloudNetworksGetallInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksGetallInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksGetallInternalServerError %+v", 500, o.Payload) + 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 { 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 index fbfd8646..dad8ee6a 100644 --- a/power/client/p_cloud_networks/pcloud_networks_ports_delete_responses.go +++ b/power/client/p_cloud_networks/pcloud_networks_ports_delete_responses.go @@ -6,6 +6,7 @@ package p_cloud_networks // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudNetworksPortsDeleteOK) Code() int { } func (o *PcloudNetworksPortsDeleteOK) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsDeleteOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsDeleteOK %+v", 200, o.Payload) + 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 { @@ -181,11 +184,13 @@ func (o *PcloudNetworksPortsDeleteBadRequest) Code() int { } func (o *PcloudNetworksPortsDeleteBadRequest) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsDeleteBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsDeleteBadRequest %+v", 400, o.Payload) + 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 { @@ -249,11 +254,13 @@ func (o *PcloudNetworksPortsDeleteUnauthorized) Code() int { } func (o *PcloudNetworksPortsDeleteUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsDeleteUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsDeleteUnauthorized %+v", 401, o.Payload) + 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 { @@ -317,11 +324,13 @@ func (o *PcloudNetworksPortsDeleteForbidden) Code() int { } func (o *PcloudNetworksPortsDeleteForbidden) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsDeleteForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsDeleteForbidden %+v", 403, o.Payload) + 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 { @@ -385,11 +394,13 @@ func (o *PcloudNetworksPortsDeleteNotFound) Code() int { } func (o *PcloudNetworksPortsDeleteNotFound) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsDeleteNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsDeleteNotFound %+v", 404, o.Payload) + 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 { @@ -453,11 +464,13 @@ func (o *PcloudNetworksPortsDeleteGone) Code() int { } func (o *PcloudNetworksPortsDeleteGone) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsDeleteGone %+v", 410, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsDeleteGone %+v", 410, o.Payload) + 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 { @@ -521,11 +534,13 @@ func (o *PcloudNetworksPortsDeleteInternalServerError) Code() int { } func (o *PcloudNetworksPortsDeleteInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsDeleteInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsDeleteInternalServerError %+v", 500, o.Payload) + 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 { 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 index 23eef77d..f9591f57 100644 --- a/power/client/p_cloud_networks/pcloud_networks_ports_get_responses.go +++ b/power/client/p_cloud_networks/pcloud_networks_ports_get_responses.go @@ -6,6 +6,7 @@ package p_cloud_networks // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudNetworksPortsGetOK) Code() int { } func (o *PcloudNetworksPortsGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsGetOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudNetworksPortsGetBadRequest) Code() int { } func (o *PcloudNetworksPortsGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsGetBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudNetworksPortsGetUnauthorized) Code() int { } func (o *PcloudNetworksPortsGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudNetworksPortsGetForbidden) Code() int { } func (o *PcloudNetworksPortsGetForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsGetForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudNetworksPortsGetNotFound) Code() int { } func (o *PcloudNetworksPortsGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsGetNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudNetworksPortsGetInternalServerError) Code() int { } func (o *PcloudNetworksPortsGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsGetInternalServerError %+v", 500, o.Payload) + 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 { 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 index ffe3498c..0c8c6165 100644 --- a/power/client/p_cloud_networks/pcloud_networks_ports_getall_responses.go +++ b/power/client/p_cloud_networks/pcloud_networks_ports_getall_responses.go @@ -6,6 +6,7 @@ package p_cloud_networks // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudNetworksPortsGetallOK) Code() int { } func (o *PcloudNetworksPortsGetallOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsGetallOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsGetallOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudNetworksPortsGetallBadRequest) Code() int { } func (o *PcloudNetworksPortsGetallBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsGetallBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsGetallBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudNetworksPortsGetallUnauthorized) Code() int { } func (o *PcloudNetworksPortsGetallUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsGetallUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsGetallUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudNetworksPortsGetallForbidden) Code() int { } func (o *PcloudNetworksPortsGetallForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsGetallForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsGetallForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudNetworksPortsGetallNotFound) Code() int { } func (o *PcloudNetworksPortsGetallNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsGetallNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsGetallNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudNetworksPortsGetallInternalServerError) Code() int { } func (o *PcloudNetworksPortsGetallInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsGetallInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsGetallInternalServerError %+v", 500, o.Payload) + 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 { 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 index 05a8818d..b5965769 100644 --- a/power/client/p_cloud_networks/pcloud_networks_ports_post_responses.go +++ b/power/client/p_cloud_networks/pcloud_networks_ports_post_responses.go @@ -6,6 +6,7 @@ package p_cloud_networks // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -121,11 +122,13 @@ func (o *PcloudNetworksPortsPostCreated) Code() int { } func (o *PcloudNetworksPortsPostCreated) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsPostCreated %+v", 201, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsPostCreated %+v", 201, o.Payload) + 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 { @@ -189,11 +192,13 @@ func (o *PcloudNetworksPortsPostBadRequest) Code() int { } func (o *PcloudNetworksPortsPostBadRequest) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsPostBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsPostBadRequest %+v", 400, o.Payload) + 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 { @@ -257,11 +262,13 @@ func (o *PcloudNetworksPortsPostUnauthorized) Code() int { } func (o *PcloudNetworksPortsPostUnauthorized) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsPostUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsPostUnauthorized %+v", 401, o.Payload) + 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 { @@ -325,11 +332,13 @@ func (o *PcloudNetworksPortsPostForbidden) Code() int { } func (o *PcloudNetworksPortsPostForbidden) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsPostForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsPostForbidden %+v", 403, o.Payload) + 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 { @@ -393,11 +402,13 @@ func (o *PcloudNetworksPortsPostNotFound) Code() int { } func (o *PcloudNetworksPortsPostNotFound) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsPostNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsPostNotFound %+v", 404, o.Payload) + 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 { @@ -461,11 +472,13 @@ func (o *PcloudNetworksPortsPostConflict) Code() int { } func (o *PcloudNetworksPortsPostConflict) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsPostConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsPostConflict %+v", 409, o.Payload) + 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 { @@ -529,11 +542,13 @@ func (o *PcloudNetworksPortsPostUnprocessableEntity) Code() int { } func (o *PcloudNetworksPortsPostUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsPostUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsPostUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -597,11 +612,13 @@ func (o *PcloudNetworksPortsPostInternalServerError) Code() int { } func (o *PcloudNetworksPortsPostInternalServerError) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsPostInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports][%d] pcloudNetworksPortsPostInternalServerError %+v", 500, o.Payload) + 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 { 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 index 0d18d785..28ef8ea0 100644 --- a/power/client/p_cloud_networks/pcloud_networks_ports_put_responses.go +++ b/power/client/p_cloud_networks/pcloud_networks_ports_put_responses.go @@ -6,6 +6,7 @@ package p_cloud_networks // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudNetworksPortsPutOK) Code() int { } func (o *PcloudNetworksPortsPutOK) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsPutOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsPutOK %+v", 200, o.Payload) + 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 { @@ -183,11 +186,13 @@ func (o *PcloudNetworksPortsPutBadRequest) Code() int { } func (o *PcloudNetworksPortsPutBadRequest) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsPutBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsPutBadRequest %+v", 400, o.Payload) + 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 { @@ -251,11 +256,13 @@ func (o *PcloudNetworksPortsPutUnauthorized) Code() int { } func (o *PcloudNetworksPortsPutUnauthorized) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsPutUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsPutUnauthorized %+v", 401, o.Payload) + 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 { @@ -319,11 +326,13 @@ func (o *PcloudNetworksPortsPutForbidden) Code() int { } func (o *PcloudNetworksPortsPutForbidden) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsPutForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsPutForbidden %+v", 403, o.Payload) + 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 { @@ -387,11 +396,13 @@ func (o *PcloudNetworksPortsPutNotFound) Code() int { } func (o *PcloudNetworksPortsPutNotFound) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsPutNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsPutNotFound %+v", 404, o.Payload) + 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 { @@ -455,11 +466,13 @@ func (o *PcloudNetworksPortsPutUnprocessableEntity) Code() int { } func (o *PcloudNetworksPortsPutUnprocessableEntity) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsPutUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsPutUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -523,11 +536,13 @@ func (o *PcloudNetworksPortsPutInternalServerError) Code() int { } func (o *PcloudNetworksPortsPutInternalServerError) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsPutInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][%d] pcloudNetworksPortsPutInternalServerError %+v", 500, o.Payload) + 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 { diff --git a/power/client/p_cloud_networks/pcloud_networks_post_responses.go b/power/client/p_cloud_networks/pcloud_networks_post_responses.go index a71af6ef..982c363e 100644 --- a/power/client/p_cloud_networks/pcloud_networks_post_responses.go +++ b/power/client/p_cloud_networks/pcloud_networks_post_responses.go @@ -6,6 +6,7 @@ package p_cloud_networks // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -133,11 +134,13 @@ func (o *PcloudNetworksPostOK) Code() int { } func (o *PcloudNetworksPostOK) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostOK %+v", 200, o.Payload) + 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 { @@ -201,11 +204,13 @@ func (o *PcloudNetworksPostCreated) Code() int { } func (o *PcloudNetworksPostCreated) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostCreated %+v", 201, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostCreated %+v", 201, o.Payload) + 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 { @@ -269,11 +274,13 @@ func (o *PcloudNetworksPostBadRequest) Code() int { } func (o *PcloudNetworksPostBadRequest) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostBadRequest %+v", 400, o.Payload) + 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 { @@ -337,11 +344,13 @@ func (o *PcloudNetworksPostUnauthorized) Code() int { } func (o *PcloudNetworksPostUnauthorized) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostUnauthorized %+v", 401, o.Payload) + 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 { @@ -405,11 +414,13 @@ func (o *PcloudNetworksPostForbidden) Code() int { } func (o *PcloudNetworksPostForbidden) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostForbidden %+v", 403, o.Payload) + 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 { @@ -473,11 +484,13 @@ func (o *PcloudNetworksPostNotFound) Code() int { } func (o *PcloudNetworksPostNotFound) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostNotFound %+v", 404, o.Payload) + 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 { @@ -541,11 +554,13 @@ func (o *PcloudNetworksPostConflict) Code() int { } func (o *PcloudNetworksPostConflict) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostConflict %+v", 409, o.Payload) + 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 { @@ -609,11 +624,13 @@ func (o *PcloudNetworksPostUnprocessableEntity) Code() int { } func (o *PcloudNetworksPostUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -677,11 +694,13 @@ func (o *PcloudNetworksPostInternalServerError) Code() int { } func (o *PcloudNetworksPostInternalServerError) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostInternalServerError %+v", 500, o.Payload) + 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 { @@ -745,11 +764,13 @@ func (o *PcloudNetworksPostStatus550) Code() int { } func (o *PcloudNetworksPostStatus550) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostStatus550 %+v", 550, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/networks][%d] pcloudNetworksPostStatus550 %+v", 550, o.Payload) + 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 { diff --git a/power/client/p_cloud_networks/pcloud_networks_put_responses.go b/power/client/p_cloud_networks/pcloud_networks_put_responses.go index 5fe0c1fa..406d09f8 100644 --- a/power/client/p_cloud_networks/pcloud_networks_put_responses.go +++ b/power/client/p_cloud_networks/pcloud_networks_put_responses.go @@ -6,6 +6,7 @@ package p_cloud_networks // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudNetworksPutOK) Code() int { } func (o *PcloudNetworksPutOK) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksPutOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksPutOK %+v", 200, o.Payload) + 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 { @@ -183,11 +186,13 @@ func (o *PcloudNetworksPutBadRequest) Code() int { } func (o *PcloudNetworksPutBadRequest) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksPutBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksPutBadRequest %+v", 400, o.Payload) + 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 { @@ -251,11 +256,13 @@ func (o *PcloudNetworksPutUnauthorized) Code() int { } func (o *PcloudNetworksPutUnauthorized) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksPutUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksPutUnauthorized %+v", 401, o.Payload) + 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 { @@ -319,11 +326,13 @@ func (o *PcloudNetworksPutForbidden) Code() int { } func (o *PcloudNetworksPutForbidden) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksPutForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksPutForbidden %+v", 403, o.Payload) + 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 { @@ -387,11 +396,13 @@ func (o *PcloudNetworksPutNotFound) Code() int { } func (o *PcloudNetworksPutNotFound) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksPutNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksPutNotFound %+v", 404, o.Payload) + 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 { @@ -455,11 +466,13 @@ func (o *PcloudNetworksPutUnprocessableEntity) Code() int { } func (o *PcloudNetworksPutUnprocessableEntity) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksPutUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksPutUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -523,11 +536,13 @@ func (o *PcloudNetworksPutInternalServerError) Code() int { } func (o *PcloudNetworksPutInternalServerError) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksPutInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}][%d] pcloudNetworksPutInternalServerError %+v", 500, o.Payload) + 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 { 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 index 92ba8969..c97ac93a 100644 --- 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 @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi 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 */ @@ -25,7 +51,7 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods 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 index 88ba6f9a..e97e8aed 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_p_vm_instances // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudPvminstancesActionPostOK) Code() int { } func (o *PcloudPvminstancesActionPostOK) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/action][%d] pcloudPvminstancesActionPostOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/action][%d] pcloudPvminstancesActionPostOK %+v", 200, o.Payload) + 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 { @@ -181,11 +184,13 @@ func (o *PcloudPvminstancesActionPostBadRequest) Code() int { } func (o *PcloudPvminstancesActionPostBadRequest) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/action][%d] pcloudPvminstancesActionPostBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/action][%d] pcloudPvminstancesActionPostBadRequest %+v", 400, o.Payload) + 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 { @@ -249,11 +254,13 @@ func (o *PcloudPvminstancesActionPostUnauthorized) Code() int { } func (o *PcloudPvminstancesActionPostUnauthorized) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/action][%d] pcloudPvminstancesActionPostUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/action][%d] pcloudPvminstancesActionPostUnauthorized %+v", 401, o.Payload) + 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 { @@ -317,11 +324,13 @@ func (o *PcloudPvminstancesActionPostForbidden) Code() int { } func (o *PcloudPvminstancesActionPostForbidden) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/action][%d] pcloudPvminstancesActionPostForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/action][%d] pcloudPvminstancesActionPostForbidden %+v", 403, o.Payload) + 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 { @@ -385,11 +394,13 @@ func (o *PcloudPvminstancesActionPostNotFound) Code() int { } func (o *PcloudPvminstancesActionPostNotFound) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/action][%d] pcloudPvminstancesActionPostNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/action][%d] pcloudPvminstancesActionPostNotFound %+v", 404, o.Payload) + 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 { @@ -453,11 +464,13 @@ func (o *PcloudPvminstancesActionPostConflict) Code() int { } func (o *PcloudPvminstancesActionPostConflict) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/action][%d] pcloudPvminstancesActionPostConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/action][%d] pcloudPvminstancesActionPostConflict %+v", 409, o.Payload) + 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 { @@ -521,11 +534,13 @@ func (o *PcloudPvminstancesActionPostInternalServerError) Code() int { } func (o *PcloudPvminstancesActionPostInternalServerError) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/action][%d] pcloudPvminstancesActionPostInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/action][%d] pcloudPvminstancesActionPostInternalServerError %+v", 500, o.Payload) + 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 { 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 index 01c675d5..388681e0 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_p_vm_instances // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -121,11 +122,13 @@ func (o *PcloudPvminstancesCapturePostOK) Code() int { } func (o *PcloudPvminstancesCapturePostOK) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudPvminstancesCapturePostOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudPvminstancesCapturePostOK %+v", 200, o.Payload) + 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 { @@ -187,11 +190,13 @@ func (o *PcloudPvminstancesCapturePostAccepted) Code() int { } func (o *PcloudPvminstancesCapturePostAccepted) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudPvminstancesCapturePostAccepted %+v", 202, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudPvminstancesCapturePostAccepted %+v", 202, o.Payload) + 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 { @@ -253,11 +258,13 @@ func (o *PcloudPvminstancesCapturePostBadRequest) Code() int { } func (o *PcloudPvminstancesCapturePostBadRequest) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudPvminstancesCapturePostBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudPvminstancesCapturePostBadRequest %+v", 400, o.Payload) + 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 { @@ -321,11 +328,13 @@ func (o *PcloudPvminstancesCapturePostUnauthorized) Code() int { } func (o *PcloudPvminstancesCapturePostUnauthorized) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudPvminstancesCapturePostUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudPvminstancesCapturePostUnauthorized %+v", 401, o.Payload) + 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 { @@ -389,11 +398,13 @@ func (o *PcloudPvminstancesCapturePostForbidden) Code() int { } func (o *PcloudPvminstancesCapturePostForbidden) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudPvminstancesCapturePostForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudPvminstancesCapturePostForbidden %+v", 403, o.Payload) + 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 { @@ -457,11 +468,13 @@ func (o *PcloudPvminstancesCapturePostNotFound) Code() int { } func (o *PcloudPvminstancesCapturePostNotFound) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudPvminstancesCapturePostNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudPvminstancesCapturePostNotFound %+v", 404, o.Payload) + 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 { @@ -525,11 +538,13 @@ func (o *PcloudPvminstancesCapturePostUnprocessableEntity) Code() int { } func (o *PcloudPvminstancesCapturePostUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudPvminstancesCapturePostUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudPvminstancesCapturePostUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -593,11 +608,13 @@ func (o *PcloudPvminstancesCapturePostInternalServerError) Code() int { } func (o *PcloudPvminstancesCapturePostInternalServerError) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudPvminstancesCapturePostInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudPvminstancesCapturePostInternalServerError %+v", 500, o.Payload) + 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 { 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 index c7ded07d..c1c3e716 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_p_vm_instances // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -121,11 +122,13 @@ func (o *PcloudPvminstancesClonePostAccepted) Code() int { } func (o *PcloudPvminstancesClonePostAccepted) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone][%d] pcloudPvminstancesClonePostAccepted %+v", 202, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone][%d] pcloudPvminstancesClonePostAccepted %+v", 202, o.Payload) + 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 { @@ -189,11 +192,13 @@ func (o *PcloudPvminstancesClonePostBadRequest) Code() int { } func (o *PcloudPvminstancesClonePostBadRequest) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone][%d] pcloudPvminstancesClonePostBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone][%d] pcloudPvminstancesClonePostBadRequest %+v", 400, o.Payload) + 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 { @@ -257,11 +262,13 @@ func (o *PcloudPvminstancesClonePostUnauthorized) Code() int { } func (o *PcloudPvminstancesClonePostUnauthorized) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone][%d] pcloudPvminstancesClonePostUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone][%d] pcloudPvminstancesClonePostUnauthorized %+v", 401, o.Payload) + 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 { @@ -325,11 +332,13 @@ func (o *PcloudPvminstancesClonePostForbidden) Code() int { } func (o *PcloudPvminstancesClonePostForbidden) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone][%d] pcloudPvminstancesClonePostForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone][%d] pcloudPvminstancesClonePostForbidden %+v", 403, o.Payload) + 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 { @@ -393,11 +402,13 @@ func (o *PcloudPvminstancesClonePostNotFound) Code() int { } func (o *PcloudPvminstancesClonePostNotFound) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone][%d] pcloudPvminstancesClonePostNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone][%d] pcloudPvminstancesClonePostNotFound %+v", 404, o.Payload) + 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 { @@ -461,11 +472,13 @@ func (o *PcloudPvminstancesClonePostConflict) Code() int { } func (o *PcloudPvminstancesClonePostConflict) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone][%d] pcloudPvminstancesClonePostConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone][%d] pcloudPvminstancesClonePostConflict %+v", 409, o.Payload) + 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 { @@ -529,11 +542,13 @@ func (o *PcloudPvminstancesClonePostUnprocessableEntity) Code() int { } func (o *PcloudPvminstancesClonePostUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone][%d] pcloudPvminstancesClonePostUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone][%d] pcloudPvminstancesClonePostUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -597,11 +612,13 @@ func (o *PcloudPvminstancesClonePostInternalServerError) Code() int { } func (o *PcloudPvminstancesClonePostInternalServerError) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone][%d] pcloudPvminstancesClonePostInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone][%d] pcloudPvminstancesClonePostInternalServerError %+v", 500, o.Payload) + 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 { 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 index 77ef3346..85083359 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_p_vm_instances // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudPvminstancesConsoleGetOK) Code() int { } func (o *PcloudPvminstancesConsoleGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsoleGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsoleGetOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudPvminstancesConsoleGetBadRequest) Code() int { } func (o *PcloudPvminstancesConsoleGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsoleGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsoleGetBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudPvminstancesConsoleGetUnauthorized) Code() int { } func (o *PcloudPvminstancesConsoleGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsoleGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsoleGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudPvminstancesConsoleGetForbidden) Code() int { } func (o *PcloudPvminstancesConsoleGetForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsoleGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsoleGetForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudPvminstancesConsoleGetNotFound) Code() int { } func (o *PcloudPvminstancesConsoleGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsoleGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsoleGetNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudPvminstancesConsoleGetInternalServerError) Code() int { } func (o *PcloudPvminstancesConsoleGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsoleGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsoleGetInternalServerError %+v", 500, o.Payload) + 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 { 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 index dab7e80c..7248603c 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_p_vm_instances // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudPvminstancesConsolePostCreated) Code() int { } func (o *PcloudPvminstancesConsolePostCreated) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePostCreated %+v", 201, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePostCreated %+v", 201, o.Payload) + 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 { @@ -183,11 +186,13 @@ func (o *PcloudPvminstancesConsolePostBadRequest) Code() int { } func (o *PcloudPvminstancesConsolePostBadRequest) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePostBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePostBadRequest %+v", 400, o.Payload) + 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 { @@ -251,11 +256,13 @@ func (o *PcloudPvminstancesConsolePostUnauthorized) Code() int { } func (o *PcloudPvminstancesConsolePostUnauthorized) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePostUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePostUnauthorized %+v", 401, o.Payload) + 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 { @@ -319,11 +326,13 @@ func (o *PcloudPvminstancesConsolePostForbidden) Code() int { } func (o *PcloudPvminstancesConsolePostForbidden) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePostForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePostForbidden %+v", 403, o.Payload) + 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 { @@ -387,11 +396,13 @@ func (o *PcloudPvminstancesConsolePostNotFound) Code() int { } func (o *PcloudPvminstancesConsolePostNotFound) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePostNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePostNotFound %+v", 404, o.Payload) + 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 { @@ -455,11 +466,13 @@ func (o *PcloudPvminstancesConsolePostUnprocessableEntity) Code() int { } func (o *PcloudPvminstancesConsolePostUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePostUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePostUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -523,11 +536,13 @@ func (o *PcloudPvminstancesConsolePostInternalServerError) Code() int { } func (o *PcloudPvminstancesConsolePostInternalServerError) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePostInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePostInternalServerError %+v", 500, o.Payload) + 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 { 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 index bd5a3f1d..d734098d 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_p_vm_instances // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudPvminstancesConsolePutOK) Code() int { } func (o *PcloudPvminstancesConsolePutOK) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePutOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePutOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudPvminstancesConsolePutBadRequest) Code() int { } func (o *PcloudPvminstancesConsolePutBadRequest) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePutBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePutBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudPvminstancesConsolePutUnauthorized) Code() int { } func (o *PcloudPvminstancesConsolePutUnauthorized) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePutUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePutUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudPvminstancesConsolePutForbidden) Code() int { } func (o *PcloudPvminstancesConsolePutForbidden) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePutForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePutForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudPvminstancesConsolePutNotFound) Code() int { } func (o *PcloudPvminstancesConsolePutNotFound) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePutNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePutNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudPvminstancesConsolePutInternalServerError) Code() int { } func (o *PcloudPvminstancesConsolePutInternalServerError) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePutInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console][%d] pcloudPvminstancesConsolePutInternalServerError %+v", 500, o.Payload) + 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 { 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 index cd3481f0..6caed9ae 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_p_vm_instances // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudPvminstancesDeleteOK) Code() int { } func (o *PcloudPvminstancesDeleteOK) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesDeleteOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesDeleteOK %+v", 200, o.Payload) + 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 { @@ -181,11 +184,13 @@ func (o *PcloudPvminstancesDeleteBadRequest) Code() int { } func (o *PcloudPvminstancesDeleteBadRequest) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesDeleteBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesDeleteBadRequest %+v", 400, o.Payload) + 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 { @@ -249,11 +254,13 @@ func (o *PcloudPvminstancesDeleteUnauthorized) Code() int { } func (o *PcloudPvminstancesDeleteUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesDeleteUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesDeleteUnauthorized %+v", 401, o.Payload) + 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 { @@ -317,11 +324,13 @@ func (o *PcloudPvminstancesDeleteForbidden) Code() int { } func (o *PcloudPvminstancesDeleteForbidden) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesDeleteForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesDeleteForbidden %+v", 403, o.Payload) + 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 { @@ -385,11 +394,13 @@ func (o *PcloudPvminstancesDeleteNotFound) Code() int { } func (o *PcloudPvminstancesDeleteNotFound) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesDeleteNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesDeleteNotFound %+v", 404, o.Payload) + 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 { @@ -453,11 +464,13 @@ func (o *PcloudPvminstancesDeleteGone) Code() int { } func (o *PcloudPvminstancesDeleteGone) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesDeleteGone %+v", 410, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesDeleteGone %+v", 410, o.Payload) + 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 { @@ -521,11 +534,13 @@ func (o *PcloudPvminstancesDeleteInternalServerError) Code() int { } func (o *PcloudPvminstancesDeleteInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesDeleteInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesDeleteInternalServerError %+v", 500, o.Payload) + 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 { 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 index e651c345..c520c6c9 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_p_vm_instances // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudPvminstancesGetOK) Code() int { } func (o *PcloudPvminstancesGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesGetOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudPvminstancesGetBadRequest) Code() int { } func (o *PcloudPvminstancesGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesGetBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudPvminstancesGetUnauthorized) Code() int { } func (o *PcloudPvminstancesGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudPvminstancesGetForbidden) Code() int { } func (o *PcloudPvminstancesGetForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesGetForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudPvminstancesGetNotFound) Code() int { } func (o *PcloudPvminstancesGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesGetNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudPvminstancesGetInternalServerError) Code() int { } func (o *PcloudPvminstancesGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesGetInternalServerError %+v", 500, o.Payload) + 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 { 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 index 02ff99af..411ef74b 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_p_vm_instances // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudPvminstancesGetallOK) Code() int { } func (o *PcloudPvminstancesGetallOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesGetallOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesGetallOK %+v", 200, o.Payload) + 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 { @@ -183,11 +186,13 @@ func (o *PcloudPvminstancesGetallBadRequest) Code() int { } func (o *PcloudPvminstancesGetallBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesGetallBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesGetallBadRequest %+v", 400, o.Payload) + 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 { @@ -251,11 +256,13 @@ func (o *PcloudPvminstancesGetallUnauthorized) Code() int { } func (o *PcloudPvminstancesGetallUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesGetallUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesGetallUnauthorized %+v", 401, o.Payload) + 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 { @@ -319,11 +326,13 @@ func (o *PcloudPvminstancesGetallForbidden) Code() int { } func (o *PcloudPvminstancesGetallForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesGetallForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesGetallForbidden %+v", 403, o.Payload) + 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 { @@ -387,11 +396,13 @@ func (o *PcloudPvminstancesGetallNotFound) Code() int { } func (o *PcloudPvminstancesGetallNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesGetallNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesGetallNotFound %+v", 404, o.Payload) + 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 { @@ -455,11 +466,13 @@ func (o *PcloudPvminstancesGetallRequestTimeout) Code() int { } func (o *PcloudPvminstancesGetallRequestTimeout) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesGetallRequestTimeout %+v", 408, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesGetallRequestTimeout %+v", 408, o.Payload) + 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 { @@ -523,11 +536,13 @@ func (o *PcloudPvminstancesGetallInternalServerError) Code() int { } func (o *PcloudPvminstancesGetallInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesGetallInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesGetallInternalServerError %+v", 500, o.Payload) + 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 { 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 index 8cab7f44..47fc0990 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_p_vm_instances // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudPvminstancesNetworksDeleteOK) Code() int { } func (o *PcloudPvminstancesNetworksDeleteOK) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksDeleteOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksDeleteOK %+v", 200, o.Payload) + 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 { @@ -181,11 +184,13 @@ func (o *PcloudPvminstancesNetworksDeleteBadRequest) Code() int { } func (o *PcloudPvminstancesNetworksDeleteBadRequest) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksDeleteBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksDeleteBadRequest %+v", 400, o.Payload) + 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 { @@ -249,11 +254,13 @@ func (o *PcloudPvminstancesNetworksDeleteUnauthorized) Code() int { } func (o *PcloudPvminstancesNetworksDeleteUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksDeleteUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksDeleteUnauthorized %+v", 401, o.Payload) + 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 { @@ -317,11 +324,13 @@ func (o *PcloudPvminstancesNetworksDeleteForbidden) Code() int { } func (o *PcloudPvminstancesNetworksDeleteForbidden) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksDeleteForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksDeleteForbidden %+v", 403, o.Payload) + 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 { @@ -385,11 +394,13 @@ func (o *PcloudPvminstancesNetworksDeleteNotFound) Code() int { } func (o *PcloudPvminstancesNetworksDeleteNotFound) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksDeleteNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksDeleteNotFound %+v", 404, o.Payload) + 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 { @@ -453,11 +464,13 @@ func (o *PcloudPvminstancesNetworksDeleteGone) Code() int { } func (o *PcloudPvminstancesNetworksDeleteGone) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksDeleteGone %+v", 410, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksDeleteGone %+v", 410, o.Payload) + 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 { @@ -521,11 +534,13 @@ func (o *PcloudPvminstancesNetworksDeleteInternalServerError) Code() int { } func (o *PcloudPvminstancesNetworksDeleteInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksDeleteInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksDeleteInternalServerError %+v", 500, o.Payload) + 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 { 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 index 531951a0..066032b9 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_p_vm_instances // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudPvminstancesNetworksGetOK) Code() int { } func (o *PcloudPvminstancesNetworksGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksGetOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudPvminstancesNetworksGetBadRequest) Code() int { } func (o *PcloudPvminstancesNetworksGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksGetBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudPvminstancesNetworksGetUnauthorized) Code() int { } func (o *PcloudPvminstancesNetworksGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudPvminstancesNetworksGetForbidden) Code() int { } func (o *PcloudPvminstancesNetworksGetForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksGetForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudPvminstancesNetworksGetNotFound) Code() int { } func (o *PcloudPvminstancesNetworksGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksGetNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudPvminstancesNetworksGetInternalServerError) Code() int { } func (o *PcloudPvminstancesNetworksGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}][%d] pcloudPvminstancesNetworksGetInternalServerError %+v", 500, o.Payload) + 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 { 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 index 5ec15c71..1c6a6f10 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_p_vm_instances // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudPvminstancesNetworksGetallOK) Code() int { } func (o *PcloudPvminstancesNetworksGetallOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksGetallOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksGetallOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudPvminstancesNetworksGetallBadRequest) Code() int { } func (o *PcloudPvminstancesNetworksGetallBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksGetallBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksGetallBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudPvminstancesNetworksGetallUnauthorized) Code() int { } func (o *PcloudPvminstancesNetworksGetallUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksGetallUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksGetallUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudPvminstancesNetworksGetallForbidden) Code() int { } func (o *PcloudPvminstancesNetworksGetallForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksGetallForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksGetallForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudPvminstancesNetworksGetallNotFound) Code() int { } func (o *PcloudPvminstancesNetworksGetallNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksGetallNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksGetallNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudPvminstancesNetworksGetallInternalServerError) Code() int { } func (o *PcloudPvminstancesNetworksGetallInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksGetallInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksGetallInternalServerError %+v", 500, o.Payload) + 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 { 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 index 59404682..9048edee 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_p_vm_instances // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -121,11 +122,13 @@ func (o *PcloudPvminstancesNetworksPostCreated) Code() int { } func (o *PcloudPvminstancesNetworksPostCreated) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksPostCreated %+v", 201, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksPostCreated %+v", 201, o.Payload) + 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 { @@ -189,11 +192,13 @@ func (o *PcloudPvminstancesNetworksPostBadRequest) Code() int { } func (o *PcloudPvminstancesNetworksPostBadRequest) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksPostBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksPostBadRequest %+v", 400, o.Payload) + 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 { @@ -257,11 +262,13 @@ func (o *PcloudPvminstancesNetworksPostUnauthorized) Code() int { } func (o *PcloudPvminstancesNetworksPostUnauthorized) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksPostUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksPostUnauthorized %+v", 401, o.Payload) + 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 { @@ -325,11 +332,13 @@ func (o *PcloudPvminstancesNetworksPostForbidden) Code() int { } func (o *PcloudPvminstancesNetworksPostForbidden) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksPostForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksPostForbidden %+v", 403, o.Payload) + 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 { @@ -393,11 +402,13 @@ func (o *PcloudPvminstancesNetworksPostNotFound) Code() int { } func (o *PcloudPvminstancesNetworksPostNotFound) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksPostNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksPostNotFound %+v", 404, o.Payload) + 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 { @@ -461,11 +472,13 @@ func (o *PcloudPvminstancesNetworksPostConflict) Code() int { } func (o *PcloudPvminstancesNetworksPostConflict) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksPostConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksPostConflict %+v", 409, o.Payload) + 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 { @@ -529,11 +542,13 @@ func (o *PcloudPvminstancesNetworksPostUnprocessableEntity) Code() int { } func (o *PcloudPvminstancesNetworksPostUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksPostUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksPostUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -597,11 +612,13 @@ func (o *PcloudPvminstancesNetworksPostInternalServerError) Code() int { } func (o *PcloudPvminstancesNetworksPostInternalServerError) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksPostInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks][%d] pcloudPvminstancesNetworksPostInternalServerError %+v", 500, o.Payload) + 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 { 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 index b02cae3f..e89f047d 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_p_vm_instances // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudPvminstancesOperationsPostOK) Code() int { } func (o *PcloudPvminstancesOperationsPostOK) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/operations][%d] pcloudPvminstancesOperationsPostOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/operations][%d] pcloudPvminstancesOperationsPostOK %+v", 200, o.Payload) + 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 { @@ -181,11 +184,13 @@ func (o *PcloudPvminstancesOperationsPostBadRequest) Code() int { } func (o *PcloudPvminstancesOperationsPostBadRequest) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/operations][%d] pcloudPvminstancesOperationsPostBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/operations][%d] pcloudPvminstancesOperationsPostBadRequest %+v", 400, o.Payload) + 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 { @@ -249,11 +254,13 @@ func (o *PcloudPvminstancesOperationsPostUnauthorized) Code() int { } func (o *PcloudPvminstancesOperationsPostUnauthorized) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/operations][%d] pcloudPvminstancesOperationsPostUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/operations][%d] pcloudPvminstancesOperationsPostUnauthorized %+v", 401, o.Payload) + 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 { @@ -317,11 +324,13 @@ func (o *PcloudPvminstancesOperationsPostForbidden) Code() int { } func (o *PcloudPvminstancesOperationsPostForbidden) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/operations][%d] pcloudPvminstancesOperationsPostForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/operations][%d] pcloudPvminstancesOperationsPostForbidden %+v", 403, o.Payload) + 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 { @@ -385,11 +394,13 @@ func (o *PcloudPvminstancesOperationsPostNotFound) Code() int { } func (o *PcloudPvminstancesOperationsPostNotFound) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/operations][%d] pcloudPvminstancesOperationsPostNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/operations][%d] pcloudPvminstancesOperationsPostNotFound %+v", 404, o.Payload) + 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 { @@ -453,11 +464,13 @@ func (o *PcloudPvminstancesOperationsPostUnprocessableEntity) Code() int { } func (o *PcloudPvminstancesOperationsPostUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/operations][%d] pcloudPvminstancesOperationsPostUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/operations][%d] pcloudPvminstancesOperationsPostUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -521,11 +534,13 @@ func (o *PcloudPvminstancesOperationsPostInternalServerError) Code() int { } func (o *PcloudPvminstancesOperationsPostInternalServerError) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/operations][%d] pcloudPvminstancesOperationsPostInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/operations][%d] pcloudPvminstancesOperationsPostInternalServerError %+v", 500, o.Payload) + 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 { 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 index 1e9b1628..16e556e5 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_p_vm_instances // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -139,11 +140,13 @@ func (o *PcloudPvminstancesPostOK) Code() int { } func (o *PcloudPvminstancesPostOK) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostOK %+v", 200, o.Payload) + 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 { @@ -205,11 +208,13 @@ func (o *PcloudPvminstancesPostCreated) Code() int { } func (o *PcloudPvminstancesPostCreated) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostCreated %+v", 201, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostCreated %+v", 201, o.Payload) + 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 { @@ -271,11 +276,13 @@ func (o *PcloudPvminstancesPostAccepted) Code() int { } func (o *PcloudPvminstancesPostAccepted) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostAccepted %+v", 202, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostAccepted %+v", 202, o.Payload) + 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 { @@ -337,11 +344,13 @@ func (o *PcloudPvminstancesPostBadRequest) Code() int { } func (o *PcloudPvminstancesPostBadRequest) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostBadRequest %+v", 400, o.Payload) + 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 { @@ -405,11 +414,13 @@ func (o *PcloudPvminstancesPostUnauthorized) Code() int { } func (o *PcloudPvminstancesPostUnauthorized) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostUnauthorized %+v", 401, o.Payload) + 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 { @@ -473,11 +484,13 @@ func (o *PcloudPvminstancesPostForbidden) Code() int { } func (o *PcloudPvminstancesPostForbidden) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostForbidden %+v", 403, o.Payload) + 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 { @@ -541,11 +554,13 @@ func (o *PcloudPvminstancesPostNotFound) Code() int { } func (o *PcloudPvminstancesPostNotFound) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostNotFound %+v", 404, o.Payload) + 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 { @@ -609,11 +624,13 @@ func (o *PcloudPvminstancesPostConflict) Code() int { } func (o *PcloudPvminstancesPostConflict) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostConflict %+v", 409, o.Payload) + 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 { @@ -677,11 +694,13 @@ func (o *PcloudPvminstancesPostUnprocessableEntity) Code() int { } func (o *PcloudPvminstancesPostUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -745,11 +764,13 @@ func (o *PcloudPvminstancesPostInternalServerError) Code() int { } func (o *PcloudPvminstancesPostInternalServerError) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostInternalServerError %+v", 500, o.Payload) + 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 { @@ -813,11 +834,13 @@ func (o *PcloudPvminstancesPostGatewayTimeout) Code() int { } func (o *PcloudPvminstancesPostGatewayTimeout) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostGatewayTimeout %+v", 504, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudPvminstancesPostGatewayTimeout %+v", 504, o.Payload) + 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 { 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 index 7147f35d..36e26e92 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_p_vm_instances // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudPvminstancesPutAccepted) Code() int { } func (o *PcloudPvminstancesPutAccepted) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutAccepted %+v", 202, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutAccepted %+v", 202, o.Payload) + 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 { @@ -183,11 +186,13 @@ func (o *PcloudPvminstancesPutBadRequest) Code() int { } func (o *PcloudPvminstancesPutBadRequest) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutBadRequest %+v", 400, o.Payload) + 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 { @@ -251,11 +256,13 @@ func (o *PcloudPvminstancesPutUnauthorized) Code() int { } func (o *PcloudPvminstancesPutUnauthorized) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutUnauthorized %+v", 401, o.Payload) + 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 { @@ -319,11 +326,13 @@ func (o *PcloudPvminstancesPutForbidden) Code() int { } func (o *PcloudPvminstancesPutForbidden) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutForbidden %+v", 403, o.Payload) + 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 { @@ -387,11 +396,13 @@ func (o *PcloudPvminstancesPutNotFound) Code() int { } func (o *PcloudPvminstancesPutNotFound) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutNotFound %+v", 404, o.Payload) + 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 { @@ -455,11 +466,13 @@ func (o *PcloudPvminstancesPutUnprocessableEntity) Code() int { } func (o *PcloudPvminstancesPutUnprocessableEntity) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -523,11 +536,13 @@ func (o *PcloudPvminstancesPutInternalServerError) Code() int { } func (o *PcloudPvminstancesPutInternalServerError) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}][%d] pcloudPvminstancesPutInternalServerError %+v", 500, o.Payload) + 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 { 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 index 3a6236eb..f093e030 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_p_vm_instances // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudPvminstancesSnapshotsGetallOK) Code() int { } func (o *PcloudPvminstancesSnapshotsGetallOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsGetallOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsGetallOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudPvminstancesSnapshotsGetallBadRequest) Code() int { } func (o *PcloudPvminstancesSnapshotsGetallBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsGetallBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsGetallBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudPvminstancesSnapshotsGetallUnauthorized) Code() int { } func (o *PcloudPvminstancesSnapshotsGetallUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsGetallUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsGetallUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudPvminstancesSnapshotsGetallForbidden) Code() int { } func (o *PcloudPvminstancesSnapshotsGetallForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsGetallForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsGetallForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudPvminstancesSnapshotsGetallNotFound) Code() int { } func (o *PcloudPvminstancesSnapshotsGetallNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsGetallNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsGetallNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudPvminstancesSnapshotsGetallInternalServerError) Code() int { } func (o *PcloudPvminstancesSnapshotsGetallInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsGetallInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsGetallInternalServerError %+v", 500, o.Payload) + 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 { 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 index bd53af99..94ef37d9 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_p_vm_instances // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -121,11 +122,13 @@ func (o *PcloudPvminstancesSnapshotsPostAccepted) Code() int { } func (o *PcloudPvminstancesSnapshotsPostAccepted) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsPostAccepted %+v", 202, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsPostAccepted %+v", 202, o.Payload) + 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 { @@ -189,11 +192,13 @@ func (o *PcloudPvminstancesSnapshotsPostBadRequest) Code() int { } func (o *PcloudPvminstancesSnapshotsPostBadRequest) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsPostBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsPostBadRequest %+v", 400, o.Payload) + 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 { @@ -257,11 +262,13 @@ func (o *PcloudPvminstancesSnapshotsPostUnauthorized) Code() int { } func (o *PcloudPvminstancesSnapshotsPostUnauthorized) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsPostUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsPostUnauthorized %+v", 401, o.Payload) + 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 { @@ -325,11 +332,13 @@ func (o *PcloudPvminstancesSnapshotsPostForbidden) Code() int { } func (o *PcloudPvminstancesSnapshotsPostForbidden) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsPostForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsPostForbidden %+v", 403, o.Payload) + 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 { @@ -393,11 +402,13 @@ func (o *PcloudPvminstancesSnapshotsPostNotFound) Code() int { } func (o *PcloudPvminstancesSnapshotsPostNotFound) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsPostNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsPostNotFound %+v", 404, o.Payload) + 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 { @@ -461,11 +472,13 @@ func (o *PcloudPvminstancesSnapshotsPostConflict) Code() int { } func (o *PcloudPvminstancesSnapshotsPostConflict) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsPostConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsPostConflict %+v", 409, o.Payload) + 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 { @@ -529,11 +542,13 @@ func (o *PcloudPvminstancesSnapshotsPostInternalServerError) Code() int { } func (o *PcloudPvminstancesSnapshotsPostInternalServerError) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsPostInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsPostInternalServerError %+v", 500, o.Payload) + 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 { @@ -597,11 +612,13 @@ func (o *PcloudPvminstancesSnapshotsPostGatewayTimeout) Code() int { } func (o *PcloudPvminstancesSnapshotsPostGatewayTimeout) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsPostGatewayTimeout %+v", 504, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots][%d] pcloudPvminstancesSnapshotsPostGatewayTimeout %+v", 504, o.Payload) + 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 { 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 index a8670faa..1ceae2e9 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_p_vm_instances // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudPvminstancesSnapshotsRestorePostAccepted) Code() int { } func (o *PcloudPvminstancesSnapshotsRestorePostAccepted) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots/{snapshot_id}/restore][%d] pcloudPvminstancesSnapshotsRestorePostAccepted %+v", 202, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots/{snapshot_id}/restore][%d] pcloudPvminstancesSnapshotsRestorePostAccepted %+v", 202, o.Payload) + 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 { @@ -183,11 +186,13 @@ func (o *PcloudPvminstancesSnapshotsRestorePostBadRequest) Code() int { } func (o *PcloudPvminstancesSnapshotsRestorePostBadRequest) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots/{snapshot_id}/restore][%d] pcloudPvminstancesSnapshotsRestorePostBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots/{snapshot_id}/restore][%d] pcloudPvminstancesSnapshotsRestorePostBadRequest %+v", 400, o.Payload) + 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 { @@ -251,11 +256,13 @@ func (o *PcloudPvminstancesSnapshotsRestorePostUnauthorized) Code() int { } func (o *PcloudPvminstancesSnapshotsRestorePostUnauthorized) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots/{snapshot_id}/restore][%d] pcloudPvminstancesSnapshotsRestorePostUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots/{snapshot_id}/restore][%d] pcloudPvminstancesSnapshotsRestorePostUnauthorized %+v", 401, o.Payload) + 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 { @@ -319,11 +326,13 @@ func (o *PcloudPvminstancesSnapshotsRestorePostForbidden) Code() int { } func (o *PcloudPvminstancesSnapshotsRestorePostForbidden) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots/{snapshot_id}/restore][%d] pcloudPvminstancesSnapshotsRestorePostForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots/{snapshot_id}/restore][%d] pcloudPvminstancesSnapshotsRestorePostForbidden %+v", 403, o.Payload) + 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 { @@ -387,11 +396,13 @@ func (o *PcloudPvminstancesSnapshotsRestorePostNotFound) Code() int { } func (o *PcloudPvminstancesSnapshotsRestorePostNotFound) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots/{snapshot_id}/restore][%d] pcloudPvminstancesSnapshotsRestorePostNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots/{snapshot_id}/restore][%d] pcloudPvminstancesSnapshotsRestorePostNotFound %+v", 404, o.Payload) + 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 { @@ -455,11 +466,13 @@ func (o *PcloudPvminstancesSnapshotsRestorePostConflict) Code() int { } func (o *PcloudPvminstancesSnapshotsRestorePostConflict) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots/{snapshot_id}/restore][%d] pcloudPvminstancesSnapshotsRestorePostConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots/{snapshot_id}/restore][%d] pcloudPvminstancesSnapshotsRestorePostConflict %+v", 409, o.Payload) + 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 { @@ -523,11 +536,13 @@ func (o *PcloudPvminstancesSnapshotsRestorePostInternalServerError) Code() int { } func (o *PcloudPvminstancesSnapshotsRestorePostInternalServerError) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots/{snapshot_id}/restore][%d] pcloudPvminstancesSnapshotsRestorePostInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots/{snapshot_id}/restore][%d] pcloudPvminstancesSnapshotsRestorePostInternalServerError %+v", 500, o.Payload) + 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 { 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 index fe4f0293..b438eef9 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_p_vm_instances // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudV2PvminstancesCaptureGetOK) Code() int { } func (o *PcloudV2PvminstancesCaptureGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCaptureGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCaptureGetOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudV2PvminstancesCaptureGetBadRequest) Code() int { } func (o *PcloudV2PvminstancesCaptureGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCaptureGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCaptureGetBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudV2PvminstancesCaptureGetUnauthorized) Code() int { } func (o *PcloudV2PvminstancesCaptureGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCaptureGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCaptureGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudV2PvminstancesCaptureGetForbidden) Code() int { } func (o *PcloudV2PvminstancesCaptureGetForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCaptureGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCaptureGetForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudV2PvminstancesCaptureGetNotFound) Code() int { } func (o *PcloudV2PvminstancesCaptureGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCaptureGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCaptureGetNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudV2PvminstancesCaptureGetInternalServerError) Code() int { } func (o *PcloudV2PvminstancesCaptureGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCaptureGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCaptureGetInternalServerError %+v", 500, o.Payload) + 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 { 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 index 362a6173..1213c38b 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_p_vm_instances // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -121,11 +122,13 @@ func (o *PcloudV2PvminstancesCapturePostAccepted) Code() int { } func (o *PcloudV2PvminstancesCapturePostAccepted) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCapturePostAccepted %+v", 202, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCapturePostAccepted %+v", 202, o.Payload) + 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 { @@ -189,11 +192,13 @@ func (o *PcloudV2PvminstancesCapturePostBadRequest) Code() int { } func (o *PcloudV2PvminstancesCapturePostBadRequest) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCapturePostBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCapturePostBadRequest %+v", 400, o.Payload) + 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 { @@ -257,11 +262,13 @@ func (o *PcloudV2PvminstancesCapturePostUnauthorized) Code() int { } func (o *PcloudV2PvminstancesCapturePostUnauthorized) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCapturePostUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCapturePostUnauthorized %+v", 401, o.Payload) + 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 { @@ -325,11 +332,13 @@ func (o *PcloudV2PvminstancesCapturePostForbidden) Code() int { } func (o *PcloudV2PvminstancesCapturePostForbidden) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCapturePostForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCapturePostForbidden %+v", 403, o.Payload) + 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 { @@ -393,11 +402,13 @@ func (o *PcloudV2PvminstancesCapturePostNotFound) Code() int { } func (o *PcloudV2PvminstancesCapturePostNotFound) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCapturePostNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCapturePostNotFound %+v", 404, o.Payload) + 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 { @@ -461,11 +472,13 @@ func (o *PcloudV2PvminstancesCapturePostConflict) Code() int { } func (o *PcloudV2PvminstancesCapturePostConflict) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCapturePostConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCapturePostConflict %+v", 409, o.Payload) + 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 { @@ -529,11 +542,13 @@ func (o *PcloudV2PvminstancesCapturePostUnprocessableEntity) Code() int { } func (o *PcloudV2PvminstancesCapturePostUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCapturePostUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCapturePostUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -597,11 +612,13 @@ func (o *PcloudV2PvminstancesCapturePostInternalServerError) Code() int { } func (o *PcloudV2PvminstancesCapturePostInternalServerError) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCapturePostInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture][%d] pcloudV2PvminstancesCapturePostInternalServerError %+v", 500, o.Payload) + 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 { 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 index cc9bce59..52f5842a 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_p_vm_instances // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudV2PvminstancesGetallOK) Code() int { } func (o *PcloudV2PvminstancesGetallOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudV2PvminstancesGetallOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudV2PvminstancesGetallOK %+v", 200, o.Payload) + 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 { @@ -183,11 +186,13 @@ func (o *PcloudV2PvminstancesGetallBadRequest) Code() int { } func (o *PcloudV2PvminstancesGetallBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudV2PvminstancesGetallBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudV2PvminstancesGetallBadRequest %+v", 400, o.Payload) + 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 { @@ -251,11 +256,13 @@ func (o *PcloudV2PvminstancesGetallUnauthorized) Code() int { } func (o *PcloudV2PvminstancesGetallUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudV2PvminstancesGetallUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudV2PvminstancesGetallUnauthorized %+v", 401, o.Payload) + 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 { @@ -319,11 +326,13 @@ func (o *PcloudV2PvminstancesGetallForbidden) Code() int { } func (o *PcloudV2PvminstancesGetallForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudV2PvminstancesGetallForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudV2PvminstancesGetallForbidden %+v", 403, o.Payload) + 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 { @@ -387,11 +396,13 @@ func (o *PcloudV2PvminstancesGetallNotFound) Code() int { } func (o *PcloudV2PvminstancesGetallNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudV2PvminstancesGetallNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudV2PvminstancesGetallNotFound %+v", 404, o.Payload) + 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 { @@ -455,11 +466,13 @@ func (o *PcloudV2PvminstancesGetallRequestTimeout) Code() int { } func (o *PcloudV2PvminstancesGetallRequestTimeout) Error() string { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudV2PvminstancesGetallRequestTimeout %+v", 408, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudV2PvminstancesGetallRequestTimeout %+v", 408, o.Payload) + 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 { @@ -523,11 +536,13 @@ func (o *PcloudV2PvminstancesGetallInternalServerError) Code() int { } func (o *PcloudV2PvminstancesGetallInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudV2PvminstancesGetallInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances][%d] pcloudV2PvminstancesGetallInternalServerError %+v", 500, o.Payload) + 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 { 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 index 801e58e2..7ed0532a 100644 --- 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 @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi 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 */ @@ -25,7 +51,7 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods 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 index de762b14..69ec152f 100644 --- a/power/client/p_cloud_placement_groups/pcloud_placementgroups_delete_responses.go +++ b/power/client/p_cloud_placement_groups/pcloud_placementgroups_delete_responses.go @@ -6,6 +6,7 @@ package p_cloud_placement_groups // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudPlacementgroupsDeleteOK) Code() int { } func (o *PcloudPlacementgroupsDeleteOK) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsDeleteOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsDeleteOK %+v", 200, o.Payload) + 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 { @@ -175,11 +178,13 @@ func (o *PcloudPlacementgroupsDeleteBadRequest) Code() int { } func (o *PcloudPlacementgroupsDeleteBadRequest) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsDeleteBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsDeleteBadRequest %+v", 400, o.Payload) + 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 { @@ -243,11 +248,13 @@ func (o *PcloudPlacementgroupsDeleteUnauthorized) Code() int { } func (o *PcloudPlacementgroupsDeleteUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsDeleteUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsDeleteUnauthorized %+v", 401, o.Payload) + 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 { @@ -311,11 +318,13 @@ func (o *PcloudPlacementgroupsDeleteForbidden) Code() int { } func (o *PcloudPlacementgroupsDeleteForbidden) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsDeleteForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsDeleteForbidden %+v", 403, o.Payload) + 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 { @@ -379,11 +388,13 @@ func (o *PcloudPlacementgroupsDeleteNotFound) Code() int { } func (o *PcloudPlacementgroupsDeleteNotFound) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsDeleteNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsDeleteNotFound %+v", 404, o.Payload) + 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 { @@ -447,11 +458,13 @@ func (o *PcloudPlacementgroupsDeleteInternalServerError) Code() int { } func (o *PcloudPlacementgroupsDeleteInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsDeleteInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsDeleteInternalServerError %+v", 500, o.Payload) + 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 { 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 index 5a9b0ee8..df2c047f 100644 --- a/power/client/p_cloud_placement_groups/pcloud_placementgroups_get_responses.go +++ b/power/client/p_cloud_placement_groups/pcloud_placementgroups_get_responses.go @@ -6,6 +6,7 @@ package p_cloud_placement_groups // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudPlacementgroupsGetOK) Code() int { } func (o *PcloudPlacementgroupsGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsGetOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudPlacementgroupsGetBadRequest) Code() int { } func (o *PcloudPlacementgroupsGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsGetBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudPlacementgroupsGetUnauthorized) Code() int { } func (o *PcloudPlacementgroupsGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudPlacementgroupsGetForbidden) Code() int { } func (o *PcloudPlacementgroupsGetForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsGetForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudPlacementgroupsGetNotFound) Code() int { } func (o *PcloudPlacementgroupsGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsGetNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudPlacementgroupsGetInternalServerError) Code() int { } func (o *PcloudPlacementgroupsGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}][%d] pcloudPlacementgroupsGetInternalServerError %+v", 500, o.Payload) + 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 { 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 index ce497c95..d0016366 100644 --- a/power/client/p_cloud_placement_groups/pcloud_placementgroups_getall_responses.go +++ b/power/client/p_cloud_placement_groups/pcloud_placementgroups_getall_responses.go @@ -6,6 +6,7 @@ package p_cloud_placement_groups // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudPlacementgroupsGetallOK) Code() int { } func (o *PcloudPlacementgroupsGetallOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsGetallOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsGetallOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudPlacementgroupsGetallBadRequest) Code() int { } func (o *PcloudPlacementgroupsGetallBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsGetallBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsGetallBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudPlacementgroupsGetallUnauthorized) Code() int { } func (o *PcloudPlacementgroupsGetallUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsGetallUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsGetallUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudPlacementgroupsGetallForbidden) Code() int { } func (o *PcloudPlacementgroupsGetallForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsGetallForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsGetallForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudPlacementgroupsGetallNotFound) Code() int { } func (o *PcloudPlacementgroupsGetallNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsGetallNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsGetallNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudPlacementgroupsGetallInternalServerError) Code() int { } func (o *PcloudPlacementgroupsGetallInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsGetallInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsGetallInternalServerError %+v", 500, o.Payload) + 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 { 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 index f7e58a2e..617f9ce0 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_placement_groups // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -121,11 +122,13 @@ func (o *PcloudPlacementgroupsMembersDeleteOK) Code() int { } func (o *PcloudPlacementgroupsMembersDeleteOK) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersDeleteOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersDeleteOK %+v", 200, o.Payload) + 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 { @@ -189,11 +192,13 @@ func (o *PcloudPlacementgroupsMembersDeleteBadRequest) Code() int { } func (o *PcloudPlacementgroupsMembersDeleteBadRequest) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersDeleteBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersDeleteBadRequest %+v", 400, o.Payload) + 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 { @@ -257,11 +262,13 @@ func (o *PcloudPlacementgroupsMembersDeleteUnauthorized) Code() int { } func (o *PcloudPlacementgroupsMembersDeleteUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersDeleteUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersDeleteUnauthorized %+v", 401, o.Payload) + 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 { @@ -325,11 +332,13 @@ func (o *PcloudPlacementgroupsMembersDeleteForbidden) Code() int { } func (o *PcloudPlacementgroupsMembersDeleteForbidden) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersDeleteForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersDeleteForbidden %+v", 403, o.Payload) + 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 { @@ -393,11 +402,13 @@ func (o *PcloudPlacementgroupsMembersDeleteNotFound) Code() int { } func (o *PcloudPlacementgroupsMembersDeleteNotFound) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersDeleteNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersDeleteNotFound %+v", 404, o.Payload) + 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 { @@ -461,11 +472,13 @@ func (o *PcloudPlacementgroupsMembersDeleteConflict) Code() int { } func (o *PcloudPlacementgroupsMembersDeleteConflict) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersDeleteConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersDeleteConflict %+v", 409, o.Payload) + 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 { @@ -529,11 +542,13 @@ func (o *PcloudPlacementgroupsMembersDeleteUnprocessableEntity) Code() int { } func (o *PcloudPlacementgroupsMembersDeleteUnprocessableEntity) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersDeleteUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersDeleteUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -597,11 +612,13 @@ func (o *PcloudPlacementgroupsMembersDeleteInternalServerError) Code() int { } func (o *PcloudPlacementgroupsMembersDeleteInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersDeleteInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersDeleteInternalServerError %+v", 500, o.Payload) + 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 { 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 index 5c0e64d8..c15ea979 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_placement_groups // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -121,11 +122,13 @@ func (o *PcloudPlacementgroupsMembersPostOK) Code() int { } func (o *PcloudPlacementgroupsMembersPostOK) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersPostOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersPostOK %+v", 200, o.Payload) + 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 { @@ -189,11 +192,13 @@ func (o *PcloudPlacementgroupsMembersPostBadRequest) Code() int { } func (o *PcloudPlacementgroupsMembersPostBadRequest) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersPostBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersPostBadRequest %+v", 400, o.Payload) + 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 { @@ -257,11 +262,13 @@ func (o *PcloudPlacementgroupsMembersPostUnauthorized) Code() int { } func (o *PcloudPlacementgroupsMembersPostUnauthorized) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersPostUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersPostUnauthorized %+v", 401, o.Payload) + 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 { @@ -325,11 +332,13 @@ func (o *PcloudPlacementgroupsMembersPostForbidden) Code() int { } func (o *PcloudPlacementgroupsMembersPostForbidden) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersPostForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersPostForbidden %+v", 403, o.Payload) + 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 { @@ -393,11 +402,13 @@ func (o *PcloudPlacementgroupsMembersPostNotFound) Code() int { } func (o *PcloudPlacementgroupsMembersPostNotFound) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersPostNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersPostNotFound %+v", 404, o.Payload) + 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 { @@ -461,11 +472,13 @@ func (o *PcloudPlacementgroupsMembersPostConflict) Code() int { } func (o *PcloudPlacementgroupsMembersPostConflict) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersPostConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersPostConflict %+v", 409, o.Payload) + 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 { @@ -529,11 +542,13 @@ func (o *PcloudPlacementgroupsMembersPostUnprocessableEntity) Code() int { } func (o *PcloudPlacementgroupsMembersPostUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersPostUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersPostUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -597,11 +612,13 @@ func (o *PcloudPlacementgroupsMembersPostInternalServerError) Code() int { } func (o *PcloudPlacementgroupsMembersPostInternalServerError) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersPostInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members][%d] pcloudPlacementgroupsMembersPostInternalServerError %+v", 500, o.Payload) + 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 { 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 index 71a5a918..0e908cf1 100644 --- a/power/client/p_cloud_placement_groups/pcloud_placementgroups_post_responses.go +++ b/power/client/p_cloud_placement_groups/pcloud_placementgroups_post_responses.go @@ -6,6 +6,7 @@ package p_cloud_placement_groups // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -121,11 +122,13 @@ func (o *PcloudPlacementgroupsPostOK) Code() int { } func (o *PcloudPlacementgroupsPostOK) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsPostOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsPostOK %+v", 200, o.Payload) + 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 { @@ -189,11 +192,13 @@ func (o *PcloudPlacementgroupsPostBadRequest) Code() int { } func (o *PcloudPlacementgroupsPostBadRequest) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsPostBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsPostBadRequest %+v", 400, o.Payload) + 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 { @@ -257,11 +262,13 @@ func (o *PcloudPlacementgroupsPostUnauthorized) Code() int { } func (o *PcloudPlacementgroupsPostUnauthorized) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsPostUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsPostUnauthorized %+v", 401, o.Payload) + 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 { @@ -325,11 +332,13 @@ func (o *PcloudPlacementgroupsPostForbidden) Code() int { } func (o *PcloudPlacementgroupsPostForbidden) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsPostForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsPostForbidden %+v", 403, o.Payload) + 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 { @@ -393,11 +402,13 @@ func (o *PcloudPlacementgroupsPostNotFound) Code() int { } func (o *PcloudPlacementgroupsPostNotFound) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsPostNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsPostNotFound %+v", 404, o.Payload) + 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 { @@ -461,11 +472,13 @@ func (o *PcloudPlacementgroupsPostConflict) Code() int { } func (o *PcloudPlacementgroupsPostConflict) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsPostConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsPostConflict %+v", 409, o.Payload) + 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 { @@ -529,11 +542,13 @@ func (o *PcloudPlacementgroupsPostUnprocessableEntity) Code() int { } func (o *PcloudPlacementgroupsPostUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsPostUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsPostUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -597,11 +612,13 @@ func (o *PcloudPlacementgroupsPostInternalServerError) Code() int { } func (o *PcloudPlacementgroupsPostInternalServerError) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsPostInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups][%d] pcloudPlacementgroupsPostInternalServerError %+v", 500, o.Payload) + 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 { 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 index 0bcf4c97..65c17f94 100644 --- 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 @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi 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 */ @@ -25,7 +51,7 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods 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 index 681badbb..d8e7f262 100644 --- a/power/client/p_cloud_pod_capacity/pcloud_podcapacity_get_responses.go +++ b/power/client/p_cloud_pod_capacity/pcloud_podcapacity_get_responses.go @@ -6,6 +6,7 @@ package p_cloud_pod_capacity // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudPodcapacityGetOK) Code() int { } func (o *PcloudPodcapacityGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pod-capacity][%d] pcloudPodcapacityGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pod-capacity][%d] pcloudPodcapacityGetOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudPodcapacityGetBadRequest) Code() int { } func (o *PcloudPodcapacityGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pod-capacity][%d] pcloudPodcapacityGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pod-capacity][%d] pcloudPodcapacityGetBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudPodcapacityGetUnauthorized) Code() int { } func (o *PcloudPodcapacityGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pod-capacity][%d] pcloudPodcapacityGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pod-capacity][%d] pcloudPodcapacityGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudPodcapacityGetForbidden) Code() int { } func (o *PcloudPodcapacityGetForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pod-capacity][%d] pcloudPodcapacityGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pod-capacity][%d] pcloudPodcapacityGetForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudPodcapacityGetNotFound) Code() int { } func (o *PcloudPodcapacityGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pod-capacity][%d] pcloudPodcapacityGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pod-capacity][%d] pcloudPodcapacityGetNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudPodcapacityGetInternalServerError) Code() int { } func (o *PcloudPodcapacityGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pod-capacity][%d] pcloudPodcapacityGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pod-capacity][%d] pcloudPodcapacityGetInternalServerError %+v", 500, o.Payload) + 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 { 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 index 917e5395..f5433f52 100644 --- a/power/client/p_cloud_s_a_p/p_cloudsap_client.go +++ b/power/client/p_cloud_s_a_p/p_cloudsap_client.go @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi 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 */ @@ -25,7 +51,7 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods 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 index ec80f3bd..d0be31ba 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_s_a_p // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudSapGetOK) Code() int { } func (o *PcloudSapGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap/{sap_profile_id}][%d] pcloudSapGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap/{sap_profile_id}][%d] pcloudSapGetOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudSapGetBadRequest) Code() int { } func (o *PcloudSapGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap/{sap_profile_id}][%d] pcloudSapGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap/{sap_profile_id}][%d] pcloudSapGetBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudSapGetUnauthorized) Code() int { } func (o *PcloudSapGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap/{sap_profile_id}][%d] pcloudSapGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap/{sap_profile_id}][%d] pcloudSapGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudSapGetForbidden) Code() int { } func (o *PcloudSapGetForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap/{sap_profile_id}][%d] pcloudSapGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap/{sap_profile_id}][%d] pcloudSapGetForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudSapGetNotFound) Code() int { } func (o *PcloudSapGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap/{sap_profile_id}][%d] pcloudSapGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap/{sap_profile_id}][%d] pcloudSapGetNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudSapGetInternalServerError) Code() int { } func (o *PcloudSapGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap/{sap_profile_id}][%d] pcloudSapGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap/{sap_profile_id}][%d] pcloudSapGetInternalServerError %+v", 500, o.Payload) + 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 { 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 index 52684d05..e69d9995 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_s_a_p // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudSapGetallOK) Code() int { } func (o *PcloudSapGetallOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapGetallOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapGetallOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudSapGetallBadRequest) Code() int { } func (o *PcloudSapGetallBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapGetallBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapGetallBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudSapGetallUnauthorized) Code() int { } func (o *PcloudSapGetallUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapGetallUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapGetallUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudSapGetallForbidden) Code() int { } func (o *PcloudSapGetallForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapGetallForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapGetallForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudSapGetallNotFound) Code() int { } func (o *PcloudSapGetallNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapGetallNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapGetallNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudSapGetallInternalServerError) Code() int { } func (o *PcloudSapGetallInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapGetallInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapGetallInternalServerError %+v", 500, o.Payload) + 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 { 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 index f68c030e..cb808bed 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_s_a_p // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -133,11 +134,13 @@ func (o *PcloudSapPostOK) Code() int { } func (o *PcloudSapPostOK) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostOK %+v", 200, o.Payload) + 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 { @@ -199,11 +202,13 @@ func (o *PcloudSapPostCreated) Code() int { } func (o *PcloudSapPostCreated) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostCreated %+v", 201, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostCreated %+v", 201, o.Payload) + 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 { @@ -265,11 +270,13 @@ func (o *PcloudSapPostAccepted) Code() int { } func (o *PcloudSapPostAccepted) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostAccepted %+v", 202, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostAccepted %+v", 202, o.Payload) + 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 { @@ -331,11 +338,13 @@ func (o *PcloudSapPostBadRequest) Code() int { } func (o *PcloudSapPostBadRequest) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostBadRequest %+v", 400, o.Payload) + 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 { @@ -399,11 +408,13 @@ func (o *PcloudSapPostUnauthorized) Code() int { } func (o *PcloudSapPostUnauthorized) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostUnauthorized %+v", 401, o.Payload) + 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 { @@ -467,11 +478,13 @@ func (o *PcloudSapPostForbidden) Code() int { } func (o *PcloudSapPostForbidden) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostForbidden %+v", 403, o.Payload) + 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 { @@ -535,11 +548,13 @@ func (o *PcloudSapPostNotFound) Code() int { } func (o *PcloudSapPostNotFound) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostNotFound %+v", 404, o.Payload) + 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 { @@ -603,11 +618,13 @@ func (o *PcloudSapPostConflict) Code() int { } func (o *PcloudSapPostConflict) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostConflict %+v", 409, o.Payload) + 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 { @@ -671,11 +688,13 @@ func (o *PcloudSapPostUnprocessableEntity) Code() int { } func (o *PcloudSapPostUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -739,11 +758,13 @@ func (o *PcloudSapPostInternalServerError) Code() int { } func (o *PcloudSapPostInternalServerError) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/sap][%d] pcloudSapPostInternalServerError %+v", 500, o.Payload) + 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 { 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 index 6407002a..e37b93ae 100644 --- 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 @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi 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 */ @@ -25,7 +51,7 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods 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 index 107bbf09..b3865e6c 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_s_p_p_placement_groups // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudSppplacementgroupsDeleteOK) Code() int { } func (o *PcloudSppplacementgroupsDeleteOK) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsDeleteOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsDeleteOK %+v", 200, o.Payload) + 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 { @@ -181,11 +184,13 @@ func (o *PcloudSppplacementgroupsDeleteBadRequest) Code() int { } func (o *PcloudSppplacementgroupsDeleteBadRequest) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsDeleteBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsDeleteBadRequest %+v", 400, o.Payload) + 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 { @@ -249,11 +254,13 @@ func (o *PcloudSppplacementgroupsDeleteUnauthorized) Code() int { } func (o *PcloudSppplacementgroupsDeleteUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsDeleteUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsDeleteUnauthorized %+v", 401, o.Payload) + 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 { @@ -317,11 +324,13 @@ func (o *PcloudSppplacementgroupsDeleteForbidden) Code() int { } func (o *PcloudSppplacementgroupsDeleteForbidden) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsDeleteForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsDeleteForbidden %+v", 403, o.Payload) + 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 { @@ -385,11 +394,13 @@ func (o *PcloudSppplacementgroupsDeleteNotFound) Code() int { } func (o *PcloudSppplacementgroupsDeleteNotFound) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsDeleteNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsDeleteNotFound %+v", 404, o.Payload) + 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 { @@ -453,11 +464,13 @@ func (o *PcloudSppplacementgroupsDeleteConflict) Code() int { } func (o *PcloudSppplacementgroupsDeleteConflict) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsDeleteConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsDeleteConflict %+v", 409, o.Payload) + 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 { @@ -521,11 +534,13 @@ func (o *PcloudSppplacementgroupsDeleteInternalServerError) Code() int { } func (o *PcloudSppplacementgroupsDeleteInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsDeleteInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsDeleteInternalServerError %+v", 500, o.Payload) + 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 { 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 index 07a983d3..f624ee83 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_s_p_p_placement_groups // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudSppplacementgroupsGetOK) Code() int { } func (o *PcloudSppplacementgroupsGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsGetOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudSppplacementgroupsGetBadRequest) Code() int { } func (o *PcloudSppplacementgroupsGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsGetBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudSppplacementgroupsGetUnauthorized) Code() int { } func (o *PcloudSppplacementgroupsGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudSppplacementgroupsGetForbidden) Code() int { } func (o *PcloudSppplacementgroupsGetForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsGetForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudSppplacementgroupsGetNotFound) Code() int { } func (o *PcloudSppplacementgroupsGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsGetNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudSppplacementgroupsGetInternalServerError) Code() int { } func (o *PcloudSppplacementgroupsGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups/{spp_placement_group_id}][%d] pcloudSppplacementgroupsGetInternalServerError %+v", 500, o.Payload) + 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 { 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 index 5c8c36c6..e29b8593 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_s_p_p_placement_groups // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudSppplacementgroupsGetallOK) Code() int { } func (o *PcloudSppplacementgroupsGetallOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsGetallOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsGetallOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudSppplacementgroupsGetallBadRequest) Code() int { } func (o *PcloudSppplacementgroupsGetallBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsGetallBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsGetallBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudSppplacementgroupsGetallUnauthorized) Code() int { } func (o *PcloudSppplacementgroupsGetallUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsGetallUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsGetallUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudSppplacementgroupsGetallForbidden) Code() int { } func (o *PcloudSppplacementgroupsGetallForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsGetallForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsGetallForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudSppplacementgroupsGetallNotFound) Code() int { } func (o *PcloudSppplacementgroupsGetallNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsGetallNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsGetallNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudSppplacementgroupsGetallInternalServerError) Code() int { } func (o *PcloudSppplacementgroupsGetallInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsGetallInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsGetallInternalServerError %+v", 500, o.Payload) + 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 { 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 index 6e06c8b7..e7c542a6 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_s_p_p_placement_groups // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudSppplacementgroupsMembersDeleteOK) Code() int { } func (o *PcloudSppplacementgroupsMembersDeleteOK) Error() string { - 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 %+v", 200, o.Payload) + 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 { - 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 %+v", 200, o.Payload) + 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 { @@ -183,11 +186,13 @@ func (o *PcloudSppplacementgroupsMembersDeleteBadRequest) Code() int { } func (o *PcloudSppplacementgroupsMembersDeleteBadRequest) Error() string { - 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 %+v", 400, o.Payload) + 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 { - 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 %+v", 400, o.Payload) + 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 { @@ -251,11 +256,13 @@ func (o *PcloudSppplacementgroupsMembersDeleteUnauthorized) Code() int { } func (o *PcloudSppplacementgroupsMembersDeleteUnauthorized) Error() string { - 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 %+v", 401, o.Payload) + 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 { - 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 %+v", 401, o.Payload) + 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 { @@ -319,11 +326,13 @@ func (o *PcloudSppplacementgroupsMembersDeleteForbidden) Code() int { } func (o *PcloudSppplacementgroupsMembersDeleteForbidden) Error() string { - 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 %+v", 403, o.Payload) + 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 { - 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 %+v", 403, o.Payload) + 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 { @@ -387,11 +396,13 @@ func (o *PcloudSppplacementgroupsMembersDeleteNotFound) Code() int { } func (o *PcloudSppplacementgroupsMembersDeleteNotFound) Error() string { - 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 %+v", 404, o.Payload) + 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 { - 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 %+v", 404, o.Payload) + 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 { @@ -455,11 +466,13 @@ func (o *PcloudSppplacementgroupsMembersDeleteConflict) Code() int { } func (o *PcloudSppplacementgroupsMembersDeleteConflict) Error() string { - 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 %+v", 409, o.Payload) + 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 { - 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 %+v", 409, o.Payload) + 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 { @@ -523,11 +536,13 @@ func (o *PcloudSppplacementgroupsMembersDeleteInternalServerError) Code() int { } func (o *PcloudSppplacementgroupsMembersDeleteInternalServerError) Error() string { - 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 %+v", 500, o.Payload) + 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 { - 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 %+v", 500, o.Payload) + 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 { 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 index b9b3f437..e1c89983 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_s_p_p_placement_groups // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -121,11 +122,13 @@ func (o *PcloudSppplacementgroupsMembersPostOK) Code() int { } func (o *PcloudSppplacementgroupsMembersPostOK) Error() string { - 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 %+v", 200, o.Payload) + 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 { - 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 %+v", 200, o.Payload) + 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 { @@ -189,11 +192,13 @@ func (o *PcloudSppplacementgroupsMembersPostBadRequest) Code() int { } func (o *PcloudSppplacementgroupsMembersPostBadRequest) Error() string { - 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 %+v", 400, o.Payload) + 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 { - 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 %+v", 400, o.Payload) + 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 { @@ -257,11 +262,13 @@ func (o *PcloudSppplacementgroupsMembersPostUnauthorized) Code() int { } func (o *PcloudSppplacementgroupsMembersPostUnauthorized) Error() string { - 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 %+v", 401, o.Payload) + 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 { - 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 %+v", 401, o.Payload) + 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 { @@ -325,11 +332,13 @@ func (o *PcloudSppplacementgroupsMembersPostForbidden) Code() int { } func (o *PcloudSppplacementgroupsMembersPostForbidden) Error() string { - 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 %+v", 403, o.Payload) + 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 { - 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 %+v", 403, o.Payload) + 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 { @@ -393,11 +402,13 @@ func (o *PcloudSppplacementgroupsMembersPostNotFound) Code() int { } func (o *PcloudSppplacementgroupsMembersPostNotFound) Error() string { - 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 %+v", 404, o.Payload) + 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 { - 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 %+v", 404, o.Payload) + 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 { @@ -461,11 +472,13 @@ func (o *PcloudSppplacementgroupsMembersPostConflict) Code() int { } func (o *PcloudSppplacementgroupsMembersPostConflict) Error() string { - 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 %+v", 409, o.Payload) + 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 { - 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 %+v", 409, o.Payload) + 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 { @@ -529,11 +542,13 @@ func (o *PcloudSppplacementgroupsMembersPostUnprocessableEntity) Code() int { } func (o *PcloudSppplacementgroupsMembersPostUnprocessableEntity) Error() string { - 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 %+v", 422, o.Payload) + 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 { - 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 %+v", 422, o.Payload) + 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 { @@ -597,11 +612,13 @@ func (o *PcloudSppplacementgroupsMembersPostInternalServerError) Code() int { } func (o *PcloudSppplacementgroupsMembersPostInternalServerError) Error() string { - 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 %+v", 500, o.Payload) + 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 { - 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 %+v", 500, o.Payload) + 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 { 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 index d11ee16e..d6344967 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_s_p_p_placement_groups // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -121,11 +122,13 @@ func (o *PcloudSppplacementgroupsPostOK) Code() int { } func (o *PcloudSppplacementgroupsPostOK) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsPostOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsPostOK %+v", 200, o.Payload) + 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 { @@ -189,11 +192,13 @@ func (o *PcloudSppplacementgroupsPostBadRequest) Code() int { } func (o *PcloudSppplacementgroupsPostBadRequest) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsPostBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsPostBadRequest %+v", 400, o.Payload) + 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 { @@ -257,11 +262,13 @@ func (o *PcloudSppplacementgroupsPostUnauthorized) Code() int { } func (o *PcloudSppplacementgroupsPostUnauthorized) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsPostUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsPostUnauthorized %+v", 401, o.Payload) + 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 { @@ -325,11 +332,13 @@ func (o *PcloudSppplacementgroupsPostForbidden) Code() int { } func (o *PcloudSppplacementgroupsPostForbidden) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsPostForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsPostForbidden %+v", 403, o.Payload) + 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 { @@ -393,11 +402,13 @@ func (o *PcloudSppplacementgroupsPostNotFound) Code() int { } func (o *PcloudSppplacementgroupsPostNotFound) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsPostNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsPostNotFound %+v", 404, o.Payload) + 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 { @@ -461,11 +472,13 @@ func (o *PcloudSppplacementgroupsPostConflict) Code() int { } func (o *PcloudSppplacementgroupsPostConflict) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsPostConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsPostConflict %+v", 409, o.Payload) + 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 { @@ -529,11 +542,13 @@ func (o *PcloudSppplacementgroupsPostUnprocessableEntity) Code() int { } func (o *PcloudSppplacementgroupsPostUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsPostUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsPostUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -597,11 +612,13 @@ func (o *PcloudSppplacementgroupsPostInternalServerError) Code() int { } func (o *PcloudSppplacementgroupsPostInternalServerError) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsPostInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups][%d] pcloudSppplacementgroupsPostInternalServerError %+v", 500, o.Payload) + 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 { 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 index 4c13670f..7200abcd 100644 --- 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 @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi 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 */ @@ -25,7 +51,7 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods 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 index d76cbd09..f23ea986 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_service_d_h_c_p // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -103,11 +104,13 @@ func (o *PcloudDhcpDeleteAccepted) Code() int { } func (o *PcloudDhcpDeleteAccepted) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpDeleteAccepted %+v", 202, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpDeleteAccepted %+v", 202, o.Payload) + 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 { @@ -169,11 +172,13 @@ func (o *PcloudDhcpDeleteBadRequest) Code() int { } func (o *PcloudDhcpDeleteBadRequest) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpDeleteBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpDeleteBadRequest %+v", 400, o.Payload) + 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 { @@ -237,11 +242,13 @@ func (o *PcloudDhcpDeleteForbidden) Code() int { } func (o *PcloudDhcpDeleteForbidden) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpDeleteForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpDeleteForbidden %+v", 403, o.Payload) + 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 { @@ -305,11 +312,13 @@ func (o *PcloudDhcpDeleteNotFound) Code() int { } func (o *PcloudDhcpDeleteNotFound) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpDeleteNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpDeleteNotFound %+v", 404, o.Payload) + 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 { @@ -373,11 +382,13 @@ func (o *PcloudDhcpDeleteInternalServerError) Code() int { } func (o *PcloudDhcpDeleteInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpDeleteInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpDeleteInternalServerError %+v", 500, o.Payload) + 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 { 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 index b8847e08..858df91a 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_service_d_h_c_p // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudDhcpGetOK) Code() int { } func (o *PcloudDhcpGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpGetOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudDhcpGetBadRequest) Code() int { } func (o *PcloudDhcpGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpGetBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudDhcpGetUnauthorized) Code() int { } func (o *PcloudDhcpGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudDhcpGetForbidden) Code() int { } func (o *PcloudDhcpGetForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpGetForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudDhcpGetNotFound) Code() int { } func (o *PcloudDhcpGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpGetNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudDhcpGetInternalServerError) Code() int { } func (o *PcloudDhcpGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp/{dhcp_id}][%d] pcloudDhcpGetInternalServerError %+v", 500, o.Payload) + 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 { 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 index f90457a4..2354a68e 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_service_d_h_c_p // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudDhcpGetallOK) Code() int { } func (o *PcloudDhcpGetallOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpGetallOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpGetallOK %+v", 200, o.Payload) + 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 { @@ -175,11 +178,13 @@ func (o *PcloudDhcpGetallBadRequest) Code() int { } func (o *PcloudDhcpGetallBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpGetallBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpGetallBadRequest %+v", 400, o.Payload) + 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 { @@ -243,11 +248,13 @@ func (o *PcloudDhcpGetallUnauthorized) Code() int { } func (o *PcloudDhcpGetallUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpGetallUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpGetallUnauthorized %+v", 401, o.Payload) + 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 { @@ -311,11 +318,13 @@ func (o *PcloudDhcpGetallForbidden) Code() int { } func (o *PcloudDhcpGetallForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpGetallForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpGetallForbidden %+v", 403, o.Payload) + 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 { @@ -379,11 +388,13 @@ func (o *PcloudDhcpGetallNotFound) Code() int { } func (o *PcloudDhcpGetallNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpGetallNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpGetallNotFound %+v", 404, o.Payload) + 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 { @@ -447,11 +458,13 @@ func (o *PcloudDhcpGetallInternalServerError) Code() int { } func (o *PcloudDhcpGetallInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpGetallInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpGetallInternalServerError %+v", 500, o.Payload) + 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 { 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 index 2578e70c..6c2181e7 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_service_d_h_c_p // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudDhcpPostAccepted) Code() int { } func (o *PcloudDhcpPostAccepted) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpPostAccepted %+v", 202, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpPostAccepted %+v", 202, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudDhcpPostBadRequest) Code() int { } func (o *PcloudDhcpPostBadRequest) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpPostBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpPostBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudDhcpPostUnauthorized) Code() int { } func (o *PcloudDhcpPostUnauthorized) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpPostUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpPostUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudDhcpPostForbidden) Code() int { } func (o *PcloudDhcpPostForbidden) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpPostForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpPostForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudDhcpPostNotFound) Code() int { } func (o *PcloudDhcpPostNotFound) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpPostNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpPostNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudDhcpPostInternalServerError) Code() int { } func (o *PcloudDhcpPostInternalServerError) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpPostInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/services/dhcp][%d] pcloudDhcpPostInternalServerError %+v", 500, o.Payload) + 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 { 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 index 7c4e27a7..6e60de90 100644 --- 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 @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi 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 */ @@ -25,7 +51,7 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods 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 index 9ba1ffa5..376e3f8d 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_shared_processor_pools // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudSharedprocessorpoolsDeleteOK) Code() int { } func (o *PcloudSharedprocessorpoolsDeleteOK) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsDeleteOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsDeleteOK %+v", 200, o.Payload) + 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 { @@ -181,11 +184,13 @@ func (o *PcloudSharedprocessorpoolsDeleteBadRequest) Code() int { } func (o *PcloudSharedprocessorpoolsDeleteBadRequest) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsDeleteBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsDeleteBadRequest %+v", 400, o.Payload) + 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 { @@ -249,11 +254,13 @@ func (o *PcloudSharedprocessorpoolsDeleteUnauthorized) Code() int { } func (o *PcloudSharedprocessorpoolsDeleteUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsDeleteUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsDeleteUnauthorized %+v", 401, o.Payload) + 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 { @@ -317,11 +324,13 @@ func (o *PcloudSharedprocessorpoolsDeleteForbidden) Code() int { } func (o *PcloudSharedprocessorpoolsDeleteForbidden) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsDeleteForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsDeleteForbidden %+v", 403, o.Payload) + 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 { @@ -385,11 +394,13 @@ func (o *PcloudSharedprocessorpoolsDeleteNotFound) Code() int { } func (o *PcloudSharedprocessorpoolsDeleteNotFound) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsDeleteNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsDeleteNotFound %+v", 404, o.Payload) + 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 { @@ -453,11 +464,13 @@ func (o *PcloudSharedprocessorpoolsDeleteConflict) Code() int { } func (o *PcloudSharedprocessorpoolsDeleteConflict) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsDeleteConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsDeleteConflict %+v", 409, o.Payload) + 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 { @@ -521,11 +534,13 @@ func (o *PcloudSharedprocessorpoolsDeleteInternalServerError) Code() int { } func (o *PcloudSharedprocessorpoolsDeleteInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsDeleteInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsDeleteInternalServerError %+v", 500, o.Payload) + 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 { 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 index 52cdaca5..9e650341 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_shared_processor_pools // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudSharedprocessorpoolsGetOK) Code() int { } func (o *PcloudSharedprocessorpoolsGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsGetOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudSharedprocessorpoolsGetBadRequest) Code() int { } func (o *PcloudSharedprocessorpoolsGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsGetBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudSharedprocessorpoolsGetUnauthorized) Code() int { } func (o *PcloudSharedprocessorpoolsGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudSharedprocessorpoolsGetForbidden) Code() int { } func (o *PcloudSharedprocessorpoolsGetForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsGetForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudSharedprocessorpoolsGetNotFound) Code() int { } func (o *PcloudSharedprocessorpoolsGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsGetNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudSharedprocessorpoolsGetInternalServerError) Code() int { } func (o *PcloudSharedprocessorpoolsGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsGetInternalServerError %+v", 500, o.Payload) + 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 { 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 index 6e6fb6c7..7d940969 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_shared_processor_pools // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudSharedprocessorpoolsGetallOK) Code() int { } func (o *PcloudSharedprocessorpoolsGetallOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsGetallOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsGetallOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudSharedprocessorpoolsGetallBadRequest) Code() int { } func (o *PcloudSharedprocessorpoolsGetallBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsGetallBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsGetallBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudSharedprocessorpoolsGetallUnauthorized) Code() int { } func (o *PcloudSharedprocessorpoolsGetallUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsGetallUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsGetallUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudSharedprocessorpoolsGetallForbidden) Code() int { } func (o *PcloudSharedprocessorpoolsGetallForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsGetallForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsGetallForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudSharedprocessorpoolsGetallNotFound) Code() int { } func (o *PcloudSharedprocessorpoolsGetallNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsGetallNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsGetallNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudSharedprocessorpoolsGetallInternalServerError) Code() int { } func (o *PcloudSharedprocessorpoolsGetallInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsGetallInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsGetallInternalServerError %+v", 500, o.Payload) + 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 { 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 index 97d5f4ce..95e946fd 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_shared_processor_pools // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -121,11 +122,13 @@ func (o *PcloudSharedprocessorpoolsPostAccepted) Code() int { } func (o *PcloudSharedprocessorpoolsPostAccepted) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsPostAccepted %+v", 202, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsPostAccepted %+v", 202, o.Payload) + 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 { @@ -189,11 +192,13 @@ func (o *PcloudSharedprocessorpoolsPostBadRequest) Code() int { } func (o *PcloudSharedprocessorpoolsPostBadRequest) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsPostBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsPostBadRequest %+v", 400, o.Payload) + 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 { @@ -257,11 +262,13 @@ func (o *PcloudSharedprocessorpoolsPostUnauthorized) Code() int { } func (o *PcloudSharedprocessorpoolsPostUnauthorized) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsPostUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsPostUnauthorized %+v", 401, o.Payload) + 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 { @@ -325,11 +332,13 @@ func (o *PcloudSharedprocessorpoolsPostForbidden) Code() int { } func (o *PcloudSharedprocessorpoolsPostForbidden) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsPostForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsPostForbidden %+v", 403, o.Payload) + 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 { @@ -393,11 +402,13 @@ func (o *PcloudSharedprocessorpoolsPostNotFound) Code() int { } func (o *PcloudSharedprocessorpoolsPostNotFound) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsPostNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsPostNotFound %+v", 404, o.Payload) + 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 { @@ -461,11 +472,13 @@ func (o *PcloudSharedprocessorpoolsPostConflict) Code() int { } func (o *PcloudSharedprocessorpoolsPostConflict) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsPostConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsPostConflict %+v", 409, o.Payload) + 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 { @@ -529,11 +542,13 @@ func (o *PcloudSharedprocessorpoolsPostUnprocessableEntity) Code() int { } func (o *PcloudSharedprocessorpoolsPostUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsPostUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsPostUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -597,11 +612,13 @@ func (o *PcloudSharedprocessorpoolsPostInternalServerError) Code() int { } func (o *PcloudSharedprocessorpoolsPostInternalServerError) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsPostInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsPostInternalServerError %+v", 500, o.Payload) + 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 { 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 index d19e776f..2ab1daef 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_shared_processor_pools // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudSharedprocessorpoolsPutOK) Code() int { } func (o *PcloudSharedprocessorpoolsPutOK) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsPutOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsPutOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudSharedprocessorpoolsPutBadRequest) Code() int { } func (o *PcloudSharedprocessorpoolsPutBadRequest) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsPutBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsPutBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudSharedprocessorpoolsPutUnauthorized) Code() int { } func (o *PcloudSharedprocessorpoolsPutUnauthorized) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsPutUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsPutUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudSharedprocessorpoolsPutForbidden) Code() int { } func (o *PcloudSharedprocessorpoolsPutForbidden) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsPutForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsPutForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudSharedprocessorpoolsPutNotFound) Code() int { } func (o *PcloudSharedprocessorpoolsPutNotFound) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsPutNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsPutNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudSharedprocessorpoolsPutInternalServerError) Code() int { } func (o *PcloudSharedprocessorpoolsPutInternalServerError) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsPutInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}][%d] pcloudSharedprocessorpoolsPutInternalServerError %+v", 500, o.Payload) + 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 { diff --git a/power/client/p_cloud_snapshots/p_cloud_snapshots_client.go b/power/client/p_cloud_snapshots/p_cloud_snapshots_client.go index cfadbbb1..c5f62564 100644 --- a/power/client/p_cloud_snapshots/p_cloud_snapshots_client.go +++ b/power/client/p_cloud_snapshots/p_cloud_snapshots_client.go @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi 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 */ @@ -25,7 +51,7 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods 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 index a920f110..85dd41fd 100644 --- a/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_delete_responses.go +++ b/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_delete_responses.go @@ -6,6 +6,7 @@ package p_cloud_snapshots // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudCloudinstancesSnapshotsDeleteAccepted) Code() int { } func (o *PcloudCloudinstancesSnapshotsDeleteAccepted) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsDeleteAccepted %+v", 202, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsDeleteAccepted %+v", 202, o.Payload) + 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 { @@ -181,11 +184,13 @@ func (o *PcloudCloudinstancesSnapshotsDeleteBadRequest) Code() int { } func (o *PcloudCloudinstancesSnapshotsDeleteBadRequest) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsDeleteBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsDeleteBadRequest %+v", 400, o.Payload) + 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 { @@ -249,11 +254,13 @@ func (o *PcloudCloudinstancesSnapshotsDeleteUnauthorized) Code() int { } func (o *PcloudCloudinstancesSnapshotsDeleteUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsDeleteUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsDeleteUnauthorized %+v", 401, o.Payload) + 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 { @@ -317,11 +324,13 @@ func (o *PcloudCloudinstancesSnapshotsDeleteForbidden) Code() int { } func (o *PcloudCloudinstancesSnapshotsDeleteForbidden) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsDeleteForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsDeleteForbidden %+v", 403, o.Payload) + 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 { @@ -385,11 +394,13 @@ func (o *PcloudCloudinstancesSnapshotsDeleteNotFound) Code() int { } func (o *PcloudCloudinstancesSnapshotsDeleteNotFound) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsDeleteNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsDeleteNotFound %+v", 404, o.Payload) + 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 { @@ -453,11 +464,13 @@ func (o *PcloudCloudinstancesSnapshotsDeleteGone) Code() int { } func (o *PcloudCloudinstancesSnapshotsDeleteGone) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsDeleteGone %+v", 410, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsDeleteGone %+v", 410, o.Payload) + 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 { @@ -521,11 +534,13 @@ func (o *PcloudCloudinstancesSnapshotsDeleteInternalServerError) Code() int { } func (o *PcloudCloudinstancesSnapshotsDeleteInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsDeleteInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsDeleteInternalServerError %+v", 500, o.Payload) + 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 { 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 index 33653592..df567764 100644 --- a/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_get_responses.go +++ b/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_get_responses.go @@ -6,6 +6,7 @@ package p_cloud_snapshots // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudCloudinstancesSnapshotsGetOK) Code() int { } func (o *PcloudCloudinstancesSnapshotsGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsGetOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudCloudinstancesSnapshotsGetBadRequest) Code() int { } func (o *PcloudCloudinstancesSnapshotsGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsGetBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudCloudinstancesSnapshotsGetUnauthorized) Code() int { } func (o *PcloudCloudinstancesSnapshotsGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudCloudinstancesSnapshotsGetForbidden) Code() int { } func (o *PcloudCloudinstancesSnapshotsGetForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsGetForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudCloudinstancesSnapshotsGetNotFound) Code() int { } func (o *PcloudCloudinstancesSnapshotsGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsGetNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudCloudinstancesSnapshotsGetInternalServerError) Code() int { } func (o *PcloudCloudinstancesSnapshotsGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsGetInternalServerError %+v", 500, o.Payload) + 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 { 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 index 5cf8680e..63d3af55 100644 --- a/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_getall_responses.go +++ b/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_getall_responses.go @@ -6,6 +6,7 @@ package p_cloud_snapshots // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudCloudinstancesSnapshotsGetallOK) Code() int { } func (o *PcloudCloudinstancesSnapshotsGetallOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots][%d] pcloudCloudinstancesSnapshotsGetallOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots][%d] pcloudCloudinstancesSnapshotsGetallOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudCloudinstancesSnapshotsGetallBadRequest) Code() int { } func (o *PcloudCloudinstancesSnapshotsGetallBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots][%d] pcloudCloudinstancesSnapshotsGetallBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots][%d] pcloudCloudinstancesSnapshotsGetallBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudCloudinstancesSnapshotsGetallUnauthorized) Code() int { } func (o *PcloudCloudinstancesSnapshotsGetallUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots][%d] pcloudCloudinstancesSnapshotsGetallUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots][%d] pcloudCloudinstancesSnapshotsGetallUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudCloudinstancesSnapshotsGetallForbidden) Code() int { } func (o *PcloudCloudinstancesSnapshotsGetallForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots][%d] pcloudCloudinstancesSnapshotsGetallForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots][%d] pcloudCloudinstancesSnapshotsGetallForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudCloudinstancesSnapshotsGetallNotFound) Code() int { } func (o *PcloudCloudinstancesSnapshotsGetallNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots][%d] pcloudCloudinstancesSnapshotsGetallNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots][%d] pcloudCloudinstancesSnapshotsGetallNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudCloudinstancesSnapshotsGetallInternalServerError) Code() int { } func (o *PcloudCloudinstancesSnapshotsGetallInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots][%d] pcloudCloudinstancesSnapshotsGetallInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots][%d] pcloudCloudinstancesSnapshotsGetallInternalServerError %+v", 500, o.Payload) + 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 { 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 index 322ef9e3..dcba5cb8 100644 --- a/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_put_responses.go +++ b/power/client/p_cloud_snapshots/pcloud_cloudinstances_snapshots_put_responses.go @@ -6,6 +6,7 @@ package p_cloud_snapshots // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudCloudinstancesSnapshotsPutOK) Code() int { } func (o *PcloudCloudinstancesSnapshotsPutOK) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsPutOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsPutOK %+v", 200, o.Payload) + 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 { @@ -175,11 +178,13 @@ func (o *PcloudCloudinstancesSnapshotsPutBadRequest) Code() int { } func (o *PcloudCloudinstancesSnapshotsPutBadRequest) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsPutBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsPutBadRequest %+v", 400, o.Payload) + 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 { @@ -243,11 +248,13 @@ func (o *PcloudCloudinstancesSnapshotsPutUnauthorized) Code() int { } func (o *PcloudCloudinstancesSnapshotsPutUnauthorized) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsPutUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsPutUnauthorized %+v", 401, o.Payload) + 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 { @@ -311,11 +318,13 @@ func (o *PcloudCloudinstancesSnapshotsPutForbidden) Code() int { } func (o *PcloudCloudinstancesSnapshotsPutForbidden) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsPutForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsPutForbidden %+v", 403, o.Payload) + 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 { @@ -379,11 +388,13 @@ func (o *PcloudCloudinstancesSnapshotsPutNotFound) Code() int { } func (o *PcloudCloudinstancesSnapshotsPutNotFound) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsPutNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsPutNotFound %+v", 404, o.Payload) + 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 { @@ -447,11 +458,13 @@ func (o *PcloudCloudinstancesSnapshotsPutInternalServerError) Code() int { } func (o *PcloudCloudinstancesSnapshotsPutInternalServerError) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsPutInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/snapshots/{snapshot_id}][%d] pcloudCloudinstancesSnapshotsPutInternalServerError %+v", 500, o.Payload) + 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 { 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 index cd76cbf1..e2305a8a 100644 --- 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 @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi 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 */ @@ -25,7 +51,7 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods 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 index 041ad0f2..7120965a 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_storage_capacity // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudStoragecapacityPoolsGetOK) Code() int { } func (o *PcloudStoragecapacityPoolsGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools/{storage_pool_name}][%d] pcloudStoragecapacityPoolsGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools/{storage_pool_name}][%d] pcloudStoragecapacityPoolsGetOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudStoragecapacityPoolsGetBadRequest) Code() int { } func (o *PcloudStoragecapacityPoolsGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools/{storage_pool_name}][%d] pcloudStoragecapacityPoolsGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools/{storage_pool_name}][%d] pcloudStoragecapacityPoolsGetBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudStoragecapacityPoolsGetUnauthorized) Code() int { } func (o *PcloudStoragecapacityPoolsGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools/{storage_pool_name}][%d] pcloudStoragecapacityPoolsGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools/{storage_pool_name}][%d] pcloudStoragecapacityPoolsGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudStoragecapacityPoolsGetForbidden) Code() int { } func (o *PcloudStoragecapacityPoolsGetForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools/{storage_pool_name}][%d] pcloudStoragecapacityPoolsGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools/{storage_pool_name}][%d] pcloudStoragecapacityPoolsGetForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudStoragecapacityPoolsGetNotFound) Code() int { } func (o *PcloudStoragecapacityPoolsGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools/{storage_pool_name}][%d] pcloudStoragecapacityPoolsGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools/{storage_pool_name}][%d] pcloudStoragecapacityPoolsGetNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudStoragecapacityPoolsGetInternalServerError) Code() int { } func (o *PcloudStoragecapacityPoolsGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools/{storage_pool_name}][%d] pcloudStoragecapacityPoolsGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools/{storage_pool_name}][%d] pcloudStoragecapacityPoolsGetInternalServerError %+v", 500, o.Payload) + 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 { 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 index 10087904..97ac829f 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_storage_capacity // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudStoragecapacityPoolsGetallOK) Code() int { } func (o *PcloudStoragecapacityPoolsGetallOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools][%d] pcloudStoragecapacityPoolsGetallOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools][%d] pcloudStoragecapacityPoolsGetallOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudStoragecapacityPoolsGetallBadRequest) Code() int { } func (o *PcloudStoragecapacityPoolsGetallBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools][%d] pcloudStoragecapacityPoolsGetallBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools][%d] pcloudStoragecapacityPoolsGetallBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudStoragecapacityPoolsGetallUnauthorized) Code() int { } func (o *PcloudStoragecapacityPoolsGetallUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools][%d] pcloudStoragecapacityPoolsGetallUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools][%d] pcloudStoragecapacityPoolsGetallUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudStoragecapacityPoolsGetallForbidden) Code() int { } func (o *PcloudStoragecapacityPoolsGetallForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools][%d] pcloudStoragecapacityPoolsGetallForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools][%d] pcloudStoragecapacityPoolsGetallForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudStoragecapacityPoolsGetallNotFound) Code() int { } func (o *PcloudStoragecapacityPoolsGetallNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools][%d] pcloudStoragecapacityPoolsGetallNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools][%d] pcloudStoragecapacityPoolsGetallNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudStoragecapacityPoolsGetallInternalServerError) Code() int { } func (o *PcloudStoragecapacityPoolsGetallInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools][%d] pcloudStoragecapacityPoolsGetallInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-pools][%d] pcloudStoragecapacityPoolsGetallInternalServerError %+v", 500, o.Payload) + 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 { 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 index 9b491a30..229517d3 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_storage_capacity // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudStoragecapacityTypesGetOK) Code() int { } func (o *PcloudStoragecapacityTypesGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types/{storage_type_name}][%d] pcloudStoragecapacityTypesGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types/{storage_type_name}][%d] pcloudStoragecapacityTypesGetOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudStoragecapacityTypesGetBadRequest) Code() int { } func (o *PcloudStoragecapacityTypesGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types/{storage_type_name}][%d] pcloudStoragecapacityTypesGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types/{storage_type_name}][%d] pcloudStoragecapacityTypesGetBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudStoragecapacityTypesGetUnauthorized) Code() int { } func (o *PcloudStoragecapacityTypesGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types/{storage_type_name}][%d] pcloudStoragecapacityTypesGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types/{storage_type_name}][%d] pcloudStoragecapacityTypesGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudStoragecapacityTypesGetForbidden) Code() int { } func (o *PcloudStoragecapacityTypesGetForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types/{storage_type_name}][%d] pcloudStoragecapacityTypesGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types/{storage_type_name}][%d] pcloudStoragecapacityTypesGetForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudStoragecapacityTypesGetNotFound) Code() int { } func (o *PcloudStoragecapacityTypesGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types/{storage_type_name}][%d] pcloudStoragecapacityTypesGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types/{storage_type_name}][%d] pcloudStoragecapacityTypesGetNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudStoragecapacityTypesGetInternalServerError) Code() int { } func (o *PcloudStoragecapacityTypesGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types/{storage_type_name}][%d] pcloudStoragecapacityTypesGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types/{storage_type_name}][%d] pcloudStoragecapacityTypesGetInternalServerError %+v", 500, o.Payload) + 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 { 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 index 50173880..dba3624c 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_storage_capacity // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudStoragecapacityTypesGetallOK) Code() int { } func (o *PcloudStoragecapacityTypesGetallOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types][%d] pcloudStoragecapacityTypesGetallOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types][%d] pcloudStoragecapacityTypesGetallOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudStoragecapacityTypesGetallBadRequest) Code() int { } func (o *PcloudStoragecapacityTypesGetallBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types][%d] pcloudStoragecapacityTypesGetallBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types][%d] pcloudStoragecapacityTypesGetallBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudStoragecapacityTypesGetallUnauthorized) Code() int { } func (o *PcloudStoragecapacityTypesGetallUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types][%d] pcloudStoragecapacityTypesGetallUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types][%d] pcloudStoragecapacityTypesGetallUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudStoragecapacityTypesGetallForbidden) Code() int { } func (o *PcloudStoragecapacityTypesGetallForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types][%d] pcloudStoragecapacityTypesGetallForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types][%d] pcloudStoragecapacityTypesGetallForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudStoragecapacityTypesGetallNotFound) Code() int { } func (o *PcloudStoragecapacityTypesGetallNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types][%d] pcloudStoragecapacityTypesGetallNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types][%d] pcloudStoragecapacityTypesGetallNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudStoragecapacityTypesGetallInternalServerError) Code() int { } func (o *PcloudStoragecapacityTypesGetallInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types][%d] pcloudStoragecapacityTypesGetallInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-capacity/storage-types][%d] pcloudStoragecapacityTypesGetallInternalServerError %+v", 500, o.Payload) + 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 { 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 index b1185a8c..624d1915 100644 --- 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 @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi 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 */ @@ -25,7 +51,7 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods 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 index e74971ae..6a033ad3 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_storage_tiers // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudCloudinstancesStoragetiersGetallOK) Code() int { } func (o *PcloudCloudinstancesStoragetiersGetallOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-tiers][%d] pcloudCloudinstancesStoragetiersGetallOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-tiers][%d] pcloudCloudinstancesStoragetiersGetallOK %+v", 200, o.Payload) + 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 { @@ -175,11 +178,13 @@ func (o *PcloudCloudinstancesStoragetiersGetallBadRequest) Code() int { } func (o *PcloudCloudinstancesStoragetiersGetallBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-tiers][%d] pcloudCloudinstancesStoragetiersGetallBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-tiers][%d] pcloudCloudinstancesStoragetiersGetallBadRequest %+v", 400, o.Payload) + 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 { @@ -243,11 +248,13 @@ func (o *PcloudCloudinstancesStoragetiersGetallUnauthorized) Code() int { } func (o *PcloudCloudinstancesStoragetiersGetallUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-tiers][%d] pcloudCloudinstancesStoragetiersGetallUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-tiers][%d] pcloudCloudinstancesStoragetiersGetallUnauthorized %+v", 401, o.Payload) + 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 { @@ -311,11 +318,13 @@ func (o *PcloudCloudinstancesStoragetiersGetallForbidden) Code() int { } func (o *PcloudCloudinstancesStoragetiersGetallForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-tiers][%d] pcloudCloudinstancesStoragetiersGetallForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-tiers][%d] pcloudCloudinstancesStoragetiersGetallForbidden %+v", 403, o.Payload) + 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 { @@ -379,11 +388,13 @@ func (o *PcloudCloudinstancesStoragetiersGetallNotFound) Code() int { } func (o *PcloudCloudinstancesStoragetiersGetallNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-tiers][%d] pcloudCloudinstancesStoragetiersGetallNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-tiers][%d] pcloudCloudinstancesStoragetiersGetallNotFound %+v", 404, o.Payload) + 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 { @@ -447,11 +458,13 @@ func (o *PcloudCloudinstancesStoragetiersGetallInternalServerError) Code() int { } func (o *PcloudCloudinstancesStoragetiersGetallInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-tiers][%d] pcloudCloudinstancesStoragetiersGetallInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/storage-tiers][%d] pcloudCloudinstancesStoragetiersGetallInternalServerError %+v", 500, o.Payload) + 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 { 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 index a2c33346..63de58c2 100644 --- 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 @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi 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 */ @@ -25,7 +51,7 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods 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 index f354158d..139f134d 100644 --- a/power/client/p_cloud_system_pools/pcloud_systempools_get_responses.go +++ b/power/client/p_cloud_system_pools/pcloud_systempools_get_responses.go @@ -6,6 +6,7 @@ package p_cloud_system_pools // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudSystempoolsGetOK) Code() int { } func (o *PcloudSystempoolsGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/system-pools][%d] pcloudSystempoolsGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/system-pools][%d] pcloudSystempoolsGetOK %+v", 200, o.Payload) + 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 { @@ -175,11 +178,13 @@ func (o *PcloudSystempoolsGetBadRequest) Code() int { } func (o *PcloudSystempoolsGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/system-pools][%d] pcloudSystempoolsGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/system-pools][%d] pcloudSystempoolsGetBadRequest %+v", 400, o.Payload) + 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 { @@ -243,11 +248,13 @@ func (o *PcloudSystempoolsGetUnauthorized) Code() int { } func (o *PcloudSystempoolsGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/system-pools][%d] pcloudSystempoolsGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/system-pools][%d] pcloudSystempoolsGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -311,11 +318,13 @@ func (o *PcloudSystempoolsGetForbidden) Code() int { } func (o *PcloudSystempoolsGetForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/system-pools][%d] pcloudSystempoolsGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/system-pools][%d] pcloudSystempoolsGetForbidden %+v", 403, o.Payload) + 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 { @@ -379,11 +388,13 @@ func (o *PcloudSystempoolsGetNotFound) Code() int { } func (o *PcloudSystempoolsGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/system-pools][%d] pcloudSystempoolsGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/system-pools][%d] pcloudSystempoolsGetNotFound %+v", 404, o.Payload) + 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 { @@ -447,11 +458,13 @@ func (o *PcloudSystempoolsGetInternalServerError) Code() int { } func (o *PcloudSystempoolsGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/system-pools][%d] pcloudSystempoolsGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/system-pools][%d] pcloudSystempoolsGetInternalServerError %+v", 500, o.Payload) + 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 { diff --git a/power/client/p_cloud_tasks/p_cloud_tasks_client.go b/power/client/p_cloud_tasks/p_cloud_tasks_client.go index 9327245f..47b5fe5d 100644 --- a/power/client/p_cloud_tasks/p_cloud_tasks_client.go +++ b/power/client/p_cloud_tasks/p_cloud_tasks_client.go @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi 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 */ @@ -25,7 +51,7 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods diff --git a/power/client/p_cloud_tasks/pcloud_tasks_delete_responses.go b/power/client/p_cloud_tasks/pcloud_tasks_delete_responses.go index 2a53efc4..b98b472b 100644 --- a/power/client/p_cloud_tasks/pcloud_tasks_delete_responses.go +++ b/power/client/p_cloud_tasks/pcloud_tasks_delete_responses.go @@ -6,6 +6,7 @@ package p_cloud_tasks // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudTasksDeleteOK) Code() int { } func (o *PcloudTasksDeleteOK) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteOK %s", 200, payload) } func (o *PcloudTasksDeleteOK) String() string { - return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteOK %+v", 200, o.Payload) + 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 { @@ -181,11 +184,13 @@ func (o *PcloudTasksDeleteBadRequest) Code() int { } func (o *PcloudTasksDeleteBadRequest) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteBadRequest %s", 400, payload) } func (o *PcloudTasksDeleteBadRequest) String() string { - return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteBadRequest %+v", 400, o.Payload) + 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 { @@ -249,11 +254,13 @@ func (o *PcloudTasksDeleteUnauthorized) Code() int { } func (o *PcloudTasksDeleteUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteUnauthorized %s", 401, payload) } func (o *PcloudTasksDeleteUnauthorized) String() string { - return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteUnauthorized %+v", 401, o.Payload) + 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 { @@ -317,11 +324,13 @@ func (o *PcloudTasksDeleteForbidden) Code() int { } func (o *PcloudTasksDeleteForbidden) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteForbidden %s", 403, payload) } func (o *PcloudTasksDeleteForbidden) String() string { - return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteForbidden %+v", 403, o.Payload) + 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 { @@ -385,11 +394,13 @@ func (o *PcloudTasksDeleteNotFound) Code() int { } func (o *PcloudTasksDeleteNotFound) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteNotFound %s", 404, payload) } func (o *PcloudTasksDeleteNotFound) String() string { - return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteNotFound %+v", 404, o.Payload) + 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 { @@ -453,11 +464,13 @@ func (o *PcloudTasksDeleteGone) Code() int { } func (o *PcloudTasksDeleteGone) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteGone %+v", 410, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteGone %s", 410, payload) } func (o *PcloudTasksDeleteGone) String() string { - return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteGone %+v", 410, o.Payload) + 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 { @@ -521,11 +534,13 @@ func (o *PcloudTasksDeleteInternalServerError) Code() int { } func (o *PcloudTasksDeleteInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteInternalServerError %s", 500, payload) } func (o *PcloudTasksDeleteInternalServerError) String() string { - return fmt.Sprintf("[DELETE /pcloud/v1/tasks/{task_id}][%d] pcloudTasksDeleteInternalServerError %+v", 500, o.Payload) + 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 { diff --git a/power/client/p_cloud_tasks/pcloud_tasks_get_responses.go b/power/client/p_cloud_tasks/pcloud_tasks_get_responses.go index 801979a7..7d919787 100644 --- a/power/client/p_cloud_tasks/pcloud_tasks_get_responses.go +++ b/power/client/p_cloud_tasks/pcloud_tasks_get_responses.go @@ -6,6 +6,7 @@ package p_cloud_tasks // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudTasksGetOK) Code() int { } func (o *PcloudTasksGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/tasks/{task_id}][%d] pcloudTasksGetOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/tasks/{task_id}][%d] pcloudTasksGetOK %s", 200, payload) } func (o *PcloudTasksGetOK) String() string { - return fmt.Sprintf("[GET /pcloud/v1/tasks/{task_id}][%d] pcloudTasksGetOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudTasksGetBadRequest) Code() int { } func (o *PcloudTasksGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/tasks/{task_id}][%d] pcloudTasksGetBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/tasks/{task_id}][%d] pcloudTasksGetBadRequest %s", 400, payload) } func (o *PcloudTasksGetBadRequest) String() string { - return fmt.Sprintf("[GET /pcloud/v1/tasks/{task_id}][%d] pcloudTasksGetBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudTasksGetUnauthorized) Code() int { } func (o *PcloudTasksGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/tasks/{task_id}][%d] pcloudTasksGetUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/tasks/{task_id}][%d] pcloudTasksGetUnauthorized %s", 401, payload) } func (o *PcloudTasksGetUnauthorized) String() string { - return fmt.Sprintf("[GET /pcloud/v1/tasks/{task_id}][%d] pcloudTasksGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudTasksGetForbidden) Code() int { } func (o *PcloudTasksGetForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/tasks/{task_id}][%d] pcloudTasksGetForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/tasks/{task_id}][%d] pcloudTasksGetForbidden %s", 403, payload) } func (o *PcloudTasksGetForbidden) String() string { - return fmt.Sprintf("[GET /pcloud/v1/tasks/{task_id}][%d] pcloudTasksGetForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudTasksGetNotFound) Code() int { } func (o *PcloudTasksGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/tasks/{task_id}][%d] pcloudTasksGetNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/tasks/{task_id}][%d] pcloudTasksGetNotFound %s", 404, payload) } func (o *PcloudTasksGetNotFound) String() string { - return fmt.Sprintf("[GET /pcloud/v1/tasks/{task_id}][%d] pcloudTasksGetNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudTasksGetInternalServerError) Code() int { } func (o *PcloudTasksGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/tasks/{task_id}][%d] pcloudTasksGetInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/tasks/{task_id}][%d] pcloudTasksGetInternalServerError %s", 500, payload) } func (o *PcloudTasksGetInternalServerError) String() string { - return fmt.Sprintf("[GET /pcloud/v1/tasks/{task_id}][%d] pcloudTasksGetInternalServerError %+v", 500, o.Payload) + 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 { diff --git a/power/client/p_cloud_tenants/p_cloud_tenants_client.go b/power/client/p_cloud_tenants/p_cloud_tenants_client.go index 4d2b50aa..0813b7f8 100644 --- a/power/client/p_cloud_tenants/p_cloud_tenants_client.go +++ b/power/client/p_cloud_tenants/p_cloud_tenants_client.go @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi 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 */ @@ -25,7 +51,7 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods diff --git a/power/client/p_cloud_tenants/pcloud_tenants_get_responses.go b/power/client/p_cloud_tenants/pcloud_tenants_get_responses.go index a3644394..be445f73 100644 --- a/power/client/p_cloud_tenants/pcloud_tenants_get_responses.go +++ b/power/client/p_cloud_tenants/pcloud_tenants_get_responses.go @@ -6,6 +6,7 @@ package p_cloud_tenants // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudTenantsGetOK) Code() int { } func (o *PcloudTenantsGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsGetOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsGetOK %s", 200, payload) } func (o *PcloudTenantsGetOK) String() string { - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsGetOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudTenantsGetBadRequest) Code() int { } func (o *PcloudTenantsGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsGetBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsGetBadRequest %s", 400, payload) } func (o *PcloudTenantsGetBadRequest) String() string { - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsGetBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudTenantsGetUnauthorized) Code() int { } func (o *PcloudTenantsGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsGetUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsGetUnauthorized %s", 401, payload) } func (o *PcloudTenantsGetUnauthorized) String() string { - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudTenantsGetForbidden) Code() int { } func (o *PcloudTenantsGetForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsGetForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsGetForbidden %s", 403, payload) } func (o *PcloudTenantsGetForbidden) String() string { - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsGetForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudTenantsGetNotFound) Code() int { } func (o *PcloudTenantsGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsGetNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsGetNotFound %s", 404, payload) } func (o *PcloudTenantsGetNotFound) String() string { - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsGetNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudTenantsGetInternalServerError) Code() int { } func (o *PcloudTenantsGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsGetInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsGetInternalServerError %s", 500, payload) } func (o *PcloudTenantsGetInternalServerError) String() string { - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsGetInternalServerError %+v", 500, o.Payload) + 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 { diff --git a/power/client/p_cloud_tenants/pcloud_tenants_put_responses.go b/power/client/p_cloud_tenants/pcloud_tenants_put_responses.go index a047d725..b91d00cf 100644 --- a/power/client/p_cloud_tenants/pcloud_tenants_put_responses.go +++ b/power/client/p_cloud_tenants/pcloud_tenants_put_responses.go @@ -6,6 +6,7 @@ package p_cloud_tenants // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudTenantsPutOK) Code() int { } func (o *PcloudTenantsPutOK) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsPutOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsPutOK %s", 200, payload) } func (o *PcloudTenantsPutOK) String() string { - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsPutOK %+v", 200, o.Payload) + 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 { @@ -183,11 +186,13 @@ func (o *PcloudTenantsPutBadRequest) Code() int { } func (o *PcloudTenantsPutBadRequest) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsPutBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsPutBadRequest %s", 400, payload) } func (o *PcloudTenantsPutBadRequest) String() string { - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsPutBadRequest %+v", 400, o.Payload) + 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 { @@ -251,11 +256,13 @@ func (o *PcloudTenantsPutUnauthorized) Code() int { } func (o *PcloudTenantsPutUnauthorized) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsPutUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsPutUnauthorized %s", 401, payload) } func (o *PcloudTenantsPutUnauthorized) String() string { - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsPutUnauthorized %+v", 401, o.Payload) + 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 { @@ -319,11 +326,13 @@ func (o *PcloudTenantsPutForbidden) Code() int { } func (o *PcloudTenantsPutForbidden) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsPutForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsPutForbidden %s", 403, payload) } func (o *PcloudTenantsPutForbidden) String() string { - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsPutForbidden %+v", 403, o.Payload) + 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 { @@ -387,11 +396,13 @@ func (o *PcloudTenantsPutNotFound) Code() int { } func (o *PcloudTenantsPutNotFound) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsPutNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsPutNotFound %s", 404, payload) } func (o *PcloudTenantsPutNotFound) String() string { - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsPutNotFound %+v", 404, o.Payload) + 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 { @@ -455,11 +466,13 @@ func (o *PcloudTenantsPutUnprocessableEntity) Code() int { } func (o *PcloudTenantsPutUnprocessableEntity) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsPutUnprocessableEntity %+v", 422, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsPutUnprocessableEntity %s", 422, payload) } func (o *PcloudTenantsPutUnprocessableEntity) String() string { - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsPutUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -523,11 +536,13 @@ func (o *PcloudTenantsPutInternalServerError) Code() int { } func (o *PcloudTenantsPutInternalServerError) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsPutInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsPutInternalServerError %s", 500, payload) } func (o *PcloudTenantsPutInternalServerError) String() string { - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}][%d] pcloudTenantsPutInternalServerError %+v", 500, o.Payload) + 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 { 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 index 90906d7e..441452be 100644 --- 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 @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi 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 */ @@ -25,7 +51,7 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods 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 index 55bf8338..b301a433 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_tenants_ssh_keys // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudTenantsSshkeysDeleteOK) Code() int { } func (o *PcloudTenantsSshkeysDeleteOK) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysDeleteOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysDeleteOK %+v", 200, o.Payload) + 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 { @@ -181,11 +184,13 @@ func (o *PcloudTenantsSshkeysDeleteBadRequest) Code() int { } func (o *PcloudTenantsSshkeysDeleteBadRequest) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysDeleteBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysDeleteBadRequest %+v", 400, o.Payload) + 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 { @@ -249,11 +254,13 @@ func (o *PcloudTenantsSshkeysDeleteUnauthorized) Code() int { } func (o *PcloudTenantsSshkeysDeleteUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysDeleteUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysDeleteUnauthorized %+v", 401, o.Payload) + 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 { @@ -317,11 +324,13 @@ func (o *PcloudTenantsSshkeysDeleteForbidden) Code() int { } func (o *PcloudTenantsSshkeysDeleteForbidden) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysDeleteForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysDeleteForbidden %+v", 403, o.Payload) + 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 { @@ -385,11 +394,13 @@ func (o *PcloudTenantsSshkeysDeleteNotFound) Code() int { } func (o *PcloudTenantsSshkeysDeleteNotFound) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysDeleteNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysDeleteNotFound %+v", 404, o.Payload) + 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 { @@ -453,11 +464,13 @@ func (o *PcloudTenantsSshkeysDeleteGone) Code() int { } func (o *PcloudTenantsSshkeysDeleteGone) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysDeleteGone %+v", 410, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysDeleteGone %+v", 410, o.Payload) + 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 { @@ -521,11 +534,13 @@ func (o *PcloudTenantsSshkeysDeleteInternalServerError) Code() int { } func (o *PcloudTenantsSshkeysDeleteInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysDeleteInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysDeleteInternalServerError %+v", 500, o.Payload) + 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 { 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 index 7b40732a..03d83f7f 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_tenants_ssh_keys // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudTenantsSshkeysGetOK) Code() int { } func (o *PcloudTenantsSshkeysGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysGetOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudTenantsSshkeysGetBadRequest) Code() int { } func (o *PcloudTenantsSshkeysGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysGetBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudTenantsSshkeysGetUnauthorized) Code() int { } func (o *PcloudTenantsSshkeysGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudTenantsSshkeysGetForbidden) Code() int { } func (o *PcloudTenantsSshkeysGetForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysGetForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudTenantsSshkeysGetNotFound) Code() int { } func (o *PcloudTenantsSshkeysGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysGetNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudTenantsSshkeysGetInternalServerError) Code() int { } func (o *PcloudTenantsSshkeysGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysGetInternalServerError %+v", 500, o.Payload) + 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 { 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 index fe2db9ec..6e339e1d 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_tenants_ssh_keys // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudTenantsSshkeysGetallOK) Code() int { } func (o *PcloudTenantsSshkeysGetallOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysGetallOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysGetallOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudTenantsSshkeysGetallBadRequest) Code() int { } func (o *PcloudTenantsSshkeysGetallBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysGetallBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysGetallBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudTenantsSshkeysGetallUnauthorized) Code() int { } func (o *PcloudTenantsSshkeysGetallUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysGetallUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysGetallUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudTenantsSshkeysGetallForbidden) Code() int { } func (o *PcloudTenantsSshkeysGetallForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysGetallForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysGetallForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudTenantsSshkeysGetallNotFound) Code() int { } func (o *PcloudTenantsSshkeysGetallNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysGetallNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysGetallNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudTenantsSshkeysGetallInternalServerError) Code() int { } func (o *PcloudTenantsSshkeysGetallInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysGetallInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysGetallInternalServerError %+v", 500, o.Payload) + 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 { 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 index 44d8ed2a..76dbebc9 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_tenants_ssh_keys // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -127,11 +128,13 @@ func (o *PcloudTenantsSshkeysPostOK) Code() int { } func (o *PcloudTenantsSshkeysPostOK) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysPostOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysPostOK %+v", 200, o.Payload) + 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 { @@ -195,11 +198,13 @@ func (o *PcloudTenantsSshkeysPostCreated) Code() int { } func (o *PcloudTenantsSshkeysPostCreated) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysPostCreated %+v", 201, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysPostCreated %+v", 201, o.Payload) + 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 { @@ -263,11 +268,13 @@ func (o *PcloudTenantsSshkeysPostBadRequest) Code() int { } func (o *PcloudTenantsSshkeysPostBadRequest) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysPostBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysPostBadRequest %+v", 400, o.Payload) + 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 { @@ -331,11 +338,13 @@ func (o *PcloudTenantsSshkeysPostUnauthorized) Code() int { } func (o *PcloudTenantsSshkeysPostUnauthorized) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysPostUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysPostUnauthorized %+v", 401, o.Payload) + 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 { @@ -399,11 +408,13 @@ func (o *PcloudTenantsSshkeysPostForbidden) Code() int { } func (o *PcloudTenantsSshkeysPostForbidden) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysPostForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysPostForbidden %+v", 403, o.Payload) + 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 { @@ -467,11 +478,13 @@ func (o *PcloudTenantsSshkeysPostNotFound) Code() int { } func (o *PcloudTenantsSshkeysPostNotFound) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysPostNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysPostNotFound %+v", 404, o.Payload) + 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 { @@ -535,11 +548,13 @@ func (o *PcloudTenantsSshkeysPostConflict) Code() int { } func (o *PcloudTenantsSshkeysPostConflict) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysPostConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysPostConflict %+v", 409, o.Payload) + 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 { @@ -603,11 +618,13 @@ func (o *PcloudTenantsSshkeysPostUnprocessableEntity) Code() int { } func (o *PcloudTenantsSshkeysPostUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysPostUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysPostUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -671,11 +688,13 @@ func (o *PcloudTenantsSshkeysPostInternalServerError) Code() int { } func (o *PcloudTenantsSshkeysPostInternalServerError) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysPostInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/tenants/{tenant_id}/sshkeys][%d] pcloudTenantsSshkeysPostInternalServerError %+v", 500, o.Payload) + 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 { 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 index 21beb65a..70026ead 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_tenants_ssh_keys // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudTenantsSshkeysPutOK) Code() int { } func (o *PcloudTenantsSshkeysPutOK) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysPutOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysPutOK %+v", 200, o.Payload) + 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 { @@ -183,11 +186,13 @@ func (o *PcloudTenantsSshkeysPutBadRequest) Code() int { } func (o *PcloudTenantsSshkeysPutBadRequest) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysPutBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysPutBadRequest %+v", 400, o.Payload) + 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 { @@ -251,11 +256,13 @@ func (o *PcloudTenantsSshkeysPutUnauthorized) Code() int { } func (o *PcloudTenantsSshkeysPutUnauthorized) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysPutUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysPutUnauthorized %+v", 401, o.Payload) + 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 { @@ -319,11 +326,13 @@ func (o *PcloudTenantsSshkeysPutForbidden) Code() int { } func (o *PcloudTenantsSshkeysPutForbidden) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysPutForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysPutForbidden %+v", 403, o.Payload) + 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 { @@ -387,11 +396,13 @@ func (o *PcloudTenantsSshkeysPutNotFound) Code() int { } func (o *PcloudTenantsSshkeysPutNotFound) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysPutNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysPutNotFound %+v", 404, o.Payload) + 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 { @@ -455,11 +466,13 @@ func (o *PcloudTenantsSshkeysPutUnprocessableEntity) Code() int { } func (o *PcloudTenantsSshkeysPutUnprocessableEntity) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysPutUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysPutUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -523,11 +536,13 @@ func (o *PcloudTenantsSshkeysPutInternalServerError) Code() int { } func (o *PcloudTenantsSshkeysPutInternalServerError) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysPutInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/tenants/{tenant_id}/sshkeys/{sshkey_name}][%d] pcloudTenantsSshkeysPutInternalServerError %+v", 500, o.Payload) + 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 { 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 index 33aac598..1d549c5a 100644 --- 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 @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi 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 */ @@ -25,7 +51,7 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods 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 index 3ae8b3a6..c65485ab 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_v_p_n_connections // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudVpnconnectionsDeleteAccepted) Code() int { } func (o *PcloudVpnconnectionsDeleteAccepted) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsDeleteAccepted %+v", 202, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsDeleteAccepted %+v", 202, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudVpnconnectionsDeleteBadRequest) Code() int { } func (o *PcloudVpnconnectionsDeleteBadRequest) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsDeleteBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsDeleteBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudVpnconnectionsDeleteUnauthorized) Code() int { } func (o *PcloudVpnconnectionsDeleteUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsDeleteUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsDeleteUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudVpnconnectionsDeleteForbidden) Code() int { } func (o *PcloudVpnconnectionsDeleteForbidden) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsDeleteForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsDeleteForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudVpnconnectionsDeleteNotFound) Code() int { } func (o *PcloudVpnconnectionsDeleteNotFound) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsDeleteNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsDeleteNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudVpnconnectionsDeleteInternalServerError) Code() int { } func (o *PcloudVpnconnectionsDeleteInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsDeleteInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsDeleteInternalServerError %+v", 500, o.Payload) + 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 { 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 index 0d4d0982..fcfd6dd0 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_v_p_n_connections // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudVpnconnectionsGetOK) Code() int { } func (o *PcloudVpnconnectionsGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsGetOK %+v", 200, o.Payload) + 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 { @@ -183,11 +186,13 @@ func (o *PcloudVpnconnectionsGetBadRequest) Code() int { } func (o *PcloudVpnconnectionsGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsGetBadRequest %+v", 400, o.Payload) + 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 { @@ -251,11 +256,13 @@ func (o *PcloudVpnconnectionsGetUnauthorized) Code() int { } func (o *PcloudVpnconnectionsGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -319,11 +326,13 @@ func (o *PcloudVpnconnectionsGetForbidden) Code() int { } func (o *PcloudVpnconnectionsGetForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsGetForbidden %+v", 403, o.Payload) + 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 { @@ -387,11 +396,13 @@ func (o *PcloudVpnconnectionsGetNotFound) Code() int { } func (o *PcloudVpnconnectionsGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsGetNotFound %+v", 404, o.Payload) + 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 { @@ -455,11 +466,13 @@ func (o *PcloudVpnconnectionsGetUnprocessableEntity) Code() int { } func (o *PcloudVpnconnectionsGetUnprocessableEntity) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsGetUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsGetUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -523,11 +536,13 @@ func (o *PcloudVpnconnectionsGetInternalServerError) Code() int { } func (o *PcloudVpnconnectionsGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsGetInternalServerError %+v", 500, o.Payload) + 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 { 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 index 6eda5280..30ec06a3 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_v_p_n_connections // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudVpnconnectionsGetallOK) Code() int { } func (o *PcloudVpnconnectionsGetallOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsGetallOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsGetallOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudVpnconnectionsGetallBadRequest) Code() int { } func (o *PcloudVpnconnectionsGetallBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsGetallBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsGetallBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudVpnconnectionsGetallUnauthorized) Code() int { } func (o *PcloudVpnconnectionsGetallUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsGetallUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsGetallUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudVpnconnectionsGetallForbidden) Code() int { } func (o *PcloudVpnconnectionsGetallForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsGetallForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsGetallForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudVpnconnectionsGetallNotFound) Code() int { } func (o *PcloudVpnconnectionsGetallNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsGetallNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsGetallNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudVpnconnectionsGetallInternalServerError) Code() int { } func (o *PcloudVpnconnectionsGetallInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsGetallInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsGetallInternalServerError %+v", 500, o.Payload) + 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 { 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 index 76f62a5a..8e465589 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_v_p_n_connections // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudVpnconnectionsNetworksDeleteAccepted) Code() int { } func (o *PcloudVpnconnectionsNetworksDeleteAccepted) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksDeleteAccepted %+v", 202, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksDeleteAccepted %+v", 202, o.Payload) + 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 { @@ -183,11 +186,13 @@ func (o *PcloudVpnconnectionsNetworksDeleteBadRequest) Code() int { } func (o *PcloudVpnconnectionsNetworksDeleteBadRequest) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksDeleteBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksDeleteBadRequest %+v", 400, o.Payload) + 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 { @@ -251,11 +256,13 @@ func (o *PcloudVpnconnectionsNetworksDeleteUnauthorized) Code() int { } func (o *PcloudVpnconnectionsNetworksDeleteUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksDeleteUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksDeleteUnauthorized %+v", 401, o.Payload) + 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 { @@ -319,11 +326,13 @@ func (o *PcloudVpnconnectionsNetworksDeleteForbidden) Code() int { } func (o *PcloudVpnconnectionsNetworksDeleteForbidden) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksDeleteForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksDeleteForbidden %+v", 403, o.Payload) + 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 { @@ -387,11 +396,13 @@ func (o *PcloudVpnconnectionsNetworksDeleteNotFound) Code() int { } func (o *PcloudVpnconnectionsNetworksDeleteNotFound) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksDeleteNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksDeleteNotFound %+v", 404, o.Payload) + 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 { @@ -455,11 +466,13 @@ func (o *PcloudVpnconnectionsNetworksDeleteUnprocessableEntity) Code() int { } func (o *PcloudVpnconnectionsNetworksDeleteUnprocessableEntity) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksDeleteUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksDeleteUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -523,11 +536,13 @@ func (o *PcloudVpnconnectionsNetworksDeleteInternalServerError) Code() int { } func (o *PcloudVpnconnectionsNetworksDeleteInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksDeleteInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksDeleteInternalServerError %+v", 500, o.Payload) + 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 { 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 index d7a825bb..4a496ffe 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_v_p_n_connections // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudVpnconnectionsNetworksGetOK) Code() int { } func (o *PcloudVpnconnectionsNetworksGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksGetOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudVpnconnectionsNetworksGetBadRequest) Code() int { } func (o *PcloudVpnconnectionsNetworksGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksGetBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudVpnconnectionsNetworksGetUnauthorized) Code() int { } func (o *PcloudVpnconnectionsNetworksGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudVpnconnectionsNetworksGetForbidden) Code() int { } func (o *PcloudVpnconnectionsNetworksGetForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksGetForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudVpnconnectionsNetworksGetNotFound) Code() int { } func (o *PcloudVpnconnectionsNetworksGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksGetNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudVpnconnectionsNetworksGetInternalServerError) Code() int { } func (o *PcloudVpnconnectionsNetworksGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksGetInternalServerError %+v", 500, o.Payload) + 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 { 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 index f88d9035..601d1d57 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_v_p_n_connections // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudVpnconnectionsNetworksPutAccepted) Code() int { } func (o *PcloudVpnconnectionsNetworksPutAccepted) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutAccepted %+v", 202, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutAccepted %+v", 202, o.Payload) + 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 { @@ -183,11 +186,13 @@ func (o *PcloudVpnconnectionsNetworksPutBadRequest) Code() int { } func (o *PcloudVpnconnectionsNetworksPutBadRequest) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutBadRequest %+v", 400, o.Payload) + 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 { @@ -251,11 +256,13 @@ func (o *PcloudVpnconnectionsNetworksPutUnauthorized) Code() int { } func (o *PcloudVpnconnectionsNetworksPutUnauthorized) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutUnauthorized %+v", 401, o.Payload) + 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 { @@ -319,11 +326,13 @@ func (o *PcloudVpnconnectionsNetworksPutForbidden) Code() int { } func (o *PcloudVpnconnectionsNetworksPutForbidden) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutForbidden %+v", 403, o.Payload) + 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 { @@ -387,11 +396,13 @@ func (o *PcloudVpnconnectionsNetworksPutNotFound) Code() int { } func (o *PcloudVpnconnectionsNetworksPutNotFound) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutNotFound %+v", 404, o.Payload) + 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 { @@ -455,11 +466,13 @@ func (o *PcloudVpnconnectionsNetworksPutUnprocessableEntity) Code() int { } func (o *PcloudVpnconnectionsNetworksPutUnprocessableEntity) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -523,11 +536,13 @@ func (o *PcloudVpnconnectionsNetworksPutInternalServerError) Code() int { } func (o *PcloudVpnconnectionsNetworksPutInternalServerError) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/networks][%d] pcloudVpnconnectionsNetworksPutInternalServerError %+v", 500, o.Payload) + 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 { 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 index 7679711f..8ef0944e 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_v_p_n_connections // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudVpnconnectionsPeersubnetsDeleteOK) Code() int { } func (o *PcloudVpnconnectionsPeersubnetsDeleteOK) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsDeleteOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsDeleteOK %+v", 200, o.Payload) + 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 { @@ -183,11 +186,13 @@ func (o *PcloudVpnconnectionsPeersubnetsDeleteBadRequest) Code() int { } func (o *PcloudVpnconnectionsPeersubnetsDeleteBadRequest) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsDeleteBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsDeleteBadRequest %+v", 400, o.Payload) + 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 { @@ -251,11 +256,13 @@ func (o *PcloudVpnconnectionsPeersubnetsDeleteUnauthorized) Code() int { } func (o *PcloudVpnconnectionsPeersubnetsDeleteUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsDeleteUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsDeleteUnauthorized %+v", 401, o.Payload) + 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 { @@ -319,11 +326,13 @@ func (o *PcloudVpnconnectionsPeersubnetsDeleteForbidden) Code() int { } func (o *PcloudVpnconnectionsPeersubnetsDeleteForbidden) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsDeleteForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsDeleteForbidden %+v", 403, o.Payload) + 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 { @@ -387,11 +396,13 @@ func (o *PcloudVpnconnectionsPeersubnetsDeleteNotFound) Code() int { } func (o *PcloudVpnconnectionsPeersubnetsDeleteNotFound) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsDeleteNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsDeleteNotFound %+v", 404, o.Payload) + 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 { @@ -455,11 +466,13 @@ func (o *PcloudVpnconnectionsPeersubnetsDeleteUnprocessableEntity) Code() int { } func (o *PcloudVpnconnectionsPeersubnetsDeleteUnprocessableEntity) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsDeleteUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsDeleteUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -523,11 +536,13 @@ func (o *PcloudVpnconnectionsPeersubnetsDeleteInternalServerError) Code() int { } func (o *PcloudVpnconnectionsPeersubnetsDeleteInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsDeleteInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsDeleteInternalServerError %+v", 500, o.Payload) + 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 { 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 index b441a2ad..6dd71e97 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_v_p_n_connections // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudVpnconnectionsPeersubnetsGetOK) Code() int { } func (o *PcloudVpnconnectionsPeersubnetsGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsGetOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudVpnconnectionsPeersubnetsGetBadRequest) Code() int { } func (o *PcloudVpnconnectionsPeersubnetsGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsGetBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudVpnconnectionsPeersubnetsGetUnauthorized) Code() int { } func (o *PcloudVpnconnectionsPeersubnetsGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudVpnconnectionsPeersubnetsGetForbidden) Code() int { } func (o *PcloudVpnconnectionsPeersubnetsGetForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsGetForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudVpnconnectionsPeersubnetsGetNotFound) Code() int { } func (o *PcloudVpnconnectionsPeersubnetsGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsGetNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudVpnconnectionsPeersubnetsGetInternalServerError) Code() int { } func (o *PcloudVpnconnectionsPeersubnetsGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsGetInternalServerError %+v", 500, o.Payload) + 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 { 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 index 76504c51..a2f6e873 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_v_p_n_connections // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudVpnconnectionsPeersubnetsPutOK) Code() int { } func (o *PcloudVpnconnectionsPeersubnetsPutOK) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsPutOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsPutOK %+v", 200, o.Payload) + 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 { @@ -183,11 +186,13 @@ func (o *PcloudVpnconnectionsPeersubnetsPutBadRequest) Code() int { } func (o *PcloudVpnconnectionsPeersubnetsPutBadRequest) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsPutBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsPutBadRequest %+v", 400, o.Payload) + 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 { @@ -251,11 +256,13 @@ func (o *PcloudVpnconnectionsPeersubnetsPutUnauthorized) Code() int { } func (o *PcloudVpnconnectionsPeersubnetsPutUnauthorized) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsPutUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsPutUnauthorized %+v", 401, o.Payload) + 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 { @@ -319,11 +326,13 @@ func (o *PcloudVpnconnectionsPeersubnetsPutForbidden) Code() int { } func (o *PcloudVpnconnectionsPeersubnetsPutForbidden) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsPutForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsPutForbidden %+v", 403, o.Payload) + 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 { @@ -387,11 +396,13 @@ func (o *PcloudVpnconnectionsPeersubnetsPutNotFound) Code() int { } func (o *PcloudVpnconnectionsPeersubnetsPutNotFound) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsPutNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsPutNotFound %+v", 404, o.Payload) + 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 { @@ -455,11 +466,13 @@ func (o *PcloudVpnconnectionsPeersubnetsPutUnprocessableEntity) Code() int { } func (o *PcloudVpnconnectionsPeersubnetsPutUnprocessableEntity) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsPutUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsPutUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -523,11 +536,13 @@ func (o *PcloudVpnconnectionsPeersubnetsPutInternalServerError) Code() int { } func (o *PcloudVpnconnectionsPeersubnetsPutInternalServerError) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsPutInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}/peer-subnets][%d] pcloudVpnconnectionsPeersubnetsPutInternalServerError %+v", 500, o.Payload) + 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 { 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 index 8f25af04..7306c239 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_v_p_n_connections // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -127,11 +128,13 @@ func (o *PcloudVpnconnectionsPostAccepted) Code() int { } func (o *PcloudVpnconnectionsPostAccepted) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsPostAccepted %+v", 202, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsPostAccepted %+v", 202, o.Payload) + 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 { @@ -195,11 +198,13 @@ func (o *PcloudVpnconnectionsPostBadRequest) Code() int { } func (o *PcloudVpnconnectionsPostBadRequest) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsPostBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsPostBadRequest %+v", 400, o.Payload) + 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 { @@ -263,11 +268,13 @@ func (o *PcloudVpnconnectionsPostUnauthorized) Code() int { } func (o *PcloudVpnconnectionsPostUnauthorized) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsPostUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsPostUnauthorized %+v", 401, o.Payload) + 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 { @@ -331,11 +338,13 @@ func (o *PcloudVpnconnectionsPostForbidden) Code() int { } func (o *PcloudVpnconnectionsPostForbidden) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsPostForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsPostForbidden %+v", 403, o.Payload) + 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 { @@ -399,11 +408,13 @@ func (o *PcloudVpnconnectionsPostNotFound) Code() int { } func (o *PcloudVpnconnectionsPostNotFound) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsPostNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsPostNotFound %+v", 404, o.Payload) + 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 { @@ -467,11 +478,13 @@ func (o *PcloudVpnconnectionsPostMethodNotAllowed) Code() int { } func (o *PcloudVpnconnectionsPostMethodNotAllowed) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsPostMethodNotAllowed %+v", 405, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsPostMethodNotAllowed %+v", 405, o.Payload) + 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 { @@ -535,11 +548,13 @@ func (o *PcloudVpnconnectionsPostConflict) Code() int { } func (o *PcloudVpnconnectionsPostConflict) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsPostConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsPostConflict %+v", 409, o.Payload) + 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 { @@ -603,11 +618,13 @@ func (o *PcloudVpnconnectionsPostUnprocessableEntity) Code() int { } func (o *PcloudVpnconnectionsPostUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsPostUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsPostUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -671,11 +688,13 @@ func (o *PcloudVpnconnectionsPostInternalServerError) Code() int { } func (o *PcloudVpnconnectionsPostInternalServerError) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsPostInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsPostInternalServerError %+v", 500, o.Payload) + 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 { 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 index d5e359eb..fd3b6409 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_v_p_n_connections // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudVpnconnectionsPutOK) Code() int { } func (o *PcloudVpnconnectionsPutOK) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsPutOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsPutOK %+v", 200, o.Payload) + 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 { @@ -183,11 +186,13 @@ func (o *PcloudVpnconnectionsPutBadRequest) Code() int { } func (o *PcloudVpnconnectionsPutBadRequest) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsPutBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsPutBadRequest %+v", 400, o.Payload) + 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 { @@ -251,11 +256,13 @@ func (o *PcloudVpnconnectionsPutUnauthorized) Code() int { } func (o *PcloudVpnconnectionsPutUnauthorized) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsPutUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsPutUnauthorized %+v", 401, o.Payload) + 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 { @@ -319,11 +326,13 @@ func (o *PcloudVpnconnectionsPutForbidden) Code() int { } func (o *PcloudVpnconnectionsPutForbidden) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsPutForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsPutForbidden %+v", 403, o.Payload) + 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 { @@ -387,11 +396,13 @@ func (o *PcloudVpnconnectionsPutNotFound) Code() int { } func (o *PcloudVpnconnectionsPutNotFound) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsPutNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsPutNotFound %+v", 404, o.Payload) + 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 { @@ -455,11 +466,13 @@ func (o *PcloudVpnconnectionsPutUnprocessableEntity) Code() int { } func (o *PcloudVpnconnectionsPutUnprocessableEntity) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsPutUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsPutUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -523,11 +536,13 @@ func (o *PcloudVpnconnectionsPutInternalServerError) Code() int { } func (o *PcloudVpnconnectionsPutInternalServerError) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsPutInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections/{vpn_connection_id}][%d] pcloudVpnconnectionsPutInternalServerError %+v", 500, o.Payload) + 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 { 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 index 65300d6d..0184c9da 100644 --- 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 @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi 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 */ @@ -25,7 +51,7 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods 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 index 353903c5..642873dc 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_v_p_n_policies // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudIkepoliciesDeleteOK) Code() int { } func (o *PcloudIkepoliciesDeleteOK) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesDeleteOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesDeleteOK %+v", 200, o.Payload) + 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 { @@ -175,11 +178,13 @@ func (o *PcloudIkepoliciesDeleteBadRequest) Code() int { } func (o *PcloudIkepoliciesDeleteBadRequest) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesDeleteBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesDeleteBadRequest %+v", 400, o.Payload) + 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 { @@ -243,11 +248,13 @@ func (o *PcloudIkepoliciesDeleteUnauthorized) Code() int { } func (o *PcloudIkepoliciesDeleteUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesDeleteUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesDeleteUnauthorized %+v", 401, o.Payload) + 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 { @@ -311,11 +318,13 @@ func (o *PcloudIkepoliciesDeleteForbidden) Code() int { } func (o *PcloudIkepoliciesDeleteForbidden) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesDeleteForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesDeleteForbidden %+v", 403, o.Payload) + 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 { @@ -379,11 +388,13 @@ func (o *PcloudIkepoliciesDeleteNotFound) Code() int { } func (o *PcloudIkepoliciesDeleteNotFound) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesDeleteNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesDeleteNotFound %+v", 404, o.Payload) + 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 { @@ -447,11 +458,13 @@ func (o *PcloudIkepoliciesDeleteInternalServerError) Code() int { } func (o *PcloudIkepoliciesDeleteInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesDeleteInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesDeleteInternalServerError %+v", 500, o.Payload) + 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 { 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 index b8cf3d12..48687437 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_v_p_n_policies // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudIkepoliciesGetOK) Code() int { } func (o *PcloudIkepoliciesGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesGetOK %+v", 200, o.Payload) + 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 { @@ -183,11 +186,13 @@ func (o *PcloudIkepoliciesGetBadRequest) Code() int { } func (o *PcloudIkepoliciesGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesGetBadRequest %+v", 400, o.Payload) + 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 { @@ -251,11 +256,13 @@ func (o *PcloudIkepoliciesGetUnauthorized) Code() int { } func (o *PcloudIkepoliciesGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -319,11 +326,13 @@ func (o *PcloudIkepoliciesGetForbidden) Code() int { } func (o *PcloudIkepoliciesGetForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesGetForbidden %+v", 403, o.Payload) + 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 { @@ -387,11 +396,13 @@ func (o *PcloudIkepoliciesGetNotFound) Code() int { } func (o *PcloudIkepoliciesGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesGetNotFound %+v", 404, o.Payload) + 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 { @@ -455,11 +466,13 @@ func (o *PcloudIkepoliciesGetUnprocessableEntity) Code() int { } func (o *PcloudIkepoliciesGetUnprocessableEntity) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesGetUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesGetUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -523,11 +536,13 @@ func (o *PcloudIkepoliciesGetInternalServerError) Code() int { } func (o *PcloudIkepoliciesGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesGetInternalServerError %+v", 500, o.Payload) + 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 { 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 index 26fab728..ed9eeb0d 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_v_p_n_policies // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudIkepoliciesGetallOK) Code() int { } func (o *PcloudIkepoliciesGetallOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesGetallOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesGetallOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudIkepoliciesGetallBadRequest) Code() int { } func (o *PcloudIkepoliciesGetallBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesGetallBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesGetallBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudIkepoliciesGetallUnauthorized) Code() int { } func (o *PcloudIkepoliciesGetallUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesGetallUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesGetallUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudIkepoliciesGetallForbidden) Code() int { } func (o *PcloudIkepoliciesGetallForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesGetallForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesGetallForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudIkepoliciesGetallNotFound) Code() int { } func (o *PcloudIkepoliciesGetallNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesGetallNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesGetallNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudIkepoliciesGetallInternalServerError) Code() int { } func (o *PcloudIkepoliciesGetallInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesGetallInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesGetallInternalServerError %+v", 500, o.Payload) + 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 { 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 index 99809353..119e2e5a 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_v_p_n_policies // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudIkepoliciesPostOK) Code() int { } func (o *PcloudIkepoliciesPostOK) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesPostOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesPostOK %+v", 200, o.Payload) + 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 { @@ -183,11 +186,13 @@ func (o *PcloudIkepoliciesPostBadRequest) Code() int { } func (o *PcloudIkepoliciesPostBadRequest) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesPostBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesPostBadRequest %+v", 400, o.Payload) + 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 { @@ -251,11 +256,13 @@ func (o *PcloudIkepoliciesPostUnauthorized) Code() int { } func (o *PcloudIkepoliciesPostUnauthorized) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesPostUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesPostUnauthorized %+v", 401, o.Payload) + 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 { @@ -319,11 +326,13 @@ func (o *PcloudIkepoliciesPostForbidden) Code() int { } func (o *PcloudIkepoliciesPostForbidden) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesPostForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesPostForbidden %+v", 403, o.Payload) + 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 { @@ -387,11 +396,13 @@ func (o *PcloudIkepoliciesPostConflict) Code() int { } func (o *PcloudIkepoliciesPostConflict) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesPostConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesPostConflict %+v", 409, o.Payload) + 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 { @@ -455,11 +466,13 @@ func (o *PcloudIkepoliciesPostUnprocessableEntity) Code() int { } func (o *PcloudIkepoliciesPostUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesPostUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesPostUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -523,11 +536,13 @@ func (o *PcloudIkepoliciesPostInternalServerError) Code() int { } func (o *PcloudIkepoliciesPostInternalServerError) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesPostInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies][%d] pcloudIkepoliciesPostInternalServerError %+v", 500, o.Payload) + 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 { 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 index ea4472aa..046ca51a 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_v_p_n_policies // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudIkepoliciesPutOK) Code() int { } func (o *PcloudIkepoliciesPutOK) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesPutOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesPutOK %+v", 200, o.Payload) + 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 { @@ -183,11 +186,13 @@ func (o *PcloudIkepoliciesPutBadRequest) Code() int { } func (o *PcloudIkepoliciesPutBadRequest) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesPutBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesPutBadRequest %+v", 400, o.Payload) + 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 { @@ -251,11 +256,13 @@ func (o *PcloudIkepoliciesPutUnauthorized) Code() int { } func (o *PcloudIkepoliciesPutUnauthorized) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesPutUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesPutUnauthorized %+v", 401, o.Payload) + 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 { @@ -319,11 +326,13 @@ func (o *PcloudIkepoliciesPutForbidden) Code() int { } func (o *PcloudIkepoliciesPutForbidden) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesPutForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesPutForbidden %+v", 403, o.Payload) + 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 { @@ -387,11 +396,13 @@ func (o *PcloudIkepoliciesPutNotFound) Code() int { } func (o *PcloudIkepoliciesPutNotFound) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesPutNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesPutNotFound %+v", 404, o.Payload) + 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 { @@ -455,11 +466,13 @@ func (o *PcloudIkepoliciesPutUnprocessableEntity) Code() int { } func (o *PcloudIkepoliciesPutUnprocessableEntity) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesPutUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesPutUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -523,11 +536,13 @@ func (o *PcloudIkepoliciesPutInternalServerError) Code() int { } func (o *PcloudIkepoliciesPutInternalServerError) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesPutInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ike-policies/{ike_policy_id}][%d] pcloudIkepoliciesPutInternalServerError %+v", 500, o.Payload) + 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 { 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 index b3728158..4b3ba8ec 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_v_p_n_policies // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudIpsecpoliciesDeleteOK) Code() int { } func (o *PcloudIpsecpoliciesDeleteOK) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesDeleteOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesDeleteOK %+v", 200, o.Payload) + 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 { @@ -175,11 +178,13 @@ func (o *PcloudIpsecpoliciesDeleteBadRequest) Code() int { } func (o *PcloudIpsecpoliciesDeleteBadRequest) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesDeleteBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesDeleteBadRequest %+v", 400, o.Payload) + 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 { @@ -243,11 +248,13 @@ func (o *PcloudIpsecpoliciesDeleteUnauthorized) Code() int { } func (o *PcloudIpsecpoliciesDeleteUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesDeleteUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesDeleteUnauthorized %+v", 401, o.Payload) + 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 { @@ -311,11 +318,13 @@ func (o *PcloudIpsecpoliciesDeleteForbidden) Code() int { } func (o *PcloudIpsecpoliciesDeleteForbidden) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesDeleteForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesDeleteForbidden %+v", 403, o.Payload) + 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 { @@ -379,11 +388,13 @@ func (o *PcloudIpsecpoliciesDeleteNotFound) Code() int { } func (o *PcloudIpsecpoliciesDeleteNotFound) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesDeleteNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesDeleteNotFound %+v", 404, o.Payload) + 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 { @@ -447,11 +458,13 @@ func (o *PcloudIpsecpoliciesDeleteInternalServerError) Code() int { } func (o *PcloudIpsecpoliciesDeleteInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesDeleteInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesDeleteInternalServerError %+v", 500, o.Payload) + 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 { 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 index a8c9bb3f..0aa1b208 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_v_p_n_policies // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudIpsecpoliciesGetOK) Code() int { } func (o *PcloudIpsecpoliciesGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesGetOK %+v", 200, o.Payload) + 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 { @@ -183,11 +186,13 @@ func (o *PcloudIpsecpoliciesGetBadRequest) Code() int { } func (o *PcloudIpsecpoliciesGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesGetBadRequest %+v", 400, o.Payload) + 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 { @@ -251,11 +256,13 @@ func (o *PcloudIpsecpoliciesGetUnauthorized) Code() int { } func (o *PcloudIpsecpoliciesGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -319,11 +326,13 @@ func (o *PcloudIpsecpoliciesGetForbidden) Code() int { } func (o *PcloudIpsecpoliciesGetForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesGetForbidden %+v", 403, o.Payload) + 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 { @@ -387,11 +396,13 @@ func (o *PcloudIpsecpoliciesGetNotFound) Code() int { } func (o *PcloudIpsecpoliciesGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesGetNotFound %+v", 404, o.Payload) + 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 { @@ -455,11 +466,13 @@ func (o *PcloudIpsecpoliciesGetUnprocessableEntity) Code() int { } func (o *PcloudIpsecpoliciesGetUnprocessableEntity) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesGetUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesGetUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -523,11 +536,13 @@ func (o *PcloudIpsecpoliciesGetInternalServerError) Code() int { } func (o *PcloudIpsecpoliciesGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesGetInternalServerError %+v", 500, o.Payload) + 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 { 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 index c717669f..d33c2905 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_v_p_n_policies // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudIpsecpoliciesGetallOK) Code() int { } func (o *PcloudIpsecpoliciesGetallOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesGetallOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesGetallOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudIpsecpoliciesGetallBadRequest) Code() int { } func (o *PcloudIpsecpoliciesGetallBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesGetallBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesGetallBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudIpsecpoliciesGetallUnauthorized) Code() int { } func (o *PcloudIpsecpoliciesGetallUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesGetallUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesGetallUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudIpsecpoliciesGetallForbidden) Code() int { } func (o *PcloudIpsecpoliciesGetallForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesGetallForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesGetallForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudIpsecpoliciesGetallNotFound) Code() int { } func (o *PcloudIpsecpoliciesGetallNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesGetallNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesGetallNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudIpsecpoliciesGetallInternalServerError) Code() int { } func (o *PcloudIpsecpoliciesGetallInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesGetallInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesGetallInternalServerError %+v", 500, o.Payload) + 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 { 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 index cc76168a..f7870d03 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_v_p_n_policies // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -121,11 +122,13 @@ func (o *PcloudIpsecpoliciesPostOK) Code() int { } func (o *PcloudIpsecpoliciesPostOK) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesPostOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesPostOK %+v", 200, o.Payload) + 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 { @@ -189,11 +192,13 @@ func (o *PcloudIpsecpoliciesPostBadRequest) Code() int { } func (o *PcloudIpsecpoliciesPostBadRequest) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesPostBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesPostBadRequest %+v", 400, o.Payload) + 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 { @@ -257,11 +262,13 @@ func (o *PcloudIpsecpoliciesPostUnauthorized) Code() int { } func (o *PcloudIpsecpoliciesPostUnauthorized) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesPostUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesPostUnauthorized %+v", 401, o.Payload) + 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 { @@ -325,11 +332,13 @@ func (o *PcloudIpsecpoliciesPostForbidden) Code() int { } func (o *PcloudIpsecpoliciesPostForbidden) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesPostForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesPostForbidden %+v", 403, o.Payload) + 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 { @@ -393,11 +402,13 @@ func (o *PcloudIpsecpoliciesPostNotFound) Code() int { } func (o *PcloudIpsecpoliciesPostNotFound) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesPostNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesPostNotFound %+v", 404, o.Payload) + 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 { @@ -461,11 +472,13 @@ func (o *PcloudIpsecpoliciesPostConflict) Code() int { } func (o *PcloudIpsecpoliciesPostConflict) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesPostConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesPostConflict %+v", 409, o.Payload) + 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 { @@ -529,11 +542,13 @@ func (o *PcloudIpsecpoliciesPostUnprocessableEntity) Code() int { } func (o *PcloudIpsecpoliciesPostUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesPostUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesPostUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -597,11 +612,13 @@ func (o *PcloudIpsecpoliciesPostInternalServerError) Code() int { } func (o *PcloudIpsecpoliciesPostInternalServerError) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesPostInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies][%d] pcloudIpsecpoliciesPostInternalServerError %+v", 500, o.Payload) + 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 { 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 index d8cdbed6..b8626e3a 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_v_p_n_policies // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -121,11 +122,13 @@ func (o *PcloudIpsecpoliciesPutOK) Code() int { } func (o *PcloudIpsecpoliciesPutOK) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesPutOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesPutOK %+v", 200, o.Payload) + 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 { @@ -189,11 +192,13 @@ func (o *PcloudIpsecpoliciesPutBadRequest) Code() int { } func (o *PcloudIpsecpoliciesPutBadRequest) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesPutBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesPutBadRequest %+v", 400, o.Payload) + 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 { @@ -257,11 +262,13 @@ func (o *PcloudIpsecpoliciesPutUnauthorized) Code() int { } func (o *PcloudIpsecpoliciesPutUnauthorized) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesPutUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesPutUnauthorized %+v", 401, o.Payload) + 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 { @@ -325,11 +332,13 @@ func (o *PcloudIpsecpoliciesPutForbidden) Code() int { } func (o *PcloudIpsecpoliciesPutForbidden) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesPutForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesPutForbidden %+v", 403, o.Payload) + 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 { @@ -393,11 +402,13 @@ func (o *PcloudIpsecpoliciesPutNotFound) Code() int { } func (o *PcloudIpsecpoliciesPutNotFound) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesPutNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesPutNotFound %+v", 404, o.Payload) + 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 { @@ -461,11 +472,13 @@ func (o *PcloudIpsecpoliciesPutConflict) Code() int { } func (o *PcloudIpsecpoliciesPutConflict) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesPutConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesPutConflict %+v", 409, o.Payload) + 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 { @@ -529,11 +542,13 @@ func (o *PcloudIpsecpoliciesPutUnprocessableEntity) Code() int { } func (o *PcloudIpsecpoliciesPutUnprocessableEntity) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesPutUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesPutUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -597,11 +612,13 @@ func (o *PcloudIpsecpoliciesPutInternalServerError) Code() int { } func (o *PcloudIpsecpoliciesPutInternalServerError) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesPutInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/ipsec-policies/{ipsec_policy_id}][%d] pcloudIpsecpoliciesPutInternalServerError %+v", 500, o.Payload) + 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 { 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 index 4f852524..f307f596 100644 --- 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 @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi 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 */ @@ -25,7 +51,7 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods 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 index 43eb6695..1bef9268 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_volume_groups // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudVolumegroupsActionPostAccepted) Code() int { } func (o *PcloudVolumegroupsActionPostAccepted) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/action][%d] pcloudVolumegroupsActionPostAccepted %+v", 202, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/action][%d] pcloudVolumegroupsActionPostAccepted %+v", 202, o.Payload) + 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 { @@ -181,11 +184,13 @@ func (o *PcloudVolumegroupsActionPostBadRequest) Code() int { } func (o *PcloudVolumegroupsActionPostBadRequest) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/action][%d] pcloudVolumegroupsActionPostBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/action][%d] pcloudVolumegroupsActionPostBadRequest %+v", 400, o.Payload) + 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 { @@ -249,11 +254,13 @@ func (o *PcloudVolumegroupsActionPostUnauthorized) Code() int { } func (o *PcloudVolumegroupsActionPostUnauthorized) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/action][%d] pcloudVolumegroupsActionPostUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/action][%d] pcloudVolumegroupsActionPostUnauthorized %+v", 401, o.Payload) + 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 { @@ -317,11 +324,13 @@ func (o *PcloudVolumegroupsActionPostForbidden) Code() int { } func (o *PcloudVolumegroupsActionPostForbidden) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/action][%d] pcloudVolumegroupsActionPostForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/action][%d] pcloudVolumegroupsActionPostForbidden %+v", 403, o.Payload) + 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 { @@ -385,11 +394,13 @@ func (o *PcloudVolumegroupsActionPostNotFound) Code() int { } func (o *PcloudVolumegroupsActionPostNotFound) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/action][%d] pcloudVolumegroupsActionPostNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/action][%d] pcloudVolumegroupsActionPostNotFound %+v", 404, o.Payload) + 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 { @@ -453,11 +464,13 @@ func (o *PcloudVolumegroupsActionPostUnprocessableEntity) Code() int { } func (o *PcloudVolumegroupsActionPostUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/action][%d] pcloudVolumegroupsActionPostUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/action][%d] pcloudVolumegroupsActionPostUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -521,11 +534,13 @@ func (o *PcloudVolumegroupsActionPostInternalServerError) Code() int { } func (o *PcloudVolumegroupsActionPostInternalServerError) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/action][%d] pcloudVolumegroupsActionPostInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/action][%d] pcloudVolumegroupsActionPostInternalServerError %+v", 500, o.Payload) + 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 { 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 index d1c02fdc..259bec92 100644 --- a/power/client/p_cloud_volume_groups/pcloud_volumegroups_delete_responses.go +++ b/power/client/p_cloud_volume_groups/pcloud_volumegroups_delete_responses.go @@ -6,6 +6,7 @@ package p_cloud_volume_groups // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudVolumegroupsDeleteAccepted) Code() int { } func (o *PcloudVolumegroupsDeleteAccepted) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsDeleteAccepted %+v", 202, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsDeleteAccepted %+v", 202, o.Payload) + 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 { @@ -175,11 +178,13 @@ func (o *PcloudVolumegroupsDeleteBadRequest) Code() int { } func (o *PcloudVolumegroupsDeleteBadRequest) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsDeleteBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsDeleteBadRequest %+v", 400, o.Payload) + 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 { @@ -243,11 +248,13 @@ func (o *PcloudVolumegroupsDeleteUnauthorized) Code() int { } func (o *PcloudVolumegroupsDeleteUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsDeleteUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsDeleteUnauthorized %+v", 401, o.Payload) + 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 { @@ -311,11 +318,13 @@ func (o *PcloudVolumegroupsDeleteForbidden) Code() int { } func (o *PcloudVolumegroupsDeleteForbidden) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsDeleteForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsDeleteForbidden %+v", 403, o.Payload) + 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 { @@ -379,11 +388,13 @@ func (o *PcloudVolumegroupsDeleteNotFound) Code() int { } func (o *PcloudVolumegroupsDeleteNotFound) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsDeleteNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsDeleteNotFound %+v", 404, o.Payload) + 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 { @@ -447,11 +458,13 @@ func (o *PcloudVolumegroupsDeleteInternalServerError) Code() int { } func (o *PcloudVolumegroupsDeleteInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsDeleteInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsDeleteInternalServerError %+v", 500, o.Payload) + 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 { 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 index 8f99d2ed..e44337c2 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_volume_groups // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudVolumegroupsGetDetailsOK) Code() int { } func (o *PcloudVolumegroupsGetDetailsOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/details][%d] pcloudVolumegroupsGetDetailsOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/details][%d] pcloudVolumegroupsGetDetailsOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudVolumegroupsGetDetailsBadRequest) Code() int { } func (o *PcloudVolumegroupsGetDetailsBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/details][%d] pcloudVolumegroupsGetDetailsBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/details][%d] pcloudVolumegroupsGetDetailsBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudVolumegroupsGetDetailsUnauthorized) Code() int { } func (o *PcloudVolumegroupsGetDetailsUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/details][%d] pcloudVolumegroupsGetDetailsUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/details][%d] pcloudVolumegroupsGetDetailsUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudVolumegroupsGetDetailsForbidden) Code() int { } func (o *PcloudVolumegroupsGetDetailsForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/details][%d] pcloudVolumegroupsGetDetailsForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/details][%d] pcloudVolumegroupsGetDetailsForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudVolumegroupsGetDetailsNotFound) Code() int { } func (o *PcloudVolumegroupsGetDetailsNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/details][%d] pcloudVolumegroupsGetDetailsNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/details][%d] pcloudVolumegroupsGetDetailsNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudVolumegroupsGetDetailsInternalServerError) Code() int { } func (o *PcloudVolumegroupsGetDetailsInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/details][%d] pcloudVolumegroupsGetDetailsInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/details][%d] pcloudVolumegroupsGetDetailsInternalServerError %+v", 500, o.Payload) + 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 { 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 index e2efcd04..38e74072 100644 --- a/power/client/p_cloud_volume_groups/pcloud_volumegroups_get_responses.go +++ b/power/client/p_cloud_volume_groups/pcloud_volumegroups_get_responses.go @@ -6,6 +6,7 @@ package p_cloud_volume_groups // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudVolumegroupsGetOK) Code() int { } func (o *PcloudVolumegroupsGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsGetOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudVolumegroupsGetBadRequest) Code() int { } func (o *PcloudVolumegroupsGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsGetBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudVolumegroupsGetUnauthorized) Code() int { } func (o *PcloudVolumegroupsGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudVolumegroupsGetForbidden) Code() int { } func (o *PcloudVolumegroupsGetForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsGetForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudVolumegroupsGetNotFound) Code() int { } func (o *PcloudVolumegroupsGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsGetNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudVolumegroupsGetInternalServerError) Code() int { } func (o *PcloudVolumegroupsGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsGetInternalServerError %+v", 500, o.Payload) + 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 { 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 index 4397ec85..bc076a04 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_volume_groups // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudVolumegroupsGetallDetailsOK) Code() int { } func (o *PcloudVolumegroupsGetallDetailsOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/details][%d] pcloudVolumegroupsGetallDetailsOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/details][%d] pcloudVolumegroupsGetallDetailsOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudVolumegroupsGetallDetailsBadRequest) Code() int { } func (o *PcloudVolumegroupsGetallDetailsBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/details][%d] pcloudVolumegroupsGetallDetailsBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/details][%d] pcloudVolumegroupsGetallDetailsBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudVolumegroupsGetallDetailsUnauthorized) Code() int { } func (o *PcloudVolumegroupsGetallDetailsUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/details][%d] pcloudVolumegroupsGetallDetailsUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/details][%d] pcloudVolumegroupsGetallDetailsUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudVolumegroupsGetallDetailsForbidden) Code() int { } func (o *PcloudVolumegroupsGetallDetailsForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/details][%d] pcloudVolumegroupsGetallDetailsForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/details][%d] pcloudVolumegroupsGetallDetailsForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudVolumegroupsGetallDetailsNotFound) Code() int { } func (o *PcloudVolumegroupsGetallDetailsNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/details][%d] pcloudVolumegroupsGetallDetailsNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/details][%d] pcloudVolumegroupsGetallDetailsNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudVolumegroupsGetallDetailsInternalServerError) Code() int { } func (o *PcloudVolumegroupsGetallDetailsInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/details][%d] pcloudVolumegroupsGetallDetailsInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/details][%d] pcloudVolumegroupsGetallDetailsInternalServerError %+v", 500, o.Payload) + 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 { 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 index f488e4dd..d8b1a7a2 100644 --- a/power/client/p_cloud_volume_groups/pcloud_volumegroups_getall_responses.go +++ b/power/client/p_cloud_volume_groups/pcloud_volumegroups_getall_responses.go @@ -6,6 +6,7 @@ package p_cloud_volume_groups // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudVolumegroupsGetallOK) Code() int { } func (o *PcloudVolumegroupsGetallOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsGetallOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsGetallOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudVolumegroupsGetallBadRequest) Code() int { } func (o *PcloudVolumegroupsGetallBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsGetallBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsGetallBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudVolumegroupsGetallUnauthorized) Code() int { } func (o *PcloudVolumegroupsGetallUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsGetallUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsGetallUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudVolumegroupsGetallForbidden) Code() int { } func (o *PcloudVolumegroupsGetallForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsGetallForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsGetallForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudVolumegroupsGetallNotFound) Code() int { } func (o *PcloudVolumegroupsGetallNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsGetallNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsGetallNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudVolumegroupsGetallInternalServerError) Code() int { } func (o *PcloudVolumegroupsGetallInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsGetallInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsGetallInternalServerError %+v", 500, o.Payload) + 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 { 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 index a5f9b46d..731fc036 100644 --- a/power/client/p_cloud_volume_groups/pcloud_volumegroups_post_responses.go +++ b/power/client/p_cloud_volume_groups/pcloud_volumegroups_post_responses.go @@ -6,6 +6,7 @@ package p_cloud_volume_groups // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -133,11 +134,13 @@ func (o *PcloudVolumegroupsPostAccepted) Code() int { } func (o *PcloudVolumegroupsPostAccepted) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostAccepted %+v", 202, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostAccepted %+v", 202, o.Payload) + 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 { @@ -201,11 +204,13 @@ func (o *PcloudVolumegroupsPostPartialContent) Code() int { } func (o *PcloudVolumegroupsPostPartialContent) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostPartialContent %+v", 206, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostPartialContent %+v", 206, o.Payload) + 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 { @@ -269,11 +274,13 @@ func (o *PcloudVolumegroupsPostBadRequest) Code() int { } func (o *PcloudVolumegroupsPostBadRequest) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostBadRequest %+v", 400, o.Payload) + 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 { @@ -337,11 +344,13 @@ func (o *PcloudVolumegroupsPostUnauthorized) Code() int { } func (o *PcloudVolumegroupsPostUnauthorized) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostUnauthorized %+v", 401, o.Payload) + 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 { @@ -405,11 +414,13 @@ func (o *PcloudVolumegroupsPostForbidden) Code() int { } func (o *PcloudVolumegroupsPostForbidden) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostForbidden %+v", 403, o.Payload) + 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 { @@ -473,11 +484,13 @@ func (o *PcloudVolumegroupsPostNotFound) Code() int { } func (o *PcloudVolumegroupsPostNotFound) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostNotFound %+v", 404, o.Payload) + 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 { @@ -541,11 +554,13 @@ func (o *PcloudVolumegroupsPostConflict) Code() int { } func (o *PcloudVolumegroupsPostConflict) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostConflict %+v", 409, o.Payload) + 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 { @@ -609,11 +624,13 @@ func (o *PcloudVolumegroupsPostUnprocessableEntity) Code() int { } func (o *PcloudVolumegroupsPostUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -677,11 +694,13 @@ func (o *PcloudVolumegroupsPostInternalServerError) Code() int { } func (o *PcloudVolumegroupsPostInternalServerError) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostInternalServerError %+v", 500, o.Payload) + 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 { @@ -745,11 +764,13 @@ func (o *PcloudVolumegroupsPostGatewayTimeout) Code() int { } func (o *PcloudVolumegroupsPostGatewayTimeout) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostGatewayTimeout %+v", 504, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostGatewayTimeout %+v", 504, o.Payload) + 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 { 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 index 121a977d..4ed822ba 100644 --- a/power/client/p_cloud_volume_groups/pcloud_volumegroups_put_responses.go +++ b/power/client/p_cloud_volume_groups/pcloud_volumegroups_put_responses.go @@ -6,6 +6,7 @@ package p_cloud_volume_groups // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -121,11 +122,13 @@ func (o *PcloudVolumegroupsPutAccepted) Code() int { } func (o *PcloudVolumegroupsPutAccepted) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsPutAccepted %+v", 202, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsPutAccepted %+v", 202, o.Payload) + 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 { @@ -187,11 +190,13 @@ func (o *PcloudVolumegroupsPutBadRequest) Code() int { } func (o *PcloudVolumegroupsPutBadRequest) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsPutBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsPutBadRequest %+v", 400, o.Payload) + 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 { @@ -255,11 +260,13 @@ func (o *PcloudVolumegroupsPutUnauthorized) Code() int { } func (o *PcloudVolumegroupsPutUnauthorized) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsPutUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsPutUnauthorized %+v", 401, o.Payload) + 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 { @@ -323,11 +330,13 @@ func (o *PcloudVolumegroupsPutForbidden) Code() int { } func (o *PcloudVolumegroupsPutForbidden) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsPutForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsPutForbidden %+v", 403, o.Payload) + 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 { @@ -391,11 +400,13 @@ func (o *PcloudVolumegroupsPutNotFound) Code() int { } func (o *PcloudVolumegroupsPutNotFound) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsPutNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsPutNotFound %+v", 404, o.Payload) + 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 { @@ -459,11 +470,13 @@ func (o *PcloudVolumegroupsPutConflict) Code() int { } func (o *PcloudVolumegroupsPutConflict) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsPutConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsPutConflict %+v", 409, o.Payload) + 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 { @@ -527,11 +540,13 @@ func (o *PcloudVolumegroupsPutUnprocessableEntity) Code() int { } func (o *PcloudVolumegroupsPutUnprocessableEntity) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsPutUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsPutUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -595,11 +610,13 @@ func (o *PcloudVolumegroupsPutInternalServerError) Code() int { } func (o *PcloudVolumegroupsPutInternalServerError) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsPutInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}][%d] pcloudVolumegroupsPutInternalServerError %+v", 500, o.Payload) + 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 { 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 index e3092d6b..17163b57 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_volume_groups // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetOK) Code() int { } func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/remote-copy-relationships][%d] pcloudVolumegroupsRemoteCopyRelationshipsGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/remote-copy-relationships][%d] pcloudVolumegroupsRemoteCopyRelationshipsGetOK %+v", 200, o.Payload) + 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 { @@ -183,11 +186,13 @@ func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetBadRequest) Code() int { } func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/remote-copy-relationships][%d] pcloudVolumegroupsRemoteCopyRelationshipsGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/remote-copy-relationships][%d] pcloudVolumegroupsRemoteCopyRelationshipsGetBadRequest %+v", 400, o.Payload) + 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 { @@ -251,11 +256,13 @@ func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetUnauthorized) Code() int { } func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/remote-copy-relationships][%d] pcloudVolumegroupsRemoteCopyRelationshipsGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/remote-copy-relationships][%d] pcloudVolumegroupsRemoteCopyRelationshipsGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -319,11 +326,13 @@ func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetForbidden) Code() int { } func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/remote-copy-relationships][%d] pcloudVolumegroupsRemoteCopyRelationshipsGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/remote-copy-relationships][%d] pcloudVolumegroupsRemoteCopyRelationshipsGetForbidden %+v", 403, o.Payload) + 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 { @@ -387,11 +396,13 @@ func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetNotFound) Code() int { } func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/remote-copy-relationships][%d] pcloudVolumegroupsRemoteCopyRelationshipsGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/remote-copy-relationships][%d] pcloudVolumegroupsRemoteCopyRelationshipsGetNotFound %+v", 404, o.Payload) + 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 { @@ -455,11 +466,13 @@ func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetTooManyRequests) Code() int } func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetTooManyRequests) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/remote-copy-relationships][%d] pcloudVolumegroupsRemoteCopyRelationshipsGetTooManyRequests %+v", 429, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/remote-copy-relationships][%d] pcloudVolumegroupsRemoteCopyRelationshipsGetTooManyRequests %+v", 429, o.Payload) + 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 { @@ -523,11 +536,13 @@ func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetInternalServerError) Code() } func (o *PcloudVolumegroupsRemoteCopyRelationshipsGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/remote-copy-relationships][%d] pcloudVolumegroupsRemoteCopyRelationshipsGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/remote-copy-relationships][%d] pcloudVolumegroupsRemoteCopyRelationshipsGetInternalServerError %+v", 500, o.Payload) + 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 { 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 index 6d39a07e..54136c93 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_volume_groups // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudVolumegroupsStorageDetailsGetOK) Code() int { } func (o *PcloudVolumegroupsStorageDetailsGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/storage-details][%d] pcloudVolumegroupsStorageDetailsGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/storage-details][%d] pcloudVolumegroupsStorageDetailsGetOK %+v", 200, o.Payload) + 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 { @@ -183,11 +186,13 @@ func (o *PcloudVolumegroupsStorageDetailsGetBadRequest) Code() int { } func (o *PcloudVolumegroupsStorageDetailsGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/storage-details][%d] pcloudVolumegroupsStorageDetailsGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/storage-details][%d] pcloudVolumegroupsStorageDetailsGetBadRequest %+v", 400, o.Payload) + 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 { @@ -251,11 +256,13 @@ func (o *PcloudVolumegroupsStorageDetailsGetUnauthorized) Code() int { } func (o *PcloudVolumegroupsStorageDetailsGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/storage-details][%d] pcloudVolumegroupsStorageDetailsGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/storage-details][%d] pcloudVolumegroupsStorageDetailsGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -319,11 +326,13 @@ func (o *PcloudVolumegroupsStorageDetailsGetForbidden) Code() int { } func (o *PcloudVolumegroupsStorageDetailsGetForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/storage-details][%d] pcloudVolumegroupsStorageDetailsGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/storage-details][%d] pcloudVolumegroupsStorageDetailsGetForbidden %+v", 403, o.Payload) + 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 { @@ -387,11 +396,13 @@ func (o *PcloudVolumegroupsStorageDetailsGetNotFound) Code() int { } func (o *PcloudVolumegroupsStorageDetailsGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/storage-details][%d] pcloudVolumegroupsStorageDetailsGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/storage-details][%d] pcloudVolumegroupsStorageDetailsGetNotFound %+v", 404, o.Payload) + 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 { @@ -455,11 +466,13 @@ func (o *PcloudVolumegroupsStorageDetailsGetTooManyRequests) Code() int { } func (o *PcloudVolumegroupsStorageDetailsGetTooManyRequests) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/storage-details][%d] pcloudVolumegroupsStorageDetailsGetTooManyRequests %+v", 429, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/storage-details][%d] pcloudVolumegroupsStorageDetailsGetTooManyRequests %+v", 429, o.Payload) + 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 { @@ -523,11 +536,13 @@ func (o *PcloudVolumegroupsStorageDetailsGetInternalServerError) Code() int { } func (o *PcloudVolumegroupsStorageDetailsGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/storage-details][%d] pcloudVolumegroupsStorageDetailsGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups/{volume_group_id}/storage-details][%d] pcloudVolumegroupsStorageDetailsGetInternalServerError %+v", 500, o.Payload) + 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 { 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 index 5e84664f..9b7bfb39 100644 --- 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 @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi 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 */ @@ -25,7 +51,7 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods 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 index 5e485da4..7f28d3c8 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_volume_onboarding // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudVolumeOnboardingGetOK) Code() int { } func (o *PcloudVolumeOnboardingGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding/{volume_onboarding_id}][%d] pcloudVolumeOnboardingGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding/{volume_onboarding_id}][%d] pcloudVolumeOnboardingGetOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudVolumeOnboardingGetBadRequest) Code() int { } func (o *PcloudVolumeOnboardingGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding/{volume_onboarding_id}][%d] pcloudVolumeOnboardingGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding/{volume_onboarding_id}][%d] pcloudVolumeOnboardingGetBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudVolumeOnboardingGetUnauthorized) Code() int { } func (o *PcloudVolumeOnboardingGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding/{volume_onboarding_id}][%d] pcloudVolumeOnboardingGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding/{volume_onboarding_id}][%d] pcloudVolumeOnboardingGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudVolumeOnboardingGetForbidden) Code() int { } func (o *PcloudVolumeOnboardingGetForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding/{volume_onboarding_id}][%d] pcloudVolumeOnboardingGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding/{volume_onboarding_id}][%d] pcloudVolumeOnboardingGetForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudVolumeOnboardingGetNotFound) Code() int { } func (o *PcloudVolumeOnboardingGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding/{volume_onboarding_id}][%d] pcloudVolumeOnboardingGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding/{volume_onboarding_id}][%d] pcloudVolumeOnboardingGetNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudVolumeOnboardingGetInternalServerError) Code() int { } func (o *PcloudVolumeOnboardingGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding/{volume_onboarding_id}][%d] pcloudVolumeOnboardingGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding/{volume_onboarding_id}][%d] pcloudVolumeOnboardingGetInternalServerError %+v", 500, o.Payload) + 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 { 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 index 1108621d..59968522 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_volume_onboarding // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudVolumeOnboardingGetallOK) Code() int { } func (o *PcloudVolumeOnboardingGetallOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingGetallOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingGetallOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudVolumeOnboardingGetallBadRequest) Code() int { } func (o *PcloudVolumeOnboardingGetallBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingGetallBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingGetallBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudVolumeOnboardingGetallUnauthorized) Code() int { } func (o *PcloudVolumeOnboardingGetallUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingGetallUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingGetallUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudVolumeOnboardingGetallForbidden) Code() int { } func (o *PcloudVolumeOnboardingGetallForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingGetallForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingGetallForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudVolumeOnboardingGetallNotFound) Code() int { } func (o *PcloudVolumeOnboardingGetallNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingGetallNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingGetallNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudVolumeOnboardingGetallInternalServerError) Code() int { } func (o *PcloudVolumeOnboardingGetallInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingGetallInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingGetallInternalServerError %+v", 500, o.Payload) + 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 { 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 index 3e728d57..801df4b4 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_volume_onboarding // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudVolumeOnboardingPostAccepted) Code() int { } func (o *PcloudVolumeOnboardingPostAccepted) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingPostAccepted %+v", 202, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingPostAccepted %+v", 202, o.Payload) + 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 { @@ -183,11 +186,13 @@ func (o *PcloudVolumeOnboardingPostBadRequest) Code() int { } func (o *PcloudVolumeOnboardingPostBadRequest) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingPostBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingPostBadRequest %+v", 400, o.Payload) + 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 { @@ -251,11 +256,13 @@ func (o *PcloudVolumeOnboardingPostUnauthorized) Code() int { } func (o *PcloudVolumeOnboardingPostUnauthorized) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingPostUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingPostUnauthorized %+v", 401, o.Payload) + 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 { @@ -319,11 +326,13 @@ func (o *PcloudVolumeOnboardingPostForbidden) Code() int { } func (o *PcloudVolumeOnboardingPostForbidden) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingPostForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingPostForbidden %+v", 403, o.Payload) + 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 { @@ -387,11 +396,13 @@ func (o *PcloudVolumeOnboardingPostNotFound) Code() int { } func (o *PcloudVolumeOnboardingPostNotFound) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingPostNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingPostNotFound %+v", 404, o.Payload) + 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 { @@ -455,11 +466,13 @@ func (o *PcloudVolumeOnboardingPostConflict) Code() int { } func (o *PcloudVolumeOnboardingPostConflict) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingPostConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingPostConflict %+v", 409, o.Payload) + 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 { @@ -523,11 +536,13 @@ func (o *PcloudVolumeOnboardingPostInternalServerError) Code() int { } func (o *PcloudVolumeOnboardingPostInternalServerError) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingPostInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/onboarding][%d] pcloudVolumeOnboardingPostInternalServerError %+v", 500, o.Payload) + 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 { diff --git a/power/client/p_cloud_volumes/p_cloud_volumes_client.go b/power/client/p_cloud_volumes/p_cloud_volumes_client.go index 1a06cbc5..e2bc42c7 100644 --- a/power/client/p_cloud_volumes/p_cloud_volumes_client.go +++ b/power/client/p_cloud_volumes/p_cloud_volumes_client.go @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi 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 */ @@ -25,7 +51,7 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods 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 index f59bc76a..6be188ce 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_volumes // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudCloudinstancesVolumesActionPostAccepted) Code() int { } func (o *PcloudCloudinstancesVolumesActionPostAccepted) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/action][%d] pcloudCloudinstancesVolumesActionPostAccepted %+v", 202, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/action][%d] pcloudCloudinstancesVolumesActionPostAccepted %+v", 202, o.Payload) + 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 { @@ -181,11 +184,13 @@ func (o *PcloudCloudinstancesVolumesActionPostBadRequest) Code() int { } func (o *PcloudCloudinstancesVolumesActionPostBadRequest) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/action][%d] pcloudCloudinstancesVolumesActionPostBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/action][%d] pcloudCloudinstancesVolumesActionPostBadRequest %+v", 400, o.Payload) + 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 { @@ -249,11 +254,13 @@ func (o *PcloudCloudinstancesVolumesActionPostUnauthorized) Code() int { } func (o *PcloudCloudinstancesVolumesActionPostUnauthorized) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/action][%d] pcloudCloudinstancesVolumesActionPostUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/action][%d] pcloudCloudinstancesVolumesActionPostUnauthorized %+v", 401, o.Payload) + 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 { @@ -317,11 +324,13 @@ func (o *PcloudCloudinstancesVolumesActionPostForbidden) Code() int { } func (o *PcloudCloudinstancesVolumesActionPostForbidden) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/action][%d] pcloudCloudinstancesVolumesActionPostForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/action][%d] pcloudCloudinstancesVolumesActionPostForbidden %+v", 403, o.Payload) + 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 { @@ -385,11 +394,13 @@ func (o *PcloudCloudinstancesVolumesActionPostNotFound) Code() int { } func (o *PcloudCloudinstancesVolumesActionPostNotFound) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/action][%d] pcloudCloudinstancesVolumesActionPostNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/action][%d] pcloudCloudinstancesVolumesActionPostNotFound %+v", 404, o.Payload) + 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 { @@ -453,11 +464,13 @@ func (o *PcloudCloudinstancesVolumesActionPostConflict) Code() int { } func (o *PcloudCloudinstancesVolumesActionPostConflict) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/action][%d] pcloudCloudinstancesVolumesActionPostConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/action][%d] pcloudCloudinstancesVolumesActionPostConflict %+v", 409, o.Payload) + 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 { @@ -521,11 +534,13 @@ func (o *PcloudCloudinstancesVolumesActionPostInternalServerError) Code() int { } func (o *PcloudCloudinstancesVolumesActionPostInternalServerError) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/action][%d] pcloudCloudinstancesVolumesActionPostInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/action][%d] pcloudCloudinstancesVolumesActionPostInternalServerError %+v", 500, o.Payload) + 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 { 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 index 5ff94957..55000c60 100644 --- a/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_delete_responses.go +++ b/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_delete_responses.go @@ -6,6 +6,7 @@ package p_cloud_volumes // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudCloudinstancesVolumesDeleteOK) Code() int { } func (o *PcloudCloudinstancesVolumesDeleteOK) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesDeleteOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesDeleteOK %+v", 200, o.Payload) + 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 { @@ -181,11 +184,13 @@ func (o *PcloudCloudinstancesVolumesDeleteBadRequest) Code() int { } func (o *PcloudCloudinstancesVolumesDeleteBadRequest) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesDeleteBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesDeleteBadRequest %+v", 400, o.Payload) + 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 { @@ -249,11 +254,13 @@ func (o *PcloudCloudinstancesVolumesDeleteUnauthorized) Code() int { } func (o *PcloudCloudinstancesVolumesDeleteUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesDeleteUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesDeleteUnauthorized %+v", 401, o.Payload) + 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 { @@ -317,11 +324,13 @@ func (o *PcloudCloudinstancesVolumesDeleteForbidden) Code() int { } func (o *PcloudCloudinstancesVolumesDeleteForbidden) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesDeleteForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesDeleteForbidden %+v", 403, o.Payload) + 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 { @@ -385,11 +394,13 @@ func (o *PcloudCloudinstancesVolumesDeleteNotFound) Code() int { } func (o *PcloudCloudinstancesVolumesDeleteNotFound) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesDeleteNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesDeleteNotFound %+v", 404, o.Payload) + 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 { @@ -453,11 +464,13 @@ func (o *PcloudCloudinstancesVolumesDeleteGone) Code() int { } func (o *PcloudCloudinstancesVolumesDeleteGone) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesDeleteGone %+v", 410, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesDeleteGone %+v", 410, o.Payload) + 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 { @@ -521,11 +534,13 @@ func (o *PcloudCloudinstancesVolumesDeleteInternalServerError) Code() int { } func (o *PcloudCloudinstancesVolumesDeleteInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesDeleteInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesDeleteInternalServerError %+v", 500, o.Payload) + 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 { 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 index 2df0879b..150b2a2c 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_volumes // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetOK) Code() int { } func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/flash-copy-mappings][%d] pcloudCloudinstancesVolumesFlashCopyMappingsGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/flash-copy-mappings][%d] pcloudCloudinstancesVolumesFlashCopyMappingsGetOK %+v", 200, o.Payload) + 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 { @@ -181,11 +184,13 @@ func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetBadRequest) Code() int { } func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/flash-copy-mappings][%d] pcloudCloudinstancesVolumesFlashCopyMappingsGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/flash-copy-mappings][%d] pcloudCloudinstancesVolumesFlashCopyMappingsGetBadRequest %+v", 400, o.Payload) + 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 { @@ -249,11 +254,13 @@ func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetUnauthorized) Code() int } func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/flash-copy-mappings][%d] pcloudCloudinstancesVolumesFlashCopyMappingsGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/flash-copy-mappings][%d] pcloudCloudinstancesVolumesFlashCopyMappingsGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -317,11 +324,13 @@ func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetForbidden) Code() int { } func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/flash-copy-mappings][%d] pcloudCloudinstancesVolumesFlashCopyMappingsGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/flash-copy-mappings][%d] pcloudCloudinstancesVolumesFlashCopyMappingsGetForbidden %+v", 403, o.Payload) + 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 { @@ -385,11 +394,13 @@ func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetNotFound) Code() int { } func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/flash-copy-mappings][%d] pcloudCloudinstancesVolumesFlashCopyMappingsGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/flash-copy-mappings][%d] pcloudCloudinstancesVolumesFlashCopyMappingsGetNotFound %+v", 404, o.Payload) + 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 { @@ -453,11 +464,13 @@ func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetTooManyRequests) Code() } func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetTooManyRequests) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/flash-copy-mappings][%d] pcloudCloudinstancesVolumesFlashCopyMappingsGetTooManyRequests %+v", 429, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/flash-copy-mappings][%d] pcloudCloudinstancesVolumesFlashCopyMappingsGetTooManyRequests %+v", 429, o.Payload) + 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 { @@ -521,11 +534,13 @@ func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetInternalServerError) Cod } func (o *PcloudCloudinstancesVolumesFlashCopyMappingsGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/flash-copy-mappings][%d] pcloudCloudinstancesVolumesFlashCopyMappingsGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/flash-copy-mappings][%d] pcloudCloudinstancesVolumesFlashCopyMappingsGetInternalServerError %+v", 500, o.Payload) + 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 { 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 index fb9dd473..7bbc8dda 100644 --- a/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_get_responses.go +++ b/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_get_responses.go @@ -6,6 +6,7 @@ package p_cloud_volumes // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudCloudinstancesVolumesGetOK) Code() int { } func (o *PcloudCloudinstancesVolumesGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesGetOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudCloudinstancesVolumesGetBadRequest) Code() int { } func (o *PcloudCloudinstancesVolumesGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesGetBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudCloudinstancesVolumesGetUnauthorized) Code() int { } func (o *PcloudCloudinstancesVolumesGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudCloudinstancesVolumesGetForbidden) Code() int { } func (o *PcloudCloudinstancesVolumesGetForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesGetForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudCloudinstancesVolumesGetNotFound) Code() int { } func (o *PcloudCloudinstancesVolumesGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesGetNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudCloudinstancesVolumesGetInternalServerError) Code() int { } func (o *PcloudCloudinstancesVolumesGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesGetInternalServerError %+v", 500, o.Payload) + 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 { 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 index ed6c3532..82c90d1c 100644 --- a/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_getall_responses.go +++ b/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_getall_responses.go @@ -6,6 +6,7 @@ package p_cloud_volumes // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudCloudinstancesVolumesGetallOK) Code() int { } func (o *PcloudCloudinstancesVolumesGetallOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesGetallOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesGetallOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudCloudinstancesVolumesGetallBadRequest) Code() int { } func (o *PcloudCloudinstancesVolumesGetallBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesGetallBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesGetallBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudCloudinstancesVolumesGetallUnauthorized) Code() int { } func (o *PcloudCloudinstancesVolumesGetallUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesGetallUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesGetallUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudCloudinstancesVolumesGetallForbidden) Code() int { } func (o *PcloudCloudinstancesVolumesGetallForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesGetallForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesGetallForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudCloudinstancesVolumesGetallNotFound) Code() int { } func (o *PcloudCloudinstancesVolumesGetallNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesGetallNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesGetallNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudCloudinstancesVolumesGetallInternalServerError) Code() int { } func (o *PcloudCloudinstancesVolumesGetallInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesGetallInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesGetallInternalServerError %+v", 500, o.Payload) + 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 { 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 index ce16de98..907ef618 100644 --- a/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_post_responses.go +++ b/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_post_responses.go @@ -6,6 +6,7 @@ package p_cloud_volumes // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -121,11 +122,13 @@ func (o *PcloudCloudinstancesVolumesPostAccepted) Code() int { } func (o *PcloudCloudinstancesVolumesPostAccepted) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesPostAccepted %+v", 202, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesPostAccepted %+v", 202, o.Payload) + 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 { @@ -189,11 +192,13 @@ func (o *PcloudCloudinstancesVolumesPostBadRequest) Code() int { } func (o *PcloudCloudinstancesVolumesPostBadRequest) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesPostBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesPostBadRequest %+v", 400, o.Payload) + 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 { @@ -257,11 +262,13 @@ func (o *PcloudCloudinstancesVolumesPostUnauthorized) Code() int { } func (o *PcloudCloudinstancesVolumesPostUnauthorized) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesPostUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesPostUnauthorized %+v", 401, o.Payload) + 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 { @@ -325,11 +332,13 @@ func (o *PcloudCloudinstancesVolumesPostForbidden) Code() int { } func (o *PcloudCloudinstancesVolumesPostForbidden) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesPostForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesPostForbidden %+v", 403, o.Payload) + 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 { @@ -393,11 +402,13 @@ func (o *PcloudCloudinstancesVolumesPostNotFound) Code() int { } func (o *PcloudCloudinstancesVolumesPostNotFound) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesPostNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesPostNotFound %+v", 404, o.Payload) + 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 { @@ -461,11 +472,13 @@ func (o *PcloudCloudinstancesVolumesPostConflict) Code() int { } func (o *PcloudCloudinstancesVolumesPostConflict) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesPostConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesPostConflict %+v", 409, o.Payload) + 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 { @@ -529,11 +542,13 @@ func (o *PcloudCloudinstancesVolumesPostUnprocessableEntity) Code() int { } func (o *PcloudCloudinstancesVolumesPostUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesPostUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesPostUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -597,11 +612,13 @@ func (o *PcloudCloudinstancesVolumesPostInternalServerError) Code() int { } func (o *PcloudCloudinstancesVolumesPostInternalServerError) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesPostInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudCloudinstancesVolumesPostInternalServerError %+v", 500, o.Payload) + 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 { 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 index 77932ec8..ae40c474 100644 --- a/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_put_responses.go +++ b/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_put_responses.go @@ -6,6 +6,7 @@ package p_cloud_volumes // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -121,11 +122,13 @@ func (o *PcloudCloudinstancesVolumesPutOK) Code() int { } func (o *PcloudCloudinstancesVolumesPutOK) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesPutOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesPutOK %+v", 200, o.Payload) + 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 { @@ -189,11 +192,13 @@ func (o *PcloudCloudinstancesVolumesPutBadRequest) Code() int { } func (o *PcloudCloudinstancesVolumesPutBadRequest) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesPutBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesPutBadRequest %+v", 400, o.Payload) + 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 { @@ -257,11 +262,13 @@ func (o *PcloudCloudinstancesVolumesPutUnauthorized) Code() int { } func (o *PcloudCloudinstancesVolumesPutUnauthorized) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesPutUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesPutUnauthorized %+v", 401, o.Payload) + 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 { @@ -325,11 +332,13 @@ func (o *PcloudCloudinstancesVolumesPutForbidden) Code() int { } func (o *PcloudCloudinstancesVolumesPutForbidden) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesPutForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesPutForbidden %+v", 403, o.Payload) + 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 { @@ -393,11 +402,13 @@ func (o *PcloudCloudinstancesVolumesPutNotFound) Code() int { } func (o *PcloudCloudinstancesVolumesPutNotFound) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesPutNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesPutNotFound %+v", 404, o.Payload) + 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 { @@ -461,11 +472,13 @@ func (o *PcloudCloudinstancesVolumesPutConflict) Code() int { } func (o *PcloudCloudinstancesVolumesPutConflict) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesPutConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesPutConflict %+v", 409, o.Payload) + 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 { @@ -529,11 +542,13 @@ func (o *PcloudCloudinstancesVolumesPutUnprocessableEntity) Code() int { } func (o *PcloudCloudinstancesVolumesPutUnprocessableEntity) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesPutUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesPutUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -597,11 +612,13 @@ func (o *PcloudCloudinstancesVolumesPutInternalServerError) Code() int { } func (o *PcloudCloudinstancesVolumesPutInternalServerError) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesPutInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}][%d] pcloudCloudinstancesVolumesPutInternalServerError %+v", 500, o.Payload) + 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 { 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 index 6f173caf..4ff63893 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_volumes // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetOK) Code() int { } func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/remote-copy][%d] pcloudCloudinstancesVolumesRemoteCopyRelationshipGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/remote-copy][%d] pcloudCloudinstancesVolumesRemoteCopyRelationshipGetOK %+v", 200, o.Payload) + 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 { @@ -183,11 +186,13 @@ func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetBadRequest) Code() } func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/remote-copy][%d] pcloudCloudinstancesVolumesRemoteCopyRelationshipGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/remote-copy][%d] pcloudCloudinstancesVolumesRemoteCopyRelationshipGetBadRequest %+v", 400, o.Payload) + 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 { @@ -251,11 +256,13 @@ func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetUnauthorized) Code( } func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/remote-copy][%d] pcloudCloudinstancesVolumesRemoteCopyRelationshipGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/remote-copy][%d] pcloudCloudinstancesVolumesRemoteCopyRelationshipGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -319,11 +326,13 @@ func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetForbidden) Code() i } func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/remote-copy][%d] pcloudCloudinstancesVolumesRemoteCopyRelationshipGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/remote-copy][%d] pcloudCloudinstancesVolumesRemoteCopyRelationshipGetForbidden %+v", 403, o.Payload) + 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 { @@ -387,11 +396,13 @@ func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetNotFound) Code() in } func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/remote-copy][%d] pcloudCloudinstancesVolumesRemoteCopyRelationshipGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/remote-copy][%d] pcloudCloudinstancesVolumesRemoteCopyRelationshipGetNotFound %+v", 404, o.Payload) + 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 { @@ -455,11 +466,13 @@ func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetTooManyRequests) Co } func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetTooManyRequests) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/remote-copy][%d] pcloudCloudinstancesVolumesRemoteCopyRelationshipGetTooManyRequests %+v", 429, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/remote-copy][%d] pcloudCloudinstancesVolumesRemoteCopyRelationshipGetTooManyRequests %+v", 429, o.Payload) + 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 { @@ -523,11 +536,13 @@ func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetInternalServerError } func (o *PcloudCloudinstancesVolumesRemoteCopyRelationshipGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/remote-copy][%d] pcloudCloudinstancesVolumesRemoteCopyRelationshipGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/{volume_id}/remote-copy][%d] pcloudCloudinstancesVolumesRemoteCopyRelationshipGetInternalServerError %+v", 500, o.Payload) + 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 { 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 index e475c5d0..b29535e9 100644 --- a/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_delete_responses.go +++ b/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_delete_responses.go @@ -6,6 +6,7 @@ package p_cloud_volumes // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudPvminstancesVolumesDeleteAccepted) Code() int { } func (o *PcloudPvminstancesVolumesDeleteAccepted) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesDeleteAccepted %+v", 202, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesDeleteAccepted %+v", 202, o.Payload) + 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 { @@ -181,11 +184,13 @@ func (o *PcloudPvminstancesVolumesDeleteBadRequest) Code() int { } func (o *PcloudPvminstancesVolumesDeleteBadRequest) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesDeleteBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesDeleteBadRequest %+v", 400, o.Payload) + 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 { @@ -249,11 +254,13 @@ func (o *PcloudPvminstancesVolumesDeleteUnauthorized) Code() int { } func (o *PcloudPvminstancesVolumesDeleteUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesDeleteUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesDeleteUnauthorized %+v", 401, o.Payload) + 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 { @@ -317,11 +324,13 @@ func (o *PcloudPvminstancesVolumesDeleteForbidden) Code() int { } func (o *PcloudPvminstancesVolumesDeleteForbidden) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesDeleteForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesDeleteForbidden %+v", 403, o.Payload) + 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 { @@ -385,11 +394,13 @@ func (o *PcloudPvminstancesVolumesDeleteNotFound) Code() int { } func (o *PcloudPvminstancesVolumesDeleteNotFound) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesDeleteNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesDeleteNotFound %+v", 404, o.Payload) + 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 { @@ -453,11 +464,13 @@ func (o *PcloudPvminstancesVolumesDeleteConflict) Code() int { } func (o *PcloudPvminstancesVolumesDeleteConflict) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesDeleteConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesDeleteConflict %+v", 409, o.Payload) + 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 { @@ -521,11 +534,13 @@ func (o *PcloudPvminstancesVolumesDeleteInternalServerError) Code() int { } func (o *PcloudPvminstancesVolumesDeleteInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesDeleteInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesDeleteInternalServerError %+v", 500, o.Payload) + 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 { 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 index fe063e85..c495c925 100644 --- a/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_get_responses.go +++ b/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_get_responses.go @@ -6,6 +6,7 @@ package p_cloud_volumes // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudPvminstancesVolumesGetOK) Code() int { } func (o *PcloudPvminstancesVolumesGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesGetOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudPvminstancesVolumesGetBadRequest) Code() int { } func (o *PcloudPvminstancesVolumesGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesGetBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudPvminstancesVolumesGetUnauthorized) Code() int { } func (o *PcloudPvminstancesVolumesGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudPvminstancesVolumesGetForbidden) Code() int { } func (o *PcloudPvminstancesVolumesGetForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesGetForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudPvminstancesVolumesGetNotFound) Code() int { } func (o *PcloudPvminstancesVolumesGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesGetNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudPvminstancesVolumesGetInternalServerError) Code() int { } func (o *PcloudPvminstancesVolumesGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesGetInternalServerError %+v", 500, o.Payload) + 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 { 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 index 515b0baa..d81c92f5 100644 --- a/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_getall_responses.go +++ b/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_getall_responses.go @@ -6,6 +6,7 @@ package p_cloud_volumes // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudPvminstancesVolumesGetallOK) Code() int { } func (o *PcloudPvminstancesVolumesGetallOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudPvminstancesVolumesGetallOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudPvminstancesVolumesGetallOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudPvminstancesVolumesGetallBadRequest) Code() int { } func (o *PcloudPvminstancesVolumesGetallBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudPvminstancesVolumesGetallBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudPvminstancesVolumesGetallBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudPvminstancesVolumesGetallUnauthorized) Code() int { } func (o *PcloudPvminstancesVolumesGetallUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudPvminstancesVolumesGetallUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudPvminstancesVolumesGetallUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudPvminstancesVolumesGetallForbidden) Code() int { } func (o *PcloudPvminstancesVolumesGetallForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudPvminstancesVolumesGetallForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudPvminstancesVolumesGetallForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudPvminstancesVolumesGetallNotFound) Code() int { } func (o *PcloudPvminstancesVolumesGetallNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudPvminstancesVolumesGetallNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudPvminstancesVolumesGetallNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudPvminstancesVolumesGetallInternalServerError) Code() int { } func (o *PcloudPvminstancesVolumesGetallInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudPvminstancesVolumesGetallInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudPvminstancesVolumesGetallInternalServerError %+v", 500, o.Payload) + 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 { 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 index 48d58e9a..add3acda 100644 --- a/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_post_responses.go +++ b/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_post_responses.go @@ -6,6 +6,7 @@ package p_cloud_volumes // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudPvminstancesVolumesPostOK) Code() int { } func (o *PcloudPvminstancesVolumesPostOK) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPostOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPostOK %+v", 200, o.Payload) + 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 { @@ -181,11 +184,13 @@ func (o *PcloudPvminstancesVolumesPostBadRequest) Code() int { } func (o *PcloudPvminstancesVolumesPostBadRequest) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPostBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPostBadRequest %+v", 400, o.Payload) + 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 { @@ -249,11 +254,13 @@ func (o *PcloudPvminstancesVolumesPostUnauthorized) Code() int { } func (o *PcloudPvminstancesVolumesPostUnauthorized) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPostUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPostUnauthorized %+v", 401, o.Payload) + 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 { @@ -317,11 +324,13 @@ func (o *PcloudPvminstancesVolumesPostForbidden) Code() int { } func (o *PcloudPvminstancesVolumesPostForbidden) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPostForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPostForbidden %+v", 403, o.Payload) + 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 { @@ -385,11 +394,13 @@ func (o *PcloudPvminstancesVolumesPostNotFound) Code() int { } func (o *PcloudPvminstancesVolumesPostNotFound) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPostNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPostNotFound %+v", 404, o.Payload) + 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 { @@ -453,11 +464,13 @@ func (o *PcloudPvminstancesVolumesPostConflict) Code() int { } func (o *PcloudPvminstancesVolumesPostConflict) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPostConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPostConflict %+v", 409, o.Payload) + 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 { @@ -521,11 +534,13 @@ func (o *PcloudPvminstancesVolumesPostInternalServerError) Code() int { } func (o *PcloudPvminstancesVolumesPostInternalServerError) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPostInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPostInternalServerError %+v", 500, o.Payload) + 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 { 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 index bcdd7318..7c4bccd6 100644 --- a/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_put_responses.go +++ b/power/client/p_cloud_volumes/pcloud_pvminstances_volumes_put_responses.go @@ -6,6 +6,7 @@ package p_cloud_volumes // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudPvminstancesVolumesPutOK) Code() int { } func (o *PcloudPvminstancesVolumesPutOK) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPutOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPutOK %+v", 200, o.Payload) + 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 { @@ -175,11 +178,13 @@ func (o *PcloudPvminstancesVolumesPutBadRequest) Code() int { } func (o *PcloudPvminstancesVolumesPutBadRequest) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPutBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPutBadRequest %+v", 400, o.Payload) + 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 { @@ -243,11 +248,13 @@ func (o *PcloudPvminstancesVolumesPutUnauthorized) Code() int { } func (o *PcloudPvminstancesVolumesPutUnauthorized) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPutUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPutUnauthorized %+v", 401, o.Payload) + 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 { @@ -311,11 +318,13 @@ func (o *PcloudPvminstancesVolumesPutForbidden) Code() int { } func (o *PcloudPvminstancesVolumesPutForbidden) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPutForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPutForbidden %+v", 403, o.Payload) + 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 { @@ -379,11 +388,13 @@ func (o *PcloudPvminstancesVolumesPutNotFound) Code() int { } func (o *PcloudPvminstancesVolumesPutNotFound) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPutNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPutNotFound %+v", 404, o.Payload) + 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 { @@ -447,11 +458,13 @@ func (o *PcloudPvminstancesVolumesPutInternalServerError) Code() int { } func (o *PcloudPvminstancesVolumesPutInternalServerError) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPutInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}][%d] pcloudPvminstancesVolumesPutInternalServerError %+v", 500, o.Payload) + 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 { 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 index 9f0d836b..f6569fee 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_volumes // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudPvminstancesVolumesSetbootPutOK) Code() int { } func (o *PcloudPvminstancesVolumesSetbootPutOK) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}/setboot][%d] pcloudPvminstancesVolumesSetbootPutOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}/setboot][%d] pcloudPvminstancesVolumesSetbootPutOK %+v", 200, o.Payload) + 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 { @@ -175,11 +178,13 @@ func (o *PcloudPvminstancesVolumesSetbootPutBadRequest) Code() int { } func (o *PcloudPvminstancesVolumesSetbootPutBadRequest) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}/setboot][%d] pcloudPvminstancesVolumesSetbootPutBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}/setboot][%d] pcloudPvminstancesVolumesSetbootPutBadRequest %+v", 400, o.Payload) + 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 { @@ -243,11 +248,13 @@ func (o *PcloudPvminstancesVolumesSetbootPutUnauthorized) Code() int { } func (o *PcloudPvminstancesVolumesSetbootPutUnauthorized) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}/setboot][%d] pcloudPvminstancesVolumesSetbootPutUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}/setboot][%d] pcloudPvminstancesVolumesSetbootPutUnauthorized %+v", 401, o.Payload) + 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 { @@ -311,11 +318,13 @@ func (o *PcloudPvminstancesVolumesSetbootPutForbidden) Code() int { } func (o *PcloudPvminstancesVolumesSetbootPutForbidden) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}/setboot][%d] pcloudPvminstancesVolumesSetbootPutForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}/setboot][%d] pcloudPvminstancesVolumesSetbootPutForbidden %+v", 403, o.Payload) + 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 { @@ -379,11 +388,13 @@ func (o *PcloudPvminstancesVolumesSetbootPutNotFound) Code() int { } func (o *PcloudPvminstancesVolumesSetbootPutNotFound) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}/setboot][%d] pcloudPvminstancesVolumesSetbootPutNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}/setboot][%d] pcloudPvminstancesVolumesSetbootPutNotFound %+v", 404, o.Payload) + 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 { @@ -447,11 +458,13 @@ func (o *PcloudPvminstancesVolumesSetbootPutInternalServerError) Code() int { } func (o *PcloudPvminstancesVolumesSetbootPutInternalServerError) Error() string { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}/setboot][%d] pcloudPvminstancesVolumesSetbootPutInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[PUT /pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes/{volume_id}/setboot][%d] pcloudPvminstancesVolumesSetbootPutInternalServerError %+v", 500, o.Payload) + 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 { 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 index 54dca395..21ab2278 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_volumes // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudV2PvminstancesVolumesDeleteAccepted) Code() int { } func (o *PcloudV2PvminstancesVolumesDeleteAccepted) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesDeleteAccepted %+v", 202, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesDeleteAccepted %+v", 202, o.Payload) + 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 { @@ -183,11 +186,13 @@ func (o *PcloudV2PvminstancesVolumesDeleteBadRequest) Code() int { } func (o *PcloudV2PvminstancesVolumesDeleteBadRequest) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesDeleteBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesDeleteBadRequest %+v", 400, o.Payload) + 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 { @@ -251,11 +256,13 @@ func (o *PcloudV2PvminstancesVolumesDeleteUnauthorized) Code() int { } func (o *PcloudV2PvminstancesVolumesDeleteUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesDeleteUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesDeleteUnauthorized %+v", 401, o.Payload) + 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 { @@ -319,11 +326,13 @@ func (o *PcloudV2PvminstancesVolumesDeleteForbidden) Code() int { } func (o *PcloudV2PvminstancesVolumesDeleteForbidden) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesDeleteForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesDeleteForbidden %+v", 403, o.Payload) + 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 { @@ -387,11 +396,13 @@ func (o *PcloudV2PvminstancesVolumesDeleteNotFound) Code() int { } func (o *PcloudV2PvminstancesVolumesDeleteNotFound) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesDeleteNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesDeleteNotFound %+v", 404, o.Payload) + 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 { @@ -455,11 +466,13 @@ func (o *PcloudV2PvminstancesVolumesDeleteConflict) Code() int { } func (o *PcloudV2PvminstancesVolumesDeleteConflict) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesDeleteConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesDeleteConflict %+v", 409, o.Payload) + 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 { @@ -523,11 +536,13 @@ func (o *PcloudV2PvminstancesVolumesDeleteInternalServerError) Code() int { } func (o *PcloudV2PvminstancesVolumesDeleteInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesDeleteInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesDeleteInternalServerError %+v", 500, o.Payload) + 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 { 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 index 53e98942..4ead4295 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_volumes // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudV2PvminstancesVolumesPostAccepted) Code() int { } func (o *PcloudV2PvminstancesVolumesPostAccepted) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesPostAccepted %+v", 202, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesPostAccepted %+v", 202, o.Payload) + 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 { @@ -183,11 +186,13 @@ func (o *PcloudV2PvminstancesVolumesPostBadRequest) Code() int { } func (o *PcloudV2PvminstancesVolumesPostBadRequest) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesPostBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesPostBadRequest %+v", 400, o.Payload) + 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 { @@ -251,11 +256,13 @@ func (o *PcloudV2PvminstancesVolumesPostUnauthorized) Code() int { } func (o *PcloudV2PvminstancesVolumesPostUnauthorized) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesPostUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesPostUnauthorized %+v", 401, o.Payload) + 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 { @@ -319,11 +326,13 @@ func (o *PcloudV2PvminstancesVolumesPostForbidden) Code() int { } func (o *PcloudV2PvminstancesVolumesPostForbidden) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesPostForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesPostForbidden %+v", 403, o.Payload) + 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 { @@ -387,11 +396,13 @@ func (o *PcloudV2PvminstancesVolumesPostNotFound) Code() int { } func (o *PcloudV2PvminstancesVolumesPostNotFound) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesPostNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesPostNotFound %+v", 404, o.Payload) + 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 { @@ -455,11 +466,13 @@ func (o *PcloudV2PvminstancesVolumesPostConflict) Code() int { } func (o *PcloudV2PvminstancesVolumesPostConflict) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesPostConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesPostConflict %+v", 409, o.Payload) + 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 { @@ -523,11 +536,13 @@ func (o *PcloudV2PvminstancesVolumesPostInternalServerError) Code() int { } func (o *PcloudV2PvminstancesVolumesPostInternalServerError) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesPostInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/volumes][%d] pcloudV2PvminstancesVolumesPostInternalServerError %+v", 500, o.Payload) + 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 { 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 index 3fe2f5ec..c5622485 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_volumes // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudV2VolumesClonePostAccepted) Code() int { } func (o *PcloudV2VolumesClonePostAccepted) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudV2VolumesClonePostAccepted %+v", 202, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudV2VolumesClonePostAccepted %+v", 202, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudV2VolumesClonePostBadRequest) Code() int { } func (o *PcloudV2VolumesClonePostBadRequest) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudV2VolumesClonePostBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudV2VolumesClonePostBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudV2VolumesClonePostUnauthorized) Code() int { } func (o *PcloudV2VolumesClonePostUnauthorized) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudV2VolumesClonePostUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudV2VolumesClonePostUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudV2VolumesClonePostForbidden) Code() int { } func (o *PcloudV2VolumesClonePostForbidden) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudV2VolumesClonePostForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudV2VolumesClonePostForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudV2VolumesClonePostNotFound) Code() int { } func (o *PcloudV2VolumesClonePostNotFound) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudV2VolumesClonePostNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudV2VolumesClonePostNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudV2VolumesClonePostInternalServerError) Code() int { } func (o *PcloudV2VolumesClonePostInternalServerError) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudV2VolumesClonePostInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudV2VolumesClonePostInternalServerError %+v", 500, o.Payload) + 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 { 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 index 3f308b61..1efc53ca 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_volumes // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudV2VolumesClonetasksGetOK) Code() int { } func (o *PcloudV2VolumesClonetasksGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone-tasks/{clone_task_id}][%d] pcloudV2VolumesClonetasksGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone-tasks/{clone_task_id}][%d] pcloudV2VolumesClonetasksGetOK %+v", 200, o.Payload) + 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 { @@ -183,11 +186,13 @@ func (o *PcloudV2VolumesClonetasksGetBadRequest) Code() int { } func (o *PcloudV2VolumesClonetasksGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone-tasks/{clone_task_id}][%d] pcloudV2VolumesClonetasksGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone-tasks/{clone_task_id}][%d] pcloudV2VolumesClonetasksGetBadRequest %+v", 400, o.Payload) + 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 { @@ -251,11 +256,13 @@ func (o *PcloudV2VolumesClonetasksGetUnauthorized) Code() int { } func (o *PcloudV2VolumesClonetasksGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone-tasks/{clone_task_id}][%d] pcloudV2VolumesClonetasksGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone-tasks/{clone_task_id}][%d] pcloudV2VolumesClonetasksGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -319,11 +326,13 @@ func (o *PcloudV2VolumesClonetasksGetForbidden) Code() int { } func (o *PcloudV2VolumesClonetasksGetForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone-tasks/{clone_task_id}][%d] pcloudV2VolumesClonetasksGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone-tasks/{clone_task_id}][%d] pcloudV2VolumesClonetasksGetForbidden %+v", 403, o.Payload) + 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 { @@ -387,11 +396,13 @@ func (o *PcloudV2VolumesClonetasksGetNotFound) Code() int { } func (o *PcloudV2VolumesClonetasksGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone-tasks/{clone_task_id}][%d] pcloudV2VolumesClonetasksGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone-tasks/{clone_task_id}][%d] pcloudV2VolumesClonetasksGetNotFound %+v", 404, o.Payload) + 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 { @@ -455,11 +466,13 @@ func (o *PcloudV2VolumesClonetasksGetConflict) Code() int { } func (o *PcloudV2VolumesClonetasksGetConflict) Error() string { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone-tasks/{clone_task_id}][%d] pcloudV2VolumesClonetasksGetConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone-tasks/{clone_task_id}][%d] pcloudV2VolumesClonetasksGetConflict %+v", 409, o.Payload) + 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 { @@ -523,11 +536,13 @@ func (o *PcloudV2VolumesClonetasksGetInternalServerError) Code() int { } func (o *PcloudV2VolumesClonetasksGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone-tasks/{clone_task_id}][%d] pcloudV2VolumesClonetasksGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes/clone-tasks/{clone_task_id}][%d] pcloudV2VolumesClonetasksGetInternalServerError %+v", 500, o.Payload) + 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 { 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 index 927d2514..822c9e95 100644 --- a/power/client/p_cloud_volumes/pcloud_v2_volumes_delete_responses.go +++ b/power/client/p_cloud_volumes/pcloud_v2_volumes_delete_responses.go @@ -6,6 +6,7 @@ package p_cloud_volumes // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -121,11 +122,13 @@ func (o *PcloudV2VolumesDeleteAccepted) Code() int { } func (o *PcloudV2VolumesDeleteAccepted) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesDeleteAccepted %+v", 202, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesDeleteAccepted %+v", 202, o.Payload) + 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 { @@ -189,11 +192,13 @@ func (o *PcloudV2VolumesDeletePartialContent) Code() int { } func (o *PcloudV2VolumesDeletePartialContent) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesDeletePartialContent %+v", 206, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesDeletePartialContent %+v", 206, o.Payload) + 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 { @@ -257,11 +262,13 @@ func (o *PcloudV2VolumesDeleteBadRequest) Code() int { } func (o *PcloudV2VolumesDeleteBadRequest) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesDeleteBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesDeleteBadRequest %+v", 400, o.Payload) + 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 { @@ -325,11 +332,13 @@ func (o *PcloudV2VolumesDeleteUnauthorized) Code() int { } func (o *PcloudV2VolumesDeleteUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesDeleteUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesDeleteUnauthorized %+v", 401, o.Payload) + 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 { @@ -393,11 +402,13 @@ func (o *PcloudV2VolumesDeleteNotFound) Code() int { } func (o *PcloudV2VolumesDeleteNotFound) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesDeleteNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesDeleteNotFound %+v", 404, o.Payload) + 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 { @@ -461,11 +472,13 @@ func (o *PcloudV2VolumesDeleteRequestTimeout) Code() int { } func (o *PcloudV2VolumesDeleteRequestTimeout) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesDeleteRequestTimeout %+v", 408, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesDeleteRequestTimeout %+v", 408, o.Payload) + 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 { @@ -529,11 +542,13 @@ func (o *PcloudV2VolumesDeleteTooManyRequests) Code() int { } func (o *PcloudV2VolumesDeleteTooManyRequests) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesDeleteTooManyRequests %+v", 429, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesDeleteTooManyRequests %+v", 429, o.Payload) + 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 { @@ -597,11 +612,13 @@ func (o *PcloudV2VolumesDeleteInternalServerError) Code() int { } func (o *PcloudV2VolumesDeleteInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesDeleteInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesDeleteInternalServerError %+v", 500, o.Payload) + 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 { 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 index 55821f6b..6febceb2 100644 --- a/power/client/p_cloud_volumes/pcloud_v2_volumes_post_responses.go +++ b/power/client/p_cloud_volumes/pcloud_v2_volumes_post_responses.go @@ -6,6 +6,7 @@ package p_cloud_volumes // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -121,11 +122,13 @@ func (o *PcloudV2VolumesPostCreated) Code() int { } func (o *PcloudV2VolumesPostCreated) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesPostCreated %+v", 201, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesPostCreated %+v", 201, o.Payload) + 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 { @@ -189,11 +192,13 @@ func (o *PcloudV2VolumesPostBadRequest) Code() int { } func (o *PcloudV2VolumesPostBadRequest) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesPostBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesPostBadRequest %+v", 400, o.Payload) + 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 { @@ -257,11 +262,13 @@ func (o *PcloudV2VolumesPostUnauthorized) Code() int { } func (o *PcloudV2VolumesPostUnauthorized) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesPostUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesPostUnauthorized %+v", 401, o.Payload) + 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 { @@ -325,11 +332,13 @@ func (o *PcloudV2VolumesPostForbidden) Code() int { } func (o *PcloudV2VolumesPostForbidden) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesPostForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesPostForbidden %+v", 403, o.Payload) + 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 { @@ -393,11 +402,13 @@ func (o *PcloudV2VolumesPostNotFound) Code() int { } func (o *PcloudV2VolumesPostNotFound) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesPostNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesPostNotFound %+v", 404, o.Payload) + 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 { @@ -461,11 +472,13 @@ func (o *PcloudV2VolumesPostConflict) Code() int { } func (o *PcloudV2VolumesPostConflict) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesPostConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesPostConflict %+v", 409, o.Payload) + 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 { @@ -529,11 +542,13 @@ func (o *PcloudV2VolumesPostUnprocessableEntity) Code() int { } func (o *PcloudV2VolumesPostUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesPostUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesPostUnprocessableEntity %+v", 422, o.Payload) + 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 { @@ -597,11 +612,13 @@ func (o *PcloudV2VolumesPostInternalServerError) Code() int { } func (o *PcloudV2VolumesPostInternalServerError) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesPostInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes][%d] pcloudV2VolumesPostInternalServerError %+v", 500, o.Payload) + 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 { 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 index f02784f0..0ed0b806 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_volumes // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudV2VolumescloneCancelPostAccepted) Code() int { } func (o *PcloudV2VolumescloneCancelPostAccepted) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/cancel][%d] pcloudV2VolumescloneCancelPostAccepted %+v", 202, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/cancel][%d] pcloudV2VolumescloneCancelPostAccepted %+v", 202, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudV2VolumescloneCancelPostBadRequest) Code() int { } func (o *PcloudV2VolumescloneCancelPostBadRequest) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/cancel][%d] pcloudV2VolumescloneCancelPostBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/cancel][%d] pcloudV2VolumescloneCancelPostBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudV2VolumescloneCancelPostUnauthorized) Code() int { } func (o *PcloudV2VolumescloneCancelPostUnauthorized) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/cancel][%d] pcloudV2VolumescloneCancelPostUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/cancel][%d] pcloudV2VolumescloneCancelPostUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudV2VolumescloneCancelPostForbidden) Code() int { } func (o *PcloudV2VolumescloneCancelPostForbidden) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/cancel][%d] pcloudV2VolumescloneCancelPostForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/cancel][%d] pcloudV2VolumescloneCancelPostForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudV2VolumescloneCancelPostNotFound) Code() int { } func (o *PcloudV2VolumescloneCancelPostNotFound) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/cancel][%d] pcloudV2VolumescloneCancelPostNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/cancel][%d] pcloudV2VolumescloneCancelPostNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudV2VolumescloneCancelPostInternalServerError) Code() int { } func (o *PcloudV2VolumescloneCancelPostInternalServerError) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/cancel][%d] pcloudV2VolumescloneCancelPostInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/cancel][%d] pcloudV2VolumescloneCancelPostInternalServerError %+v", 500, o.Payload) + 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 { 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 index 70e6f6ce..b5ca513a 100644 --- a/power/client/p_cloud_volumes/pcloud_v2_volumesclone_delete_responses.go +++ b/power/client/p_cloud_volumes/pcloud_v2_volumesclone_delete_responses.go @@ -6,6 +6,7 @@ package p_cloud_volumes // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudV2VolumescloneDeleteOK) Code() int { } func (o *PcloudV2VolumescloneDeleteOK) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneDeleteOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneDeleteOK %+v", 200, o.Payload) + 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 { @@ -175,11 +178,13 @@ func (o *PcloudV2VolumescloneDeleteBadRequest) Code() int { } func (o *PcloudV2VolumescloneDeleteBadRequest) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneDeleteBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneDeleteBadRequest %+v", 400, o.Payload) + 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 { @@ -243,11 +248,13 @@ func (o *PcloudV2VolumescloneDeleteUnauthorized) Code() int { } func (o *PcloudV2VolumescloneDeleteUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneDeleteUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneDeleteUnauthorized %+v", 401, o.Payload) + 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 { @@ -311,11 +318,13 @@ func (o *PcloudV2VolumescloneDeleteForbidden) Code() int { } func (o *PcloudV2VolumescloneDeleteForbidden) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneDeleteForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneDeleteForbidden %+v", 403, o.Payload) + 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 { @@ -379,11 +388,13 @@ func (o *PcloudV2VolumescloneDeleteNotFound) Code() int { } func (o *PcloudV2VolumescloneDeleteNotFound) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneDeleteNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneDeleteNotFound %+v", 404, o.Payload) + 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 { @@ -447,11 +458,13 @@ func (o *PcloudV2VolumescloneDeleteInternalServerError) Code() int { } func (o *PcloudV2VolumescloneDeleteInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneDeleteInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneDeleteInternalServerError %+v", 500, o.Payload) + 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 { 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 index 388a45b4..0d09798c 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_volumes // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudV2VolumescloneExecutePostAccepted) Code() int { } func (o *PcloudV2VolumescloneExecutePostAccepted) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/execute][%d] pcloudV2VolumescloneExecutePostAccepted %+v", 202, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/execute][%d] pcloudV2VolumescloneExecutePostAccepted %+v", 202, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudV2VolumescloneExecutePostBadRequest) Code() int { } func (o *PcloudV2VolumescloneExecutePostBadRequest) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/execute][%d] pcloudV2VolumescloneExecutePostBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/execute][%d] pcloudV2VolumescloneExecutePostBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudV2VolumescloneExecutePostUnauthorized) Code() int { } func (o *PcloudV2VolumescloneExecutePostUnauthorized) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/execute][%d] pcloudV2VolumescloneExecutePostUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/execute][%d] pcloudV2VolumescloneExecutePostUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudV2VolumescloneExecutePostForbidden) Code() int { } func (o *PcloudV2VolumescloneExecutePostForbidden) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/execute][%d] pcloudV2VolumescloneExecutePostForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/execute][%d] pcloudV2VolumescloneExecutePostForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudV2VolumescloneExecutePostNotFound) Code() int { } func (o *PcloudV2VolumescloneExecutePostNotFound) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/execute][%d] pcloudV2VolumescloneExecutePostNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/execute][%d] pcloudV2VolumescloneExecutePostNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudV2VolumescloneExecutePostInternalServerError) Code() int { } func (o *PcloudV2VolumescloneExecutePostInternalServerError) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/execute][%d] pcloudV2VolumescloneExecutePostInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/execute][%d] pcloudV2VolumescloneExecutePostInternalServerError %+v", 500, o.Payload) + 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 { 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 index fc4d2559..04f093c8 100644 --- a/power/client/p_cloud_volumes/pcloud_v2_volumesclone_get_responses.go +++ b/power/client/p_cloud_volumes/pcloud_v2_volumesclone_get_responses.go @@ -6,6 +6,7 @@ package p_cloud_volumes // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudV2VolumescloneGetOK) Code() int { } func (o *PcloudV2VolumescloneGetOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneGetOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudV2VolumescloneGetBadRequest) Code() int { } func (o *PcloudV2VolumescloneGetBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneGetBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudV2VolumescloneGetUnauthorized) Code() int { } func (o *PcloudV2VolumescloneGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudV2VolumescloneGetForbidden) Code() int { } func (o *PcloudV2VolumescloneGetForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneGetForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudV2VolumescloneGetNotFound) Code() int { } func (o *PcloudV2VolumescloneGetNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneGetNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudV2VolumescloneGetInternalServerError) Code() int { } func (o *PcloudV2VolumescloneGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneGetInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}][%d] pcloudV2VolumescloneGetInternalServerError %+v", 500, o.Payload) + 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 { 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 index 95d3652e..a7317a2a 100644 --- a/power/client/p_cloud_volumes/pcloud_v2_volumesclone_getall_responses.go +++ b/power/client/p_cloud_volumes/pcloud_v2_volumesclone_getall_responses.go @@ -6,6 +6,7 @@ package p_cloud_volumes // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudV2VolumescloneGetallOK) Code() int { } func (o *PcloudV2VolumescloneGetallOK) Error() string { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumescloneGetallOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumescloneGetallOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudV2VolumescloneGetallBadRequest) Code() int { } func (o *PcloudV2VolumescloneGetallBadRequest) Error() string { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumescloneGetallBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumescloneGetallBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudV2VolumescloneGetallUnauthorized) Code() int { } func (o *PcloudV2VolumescloneGetallUnauthorized) Error() string { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumescloneGetallUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumescloneGetallUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudV2VolumescloneGetallForbidden) Code() int { } func (o *PcloudV2VolumescloneGetallForbidden) Error() string { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumescloneGetallForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumescloneGetallForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudV2VolumescloneGetallNotFound) Code() int { } func (o *PcloudV2VolumescloneGetallNotFound) Error() string { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumescloneGetallNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumescloneGetallNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudV2VolumescloneGetallInternalServerError) Code() int { } func (o *PcloudV2VolumescloneGetallInternalServerError) Error() string { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumescloneGetallInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[GET /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumescloneGetallInternalServerError %+v", 500, o.Payload) + 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 { 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 index 396cbfce..b467ebda 100644 --- a/power/client/p_cloud_volumes/pcloud_v2_volumesclone_post_responses.go +++ b/power/client/p_cloud_volumes/pcloud_v2_volumesclone_post_responses.go @@ -6,6 +6,7 @@ package p_cloud_volumes // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudV2VolumesclonePostAccepted) Code() int { } func (o *PcloudV2VolumesclonePostAccepted) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumesclonePostAccepted %+v", 202, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumesclonePostAccepted %+v", 202, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudV2VolumesclonePostBadRequest) Code() int { } func (o *PcloudV2VolumesclonePostBadRequest) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumesclonePostBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumesclonePostBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudV2VolumesclonePostUnauthorized) Code() int { } func (o *PcloudV2VolumesclonePostUnauthorized) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumesclonePostUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumesclonePostUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudV2VolumesclonePostForbidden) Code() int { } func (o *PcloudV2VolumesclonePostForbidden) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumesclonePostForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumesclonePostForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudV2VolumesclonePostNotFound) Code() int { } func (o *PcloudV2VolumesclonePostNotFound) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumesclonePostNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumesclonePostNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudV2VolumesclonePostInternalServerError) Code() int { } func (o *PcloudV2VolumesclonePostInternalServerError) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumesclonePostInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone][%d] pcloudV2VolumesclonePostInternalServerError %+v", 500, o.Payload) + 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 { 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 index 2c48aa39..1af5ddc5 100644 --- 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 @@ -6,6 +6,7 @@ package p_cloud_volumes // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *PcloudV2VolumescloneStartPostOK) Code() int { } func (o *PcloudV2VolumescloneStartPostOK) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/start][%d] pcloudV2VolumescloneStartPostOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/start][%d] pcloudV2VolumescloneStartPostOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *PcloudV2VolumescloneStartPostBadRequest) Code() int { } func (o *PcloudV2VolumescloneStartPostBadRequest) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/start][%d] pcloudV2VolumescloneStartPostBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/start][%d] pcloudV2VolumescloneStartPostBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *PcloudV2VolumescloneStartPostUnauthorized) Code() int { } func (o *PcloudV2VolumescloneStartPostUnauthorized) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/start][%d] pcloudV2VolumescloneStartPostUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/start][%d] pcloudV2VolumescloneStartPostUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *PcloudV2VolumescloneStartPostForbidden) Code() int { } func (o *PcloudV2VolumescloneStartPostForbidden) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/start][%d] pcloudV2VolumescloneStartPostForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/start][%d] pcloudV2VolumescloneStartPostForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *PcloudV2VolumescloneStartPostNotFound) Code() int { } func (o *PcloudV2VolumescloneStartPostNotFound) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/start][%d] pcloudV2VolumescloneStartPostNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/start][%d] pcloudV2VolumescloneStartPostNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *PcloudV2VolumescloneStartPostInternalServerError) Code() int { } func (o *PcloudV2VolumescloneStartPostInternalServerError) Error() string { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/start][%d] pcloudV2VolumescloneStartPostInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v2/cloud-instances/{cloud_instance_id}/volumes-clone/{volumes_clone_id}/start][%d] pcloudV2VolumescloneStartPostInternalServerError %+v", 500, o.Payload) + 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 { 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 index 212814d9..bb5b118c 100644 --- a/power/client/p_cloud_volumes/pcloud_volumes_clone_post_responses.go +++ b/power/client/p_cloud_volumes/pcloud_volumes_clone_post_responses.go @@ -6,6 +6,7 @@ package p_cloud_volumes // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *PcloudVolumesClonePostOK) Code() int { } func (o *PcloudVolumesClonePostOK) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudVolumesClonePostOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudVolumesClonePostOK %+v", 200, o.Payload) + 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 { @@ -183,11 +186,13 @@ func (o *PcloudVolumesClonePostBadRequest) Code() int { } func (o *PcloudVolumesClonePostBadRequest) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudVolumesClonePostBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudVolumesClonePostBadRequest %+v", 400, o.Payload) + 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 { @@ -251,11 +256,13 @@ func (o *PcloudVolumesClonePostUnauthorized) Code() int { } func (o *PcloudVolumesClonePostUnauthorized) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudVolumesClonePostUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudVolumesClonePostUnauthorized %+v", 401, o.Payload) + 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 { @@ -319,11 +326,13 @@ func (o *PcloudVolumesClonePostForbidden) Code() int { } func (o *PcloudVolumesClonePostForbidden) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudVolumesClonePostForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudVolumesClonePostForbidden %+v", 403, o.Payload) + 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 { @@ -387,11 +396,13 @@ func (o *PcloudVolumesClonePostNotFound) Code() int { } func (o *PcloudVolumesClonePostNotFound) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudVolumesClonePostNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudVolumesClonePostNotFound %+v", 404, o.Payload) + 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 { @@ -455,11 +466,13 @@ func (o *PcloudVolumesClonePostConflict) Code() int { } func (o *PcloudVolumesClonePostConflict) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudVolumesClonePostConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudVolumesClonePostConflict %+v", 409, o.Payload) + 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 { @@ -523,11 +536,13 @@ func (o *PcloudVolumesClonePostInternalServerError) Code() int { } func (o *PcloudVolumesClonePostInternalServerError) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudVolumesClonePostInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volumes/clone][%d] pcloudVolumesClonePostInternalServerError %+v", 500, o.Payload) + 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 { diff --git a/power/client/power_edge_router/power_edge_router_client.go b/power/client/power_edge_router/power_edge_router_client.go index 6102abdf..67f3b9c7 100644 --- a/power/client/power_edge_router/power_edge_router_client.go +++ b/power/client/power_edge_router/power_edge_router_client.go @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi 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 */ @@ -25,7 +51,7 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods 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 index 8dfd54fb..625910f4 100644 --- a/power/client/power_edge_router/v1_poweredgerouter_action_post_responses.go +++ b/power/client/power_edge_router/v1_poweredgerouter_action_post_responses.go @@ -6,6 +6,7 @@ package power_edge_router // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *V1PoweredgerouterActionPostOK) Code() int { } func (o *V1PoweredgerouterActionPostOK) Error() string { - return fmt.Sprintf("[POST /v1/workspaces/{workspace_id}/power-edge-router/action][%d] v1PoweredgerouterActionPostOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[POST /v1/workspaces/{workspace_id}/power-edge-router/action][%d] v1PoweredgerouterActionPostOK %+v", 200, o.Payload) + 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 { @@ -181,11 +184,13 @@ func (o *V1PoweredgerouterActionPostBadRequest) Code() int { } func (o *V1PoweredgerouterActionPostBadRequest) Error() string { - return fmt.Sprintf("[POST /v1/workspaces/{workspace_id}/power-edge-router/action][%d] v1PoweredgerouterActionPostBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[POST /v1/workspaces/{workspace_id}/power-edge-router/action][%d] v1PoweredgerouterActionPostBadRequest %+v", 400, o.Payload) + 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 { @@ -249,11 +254,13 @@ func (o *V1PoweredgerouterActionPostUnauthorized) Code() int { } func (o *V1PoweredgerouterActionPostUnauthorized) Error() string { - return fmt.Sprintf("[POST /v1/workspaces/{workspace_id}/power-edge-router/action][%d] v1PoweredgerouterActionPostUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[POST /v1/workspaces/{workspace_id}/power-edge-router/action][%d] v1PoweredgerouterActionPostUnauthorized %+v", 401, o.Payload) + 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 { @@ -317,11 +324,13 @@ func (o *V1PoweredgerouterActionPostForbidden) Code() int { } func (o *V1PoweredgerouterActionPostForbidden) Error() string { - return fmt.Sprintf("[POST /v1/workspaces/{workspace_id}/power-edge-router/action][%d] v1PoweredgerouterActionPostForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[POST /v1/workspaces/{workspace_id}/power-edge-router/action][%d] v1PoweredgerouterActionPostForbidden %+v", 403, o.Payload) + 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 { @@ -385,11 +394,13 @@ func (o *V1PoweredgerouterActionPostNotFound) Code() int { } func (o *V1PoweredgerouterActionPostNotFound) Error() string { - return fmt.Sprintf("[POST /v1/workspaces/{workspace_id}/power-edge-router/action][%d] v1PoweredgerouterActionPostNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[POST /v1/workspaces/{workspace_id}/power-edge-router/action][%d] v1PoweredgerouterActionPostNotFound %+v", 404, o.Payload) + 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 { @@ -453,11 +464,13 @@ func (o *V1PoweredgerouterActionPostConflict) Code() int { } func (o *V1PoweredgerouterActionPostConflict) Error() string { - return fmt.Sprintf("[POST /v1/workspaces/{workspace_id}/power-edge-router/action][%d] v1PoweredgerouterActionPostConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[POST /v1/workspaces/{workspace_id}/power-edge-router/action][%d] v1PoweredgerouterActionPostConflict %+v", 409, o.Payload) + 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 { @@ -521,11 +534,13 @@ func (o *V1PoweredgerouterActionPostInternalServerError) Code() int { } func (o *V1PoweredgerouterActionPostInternalServerError) Error() string { - return fmt.Sprintf("[POST /v1/workspaces/{workspace_id}/power-edge-router/action][%d] v1PoweredgerouterActionPostInternalServerError %+v", 500, o.Payload) + 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 { - return fmt.Sprintf("[POST /v1/workspaces/{workspace_id}/power-edge-router/action][%d] v1PoweredgerouterActionPostInternalServerError %+v", 500, o.Payload) + 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 { diff --git a/power/client/service_bindings/service_binding_binding_responses.go b/power/client/service_bindings/service_binding_binding_responses.go index 2c32202d..6bd01f3c 100644 --- a/power/client/service_bindings/service_binding_binding_responses.go +++ b/power/client/service_bindings/service_binding_binding_responses.go @@ -6,6 +6,7 @@ package service_bindings // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -127,11 +128,13 @@ func (o *ServiceBindingBindingOK) Code() int { } func (o *ServiceBindingBindingOK) Error() string { - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingBindingOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingBindingOK %+v", 200, o.Payload) + 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 { @@ -195,11 +198,13 @@ func (o *ServiceBindingBindingCreated) Code() int { } func (o *ServiceBindingBindingCreated) Error() string { - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingBindingCreated %+v", 201, o.Payload) + 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 { - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingBindingCreated %+v", 201, o.Payload) + 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 { @@ -263,11 +268,13 @@ func (o *ServiceBindingBindingAccepted) Code() int { } func (o *ServiceBindingBindingAccepted) Error() string { - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingBindingAccepted %+v", 202, o.Payload) + 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 { - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingBindingAccepted %+v", 202, o.Payload) + 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 { @@ -331,11 +338,13 @@ func (o *ServiceBindingBindingBadRequest) Code() int { } func (o *ServiceBindingBindingBadRequest) Error() string { - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingBindingBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingBindingBadRequest %+v", 400, o.Payload) + 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 { @@ -399,11 +408,13 @@ func (o *ServiceBindingBindingUnauthorized) Code() int { } func (o *ServiceBindingBindingUnauthorized) Error() string { - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingBindingUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingBindingUnauthorized %+v", 401, o.Payload) + 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 { @@ -467,11 +478,13 @@ func (o *ServiceBindingBindingForbidden) Code() int { } func (o *ServiceBindingBindingForbidden) Error() string { - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingBindingForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingBindingForbidden %+v", 403, o.Payload) + 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 { @@ -535,11 +548,13 @@ func (o *ServiceBindingBindingNotFound) Code() int { } func (o *ServiceBindingBindingNotFound) Error() string { - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingBindingNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingBindingNotFound %+v", 404, o.Payload) + 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 { @@ -603,11 +618,13 @@ func (o *ServiceBindingBindingConflict) Code() int { } func (o *ServiceBindingBindingConflict) Error() string { - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingBindingConflict %+v", 409, o.Payload) + 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 { - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingBindingConflict %+v", 409, o.Payload) + 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 { @@ -671,11 +688,13 @@ func (o *ServiceBindingBindingUnprocessableEntity) Code() int { } func (o *ServiceBindingBindingUnprocessableEntity) Error() string { - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingBindingUnprocessableEntity %+v", 422, o.Payload) + 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 { - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingBindingUnprocessableEntity %+v", 422, o.Payload) + 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 { diff --git a/power/client/service_bindings/service_binding_get_responses.go b/power/client/service_bindings/service_binding_get_responses.go index 3701f13c..740dc496 100644 --- a/power/client/service_bindings/service_binding_get_responses.go +++ b/power/client/service_bindings/service_binding_get_responses.go @@ -6,6 +6,7 @@ package service_bindings // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -103,11 +104,13 @@ func (o *ServiceBindingGetOK) Code() int { } func (o *ServiceBindingGetOK) Error() string { - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingGetOK %+v", 200, o.Payload) + 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 { @@ -171,11 +174,13 @@ func (o *ServiceBindingGetBadRequest) Code() int { } func (o *ServiceBindingGetBadRequest) Error() string { - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingGetBadRequest %+v", 400, o.Payload) + 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 { @@ -239,11 +244,13 @@ func (o *ServiceBindingGetUnauthorized) Code() int { } func (o *ServiceBindingGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -307,11 +314,13 @@ func (o *ServiceBindingGetForbidden) Code() int { } func (o *ServiceBindingGetForbidden) Error() string { - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingGetForbidden %+v", 403, o.Payload) + 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 { @@ -375,11 +384,13 @@ func (o *ServiceBindingGetNotFound) Code() int { } func (o *ServiceBindingGetNotFound) Error() string { - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingGetNotFound %+v", 404, o.Payload) + 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 { 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 index 00066825..9f0824ba 100644 --- a/power/client/service_bindings/service_binding_last_operation_get_responses.go +++ b/power/client/service_bindings/service_binding_last_operation_get_responses.go @@ -6,6 +6,7 @@ package service_bindings // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *ServiceBindingLastOperationGetOK) Code() int { } func (o *ServiceBindingLastOperationGetOK) Error() string { - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}/last_operation][%d] serviceBindingLastOperationGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}/last_operation][%d] serviceBindingLastOperationGetOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *ServiceBindingLastOperationGetBadRequest) Code() int { } func (o *ServiceBindingLastOperationGetBadRequest) Error() string { - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}/last_operation][%d] serviceBindingLastOperationGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}/last_operation][%d] serviceBindingLastOperationGetBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *ServiceBindingLastOperationGetUnauthorized) Code() int { } func (o *ServiceBindingLastOperationGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}/last_operation][%d] serviceBindingLastOperationGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}/last_operation][%d] serviceBindingLastOperationGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *ServiceBindingLastOperationGetForbidden) Code() int { } func (o *ServiceBindingLastOperationGetForbidden) Error() string { - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}/last_operation][%d] serviceBindingLastOperationGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}/last_operation][%d] serviceBindingLastOperationGetForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *ServiceBindingLastOperationGetNotFound) Code() int { } func (o *ServiceBindingLastOperationGetNotFound) Error() string { - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}/last_operation][%d] serviceBindingLastOperationGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}/last_operation][%d] serviceBindingLastOperationGetNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *ServiceBindingLastOperationGetGone) Code() int { } func (o *ServiceBindingLastOperationGetGone) Error() string { - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}/last_operation][%d] serviceBindingLastOperationGetGone %+v", 410, o.Payload) + 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 { - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}/last_operation][%d] serviceBindingLastOperationGetGone %+v", 410, o.Payload) + 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 { diff --git a/power/client/service_bindings/service_binding_unbinding_responses.go b/power/client/service_bindings/service_binding_unbinding_responses.go index 6f1cb703..2fdaa4f6 100644 --- a/power/client/service_bindings/service_binding_unbinding_responses.go +++ b/power/client/service_bindings/service_binding_unbinding_responses.go @@ -6,6 +6,7 @@ package service_bindings // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *ServiceBindingUnbindingOK) Code() int { } func (o *ServiceBindingUnbindingOK) Error() string { - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingUnbindingOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingUnbindingOK %+v", 200, o.Payload) + 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 { @@ -181,11 +184,13 @@ func (o *ServiceBindingUnbindingAccepted) Code() int { } func (o *ServiceBindingUnbindingAccepted) Error() string { - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingUnbindingAccepted %+v", 202, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingUnbindingAccepted %+v", 202, o.Payload) + 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 { @@ -249,11 +254,13 @@ func (o *ServiceBindingUnbindingBadRequest) Code() int { } func (o *ServiceBindingUnbindingBadRequest) Error() string { - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingUnbindingBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingUnbindingBadRequest %+v", 400, o.Payload) + 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 { @@ -317,11 +324,13 @@ func (o *ServiceBindingUnbindingUnauthorized) Code() int { } func (o *ServiceBindingUnbindingUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingUnbindingUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingUnbindingUnauthorized %+v", 401, o.Payload) + 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 { @@ -385,11 +394,13 @@ func (o *ServiceBindingUnbindingForbidden) Code() int { } func (o *ServiceBindingUnbindingForbidden) Error() string { - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingUnbindingForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingUnbindingForbidden %+v", 403, o.Payload) + 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 { @@ -453,11 +464,13 @@ func (o *ServiceBindingUnbindingNotFound) Code() int { } func (o *ServiceBindingUnbindingNotFound) Error() string { - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingUnbindingNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingUnbindingNotFound %+v", 404, o.Payload) + 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 { @@ -521,11 +534,13 @@ func (o *ServiceBindingUnbindingGone) Code() int { } func (o *ServiceBindingUnbindingGone) Error() string { - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingUnbindingGone %+v", 410, o.Payload) + 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 { - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}/service_bindings/{binding_id}][%d] serviceBindingUnbindingGone %+v", 410, o.Payload) + 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 { diff --git a/power/client/service_bindings/service_bindings_client.go b/power/client/service_bindings/service_bindings_client.go index 73c69f53..7eb11603 100644 --- a/power/client/service_bindings/service_bindings_client.go +++ b/power/client/service_bindings/service_bindings_client.go @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi 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 */ @@ -25,7 +51,7 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods diff --git a/power/client/service_instances/service_instance_deprovision_responses.go b/power/client/service_instances/service_instance_deprovision_responses.go index 9c2251ee..83b0ddd2 100644 --- a/power/client/service_instances/service_instance_deprovision_responses.go +++ b/power/client/service_instances/service_instance_deprovision_responses.go @@ -6,6 +6,7 @@ package service_instances // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -121,11 +122,13 @@ func (o *ServiceInstanceDeprovisionOK) Code() int { } func (o *ServiceInstanceDeprovisionOK) Error() string { - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionOK %s", 200, payload) } func (o *ServiceInstanceDeprovisionOK) String() string { - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionOK %+v", 200, o.Payload) + 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 { @@ -187,11 +190,13 @@ func (o *ServiceInstanceDeprovisionAccepted) Code() int { } func (o *ServiceInstanceDeprovisionAccepted) Error() string { - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionAccepted %+v", 202, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionAccepted %s", 202, payload) } func (o *ServiceInstanceDeprovisionAccepted) String() string { - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionAccepted %+v", 202, o.Payload) + 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 { @@ -255,11 +260,13 @@ func (o *ServiceInstanceDeprovisionBadRequest) Code() int { } func (o *ServiceInstanceDeprovisionBadRequest) Error() string { - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionBadRequest %s", 400, payload) } func (o *ServiceInstanceDeprovisionBadRequest) String() string { - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionBadRequest %+v", 400, o.Payload) + 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 { @@ -323,11 +330,13 @@ func (o *ServiceInstanceDeprovisionUnauthorized) Code() int { } func (o *ServiceInstanceDeprovisionUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionUnauthorized %s", 401, payload) } func (o *ServiceInstanceDeprovisionUnauthorized) String() string { - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionUnauthorized %+v", 401, o.Payload) + 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 { @@ -391,11 +400,13 @@ func (o *ServiceInstanceDeprovisionForbidden) Code() int { } func (o *ServiceInstanceDeprovisionForbidden) Error() string { - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionForbidden %s", 403, payload) } func (o *ServiceInstanceDeprovisionForbidden) String() string { - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionForbidden %+v", 403, o.Payload) + 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 { @@ -459,11 +470,13 @@ func (o *ServiceInstanceDeprovisionNotFound) Code() int { } func (o *ServiceInstanceDeprovisionNotFound) Error() string { - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionNotFound %s", 404, payload) } func (o *ServiceInstanceDeprovisionNotFound) String() string { - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionNotFound %+v", 404, o.Payload) + 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 { @@ -527,11 +540,13 @@ func (o *ServiceInstanceDeprovisionGone) Code() int { } func (o *ServiceInstanceDeprovisionGone) Error() string { - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionGone %+v", 410, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionGone %s", 410, payload) } func (o *ServiceInstanceDeprovisionGone) String() string { - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionGone %+v", 410, o.Payload) + 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 { @@ -595,11 +610,13 @@ func (o *ServiceInstanceDeprovisionUnprocessableEntity) Code() int { } func (o *ServiceInstanceDeprovisionUnprocessableEntity) Error() string { - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionUnprocessableEntity %+v", 422, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionUnprocessableEntity %s", 422, payload) } func (o *ServiceInstanceDeprovisionUnprocessableEntity) String() string { - return fmt.Sprintf("[DELETE /v2/service_instances/{instance_id}][%d] serviceInstanceDeprovisionUnprocessableEntity %+v", 422, o.Payload) + 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 { diff --git a/power/client/service_instances/service_instance_get_responses.go b/power/client/service_instances/service_instance_get_responses.go index f80a178f..d94ed17c 100644 --- a/power/client/service_instances/service_instance_get_responses.go +++ b/power/client/service_instances/service_instance_get_responses.go @@ -6,6 +6,7 @@ package service_instances // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -103,11 +104,13 @@ func (o *ServiceInstanceGetOK) Code() int { } func (o *ServiceInstanceGetOK) Error() string { - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}][%d] serviceInstanceGetOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v2/service_instances/{instance_id}][%d] serviceInstanceGetOK %s", 200, payload) } func (o *ServiceInstanceGetOK) String() string { - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}][%d] serviceInstanceGetOK %+v", 200, o.Payload) + 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 { @@ -171,11 +174,13 @@ func (o *ServiceInstanceGetBadRequest) Code() int { } func (o *ServiceInstanceGetBadRequest) Error() string { - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}][%d] serviceInstanceGetBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v2/service_instances/{instance_id}][%d] serviceInstanceGetBadRequest %s", 400, payload) } func (o *ServiceInstanceGetBadRequest) String() string { - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}][%d] serviceInstanceGetBadRequest %+v", 400, o.Payload) + 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 { @@ -239,11 +244,13 @@ func (o *ServiceInstanceGetUnauthorized) Code() int { } func (o *ServiceInstanceGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}][%d] serviceInstanceGetUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v2/service_instances/{instance_id}][%d] serviceInstanceGetUnauthorized %s", 401, payload) } func (o *ServiceInstanceGetUnauthorized) String() string { - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}][%d] serviceInstanceGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -307,11 +314,13 @@ func (o *ServiceInstanceGetForbidden) Code() int { } func (o *ServiceInstanceGetForbidden) Error() string { - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}][%d] serviceInstanceGetForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v2/service_instances/{instance_id}][%d] serviceInstanceGetForbidden %s", 403, payload) } func (o *ServiceInstanceGetForbidden) String() string { - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}][%d] serviceInstanceGetForbidden %+v", 403, o.Payload) + 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 { @@ -375,11 +384,13 @@ func (o *ServiceInstanceGetNotFound) Code() int { } func (o *ServiceInstanceGetNotFound) Error() string { - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}][%d] serviceInstanceGetNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v2/service_instances/{instance_id}][%d] serviceInstanceGetNotFound %s", 404, payload) } func (o *ServiceInstanceGetNotFound) String() string { - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}][%d] serviceInstanceGetNotFound %+v", 404, o.Payload) + 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 { 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 index 866c00b5..e9a10245 100644 --- a/power/client/service_instances/service_instance_last_operation_get_responses.go +++ b/power/client/service_instances/service_instance_last_operation_get_responses.go @@ -6,6 +6,7 @@ package service_instances // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *ServiceInstanceLastOperationGetOK) Code() int { } func (o *ServiceInstanceLastOperationGetOK) Error() string { - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/last_operation][%d] serviceInstanceLastOperationGetOK %+v", 200, o.Payload) + 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 { - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/last_operation][%d] serviceInstanceLastOperationGetOK %+v", 200, o.Payload) + 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 { @@ -177,11 +180,13 @@ func (o *ServiceInstanceLastOperationGetBadRequest) Code() int { } func (o *ServiceInstanceLastOperationGetBadRequest) Error() string { - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/last_operation][%d] serviceInstanceLastOperationGetBadRequest %+v", 400, o.Payload) + 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 { - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/last_operation][%d] serviceInstanceLastOperationGetBadRequest %+v", 400, o.Payload) + 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 { @@ -245,11 +250,13 @@ func (o *ServiceInstanceLastOperationGetUnauthorized) Code() int { } func (o *ServiceInstanceLastOperationGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/last_operation][%d] serviceInstanceLastOperationGetUnauthorized %+v", 401, o.Payload) + 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 { - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/last_operation][%d] serviceInstanceLastOperationGetUnauthorized %+v", 401, o.Payload) + 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 { @@ -313,11 +320,13 @@ func (o *ServiceInstanceLastOperationGetForbidden) Code() int { } func (o *ServiceInstanceLastOperationGetForbidden) Error() string { - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/last_operation][%d] serviceInstanceLastOperationGetForbidden %+v", 403, o.Payload) + 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 { - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/last_operation][%d] serviceInstanceLastOperationGetForbidden %+v", 403, o.Payload) + 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 { @@ -381,11 +390,13 @@ func (o *ServiceInstanceLastOperationGetNotFound) Code() int { } func (o *ServiceInstanceLastOperationGetNotFound) Error() string { - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/last_operation][%d] serviceInstanceLastOperationGetNotFound %+v", 404, o.Payload) + 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 { - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/last_operation][%d] serviceInstanceLastOperationGetNotFound %+v", 404, o.Payload) + 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 { @@ -449,11 +460,13 @@ func (o *ServiceInstanceLastOperationGetGone) Code() int { } func (o *ServiceInstanceLastOperationGetGone) Error() string { - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/last_operation][%d] serviceInstanceLastOperationGetGone %+v", 410, o.Payload) + 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 { - return fmt.Sprintf("[GET /v2/service_instances/{instance_id}/last_operation][%d] serviceInstanceLastOperationGetGone %+v", 410, o.Payload) + 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 { diff --git a/power/client/service_instances/service_instance_provision_responses.go b/power/client/service_instances/service_instance_provision_responses.go index 89e977ad..6d82abbf 100644 --- a/power/client/service_instances/service_instance_provision_responses.go +++ b/power/client/service_instances/service_instance_provision_responses.go @@ -6,6 +6,7 @@ package service_instances // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -127,11 +128,13 @@ func (o *ServiceInstanceProvisionOK) Code() int { } func (o *ServiceInstanceProvisionOK) Error() string { - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionOK %s", 200, payload) } func (o *ServiceInstanceProvisionOK) String() string { - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionOK %+v", 200, o.Payload) + 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 { @@ -195,11 +198,13 @@ func (o *ServiceInstanceProvisionCreated) Code() int { } func (o *ServiceInstanceProvisionCreated) Error() string { - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionCreated %+v", 201, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionCreated %s", 201, payload) } func (o *ServiceInstanceProvisionCreated) String() string { - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionCreated %+v", 201, o.Payload) + 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 { @@ -263,11 +268,13 @@ func (o *ServiceInstanceProvisionAccepted) Code() int { } func (o *ServiceInstanceProvisionAccepted) Error() string { - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionAccepted %+v", 202, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionAccepted %s", 202, payload) } func (o *ServiceInstanceProvisionAccepted) String() string { - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionAccepted %+v", 202, o.Payload) + 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 { @@ -331,11 +338,13 @@ func (o *ServiceInstanceProvisionBadRequest) Code() int { } func (o *ServiceInstanceProvisionBadRequest) Error() string { - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionBadRequest %s", 400, payload) } func (o *ServiceInstanceProvisionBadRequest) String() string { - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionBadRequest %+v", 400, o.Payload) + 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 { @@ -399,11 +408,13 @@ func (o *ServiceInstanceProvisionUnauthorized) Code() int { } func (o *ServiceInstanceProvisionUnauthorized) Error() string { - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionUnauthorized %s", 401, payload) } func (o *ServiceInstanceProvisionUnauthorized) String() string { - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionUnauthorized %+v", 401, o.Payload) + 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 { @@ -467,11 +478,13 @@ func (o *ServiceInstanceProvisionForbidden) Code() int { } func (o *ServiceInstanceProvisionForbidden) Error() string { - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionForbidden %s", 403, payload) } func (o *ServiceInstanceProvisionForbidden) String() string { - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionForbidden %+v", 403, o.Payload) + 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 { @@ -535,11 +548,13 @@ func (o *ServiceInstanceProvisionNotFound) Code() int { } func (o *ServiceInstanceProvisionNotFound) Error() string { - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionNotFound %s", 404, payload) } func (o *ServiceInstanceProvisionNotFound) String() string { - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionNotFound %+v", 404, o.Payload) + 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 { @@ -603,11 +618,13 @@ func (o *ServiceInstanceProvisionConflict) Code() int { } func (o *ServiceInstanceProvisionConflict) Error() string { - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionConflict %+v", 409, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionConflict %s", 409, payload) } func (o *ServiceInstanceProvisionConflict) String() string { - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionConflict %+v", 409, o.Payload) + 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 { @@ -671,11 +688,13 @@ func (o *ServiceInstanceProvisionUnprocessableEntity) Code() int { } func (o *ServiceInstanceProvisionUnprocessableEntity) Error() string { - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionUnprocessableEntity %+v", 422, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionUnprocessableEntity %s", 422, payload) } func (o *ServiceInstanceProvisionUnprocessableEntity) String() string { - return fmt.Sprintf("[PUT /v2/service_instances/{instance_id}][%d] serviceInstanceProvisionUnprocessableEntity %+v", 422, o.Payload) + 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 { diff --git a/power/client/service_instances/service_instance_update_responses.go b/power/client/service_instances/service_instance_update_responses.go index eeb9bd7c..66aa9ad1 100644 --- a/power/client/service_instances/service_instance_update_responses.go +++ b/power/client/service_instances/service_instance_update_responses.go @@ -6,6 +6,7 @@ package service_instances // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *ServiceInstanceUpdateOK) Code() int { } func (o *ServiceInstanceUpdateOK) Error() string { - return fmt.Sprintf("[PATCH /v2/service_instances/{instance_id}][%d] serviceInstanceUpdateOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PATCH /v2/service_instances/{instance_id}][%d] serviceInstanceUpdateOK %s", 200, payload) } func (o *ServiceInstanceUpdateOK) String() string { - return fmt.Sprintf("[PATCH /v2/service_instances/{instance_id}][%d] serviceInstanceUpdateOK %+v", 200, o.Payload) + 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 { @@ -181,11 +184,13 @@ func (o *ServiceInstanceUpdateAccepted) Code() int { } func (o *ServiceInstanceUpdateAccepted) Error() string { - return fmt.Sprintf("[PATCH /v2/service_instances/{instance_id}][%d] serviceInstanceUpdateAccepted %+v", 202, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PATCH /v2/service_instances/{instance_id}][%d] serviceInstanceUpdateAccepted %s", 202, payload) } func (o *ServiceInstanceUpdateAccepted) String() string { - return fmt.Sprintf("[PATCH /v2/service_instances/{instance_id}][%d] serviceInstanceUpdateAccepted %+v", 202, o.Payload) + 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 { @@ -249,11 +254,13 @@ func (o *ServiceInstanceUpdateBadRequest) Code() int { } func (o *ServiceInstanceUpdateBadRequest) Error() string { - return fmt.Sprintf("[PATCH /v2/service_instances/{instance_id}][%d] serviceInstanceUpdateBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PATCH /v2/service_instances/{instance_id}][%d] serviceInstanceUpdateBadRequest %s", 400, payload) } func (o *ServiceInstanceUpdateBadRequest) String() string { - return fmt.Sprintf("[PATCH /v2/service_instances/{instance_id}][%d] serviceInstanceUpdateBadRequest %+v", 400, o.Payload) + 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 { @@ -317,11 +324,13 @@ func (o *ServiceInstanceUpdateUnauthorized) Code() int { } func (o *ServiceInstanceUpdateUnauthorized) Error() string { - return fmt.Sprintf("[PATCH /v2/service_instances/{instance_id}][%d] serviceInstanceUpdateUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PATCH /v2/service_instances/{instance_id}][%d] serviceInstanceUpdateUnauthorized %s", 401, payload) } func (o *ServiceInstanceUpdateUnauthorized) String() string { - return fmt.Sprintf("[PATCH /v2/service_instances/{instance_id}][%d] serviceInstanceUpdateUnauthorized %+v", 401, o.Payload) + 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 { @@ -385,11 +394,13 @@ func (o *ServiceInstanceUpdateForbidden) Code() int { } func (o *ServiceInstanceUpdateForbidden) Error() string { - return fmt.Sprintf("[PATCH /v2/service_instances/{instance_id}][%d] serviceInstanceUpdateForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PATCH /v2/service_instances/{instance_id}][%d] serviceInstanceUpdateForbidden %s", 403, payload) } func (o *ServiceInstanceUpdateForbidden) String() string { - return fmt.Sprintf("[PATCH /v2/service_instances/{instance_id}][%d] serviceInstanceUpdateForbidden %+v", 403, o.Payload) + 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 { @@ -453,11 +464,13 @@ func (o *ServiceInstanceUpdateNotFound) Code() int { } func (o *ServiceInstanceUpdateNotFound) Error() string { - return fmt.Sprintf("[PATCH /v2/service_instances/{instance_id}][%d] serviceInstanceUpdateNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PATCH /v2/service_instances/{instance_id}][%d] serviceInstanceUpdateNotFound %s", 404, payload) } func (o *ServiceInstanceUpdateNotFound) String() string { - return fmt.Sprintf("[PATCH /v2/service_instances/{instance_id}][%d] serviceInstanceUpdateNotFound %+v", 404, o.Payload) + 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 { @@ -521,11 +534,13 @@ func (o *ServiceInstanceUpdateUnprocessableEntity) Code() int { } func (o *ServiceInstanceUpdateUnprocessableEntity) Error() string { - return fmt.Sprintf("[PATCH /v2/service_instances/{instance_id}][%d] serviceInstanceUpdateUnprocessableEntity %+v", 422, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[PATCH /v2/service_instances/{instance_id}][%d] serviceInstanceUpdateUnprocessableEntity %s", 422, payload) } func (o *ServiceInstanceUpdateUnprocessableEntity) String() string { - return fmt.Sprintf("[PATCH /v2/service_instances/{instance_id}][%d] serviceInstanceUpdateUnprocessableEntity %+v", 422, o.Payload) + 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 { diff --git a/power/client/service_instances/service_instances_client.go b/power/client/service_instances/service_instances_client.go index 9dc2833e..094ce61c 100644 --- a/power/client/service_instances/service_instances_client.go +++ b/power/client/service_instances/service_instances_client.go @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi 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 */ @@ -25,7 +51,7 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods diff --git a/power/client/storage_types/service_broker_storagetypes_get_responses.go b/power/client/storage_types/service_broker_storagetypes_get_responses.go index e1fb7e6b..d8bd8f2d 100644 --- a/power/client/storage_types/service_broker_storagetypes_get_responses.go +++ b/power/client/storage_types/service_broker_storagetypes_get_responses.go @@ -6,6 +6,7 @@ package storage_types // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *ServiceBrokerStoragetypesGetOK) Code() int { } func (o *ServiceBrokerStoragetypesGetOK) Error() string { - return fmt.Sprintf("[GET /broker/v1/storage-types][%d] serviceBrokerStoragetypesGetOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/storage-types][%d] serviceBrokerStoragetypesGetOK %s", 200, payload) } func (o *ServiceBrokerStoragetypesGetOK) String() string { - return fmt.Sprintf("[GET /broker/v1/storage-types][%d] serviceBrokerStoragetypesGetOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/storage-types][%d] serviceBrokerStoragetypesGetOK %s", 200, payload) } func (o *ServiceBrokerStoragetypesGetOK) GetPayload() models.StorageTypes { @@ -181,11 +184,13 @@ func (o *ServiceBrokerStoragetypesGetBadRequest) Code() int { } func (o *ServiceBrokerStoragetypesGetBadRequest) Error() string { - return fmt.Sprintf("[GET /broker/v1/storage-types][%d] serviceBrokerStoragetypesGetBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/storage-types][%d] serviceBrokerStoragetypesGetBadRequest %s", 400, payload) } func (o *ServiceBrokerStoragetypesGetBadRequest) String() string { - return fmt.Sprintf("[GET /broker/v1/storage-types][%d] serviceBrokerStoragetypesGetBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/storage-types][%d] serviceBrokerStoragetypesGetBadRequest %s", 400, payload) } func (o *ServiceBrokerStoragetypesGetBadRequest) GetPayload() *models.Error { @@ -249,11 +254,13 @@ func (o *ServiceBrokerStoragetypesGetUnauthorized) Code() int { } func (o *ServiceBrokerStoragetypesGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /broker/v1/storage-types][%d] serviceBrokerStoragetypesGetUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/storage-types][%d] serviceBrokerStoragetypesGetUnauthorized %s", 401, payload) } func (o *ServiceBrokerStoragetypesGetUnauthorized) String() string { - return fmt.Sprintf("[GET /broker/v1/storage-types][%d] serviceBrokerStoragetypesGetUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/storage-types][%d] serviceBrokerStoragetypesGetUnauthorized %s", 401, payload) } func (o *ServiceBrokerStoragetypesGetUnauthorized) GetPayload() *models.Error { @@ -317,11 +324,13 @@ func (o *ServiceBrokerStoragetypesGetForbidden) Code() int { } func (o *ServiceBrokerStoragetypesGetForbidden) Error() string { - return fmt.Sprintf("[GET /broker/v1/storage-types][%d] serviceBrokerStoragetypesGetForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/storage-types][%d] serviceBrokerStoragetypesGetForbidden %s", 403, payload) } func (o *ServiceBrokerStoragetypesGetForbidden) String() string { - return fmt.Sprintf("[GET /broker/v1/storage-types][%d] serviceBrokerStoragetypesGetForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/storage-types][%d] serviceBrokerStoragetypesGetForbidden %s", 403, payload) } func (o *ServiceBrokerStoragetypesGetForbidden) GetPayload() *models.Error { @@ -385,11 +394,13 @@ func (o *ServiceBrokerStoragetypesGetNotFound) Code() int { } func (o *ServiceBrokerStoragetypesGetNotFound) Error() string { - return fmt.Sprintf("[GET /broker/v1/storage-types][%d] serviceBrokerStoragetypesGetNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/storage-types][%d] serviceBrokerStoragetypesGetNotFound %s", 404, payload) } func (o *ServiceBrokerStoragetypesGetNotFound) String() string { - return fmt.Sprintf("[GET /broker/v1/storage-types][%d] serviceBrokerStoragetypesGetNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/storage-types][%d] serviceBrokerStoragetypesGetNotFound %s", 404, payload) } func (o *ServiceBrokerStoragetypesGetNotFound) GetPayload() *models.Error { @@ -453,11 +464,13 @@ func (o *ServiceBrokerStoragetypesGetUnprocessableEntity) Code() int { } func (o *ServiceBrokerStoragetypesGetUnprocessableEntity) Error() string { - return fmt.Sprintf("[GET /broker/v1/storage-types][%d] serviceBrokerStoragetypesGetUnprocessableEntity %+v", 422, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/storage-types][%d] serviceBrokerStoragetypesGetUnprocessableEntity %s", 422, payload) } func (o *ServiceBrokerStoragetypesGetUnprocessableEntity) String() string { - return fmt.Sprintf("[GET /broker/v1/storage-types][%d] serviceBrokerStoragetypesGetUnprocessableEntity %+v", 422, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/storage-types][%d] serviceBrokerStoragetypesGetUnprocessableEntity %s", 422, payload) } func (o *ServiceBrokerStoragetypesGetUnprocessableEntity) GetPayload() *models.Error { @@ -521,11 +534,13 @@ func (o *ServiceBrokerStoragetypesGetInternalServerError) Code() int { } func (o *ServiceBrokerStoragetypesGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /broker/v1/storage-types][%d] serviceBrokerStoragetypesGetInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/storage-types][%d] serviceBrokerStoragetypesGetInternalServerError %s", 500, payload) } func (o *ServiceBrokerStoragetypesGetInternalServerError) String() string { - return fmt.Sprintf("[GET /broker/v1/storage-types][%d] serviceBrokerStoragetypesGetInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /broker/v1/storage-types][%d] serviceBrokerStoragetypesGetInternalServerError %s", 500, payload) } func (o *ServiceBrokerStoragetypesGetInternalServerError) GetPayload() *models.Error { diff --git a/power/client/storage_types/storage_types_client.go b/power/client/storage_types/storage_types_client.go index 7a981903..51bfe993 100644 --- a/power/client/storage_types/storage_types_client.go +++ b/power/client/storage_types/storage_types_client.go @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi 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 */ @@ -25,7 +51,7 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods diff --git a/power/client/swagger_spec/service_broker_swaggerspec_responses.go b/power/client/swagger_spec/service_broker_swaggerspec_responses.go index 8e445944..d938fd2f 100644 --- a/power/client/swagger_spec/service_broker_swaggerspec_responses.go +++ b/power/client/swagger_spec/service_broker_swaggerspec_responses.go @@ -6,6 +6,7 @@ package swagger_spec // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -103,11 +104,13 @@ func (o *ServiceBrokerSwaggerspecOK) Code() int { } func (o *ServiceBrokerSwaggerspecOK) Error() string { - return fmt.Sprintf("[GET /v1/swagger.json][%d] serviceBrokerSwaggerspecOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/swagger.json][%d] serviceBrokerSwaggerspecOK %s", 200, payload) } func (o *ServiceBrokerSwaggerspecOK) String() string { - return fmt.Sprintf("[GET /v1/swagger.json][%d] serviceBrokerSwaggerspecOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/swagger.json][%d] serviceBrokerSwaggerspecOK %s", 200, payload) } func (o *ServiceBrokerSwaggerspecOK) GetPayload() models.Object { @@ -169,11 +172,13 @@ func (o *ServiceBrokerSwaggerspecBadRequest) Code() int { } func (o *ServiceBrokerSwaggerspecBadRequest) Error() string { - return fmt.Sprintf("[GET /v1/swagger.json][%d] serviceBrokerSwaggerspecBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/swagger.json][%d] serviceBrokerSwaggerspecBadRequest %s", 400, payload) } func (o *ServiceBrokerSwaggerspecBadRequest) String() string { - return fmt.Sprintf("[GET /v1/swagger.json][%d] serviceBrokerSwaggerspecBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/swagger.json][%d] serviceBrokerSwaggerspecBadRequest %s", 400, payload) } func (o *ServiceBrokerSwaggerspecBadRequest) GetPayload() *models.Error { @@ -237,11 +242,13 @@ func (o *ServiceBrokerSwaggerspecUnauthorized) Code() int { } func (o *ServiceBrokerSwaggerspecUnauthorized) Error() string { - return fmt.Sprintf("[GET /v1/swagger.json][%d] serviceBrokerSwaggerspecUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/swagger.json][%d] serviceBrokerSwaggerspecUnauthorized %s", 401, payload) } func (o *ServiceBrokerSwaggerspecUnauthorized) String() string { - return fmt.Sprintf("[GET /v1/swagger.json][%d] serviceBrokerSwaggerspecUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/swagger.json][%d] serviceBrokerSwaggerspecUnauthorized %s", 401, payload) } func (o *ServiceBrokerSwaggerspecUnauthorized) GetPayload() *models.Error { @@ -305,11 +312,13 @@ func (o *ServiceBrokerSwaggerspecForbidden) Code() int { } func (o *ServiceBrokerSwaggerspecForbidden) Error() string { - return fmt.Sprintf("[GET /v1/swagger.json][%d] serviceBrokerSwaggerspecForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/swagger.json][%d] serviceBrokerSwaggerspecForbidden %s", 403, payload) } func (o *ServiceBrokerSwaggerspecForbidden) String() string { - return fmt.Sprintf("[GET /v1/swagger.json][%d] serviceBrokerSwaggerspecForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/swagger.json][%d] serviceBrokerSwaggerspecForbidden %s", 403, payload) } func (o *ServiceBrokerSwaggerspecForbidden) GetPayload() *models.Error { @@ -373,11 +382,13 @@ func (o *ServiceBrokerSwaggerspecNotFound) Code() int { } func (o *ServiceBrokerSwaggerspecNotFound) Error() string { - return fmt.Sprintf("[GET /v1/swagger.json][%d] serviceBrokerSwaggerspecNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/swagger.json][%d] serviceBrokerSwaggerspecNotFound %s", 404, payload) } func (o *ServiceBrokerSwaggerspecNotFound) String() string { - return fmt.Sprintf("[GET /v1/swagger.json][%d] serviceBrokerSwaggerspecNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/swagger.json][%d] serviceBrokerSwaggerspecNotFound %s", 404, payload) } func (o *ServiceBrokerSwaggerspecNotFound) GetPayload() *models.Error { diff --git a/power/client/swagger_spec/swagger_spec_client.go b/power/client/swagger_spec/swagger_spec_client.go index 32228ff3..6ac98108 100644 --- a/power/client/swagger_spec/swagger_spec_client.go +++ b/power/client/swagger_spec/swagger_spec_client.go @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi 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 */ @@ -25,7 +51,7 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods diff --git a/power/client/workspaces/v1_workspaces_get_responses.go b/power/client/workspaces/v1_workspaces_get_responses.go index e04a3ee5..9a44710f 100644 --- a/power/client/workspaces/v1_workspaces_get_responses.go +++ b/power/client/workspaces/v1_workspaces_get_responses.go @@ -6,6 +6,7 @@ package workspaces // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -115,11 +116,13 @@ func (o *V1WorkspacesGetOK) Code() int { } func (o *V1WorkspacesGetOK) Error() string { - return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetOK %s", 200, payload) } func (o *V1WorkspacesGetOK) String() string { - return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetOK %s", 200, payload) } func (o *V1WorkspacesGetOK) GetPayload() *models.Workspace { @@ -183,11 +186,13 @@ func (o *V1WorkspacesGetBadRequest) Code() int { } func (o *V1WorkspacesGetBadRequest) Error() string { - return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetBadRequest %s", 400, payload) } func (o *V1WorkspacesGetBadRequest) String() string { - return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetBadRequest %s", 400, payload) } func (o *V1WorkspacesGetBadRequest) GetPayload() *models.Error { @@ -251,11 +256,13 @@ func (o *V1WorkspacesGetUnauthorized) Code() int { } func (o *V1WorkspacesGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetUnauthorized %s", 401, payload) } func (o *V1WorkspacesGetUnauthorized) String() string { - return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetUnauthorized %s", 401, payload) } func (o *V1WorkspacesGetUnauthorized) GetPayload() *models.Error { @@ -319,11 +326,13 @@ func (o *V1WorkspacesGetForbidden) Code() int { } func (o *V1WorkspacesGetForbidden) Error() string { - return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetForbidden %s", 403, payload) } func (o *V1WorkspacesGetForbidden) String() string { - return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetForbidden %s", 403, payload) } func (o *V1WorkspacesGetForbidden) GetPayload() *models.Error { @@ -387,11 +396,13 @@ func (o *V1WorkspacesGetNotFound) Code() int { } func (o *V1WorkspacesGetNotFound) Error() string { - return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetNotFound %s", 404, payload) } func (o *V1WorkspacesGetNotFound) String() string { - return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetNotFound %+v", 404, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetNotFound %s", 404, payload) } func (o *V1WorkspacesGetNotFound) GetPayload() *models.Error { @@ -455,11 +466,13 @@ func (o *V1WorkspacesGetTooManyRequests) Code() int { } func (o *V1WorkspacesGetTooManyRequests) Error() string { - return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetTooManyRequests %+v", 429, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetTooManyRequests %s", 429, payload) } func (o *V1WorkspacesGetTooManyRequests) String() string { - return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetTooManyRequests %+v", 429, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetTooManyRequests %s", 429, payload) } func (o *V1WorkspacesGetTooManyRequests) GetPayload() *models.Error { @@ -523,11 +536,13 @@ func (o *V1WorkspacesGetInternalServerError) Code() int { } func (o *V1WorkspacesGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetInternalServerError %s", 500, payload) } func (o *V1WorkspacesGetInternalServerError) String() string { - return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/workspaces/{workspace_id}][%d] v1WorkspacesGetInternalServerError %s", 500, payload) } func (o *V1WorkspacesGetInternalServerError) GetPayload() *models.Error { diff --git a/power/client/workspaces/v1_workspaces_getall_responses.go b/power/client/workspaces/v1_workspaces_getall_responses.go index 671dc336..1ab245fc 100644 --- a/power/client/workspaces/v1_workspaces_getall_responses.go +++ b/power/client/workspaces/v1_workspaces_getall_responses.go @@ -6,6 +6,7 @@ package workspaces // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -103,11 +104,13 @@ func (o *V1WorkspacesGetallOK) Code() int { } func (o *V1WorkspacesGetallOK) Error() string { - return fmt.Sprintf("[GET /v1/workspaces][%d] v1WorkspacesGetallOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/workspaces][%d] v1WorkspacesGetallOK %s", 200, payload) } func (o *V1WorkspacesGetallOK) String() string { - return fmt.Sprintf("[GET /v1/workspaces][%d] v1WorkspacesGetallOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/workspaces][%d] v1WorkspacesGetallOK %s", 200, payload) } func (o *V1WorkspacesGetallOK) GetPayload() *models.Workspaces { @@ -171,11 +174,13 @@ func (o *V1WorkspacesGetallUnauthorized) Code() int { } func (o *V1WorkspacesGetallUnauthorized) Error() string { - return fmt.Sprintf("[GET /v1/workspaces][%d] v1WorkspacesGetallUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/workspaces][%d] v1WorkspacesGetallUnauthorized %s", 401, payload) } func (o *V1WorkspacesGetallUnauthorized) String() string { - return fmt.Sprintf("[GET /v1/workspaces][%d] v1WorkspacesGetallUnauthorized %+v", 401, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/workspaces][%d] v1WorkspacesGetallUnauthorized %s", 401, payload) } func (o *V1WorkspacesGetallUnauthorized) GetPayload() *models.Error { @@ -239,11 +244,13 @@ func (o *V1WorkspacesGetallForbidden) Code() int { } func (o *V1WorkspacesGetallForbidden) Error() string { - return fmt.Sprintf("[GET /v1/workspaces][%d] v1WorkspacesGetallForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/workspaces][%d] v1WorkspacesGetallForbidden %s", 403, payload) } func (o *V1WorkspacesGetallForbidden) String() string { - return fmt.Sprintf("[GET /v1/workspaces][%d] v1WorkspacesGetallForbidden %+v", 403, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/workspaces][%d] v1WorkspacesGetallForbidden %s", 403, payload) } func (o *V1WorkspacesGetallForbidden) GetPayload() *models.Error { @@ -307,11 +314,13 @@ func (o *V1WorkspacesGetallTooManyRequests) Code() int { } func (o *V1WorkspacesGetallTooManyRequests) Error() string { - return fmt.Sprintf("[GET /v1/workspaces][%d] v1WorkspacesGetallTooManyRequests %+v", 429, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/workspaces][%d] v1WorkspacesGetallTooManyRequests %s", 429, payload) } func (o *V1WorkspacesGetallTooManyRequests) String() string { - return fmt.Sprintf("[GET /v1/workspaces][%d] v1WorkspacesGetallTooManyRequests %+v", 429, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/workspaces][%d] v1WorkspacesGetallTooManyRequests %s", 429, payload) } func (o *V1WorkspacesGetallTooManyRequests) GetPayload() *models.Error { @@ -375,11 +384,13 @@ func (o *V1WorkspacesGetallInternalServerError) Code() int { } func (o *V1WorkspacesGetallInternalServerError) Error() string { - return fmt.Sprintf("[GET /v1/workspaces][%d] v1WorkspacesGetallInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/workspaces][%d] v1WorkspacesGetallInternalServerError %s", 500, payload) } func (o *V1WorkspacesGetallInternalServerError) String() string { - return fmt.Sprintf("[GET /v1/workspaces][%d] v1WorkspacesGetallInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/workspaces][%d] v1WorkspacesGetallInternalServerError %s", 500, payload) } func (o *V1WorkspacesGetallInternalServerError) GetPayload() *models.Error { diff --git a/power/client/workspaces/workspaces_client.go b/power/client/workspaces/workspaces_client.go index 4929b695..be7f3e6e 100644 --- a/power/client/workspaces/workspaces_client.go +++ b/power/client/workspaces/workspaces_client.go @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi 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 */ @@ -25,7 +51,7 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) // ClientService is the interface for Client methods diff --git a/power/models/clone_task_status.go b/power/models/clone_task_status.go index cb47470d..1099b76a 100644 --- a/power/models/clone_task_status.go +++ b/power/models/clone_task_status.go @@ -33,7 +33,7 @@ type CloneTaskStatus struct { // Status of the clone volumes task // Required: true - // Enum: [running completed failed unknown] + // Enum: ["running","completed","failed","unknown"] Status *string `json:"status"` } diff --git a/power/models/cloud_connection_create.go b/power/models/cloud_connection_create.go index dba0f641..ccae9f01 100644 --- a/power/models/cloud_connection_create.go +++ b/power/models/cloud_connection_create.go @@ -35,7 +35,7 @@ type CloudConnectionCreate struct { // speed of the cloud connection (speed in megabits per second) // Required: true - // Enum: [50 100 200 500 1000 2000 5000 10000] + // Enum: [50,100,200,500,1000,2000,5000,10000] Speed *int64 `json:"speed"` // list of subnets to attach to cloud connection diff --git a/power/models/cloud_connection_update.go b/power/models/cloud_connection_update.go index 4274cf1c..eedf1a7a 100644 --- a/power/models/cloud_connection_update.go +++ b/power/models/cloud_connection_update.go @@ -33,7 +33,7 @@ type CloudConnectionUpdate struct { Name *string `json:"name,omitempty"` // speed of the cloud connection (speed in megabits per second) - // Enum: [50 100 200 500 1000 2000 5000 10000] + // Enum: [50,100,200,500,1000,2000,5000,10000] Speed *int64 `json:"speed,omitempty"` // vpc diff --git a/power/models/cloud_initialization.go b/power/models/cloud_initialization.go index 49be6931..3bc111b2 100644 --- a/power/models/cloud_initialization.go +++ b/power/models/cloud_initialization.go @@ -21,7 +21,7 @@ import ( type CloudInitialization struct { // Virtual Machine's Cloud Initialization Virtual Optical Device - // Enum: [attach detach] + // Enum: ["attach","detach"] VirtualOpticalDevice string `json:"virtualOpticalDevice,omitempty"` } diff --git a/power/models/create_cos_image_import_job.go b/power/models/create_cos_image_import_job.go index c5e98fa2..642f5675 100644 --- a/power/models/create_cos_image_import_job.go +++ b/power/models/create_cos_image_import_job.go @@ -24,7 +24,7 @@ type CreateCosImageImportJob struct { 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] + // Enum: ["public","private"] BucketAccess *string `json:"bucketAccess,omitempty"` // Cloud Object Storage bucket name; bucket-name[/optional/folder] @@ -46,7 +46,7 @@ type CreateCosImageImportJob struct { 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] + // Enum: ["aix","ibmi","rhel","sles"] OsType string `json:"osType,omitempty"` // Cloud Object Storage region diff --git a/power/models/create_data_volume.go b/power/models/create_data_volume.go index 626e9b09..ab5c4051 100644 --- a/power/models/create_data_volume.go +++ b/power/models/create_data_volume.go @@ -24,7 +24,7 @@ type CreateDataVolume struct { 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] + // 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 diff --git a/power/models/create_image.go b/power/models/create_image.go index 3fe6eb12..d109378b 100644 --- a/power/models/create_image.go +++ b/power/models/create_image.go @@ -42,7 +42,7 @@ type CreateImage struct { 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] + // Enum: ["aix","ibmi","rhel","sles"] OsType string `json:"osType,omitempty"` // Cloud Storage Region; only required to access IBM Cloud Storage @@ -55,7 +55,7 @@ type CreateImage struct { // >*Note*: url option is deprecated, this option is supported till Oct 2022 // // Required: true - // Enum: [root-project url] + // 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. diff --git a/power/models/datacenter.go b/power/models/datacenter.go index 62c632be..2c33b15c 100644 --- a/power/models/datacenter.go +++ b/power/models/datacenter.go @@ -33,12 +33,12 @@ type Datacenter struct { // The Datacenter status // Required: true - // Enum: [active maintenance down] + // Enum: ["active","maintenance","down"] Status *string `json:"status"` // The Datacenter type // Required: true - // Enum: [off-premises on-premises] + // Enum: ["off-premises","on-premises"] Type *string `json:"type"` } diff --git a/power/models/dead_peer_detection.go b/power/models/dead_peer_detection.go index 89688eaa..5ec338a8 100644 --- a/power/models/dead_peer_detection.go +++ b/power/models/dead_peer_detection.go @@ -22,7 +22,7 @@ type DeadPeerDetection struct { // Action to take when a Peer Gateway stops responding // Required: true - // Enum: [restart] + // Enum: ["restart"] Action *string `json:"action"` // How often to test that the Peer Gateway is responsive diff --git a/power/models/deployment_target.go b/power/models/deployment_target.go index 25d52b67..baf2b292 100644 --- a/power/models/deployment_target.go +++ b/power/models/deployment_target.go @@ -26,7 +26,7 @@ type DeploymentTarget struct { // specify if deploying to a host group or a host // Required: true - // Enum: [hostGroup host] + // Enum: ["hostGroup","host"] Type *string `json:"type"` } diff --git a/power/models/event.go b/power/models/event.go index bd5ac368..79d6edec 100644 --- a/power/models/event.go +++ b/power/models/event.go @@ -30,7 +30,7 @@ type Event struct { // Level of the event (notice, info, warning, error) // Required: true - // Enum: [notice info warning error] + // Enum: ["notice","info","warning","error"] Level *string `json:"level"` // The (translated) message of the event diff --git a/power/models/i_k_e_policy.go b/power/models/i_k_e_policy.go index 4a101ecf..b1464ef1 100644 --- a/power/models/i_k_e_policy.go +++ b/power/models/i_k_e_policy.go @@ -27,13 +27,13 @@ type IKEPolicy struct { // DH group of the IKE Policy // Example: 2 // Required: true - // Enum: [1 2 5 14 19 20 24] + // 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] + // 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 @@ -53,7 +53,7 @@ type IKEPolicy struct { // version of the IKE Policy // Example: 2 // Required: true - // Enum: [1 2] + // Enum: [1,2] Version *int64 `json:"version"` } diff --git a/power/models/i_k_e_policy_create.go b/power/models/i_k_e_policy_create.go index 39757af5..0f663cb5 100644 --- a/power/models/i_k_e_policy_create.go +++ b/power/models/i_k_e_policy_create.go @@ -26,13 +26,13 @@ type IKEPolicyCreate struct { // DH group of the IKE Policy // Example: 2 // Required: true - // Enum: [1 2 5 14 19 20 24] + // 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] + // Enum: ["aes-256-cbc","aes-192-cbc","aes-128-cbc","aes-256-gcm","aes-128-gcm","3des-cbc"] Encryption *string `json:"encryption"` // key lifetime @@ -53,7 +53,7 @@ type IKEPolicyCreate struct { // version of the IKE Policy // Example: 2 // Required: true - // Enum: [1 2] + // Enum: [1,2] Version *int64 `json:"version"` } diff --git a/power/models/i_k_e_policy_update.go b/power/models/i_k_e_policy_update.go index e8d42411..2bb87db9 100644 --- a/power/models/i_k_e_policy_update.go +++ b/power/models/i_k_e_policy_update.go @@ -17,7 +17,7 @@ import ( // IKEPolicyUpdate IKE Policy object used for update // -// Min Properties: 1 +// MinProperties: 1 // // swagger:model IKEPolicyUpdate type IKEPolicyUpdate struct { @@ -27,12 +27,12 @@ type IKEPolicyUpdate struct { // DH group of the IKE Policy // Example: 2 - // Enum: [1 2 5 14 19 20 24] + // 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] + // 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 @@ -49,7 +49,7 @@ type IKEPolicyUpdate struct { // version of the IKE Policy // Example: 2 - // Enum: [1 2] + // Enum: [1,2] Version int64 `json:"version,omitempty"` // i k e policy update additional properties @@ -66,12 +66,12 @@ func (m *IKEPolicyUpdate) UnmarshalJSON(data []byte) error { // DH group of the IKE Policy // Example: 2 - // Enum: [1 2 5 14 19 20 24] + // 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] + // 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 @@ -88,7 +88,7 @@ func (m *IKEPolicyUpdate) UnmarshalJSON(data []byte) error { // version of the IKE Policy // Example: 2 - // Enum: [1 2] + // Enum: [1,2] Version int64 `json:"version,omitempty"` } if err := json.Unmarshal(data, &stage1); err != nil { @@ -143,12 +143,12 @@ func (m IKEPolicyUpdate) MarshalJSON() ([]byte, error) { // DH group of the IKE Policy // Example: 2 - // Enum: [1 2 5 14 19 20 24] + // 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] + // 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 @@ -165,7 +165,7 @@ func (m IKEPolicyUpdate) MarshalJSON() ([]byte, error) { // version of the IKE Policy // Example: 2 - // Enum: [1 2] + // Enum: [1,2] Version int64 `json:"version,omitempty"` } diff --git a/power/models/image_import_details.go b/power/models/image_import_details.go index 59560a09..4fc18548 100644 --- a/power/models/image_import_details.go +++ b/power/models/image_import_details.go @@ -22,17 +22,17 @@ type ImageImportDetails struct { // Origin of the license of the product // Required: true - // Enum: [byol] + // Enum: ["byol"] LicenseType *string `json:"licenseType"` // Product within the image // Required: true - // Enum: [Hana Netweaver] + // Enum: ["Hana","Netweaver"] Product *string `json:"product"` // Vendor supporting the product // Required: true - // Enum: [SAP] + // Enum: ["SAP"] Vendor *string `json:"vendor"` } diff --git a/power/models/ip_sec_policy.go b/power/models/ip_sec_policy.go index d2e62f42..67e87daa 100644 --- a/power/models/ip_sec_policy.go +++ b/power/models/ip_sec_policy.go @@ -27,13 +27,13 @@ type IPSecPolicy struct { // Diffie-Hellman group // Example: 2 // Required: true - // Enum: [1 2 5 14 19 20 24] + // 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] + // 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 diff --git a/power/models/ip_sec_policy_create.go b/power/models/ip_sec_policy_create.go index b46a3812..d64e5945 100644 --- a/power/models/ip_sec_policy_create.go +++ b/power/models/ip_sec_policy_create.go @@ -26,13 +26,13 @@ type IPSecPolicyCreate struct { // Diffie-Hellman group // Example: 2 // Required: true - // Enum: [1 2 5 14 19 20 24] + // 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] + // 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 diff --git a/power/models/ip_sec_policy_update.go b/power/models/ip_sec_policy_update.go index f753650c..b795c162 100644 --- a/power/models/ip_sec_policy_update.go +++ b/power/models/ip_sec_policy_update.go @@ -17,7 +17,7 @@ import ( // IPSecPolicyUpdate IPSEc Policy object used for update // -// Min Properties: 1 +// MinProperties: 1 // // swagger:model IPSecPolicyUpdate type IPSecPolicyUpdate struct { @@ -27,12 +27,12 @@ type IPSecPolicyUpdate struct { // Diffie-Hellman group // Example: 2 - // Enum: [1 2 5 14 19 20 24] + // 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] + // 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 @@ -62,12 +62,12 @@ func (m *IPSecPolicyUpdate) UnmarshalJSON(data []byte) error { // Diffie-Hellman group // Example: 2 - // Enum: [1 2 5 14 19 20 24] + // 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] + // 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 @@ -133,12 +133,12 @@ func (m IPSecPolicyUpdate) MarshalJSON() ([]byte, error) { // Diffie-Hellman group // Example: 2 - // Enum: [1 2 5 14 19 20 24] + // 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] + // 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 diff --git a/power/models/last_operation_resource.go b/power/models/last_operation_resource.go index 37596b72..166044db 100644 --- a/power/models/last_operation_resource.go +++ b/power/models/last_operation_resource.go @@ -25,7 +25,7 @@ type LastOperationResource struct { // state // Required: true - // Enum: [in progress succeeded failed] + // Enum: ["in progress","succeeded","failed"] State *string `json:"state"` } diff --git a/power/models/multi_volumes_create.go b/power/models/multi_volumes_create.go index 5e5ae0cf..7b1a701f 100644 --- a/power/models/multi_volumes_create.go +++ b/power/models/multi_volumes_create.go @@ -24,7 +24,7 @@ type MultiVolumesCreate struct { 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] + // 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 diff --git a/power/models/network.go b/power/models/network.go index 512aa941..848f5280 100644 --- a/power/models/network.go +++ b/power/models/network.go @@ -70,7 +70,7 @@ type Network struct { // Type of Network - 'vlan' (private network) 'pub-vlan' (public network) 'dhcp-vlan' (for satellite locations only) // Required: true - // Enum: [vlan pub-vlan dhcp-vlan] + // Enum: ["vlan","pub-vlan","dhcp-vlan"] Type *string `json:"type"` // VLAN ID diff --git a/power/models/network_create.go b/power/models/network_create.go index f320776e..093cbaa0 100644 --- a/power/models/network_create.go +++ b/power/models/network_create.go @@ -50,7 +50,7 @@ type NetworkCreate struct { // Type of Network - 'vlan' (private network) 'pub-vlan' (public network) 'dhcp-vlan' (for satellite locations only) // Required: true - // Enum: [vlan pub-vlan dhcp-vlan] + // Enum: ["vlan","pub-vlan","dhcp-vlan"] Type *string `json:"type"` } diff --git a/power/models/network_reference.go b/power/models/network_reference.go index 40563314..f4e765c6 100644 --- a/power/models/network_reference.go +++ b/power/models/network_reference.go @@ -48,7 +48,7 @@ type NetworkReference struct { // Type of Network - 'vlan' (private network) 'pub-vlan' (public network) 'dhcp-vlan' (for satellite locations only) // Required: true - // Enum: [vlan pub-vlan dhcp-vlan] + // Enum: ["vlan","pub-vlan","dhcp-vlan"] Type *string `json:"type"` // VLAN ID diff --git a/power/models/operations.go b/power/models/operations.go index 4c2d8b08..66c44c0f 100644 --- a/power/models/operations.go +++ b/power/models/operations.go @@ -21,15 +21,15 @@ import ( 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] + // Enum: ["a","b","c","d"] BootMode string `json:"bootMode,omitempty"` // Name of the server operating mode - // Enum: [normal manual] + // Enum: ["normal","manual"] OperatingMode string `json:"operatingMode,omitempty"` // Name of the job task to execute - // Enum: [dston retrydump consoleservice iopreset remotedstoff remotedston iopdump dumprestart] + // Enum: ["dston","retrydump","consoleservice","iopreset","remotedstoff","remotedston","iopdump","dumprestart"] Task string `json:"task,omitempty"` } diff --git a/power/models/p_vm_instance.go b/power/models/p_vm_instance.go index 9f80286d..525c15d6 100644 --- a/power/models/p_vm_instance.go +++ b/power/models/p_vm_instance.go @@ -95,7 +95,7 @@ type PVMInstance struct { // Processor type (dedicated, shared, capped) // Required: true - // Enum: [dedicated shared capped ] + // Enum: ["dedicated","shared","capped",""] ProcType *string `json:"procType"` // Number of processors allocated diff --git a/power/models/p_vm_instance_action.go b/power/models/p_vm_instance_action.go index ee89da8e..582f52a5 100644 --- a/power/models/p_vm_instance_action.go +++ b/power/models/p_vm_instance_action.go @@ -22,7 +22,7 @@ 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] + // Enum: ["start","stop","immediate-shutdown","hard-reboot","soft-reboot","reset-state","dhcp-ip-sync"] Action *string `json:"action"` } diff --git a/power/models/p_vm_instance_address.go b/power/models/p_vm_instance_address.go index 2e7ad6b9..48dee66d 100644 --- a/power/models/p_vm_instance_address.go +++ b/power/models/p_vm_instance_address.go @@ -46,6 +46,16 @@ func (m PVMInstanceAddress) MarshalJSON() ([]byte, error) { // Validate validates this p VM instance address func (m *PVMInstanceAddress) Validate(formats strfmt.Registry) error { + var res []error + + // validation for a type composition with PVMInstanceNetwork + if err := m.PVMInstanceNetwork.Validate(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } return nil } diff --git a/power/models/p_vm_instance_capture.go b/power/models/p_vm_instance_capture.go index edac443a..1f0976d1 100644 --- a/power/models/p_vm_instance_capture.go +++ b/power/models/p_vm_instance_capture.go @@ -22,7 +22,7 @@ type PVMInstanceCapture struct { // Destination for the deployable image // Required: true - // Enum: [image-catalog cloud-storage both] + // Enum: ["image-catalog","cloud-storage","both"] CaptureDestination *string `json:"captureDestination"` // Name of the deployable image created for the captured PVMInstance diff --git a/power/models/p_vm_instance_clone.go b/power/models/p_vm_instance_clone.go index 6604fcf8..b1bbd983 100644 --- a/power/models/p_vm_instance_clone.go +++ b/power/models/p_vm_instance_clone.go @@ -36,7 +36,7 @@ type PVMInstanceClone struct { Networks []*PVMInstanceAddNetwork `json:"networks"` // Processor type (dedicated, shared, capped) - // Enum: [dedicated shared capped] + // Enum: ["dedicated","shared","capped"] ProcType *string `json:"procType,omitempty"` // Number of processors allocated diff --git a/power/models/p_vm_instance_create.go b/power/models/p_vm_instance_create.go index b01489d4..c8ec2702 100644 --- a/power/models/p_vm_instance_create.go +++ b/power/models/p_vm_instance_create.go @@ -58,7 +58,7 @@ type PVMInstanceCreate struct { // Processor type (dedicated, shared, capped) // Required: true - // Enum: [dedicated shared capped] + // Enum: ["dedicated","shared","capped"] ProcType *string `json:"procType"` // Number of processors allocated @@ -66,11 +66,11 @@ type PVMInstanceCreate struct { 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] + // Enum: ["affinity","anti-affinity","none"] ReplicantAffinityPolicy *string `json:"replicantAffinityPolicy,omitempty"` // How to name the created vms - // Enum: [prefix suffix] + // Enum: ["prefix","suffix"] ReplicantNamingScheme *string `json:"replicantNamingScheme,omitempty"` // Number of duplicate instances to create in this request @@ -90,11 +90,11 @@ type PVMInstanceCreate struct { StorageAffinity *StorageAffinity `json:"storageAffinity,omitempty"` // The storage connection type - // Enum: [vSCSI maxVolumeSupport] + // Enum: ["vSCSI","maxVolumeSupport"] StorageConnection string `json:"storageConnection,omitempty"` // The storage connection type - // Enum: [vSCSI maxVolumeSupport] + // 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 diff --git a/power/models/p_vm_instance_multi_create.go b/power/models/p_vm_instance_multi_create.go index 682af222..7df1b2e6 100644 --- a/power/models/p_vm_instance_multi_create.go +++ b/power/models/p_vm_instance_multi_create.go @@ -21,14 +21,14 @@ import ( 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] + // 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] + // Enum: ["prefix","suffix"] Numerical *string `json:"numerical,omitempty"` } diff --git a/power/models/p_vm_instance_operation.go b/power/models/p_vm_instance_operation.go index 37c18f85..88a38dfb 100644 --- a/power/models/p_vm_instance_operation.go +++ b/power/models/p_vm_instance_operation.go @@ -26,7 +26,7 @@ type PVMInstanceOperation struct { // Name of the operation to execute; can be job or boot // Required: true - // Enum: [job boot] + // Enum: ["job","boot"] OperationType *string `json:"operationType"` } diff --git a/power/models/p_vm_instance_reference.go b/power/models/p_vm_instance_reference.go index 03af3a5e..54e5d7b1 100644 --- a/power/models/p_vm_instance_reference.go +++ b/power/models/p_vm_instance_reference.go @@ -89,7 +89,7 @@ type PVMInstanceReference struct { // Processor type (dedicated, shared, capped) // Required: true - // Enum: [dedicated shared capped] + // Enum: ["dedicated","shared","capped"] ProcType *string `json:"procType"` // Number of processors allocated diff --git a/power/models/p_vm_instance_update.go b/power/models/p_vm_instance_update.go index 4fb843f6..56e06295 100644 --- a/power/models/p_vm_instance_update.go +++ b/power/models/p_vm_instance_update.go @@ -36,7 +36,7 @@ type PVMInstanceUpdate struct { PinPolicy PinPolicy `json:"pinPolicy,omitempty"` // Processor type (dedicated, shared, capped) - // Enum: [dedicated shared capped] + // Enum: ["dedicated","shared","capped"] ProcType string `json:"procType,omitempty"` // Number of processors allocated diff --git a/power/models/p_vm_instance_update_response.go b/power/models/p_vm_instance_update_response.go index 07ccf955..21176e39 100644 --- a/power/models/p_vm_instance_update_response.go +++ b/power/models/p_vm_instance_update_response.go @@ -30,7 +30,7 @@ type PVMInstanceUpdateResponse struct { PinPolicy PinPolicy `json:"pinPolicy,omitempty"` // Processor type (dedicated, shared, capped) - // Enum: [dedicated shared capped] + // Enum: ["dedicated","shared","capped"] ProcType string `json:"procType,omitempty"` // Number of processors allocated diff --git a/power/models/p_vm_instance_v2_network_port.go b/power/models/p_vm_instance_v2_network_port.go index dc5bacb4..840f0d50 100644 --- a/power/models/p_vm_instance_v2_network_port.go +++ b/power/models/p_vm_instance_v2_network_port.go @@ -24,7 +24,7 @@ type PVMInstanceV2NetworkPort struct { ID string `json:"id,omitempty"` // Dynamic Host Configuration Protocol {IPv4, IPv6} - // Enum: [IPv4 IPv6] + // Enum: ["IPv4","IPv6"] IPProtocol string `json:"ipProtocol,omitempty"` // The mac address of the network interface @@ -34,7 +34,7 @@ type PVMInstanceV2NetworkPort struct { PrivateIP string `json:"privateIP,omitempty"` // The type of ip allocation {dhcp, static} - // Enum: [dhcp static] + // Enum: ["dhcp","static"] Type string `json:"type,omitempty"` } diff --git a/power/models/placement_group.go b/power/models/placement_group.go index 31661603..bd3cf515 100644 --- a/power/models/placement_group.go +++ b/power/models/placement_group.go @@ -34,7 +34,7 @@ type PlacementGroup struct { // The Placement Group Policy // Required: true - // Enum: [affinity anti-affinity] + // Enum: ["affinity","anti-affinity"] Policy *string `json:"policy"` } diff --git a/power/models/placement_group_create.go b/power/models/placement_group_create.go index 2fd3d083..9c3a804e 100644 --- a/power/models/placement_group_create.go +++ b/power/models/placement_group_create.go @@ -26,7 +26,7 @@ type PlacementGroupCreate struct { // The Placement Group Policy // Required: true - // Enum: [affinity anti-affinity] + // Enum: ["affinity","anti-affinity"] Policy *string `json:"policy"` } diff --git a/power/models/power_edge_router_action.go b/power/models/power_edge_router_action.go index ed427705..428c4ef4 100644 --- a/power/models/power_edge_router_action.go +++ b/power/models/power_edge_router_action.go @@ -22,7 +22,7 @@ type PowerEdgeRouterAction struct { // Name of the action to take; can be migrate-start, migrate-validate // Required: true - // Enum: [migrate-start migrate-validate] + // Enum: ["migrate-start","migrate-validate"] Action *string `json:"action"` } diff --git a/power/models/pvm_instance_deployment.go b/power/models/pvm_instance_deployment.go index e3be7bea..24a38568 100644 --- a/power/models/pvm_instance_deployment.go +++ b/power/models/pvm_instance_deployment.go @@ -28,7 +28,7 @@ type PvmInstanceDeployment struct { // Processor mode (dedicated, shared, capped) // Required: true - // Enum: [dedicated shared capped] + // Enum: ["dedicated","shared","capped"] ProcessorMode *string `json:"processorMode"` // Type of Deployment [SAP-RISE, EPIC] diff --git a/power/models/s_a_p_profile.go b/power/models/s_a_p_profile.go index 51bec76a..86d688a2 100644 --- a/power/models/s_a_p_profile.go +++ b/power/models/s_a_p_profile.go @@ -43,7 +43,7 @@ type SAPProfile struct { Saps int64 `json:"saps"` // Required smt mode for that profile - // Enum: [4 8] + // Enum: [4,8] SmtMode int64 `json:"smtMode"` // List of supported systems @@ -51,7 +51,7 @@ type SAPProfile struct { // Type of profile // Required: true - // Enum: [balanced compute memory non-production ultra-memory small SAP Rise Optimized] + // Enum: ["balanced","compute","memory","non-production","ultra-memory","small","SAP Rise Optimized"] Type *string `json:"type"` // List of supported workload types diff --git a/power/models/s_p_p_placement_group_create.go b/power/models/s_p_p_placement_group_create.go index 9bc09ffc..acf4c06d 100644 --- a/power/models/s_p_p_placement_group_create.go +++ b/power/models/s_p_p_placement_group_create.go @@ -26,7 +26,7 @@ type SPPPlacementGroupCreate struct { // The placement group policy // Required: true - // Enum: [affinity anti-affinity] + // Enum: ["affinity","anti-affinity"] Policy *string `json:"policy"` } diff --git a/power/models/service_binding_volume_mount.go b/power/models/service_binding_volume_mount.go index 96b1ac78..e95edd18 100644 --- a/power/models/service_binding_volume_mount.go +++ b/power/models/service_binding_volume_mount.go @@ -30,7 +30,7 @@ type ServiceBindingVolumeMount struct { // device type // Required: true - // Enum: [shared] + // Enum: ["shared"] DeviceType *string `json:"device_type"` // driver @@ -39,7 +39,7 @@ type ServiceBindingVolumeMount struct { // mode // Required: true - // Enum: [r rw] + // Enum: ["r","rw"] Mode *string `json:"mode"` } diff --git a/power/models/shared_processor_pool_server.go b/power/models/shared_processor_pool_server.go index 87e4b461..87a1dcab 100644 --- a/power/models/shared_processor_pool_server.go +++ b/power/models/shared_processor_pool_server.go @@ -18,7 +18,7 @@ import ( type SharedProcessorPoolServer struct { // The amount of cpus for the server - Cpus int64 `json:"Cpus,omitempty"` + Cpus float64 `json:"Cpus,omitempty"` // Identifies if uncapped or not Uncapped bool `json:"Uncapped,omitempty"` @@ -39,7 +39,7 @@ type SharedProcessorPoolServer struct { Status string `json:"status,omitempty"` // The amout of vcpus for the server - Vcpus float64 `json:"vcpus,omitempty"` + Vcpus int64 `json:"vcpus,omitempty"` } // Validate validates this shared processor pool server diff --git a/power/models/storage_affinity.go b/power/models/storage_affinity.go index 071b9891..49ea8ed6 100644 --- a/power/models/storage_affinity.go +++ b/power/models/storage_affinity.go @@ -24,7 +24,7 @@ type StorageAffinity struct { 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] + // 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 diff --git a/power/models/storage_pool.go b/power/models/storage_pool.go index 2689e790..3f70d6a3 100644 --- a/power/models/storage_pool.go +++ b/power/models/storage_pool.go @@ -37,7 +37,7 @@ type StoragePool struct { // state of storage pool // Required: true - // Enum: [closed opened] + // Enum: ["closed","opened"] State *string `json:"state"` // type of storage pool diff --git a/power/models/storage_tier.go b/power/models/storage_tier.go index ae6990bb..16531848 100644 --- a/power/models/storage_tier.go +++ b/power/models/storage_tier.go @@ -27,7 +27,7 @@ type StorageTier struct { Name string `json:"name,omitempty"` // State of the storage tier (active or inactive) - // Enum: [active inactive] + // Enum: ["active","inactive"] State *string `json:"state,omitempty"` } diff --git a/power/models/storage_type.go b/power/models/storage_type.go index 4af1f895..79b41647 100644 --- a/power/models/storage_type.go +++ b/power/models/storage_type.go @@ -27,7 +27,7 @@ type StorageType struct { Description string `json:"description,omitempty"` // State of the storage type (active or inactive) - // Enum: [active inactive] + // Enum: ["active","inactive"] State *string `json:"state,omitempty"` // Storage type diff --git a/power/models/token_request.go b/power/models/token_request.go index a136c5ce..a6801a13 100644 --- a/power/models/token_request.go +++ b/power/models/token_request.go @@ -26,7 +26,7 @@ type TokenRequest struct { // Source type of the token request (web or cli) // Required: true - // Enum: [web cli] + // Enum: ["web","cli"] Source *string `json:"source"` } diff --git a/power/models/transit_gateway_location.go b/power/models/transit_gateway_location.go index 98e5e393..766183b6 100644 --- a/power/models/transit_gateway_location.go +++ b/power/models/transit_gateway_location.go @@ -28,7 +28,7 @@ type TransitGatewayLocation struct { // Location Type of the PowerVS Service // Example: data-center // Required: true - // Enum: [region data-center zone] + // Enum: ["region","data-center","zone"] LocationType *string `json:"locationType"` // The PowerVS Location URL path to access specific service instance information diff --git a/power/models/update_storage_pool.go b/power/models/update_storage_pool.go index 288e2d3c..cdb59e49 100644 --- a/power/models/update_storage_pool.go +++ b/power/models/update_storage_pool.go @@ -30,7 +30,7 @@ type UpdateStoragePool struct { OverrideThresholds *Thresholds `json:"overrideThresholds,omitempty"` // state of storage pool - // Enum: [closed opened] + // Enum: ["closed","opened"] State *string `json:"state,omitempty"` } diff --git a/power/models/v_p_n_connection.go b/power/models/v_p_n_connection.go index cdc7c00e..cafa6591 100644 --- a/power/models/v_p_n_connection.go +++ b/power/models/v_p_n_connection.go @@ -45,7 +45,7 @@ type VPNConnection struct { // 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] + // Enum: ["policy","route"] Mode *string `json:"mode"` // VPN Connection name @@ -69,7 +69,7 @@ type VPNConnection struct { // status of the VPN connection // Required: true - // Enum: [active warning disabled] + // Enum: ["active","warning","disabled"] Status *string `json:"status"` // public IP address of the VPN Gateway (vSRX) attached to this VPNConnection diff --git a/power/models/v_p_n_connection_create.go b/power/models/v_p_n_connection_create.go index 3e6fe175..81738285 100644 --- a/power/models/v_p_n_connection_create.go +++ b/power/models/v_p_n_connection_create.go @@ -33,7 +33,7 @@ type VPNConnectionCreate struct { // 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] + // Enum: ["policy","route"] Mode *string `json:"mode"` // VPN Connection name diff --git a/power/models/v_p_n_connection_update.go b/power/models/v_p_n_connection_update.go index 455d705f..5fe68e01 100644 --- a/power/models/v_p_n_connection_update.go +++ b/power/models/v_p_n_connection_update.go @@ -16,7 +16,7 @@ import ( // VPNConnectionUpdate VPN Connection object to send during the update // -// Min Properties: 1 +// MinProperties: 1 // // swagger:model VPNConnectionUpdate type VPNConnectionUpdate struct { diff --git a/power/models/volume.go b/power/models/volume.go index a547d52f..3eadf969 100644 --- a/power/models/volume.go +++ b/power/models/volume.go @@ -71,7 +71,7 @@ type Volume struct { OutOfBandDeleted bool `json:"outOfBandDeleted,omitempty"` // indicates whether master/aux volume is playing the primary role - // Enum: [master aux] + // Enum: ["master","aux"] PrimaryRole string `json:"primaryRole,omitempty"` // List of PCloud PVM Instance attached to the volume diff --git a/power/models/volume_group_action.go b/power/models/volume_group_action.go index 937960a0..9da802f0 100644 --- a/power/models/volume_group_action.go +++ b/power/models/volume_group_action.go @@ -16,8 +16,8 @@ import ( // VolumeGroupAction Performs an action (start stop reset ) on a volume group(one at a time). // -// Min Properties: 1 -// Max Properties: 1 +// MinProperties: 1 +// MaxProperties: 1 // // swagger:model VolumeGroupAction type VolumeGroupAction struct { diff --git a/power/models/volume_group_action_reset.go b/power/models/volume_group_action_reset.go index 6a108ff7..1e5bb0ac 100644 --- a/power/models/volume_group_action_reset.go +++ b/power/models/volume_group_action_reset.go @@ -22,7 +22,7 @@ type VolumeGroupActionReset struct { // New status to be set for a volume group // Required: true - // Enum: [available] + // Enum: ["available"] Status *string `json:"status"` } diff --git a/power/models/volume_group_action_start.go b/power/models/volume_group_action_start.go index 8a445a15..fe500653 100644 --- a/power/models/volume_group_action_start.go +++ b/power/models/volume_group_action_start.go @@ -22,7 +22,7 @@ type VolumeGroupActionStart struct { // Indicates the source of the action // Required: true - // Enum: [master aux] + // Enum: ["master","aux"] Source *string `json:"source"` } diff --git a/power/models/volume_reference.go b/power/models/volume_reference.go index fe2c483b..4c68c21a 100644 --- a/power/models/volume_reference.go +++ b/power/models/volume_reference.go @@ -77,7 +77,7 @@ type VolumeReference struct { OutOfBandDeleted bool `json:"outOfBandDeleted,omitempty"` // indicates whether master/aux volume is playing the primary role - // Enum: [master aux] + // Enum: ["master","aux"] PrimaryRole string `json:"primaryRole,omitempty"` // List of PCloud PVM Instance attached to the volume diff --git a/power/models/workspace.go b/power/models/workspace.go index 6cc54bab..89fdc4dc 100644 --- a/power/models/workspace.go +++ b/power/models/workspace.go @@ -46,7 +46,7 @@ type Workspace struct { // The Workspace type // Required: true - // Enum: [off-premises on-premises] + // Enum: ["off-premises","on-premises"] Type *string `json:"type"` } diff --git a/power/models/workspace_power_edge_router_details.go b/power/models/workspace_power_edge_router_details.go index 91e5d997..60509fb7 100644 --- a/power/models/workspace_power_edge_router_details.go +++ b/power/models/workspace_power_edge_router_details.go @@ -21,17 +21,17 @@ import ( type WorkspacePowerEdgeRouterDetails struct { // The migration status of a Power Edge Router - // Enum: [intializing migrating deleted completed] + // 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] + // Enum: ["active","error","warning","configuring","removing","inactive","user-validation"] State *string `json:"state"` // The Power Edge Router type // Required: true - // Enum: [automated manual] + // Enum: ["automated","manual"] Type *string `json:"type"` } From 3cf13d3c1494d7454f9a12984d5ce7937283dbf6 Mon Sep 17 00:00:00 2001 From: michaelkad <45772690+michaelkad@users.noreply.github.com> Date: Fri, 31 May 2024 10:02:42 -0500 Subject: [PATCH 077/118] Update to go 1.22 (#396) --- .github/workflows/go.yml | 2 +- go.mod | 2 +- go.sum | 10 ++++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index b475f774..d8f5e267 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -18,7 +18,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: '1.20' + go-version: '1.22' - name: Lint uses: golangci/golangci-lint-action@v5 diff --git a/go.mod b/go.mod index 1208f872..49b13a69 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/IBM-Cloud/power-go-client -go 1.20 +go 1.22 require ( github.com/IBM/go-sdk-core/v5 v5.15.3 diff --git a/go.sum b/go.sum index 28057c5e..0ae0fcce 100644 --- a/go.sum +++ b/go.sum @@ -10,6 +10,7 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= +github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= @@ -38,6 +39,7 @@ github.com/go-openapi/swag v0.22.5/go.mod h1:Gl91UqO+btAM0plGGxHqJcQZ1ZTy6jbmrid github.com/go-openapi/validate v0.22.4 h1:5v3jmMyIPKTR8Lv9syBAIRxG6lY0RqeBPB1LKEijzk8= github.com/go-openapi/validate v0.22.4/go.mod h1:qm6O8ZIcPVdSY5219468Jv7kBdGvkiZLPOmqnqTUZ2A= github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= +github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= @@ -60,7 +62,9 @@ github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8Hm github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leodido/go-urn v1.3.0 h1:jX8FDLfW4ThVXctBNZ+3cIWnCSnrACDV73r76dy0aQQ= github.com/leodido/go-urn v1.3.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= @@ -69,9 +73,11 @@ github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyua github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg= github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= @@ -79,6 +85,7 @@ github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYr github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -94,6 +101,7 @@ go.mongodb.org/mongo-driver v1.13.1/go.mod h1:wcDf1JBCXy2mOW0bWHwO/IOYqdca1MPCwD go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM= go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU= go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY= +go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM= go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M= go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -135,7 +143,9 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= From c9095d1b180dc4bdf4aaa20e61ab5124a02fbbc4 Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Mon, 10 Jun 2024 12:43:47 -0500 Subject: [PATCH 078/118] Generated Swagger client from service-broker commit f43b28fb6f66ffdf7aa6499f4dc09619d22feeda (#401) --- power/client/power_iaas_api_client.go | 5 + power/client/snapshots/snapshots_client.go | 147 ++++++ .../snapshots/v1_snapshots_get_parameters.go | 151 ++++++ .../snapshots/v1_snapshots_get_responses.go | 486 ++++++++++++++++++ .../v1_snapshots_getall_parameters.go | 128 +++++ .../v1_snapshots_getall_responses.go | 410 +++++++++++++++ power/models/snapshot_list.go | 124 +++++ power/models/snapshot_v1.go | 179 +++++++ 8 files changed, 1630 insertions(+) create mode 100644 power/client/snapshots/snapshots_client.go create mode 100644 power/client/snapshots/v1_snapshots_get_parameters.go create mode 100644 power/client/snapshots/v1_snapshots_get_responses.go create mode 100644 power/client/snapshots/v1_snapshots_getall_parameters.go create mode 100644 power/client/snapshots/v1_snapshots_getall_responses.go create mode 100644 power/models/snapshot_list.go create mode 100644 power/models/snapshot_v1.go diff --git a/power/client/power_iaas_api_client.go b/power/client/power_iaas_api_client.go index cbd707d0..43c7c298 100644 --- a/power/client/power_iaas_api_client.go +++ b/power/client/power_iaas_api_client.go @@ -51,6 +51,7 @@ import ( "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" @@ -139,6 +140,7 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *PowerIaasA 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) @@ -268,6 +270,8 @@ type PowerIaasAPI struct { ServiceInstances service_instances.ClientService + Snapshots snapshots.ClientService + StorageTypes storage_types.ClientService SwaggerSpec swagger_spec.ClientService @@ -321,6 +325,7 @@ func (c *PowerIaasAPI) SetTransport(transport runtime.ClientTransport) { 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/snapshots/snapshots_client.go b/power/client/snapshots/snapshots_client.go new file mode 100644 index 00000000..3ad1d9fc --- /dev/null +++ b/power/client/snapshots/snapshots_client.go @@ -0,0 +1,147 @@ +// 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) + + SetTransport(transport runtime.ClientTransport) +} + +/* +V1SnapshotsGet gets the detail of a snapshot +*/ +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 +*/ +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) +} + +// 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 new file mode 100644 index 00000000..9777373d --- /dev/null +++ b/power/client/snapshots/v1_snapshots_get_parameters.go @@ -0,0 +1,151 @@ +// 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 new file mode 100644 index 00000000..576e0c59 --- /dev/null +++ b/power/client/snapshots/v1_snapshots_get_responses.go @@ -0,0 +1,486 @@ +// 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 + 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 +} diff --git a/power/client/snapshots/v1_snapshots_getall_parameters.go b/power/client/snapshots/v1_snapshots_getall_parameters.go new file mode 100644 index 00000000..99063ef1 --- /dev/null +++ b/power/client/snapshots/v1_snapshots_getall_parameters.go @@ -0,0 +1,128 @@ +// 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 new file mode 100644 index 00000000..36b8f3ee --- /dev/null +++ b/power/client/snapshots/v1_snapshots_getall_responses.go @@ -0,0 +1,410 @@ +// 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 + 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 +} diff --git a/power/models/snapshot_list.go b/power/models/snapshot_list.go new file mode 100644 index 00000000..a1e6fd10 --- /dev/null +++ b/power/models/snapshot_list.go @@ -0,0 +1,124 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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 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_v1.go b/power/models/snapshot_v1.go new file mode 100644 index 00000000..2974fef6 --- /dev/null +++ b/power/models/snapshot_v1.go @@ -0,0 +1,179 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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 snapshot was created. + // Format: date-time + CreationDate strfmt.DateTime `json:"creationDate,omitempty"` + + // The snapshot UUID. + // Required: true + ID *string `json:"id"` + + // The snapshot name. + // Required: true + Name *string `json:"name"` + + // The size of the snapshot, in gibibytes (GiB). + // Required: true + Size *float64 `json:"size"` + + // The status for the snapshot. + // Required: true + Status *string `json:"status"` + + // The date and time when the 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.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) 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 validates this snapshot v1 based on context it is used +func (m *SnapshotV1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + 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 +} From be8ae866a2e122920b937e3a4379e963151856b9 Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Mon, 17 Jun 2024 10:46:17 -0500 Subject: [PATCH 079/118] Generated Swagger client from service-broker commit 814f6cac25d7b8aef6e71aa89b6ba9ebecbfff9e (#402) --- power/models/create_data_volume.go | 3 ++ power/models/multi_volumes_create.go | 3 ++ power/models/site.go | 76 +++++++++++++++++++++++++++- power/models/storage_pool_map.go | 53 +++++++++++++++++++ 4 files changed, 134 insertions(+), 1 deletion(-) create mode 100644 power/models/storage_pool_map.go diff --git a/power/models/create_data_volume.go b/power/models/create_data_volume.go index ab5c4051..52d2a500 100644 --- a/power/models/create_data_volume.go +++ b/power/models/create_data_volume.go @@ -46,6 +46,9 @@ type CreateDataVolume struct { // Indicates if the volume should be replication enabled or not ReplicationEnabled *bool `json:"replicationEnabled,omitempty"` + // List of replication sites for volume replication + ReplicationSite []string `json:"replicationSite,omitempty"` + // Indicates if the volume is shareable between VMs Shareable *bool `json:"shareable,omitempty"` diff --git a/power/models/multi_volumes_create.go b/power/models/multi_volumes_create.go index 7b1a701f..28ce2b24 100644 --- a/power/models/multi_volumes_create.go +++ b/power/models/multi_volumes_create.go @@ -49,6 +49,9 @@ type MultiVolumesCreate struct { // Indicates if the volume should be replication enabled or not ReplicationEnabled *bool `json:"replicationEnabled,omitempty"` + // List of replication sites for volume replication + ReplicationSite []string `json:"replicationSite,omitempty"` + // Indicates if the volume is shareable between VMs Shareable *bool `json:"shareable,omitempty"` diff --git a/power/models/site.go b/power/models/site.go index e6523f50..2a9caa29 100644 --- a/power/models/site.go +++ b/power/models/site.go @@ -7,7 +7,9 @@ package models import ( "context" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -17,6 +19,9 @@ import ( // 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"` @@ -26,11 +31,80 @@ type Site struct { // 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 validates this site based on context it is used +// 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 } diff --git a/power/models/storage_pool_map.go b/power/models/storage_pool_map.go new file mode 100644 index 00000000..d42b5209 --- /dev/null +++ b/power/models/storage_pool_map.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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 +} From 7e37813414bcf7fec3e1cbfa684766cd5f22e855 Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Mon, 17 Jun 2024 10:46:45 -0500 Subject: [PATCH 080/118] Generated Swagger client from service-broker commit d82c42a9b20ab1dcd2188c89e0b0a3c8ea8db1ff (#403) --- power/models/volume.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/power/models/volume.go b/power/models/volume.go index 3eadf969..97e5ca8b 100644 --- a/power/models/volume.go +++ b/power/models/volume.go @@ -80,6 +80,9 @@ type Volume struct { // True if volume is replication enabled otherwise false ReplicationEnabled *bool `json:"replicationEnabled,omitempty"` + // List of replication sites for volume replication + ReplicationSite []string `json:"replicationSite,omitempty"` + // Replication status of a volume ReplicationStatus string `json:"replicationStatus,omitempty"` From 4f8914d18d6853498149e0ac7166f064b13ea911 Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Mon, 17 Jun 2024 10:47:12 -0500 Subject: [PATCH 081/118] Generated Swagger client from service-broker commit ad5b24d0dca3b490cb45eadc0284d9bbcfbcea4e (#404) --- power/models/volume_reference.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/power/models/volume_reference.go b/power/models/volume_reference.go index 4c68c21a..1998307a 100644 --- a/power/models/volume_reference.go +++ b/power/models/volume_reference.go @@ -86,6 +86,9 @@ type VolumeReference struct { // True if volume is replication enabled otherwise false ReplicationEnabled *bool `json:"replicationEnabled,omitempty"` + // List of replication sites for volume replication + ReplicationSite []string `json:"replicationSite,omitempty"` + // shows the replication status of a volume ReplicationStatus string `json:"replicationStatus,omitempty"` From 14463b0dd832a599e9975fe46b438671a41624ad Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Mon, 17 Jun 2024 10:47:26 -0500 Subject: [PATCH 082/118] Generated Swagger client from service-broker commit 5fa65c3c11cd0c1479d3c3e135aa62c79cfd84bf (#405) From a21698db6b435ba5944735861bb81aab530f373b Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Mon, 17 Jun 2024 10:47:44 -0500 Subject: [PATCH 083/118] Generated Swagger client from service-broker commit c455f6094ce91e25678e3fe9575767c3122cf837 (#406) --- .../snapshots/v1_snapshots_get_responses.go | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/power/client/snapshots/v1_snapshots_get_responses.go b/power/client/snapshots/v1_snapshots_get_responses.go index 576e0c59..ebddf614 100644 --- a/power/client/snapshots/v1_snapshots_get_responses.go +++ b/power/client/snapshots/v1_snapshots_get_responses.go @@ -60,6 +60,12 @@ func (o *V1SnapshotsGetReader) ReadResponse(response runtime.ClientResponse, con 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()) } @@ -484,3 +490,73 @@ func (o *V1SnapshotsGetInternalServerError) readResponse(response runtime.Client 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 +} From d0cf2310b1d3ca3b5fe03cbdeb14ad399f52c9bb Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Mon, 17 Jun 2024 10:48:01 -0500 Subject: [PATCH 084/118] Generated Swagger client from service-broker commit f19df27ca2e676ba6cb9f5e73036f4536d5c050c (#407) --- .../v1_snapshots_getall_responses.go | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/power/client/snapshots/v1_snapshots_getall_responses.go b/power/client/snapshots/v1_snapshots_getall_responses.go index 36b8f3ee..5c4ebf06 100644 --- a/power/client/snapshots/v1_snapshots_getall_responses.go +++ b/power/client/snapshots/v1_snapshots_getall_responses.go @@ -54,6 +54,12 @@ func (o *V1SnapshotsGetallReader) ReadResponse(response runtime.ClientResponse, 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()) } @@ -408,3 +414,73 @@ func (o *V1SnapshotsGetallInternalServerError) readResponse(response runtime.Cli 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 +} From 296b45bcef182c6d97cab207310ec7c1e8d42d75 Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Mon, 17 Jun 2024 10:48:33 -0500 Subject: [PATCH 085/118] Generated Swagger client from service-broker commit f856adaa7760209889781f329a122db016cc5587 (#408) From dd62fa532a42c5363c14ead3d3caded49baa959a Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Mon, 17 Jun 2024 10:48:52 -0500 Subject: [PATCH 086/118] Generated Swagger client from service-broker commit b7a20105660b86a198fa90be0e47093ac3ff9a5d (#409) From 5e0c12635d13d16dc8ec816df4a009e6f1b2b9d0 Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Thu, 20 Jun 2024 11:56:04 -0500 Subject: [PATCH 087/118] Generated Swagger client from service-broker commit a12c633b384121ad968e29dc314911c618f594fb (#411) --- power/models/create_data_volume.go | 3 --- power/models/multi_volumes_create.go | 3 --- power/models/p_vm_instance_create.go | 3 +++ power/models/s_a_p_create.go | 3 +++ power/models/volume.go | 3 --- power/models/volume_reference.go | 3 --- 6 files changed, 6 insertions(+), 12 deletions(-) diff --git a/power/models/create_data_volume.go b/power/models/create_data_volume.go index 52d2a500..ab5c4051 100644 --- a/power/models/create_data_volume.go +++ b/power/models/create_data_volume.go @@ -46,9 +46,6 @@ type CreateDataVolume struct { // Indicates if the volume should be replication enabled or not ReplicationEnabled *bool `json:"replicationEnabled,omitempty"` - // List of replication sites for volume replication - ReplicationSite []string `json:"replicationSite,omitempty"` - // Indicates if the volume is shareable between VMs Shareable *bool `json:"shareable,omitempty"` diff --git a/power/models/multi_volumes_create.go b/power/models/multi_volumes_create.go index 28ce2b24..7b1a701f 100644 --- a/power/models/multi_volumes_create.go +++ b/power/models/multi_volumes_create.go @@ -49,9 +49,6 @@ type MultiVolumesCreate struct { // Indicates if the volume should be replication enabled or not ReplicationEnabled *bool `json:"replicationEnabled,omitempty"` - // List of replication sites for volume replication - ReplicationSite []string `json:"replicationSite,omitempty"` - // Indicates if the volume is shareable between VMs Shareable *bool `json:"shareable,omitempty"` diff --git a/power/models/p_vm_instance_create.go b/power/models/p_vm_instance_create.go index c8ec2702..d3bde052 100644 --- a/power/models/p_vm_instance_create.go +++ b/power/models/p_vm_instance_create.go @@ -21,6 +21,9 @@ import ( // 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"` diff --git a/power/models/s_a_p_create.go b/power/models/s_a_p_create.go index 36187301..967ec274 100644 --- a/power/models/s_a_p_create.go +++ b/power/models/s_a_p_create.go @@ -20,6 +20,9 @@ import ( // 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"` diff --git a/power/models/volume.go b/power/models/volume.go index 97e5ca8b..3eadf969 100644 --- a/power/models/volume.go +++ b/power/models/volume.go @@ -80,9 +80,6 @@ type Volume struct { // True if volume is replication enabled otherwise false ReplicationEnabled *bool `json:"replicationEnabled,omitempty"` - // List of replication sites for volume replication - ReplicationSite []string `json:"replicationSite,omitempty"` - // Replication status of a volume ReplicationStatus string `json:"replicationStatus,omitempty"` diff --git a/power/models/volume_reference.go b/power/models/volume_reference.go index 1998307a..4c68c21a 100644 --- a/power/models/volume_reference.go +++ b/power/models/volume_reference.go @@ -86,9 +86,6 @@ type VolumeReference struct { // True if volume is replication enabled otherwise false ReplicationEnabled *bool `json:"replicationEnabled,omitempty"` - // List of replication sites for volume replication - ReplicationSite []string `json:"replicationSite,omitempty"` - // shows the replication status of a volume ReplicationStatus string `json:"replicationStatus,omitempty"` From 148348f37cf83f80f27cff82ed2999a4cf148361 Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Thu, 20 Jun 2024 11:57:29 -0500 Subject: [PATCH 088/118] Generated Swagger client from service-broker commit e5f06d783dd7b97fec439b1aab6b685acf4faaaf (#415) --- power/client/snapshots/snapshots_client.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/power/client/snapshots/snapshots_client.go b/power/client/snapshots/snapshots_client.go index 3ad1d9fc..dc26c54c 100644 --- a/power/client/snapshots/snapshots_client.go +++ b/power/client/snapshots/snapshots_client.go @@ -65,6 +65,8 @@ type ClientService interface { /* V1SnapshotsGet gets the detail of a snapshot + +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 @@ -104,6 +106,8 @@ func (a *Client) V1SnapshotsGet(params *V1SnapshotsGetParams, authInfo runtime.C /* V1SnapshotsGetall gets a list of all the snapshots on a workspace + +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 From 35f53122a35d96ef223ba69725118b407269a99d Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Wed, 26 Jun 2024 10:32:10 -0500 Subject: [PATCH 089/118] Generated Swagger client from service-broker commit f6e02b8a86dff9db756936ce068fe9c691b65bf0 (#417) --- power/models/create_data_volume.go | 3 +++ power/models/volume.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/power/models/create_data_volume.go b/power/models/create_data_volume.go index ab5c4051..2743ff2f 100644 --- a/power/models/create_data_volume.go +++ b/power/models/create_data_volume.go @@ -46,6 +46,9 @@ type CreateDataVolume struct { // 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"` diff --git a/power/models/volume.go b/power/models/volume.go index 3eadf969..c3bcfed7 100644 --- a/power/models/volume.go +++ b/power/models/volume.go @@ -80,6 +80,9 @@ type Volume struct { // 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"` From 9b9e06d9ab1bc08b658e3b183d4598c8df9a6b63 Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Thu, 11 Jul 2024 10:58:25 -0500 Subject: [PATCH 090/118] Generated Swagger client from service-broker commit fd290cea4c8f21c4cdbcf02ab10d3d0b895d310e (#424) --- power/models/multi_volumes_create.go | 3 +++ power/models/p_vm_instance_create.go | 3 +++ power/models/volume.go | 20 ++++++++++++++++++++ power/models/volume_group.go | 9 +++++++++ power/models/volume_group_details.go | 9 +++++++++ power/models/volume_reference.go | 23 +++++++++++++++++++++++ 6 files changed, 67 insertions(+) diff --git a/power/models/multi_volumes_create.go b/power/models/multi_volumes_create.go index 7b1a701f..eb98deb2 100644 --- a/power/models/multi_volumes_create.go +++ b/power/models/multi_volumes_create.go @@ -49,6 +49,9 @@ type MultiVolumesCreate struct { // 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"` diff --git a/power/models/p_vm_instance_create.go b/power/models/p_vm_instance_create.go index d3bde052..e81b20e4 100644 --- a/power/models/p_vm_instance_create.go +++ b/power/models/p_vm_instance_create.go @@ -79,6 +79,9 @@ type PVMInstanceCreate struct { // 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"` diff --git a/power/models/volume.go b/power/models/volume.go index c3bcfed7..96e80ee7 100644 --- a/power/models/volume.go +++ b/power/models/volume.go @@ -46,6 +46,10 @@ type Volume struct { // 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"` @@ -121,6 +125,10 @@ func (m *Volume) Validate(formats strfmt.Registry) error { 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) } @@ -160,6 +168,18 @@ func (m *Volume) validateCreationDate(formats strfmt.Registry) error { 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 { diff --git a/power/models/volume_group.go b/power/models/volume_group.go index 077a3dbd..af67ef92 100644 --- a/power/models/volume_group.go +++ b/power/models/volume_group.go @@ -19,6 +19,9 @@ import ( // 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"` @@ -30,6 +33,9 @@ type VolumeGroup struct { // 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"` @@ -38,6 +44,9 @@ type VolumeGroup struct { // 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 diff --git a/power/models/volume_group_details.go b/power/models/volume_group_details.go index 2642a06d..9656e882 100644 --- a/power/models/volume_group_details.go +++ b/power/models/volume_group_details.go @@ -19,6 +19,9 @@ import ( // 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"` @@ -30,6 +33,9 @@ type VolumeGroupDetails struct { // 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"` @@ -39,6 +45,9 @@ type VolumeGroupDetails struct { // 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"` } diff --git a/power/models/volume_reference.go b/power/models/volume_reference.go index 4c68c21a..cfae6698 100644 --- a/power/models/volume_reference.go +++ b/power/models/volume_reference.go @@ -48,6 +48,10 @@ type VolumeReference struct { // 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"` @@ -86,6 +90,9 @@ type VolumeReference struct { // 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"` @@ -135,6 +142,10 @@ func (m *VolumeReference) Validate(formats strfmt.Registry) error { 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) } @@ -208,6 +219,18 @@ func (m *VolumeReference) validateDiskType(formats strfmt.Registry) error { 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 { From 425ad3377f4a05919e7bc8d2a401c60e87f815ce Mon Sep 17 00:00:00 2001 From: michaelkad <45772690+michaelkad@users.noreply.github.com> Date: Thu, 11 Jul 2024 14:43:44 -0500 Subject: [PATCH 091/118] Add Snaphots (#420) --- clients/instance/ibm-pi-snapshot.go | 30 +++++++++++++++++++++++++++++ examples/snapshot/main.go | 13 +++++++++++++ go.mod | 2 +- go.sum | 1 - 4 files changed, 44 insertions(+), 2 deletions(-) diff --git a/clients/instance/ibm-pi-snapshot.go b/clients/instance/ibm-pi-snapshot.go index 676c9647..5fe18aae 100644 --- a/clients/instance/ibm-pi-snapshot.go +++ b/clients/instance/ibm-pi-snapshot.go @@ -8,6 +8,8 @@ import ( "github.com/IBM-Cloud/power-go-client/ibmpisession" "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_snapshots" + "github.com/IBM-Cloud/power-go-client/power/client/snapshots" + "github.com/IBM-Cloud/power-go-client/power/models" ) @@ -96,3 +98,31 @@ func (f *IBMPISnapshotClient) Create(instanceID, snapshotID, restoreFailAction s } return resp.Payload, nil } + +// Get a SnapshotV1 +func (f *IBMPISnapshotClient) V1SnapshotsGet(id string) (*models.SnapshotV1, error) { + params := snapshots.NewV1SnapshotsGetParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).WithSnapshotID(id) + resp, err := f.session.Power.Snapshots.V1SnapshotsGet(params, f.session.AuthInfo(f.cloudInstanceID)) + + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Get PI Snapshot %s: %w", id, err)) + } + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to Get PI Snapshot %s", id) + } + return resp.Payload, nil +} + +// Get All SnapshotsV1 +func (f *IBMPISnapshotClient) V1SnapshotsGetall() (*models.SnapshotList, error) { + params := snapshots.NewV1SnapshotsGetallParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut) + resp, err := f.session.Power.Snapshots.V1SnapshotsGetall(params, f.session.AuthInfo(f.cloudInstanceID)) + + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Get all PI Snapshots: %w", err)) + } + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to Get all PI Snapshots") + } + return resp.Payload, nil +} diff --git a/examples/snapshot/main.go b/examples/snapshot/main.go index db5ead3d..55403a16 100644 --- a/examples/snapshot/main.go +++ b/examples/snapshot/main.go @@ -24,6 +24,7 @@ func main() { instance_id := " < INSTANCE ID > " snap_name := " < SNAPSHOT NAME > " description := " < DESCRIPTION > " + snapshot_id := " < SNAPSHOT ID > " authenticator := &core.BearerTokenAuthenticator{ BearerToken: token, @@ -81,4 +82,16 @@ func main() { } log.Printf("***************[4]****************** %+v \n", err) + // ***************[] SnapshotsV1 []****************** + getAllSnapV1Resp, err := powerSnapClient.V1SnapshotsGetall() + if err != nil { + log.Fatal(err) + } + log.Printf("***************[5]****************** %+v \n", getAllSnapV1Resp) + + getSnapV1Resp, err := powerSnapClient.V1SnapshotsGet(snapshot_id) + if err != nil { + log.Fatal(err) + } + log.Printf("***************[6]****************** %+v \n", getSnapV1Resp) } diff --git a/go.mod b/go.mod index 49b13a69..017e73ae 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/IBM-Cloud/power-go-client -go 1.22 +go 1.22.0 require ( github.com/IBM/go-sdk-core/v5 v5.15.3 diff --git a/go.sum b/go.sum index fd49abf1..0ae0fcce 100644 --- a/go.sum +++ b/go.sum @@ -80,7 +80,6 @@ github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg= github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= -github.com/onsi/gomega v1.31.1/go.mod h1:y40C95dwAD1Nz36SsEnxvfFe8FFfNxzI5eJ0EYGyAy0= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= From ef2ef2a570187290b09468d90093fa2fb18b1c6a Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Tue, 16 Jul 2024 12:01:28 -0500 Subject: [PATCH 092/118] Generated Swagger client from service-broker commit 35aa4910370044d82d24dad103292b5963600875 (#427) --- .../p_cloud_volumes/p_cloud_volumes_client.go | 41 ++ .../pcloud_v2_volumes_getall_parameters.go | 175 +++++++ .../pcloud_v2_volumes_getall_responses.go | 486 ++++++++++++++++++ power/models/capability_details.go | 157 ++++++ power/models/datacenter.go | 51 ++ power/models/disaster_recovery.go | 108 ++++ power/models/get_bulk_volume.go | 71 +++ power/models/image_specifications.go | 3 + power/models/replication_service.go | 141 +++++ power/models/replication_services.go | 159 ++++++ power/models/replication_target_location.go | 108 ++++ power/models/supported_systems.go | 88 ++++ 12 files changed, 1588 insertions(+) create mode 100644 power/client/p_cloud_volumes/pcloud_v2_volumes_getall_parameters.go create mode 100644 power/client/p_cloud_volumes/pcloud_v2_volumes_getall_responses.go create mode 100644 power/models/capability_details.go create mode 100644 power/models/disaster_recovery.go create mode 100644 power/models/get_bulk_volume.go create mode 100644 power/models/replication_service.go create mode 100644 power/models/replication_services.go create mode 100644 power/models/replication_target_location.go create mode 100644 power/models/supported_systems.go diff --git a/power/client/p_cloud_volumes/p_cloud_volumes_client.go b/power/client/p_cloud_volumes/p_cloud_volumes_client.go index e2bc42c7..219bd859 100644 --- a/power/client/p_cloud_volumes/p_cloud_volumes_client.go +++ b/power/client/p_cloud_volumes/p_cloud_volumes_client.go @@ -94,6 +94,8 @@ type ClientService interface { 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) @@ -869,6 +871,45 @@ func (a *Client) PcloudV2VolumesDelete(params *PcloudV2VolumesDeleteParams, auth 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 */ 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 new file mode 100644 index 00000000..4c668aff --- /dev/null +++ b/power/client/p_cloud_volumes/pcloud_v2_volumes_getall_parameters.go @@ -0,0 +1,175 @@ +// 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 new file mode 100644 index 00000000..8d2120b5 --- /dev/null +++ b/power/client/p_cloud_volumes/pcloud_v2_volumes_getall_responses.go @@ -0,0 +1,486 @@ +// 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/models/capability_details.go b/power/models/capability_details.go new file mode 100644 index 00000000..1b2c0f42 --- /dev/null +++ b/power/models/capability_details.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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" +) + +// CapabilityDetails capability details +// +// swagger:model CapabilityDetails +type CapabilityDetails struct { + + // Disaster Recovery Information + // Required: true + DisasterRecovery *DisasterRecovery `json:"disasterRecovery"` + + // Datacenter System Types Information + // Required: true + SupportedSystems *SupportedSystems `json:"supportedSystems"` +} + +// Validate validates this capability details +func (m *CapabilityDetails) 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 *CapabilityDetails) 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 *CapabilityDetails) 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 capability details based on the context it is used +func (m *CapabilityDetails) 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 *CapabilityDetails) 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 *CapabilityDetails) 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 *CapabilityDetails) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CapabilityDetails) UnmarshalBinary(b []byte) error { + var res CapabilityDetails + 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 index 2c33b15c..9fce52be 100644 --- a/power/models/datacenter.go +++ b/power/models/datacenter.go @@ -24,6 +24,9 @@ type Datacenter struct { // Required: true Capabilities map[string]bool `json:"capabilities"` + // Additional Datacenter Capability Details + CapabilityDetails *CapabilityDetails `json:"capabilityDetails,omitempty"` + // Link to Datacenter Region Href string `json:"href,omitempty"` @@ -50,6 +53,10 @@ func (m *Datacenter) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateCapabilityDetails(formats); err != nil { + res = append(res, err) + } + if err := m.validateLocation(formats); err != nil { res = append(res, err) } @@ -77,6 +84,25 @@ func (m *Datacenter) validateCapabilities(formats strfmt.Registry) error { return nil } +func (m *Datacenter) validateCapabilityDetails(formats strfmt.Registry) error { + if swag.IsZero(m.CapabilityDetails) { // not required + return nil + } + + if m.CapabilityDetails != nil { + if err := m.CapabilityDetails.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("capabilityDetails") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("capabilityDetails") + } + return err + } + } + + return nil +} + func (m *Datacenter) validateLocation(formats strfmt.Registry) error { if err := validate.Required("location", "body", m.Location); err != nil { @@ -190,6 +216,10 @@ func (m *Datacenter) validateType(formats strfmt.Registry) error { func (m *Datacenter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error + if err := m.contextValidateCapabilityDetails(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateLocation(ctx, formats); err != nil { res = append(res, err) } @@ -200,6 +230,27 @@ func (m *Datacenter) ContextValidate(ctx context.Context, formats strfmt.Registr return nil } +func (m *Datacenter) contextValidateCapabilityDetails(ctx context.Context, formats strfmt.Registry) error { + + if m.CapabilityDetails != nil { + + if swag.IsZero(m.CapabilityDetails) { // not required + return nil + } + + if err := m.CapabilityDetails.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("capabilityDetails") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("capabilityDetails") + } + return err + } + } + + return nil +} + func (m *Datacenter) contextValidateLocation(ctx context.Context, formats strfmt.Registry) error { if m.Location != nil { diff --git a/power/models/disaster_recovery.go b/power/models/disaster_recovery.go new file mode 100644 index 00000000..852793de --- /dev/null +++ b/power/models/disaster_recovery.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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 { + + // Disaster Recovery Information + // Required: true + ReplicationServices *ReplicationServices `json:"replicationServices"` +} + +// Validate validates this disaster recovery +func (m *DisasterRecovery) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateReplicationServices(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DisasterRecovery) validateReplicationServices(formats strfmt.Registry) error { + + if err := validate.Required("replicationServices", "body", m.ReplicationServices); err != nil { + return err + } + + if m.ReplicationServices != nil { + if err := m.ReplicationServices.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("replicationServices") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("replicationServices") + } + 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.contextValidateReplicationServices(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DisasterRecovery) contextValidateReplicationServices(ctx context.Context, formats strfmt.Registry) error { + + if m.ReplicationServices != nil { + + if err := m.ReplicationServices.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("replicationServices") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("replicationServices") + } + 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/get_bulk_volume.go b/power/models/get_bulk_volume.go new file mode 100644 index 00000000..0a72234d --- /dev/null +++ b/power/models/get_bulk_volume.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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/image_specifications.go b/power/models/image_specifications.go index d5f71a0e..70ec4210 100644 --- a/power/models/image_specifications.go +++ b/power/models/image_specifications.go @@ -37,6 +37,9 @@ type ImageSpecifications struct { // 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 diff --git a/power/models/replication_service.go b/power/models/replication_service.go new file mode 100644 index 00000000..c16beb90 --- /dev/null +++ b/power/models/replication_service.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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_services.go b/power/models/replication_services.go new file mode 100644 index 00000000..637125d0 --- /dev/null +++ b/power/models/replication_services.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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" +) + +// ReplicationServices replication services +// +// swagger:model ReplicationServices +type ReplicationServices struct { + + // Asynchronous Replication Target Information + // Required: true + AsynchronousReplication *ReplicationService `json:"asynchronousReplication"` + + // Synchronous Replication Target Information + SynchronousReplication *ReplicationService `json:"synchronousReplication,omitempty"` +} + +// Validate validates this replication services +func (m *ReplicationServices) 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 *ReplicationServices) 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 *ReplicationServices) 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 replication services based on the context it is used +func (m *ReplicationServices) 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 *ReplicationServices) 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 *ReplicationServices) 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 *ReplicationServices) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ReplicationServices) UnmarshalBinary(b []byte) error { + var res ReplicationServices + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/power/models/replication_target_location.go b/power/models/replication_target_location.go new file mode 100644 index 00000000..453edf48 --- /dev/null +++ b/power/models/replication_target_location.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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/supported_systems.go b/power/models/supported_systems.go new file mode 100644 index 00000000..de991f0f --- /dev/null +++ b/power/models/supported_systems.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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 +} From f41ec956827bf5e512cdb6cae32b58111889c0c6 Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Thu, 25 Jul 2024 09:23:11 -0500 Subject: [PATCH 093/118] Generated Swagger client from service-broker commit 01eebb83bef64e16e87162c9c7654c8a166e5086 (#431) --- .../network_address_groups_client.go | 353 +++++++++ ...1_network_address_groups_get_parameters.go | 128 ++++ ...v1_network_address_groups_get_responses.go | 486 ++++++++++++ ...ork_address_groups_id_delete_parameters.go | 151 ++++ ...work_address_groups_id_delete_responses.go | 560 ++++++++++++++ ...etwork_address_groups_id_get_parameters.go | 151 ++++ ...network_address_groups_id_get_responses.go | 486 ++++++++++++ ...etwork_address_groups_id_put_parameters.go | 175 +++++ ...network_address_groups_id_put_responses.go | 486 ++++++++++++ ...ddress_groups_members_delete_parameters.go | 173 +++++ ...address_groups_members_delete_responses.go | 562 ++++++++++++++ ..._address_groups_members_post_parameters.go | 175 +++++ ...k_address_groups_members_post_responses.go | 638 ++++++++++++++++ ..._network_address_groups_post_parameters.go | 153 ++++ ...1_network_address_groups_post_responses.go | 714 ++++++++++++++++++ .../network_security_groups_client.go | 477 ++++++++++++ ..._security_groups_action_post_parameters.go | 153 ++++ ...k_security_groups_action_post_responses.go | 634 ++++++++++++++++ ...rk_security_groups_id_delete_parameters.go | 151 ++++ ...ork_security_groups_id_delete_responses.go | 560 ++++++++++++++ ...twork_security_groups_id_get_parameters.go | 151 ++++ ...etwork_security_groups_id_get_responses.go | 486 ++++++++++++ ...twork_security_groups_id_put_parameters.go | 175 +++++ ...etwork_security_groups_id_put_responses.go | 486 ++++++++++++ ...network_security_groups_list_parameters.go | 128 ++++ ..._network_security_groups_list_responses.go | 486 ++++++++++++ ...curity_groups_members_delete_parameters.go | 173 +++++ ...ecurity_groups_members_delete_responses.go | 562 ++++++++++++++ ...security_groups_members_post_parameters.go | 175 +++++ ..._security_groups_members_post_responses.go | 638 ++++++++++++++++ ...network_security_groups_post_parameters.go | 153 ++++ ..._network_security_groups_post_responses.go | 714 ++++++++++++++++++ ...security_groups_rules_delete_parameters.go | 173 +++++ ..._security_groups_rules_delete_responses.go | 562 ++++++++++++++ ...k_security_groups_rules_post_parameters.go | 175 +++++ ...rk_security_groups_rules_post_responses.go | 638 ++++++++++++++++ power/client/networks/networks_client.go | 270 +++++++ ...ks_network_interfaces_delete_parameters.go | 173 +++++ ...rks_network_interfaces_delete_responses.go | 560 ++++++++++++++ ...works_network_interfaces_get_parameters.go | 173 +++++ ...tworks_network_interfaces_get_responses.go | 486 ++++++++++++ ...ks_network_interfaces_getall_parameters.go | 151 ++++ ...rks_network_interfaces_getall_responses.go | 486 ++++++++++++ ...orks_network_interfaces_post_parameters.go | 175 +++++ ...works_network_interfaces_post_responses.go | 638 ++++++++++++++++ ...works_network_interfaces_put_parameters.go | 197 +++++ ...tworks_network_interfaces_put_responses.go | 562 ++++++++++++++ ...cloud_pvminstances_clone_post_responses.go | 76 ++ power/client/power_iaas_api_client.go | 15 + power/models/network.go | 6 + power/models/network_address_group.go | 176 +++++ .../network_address_group_add_member.go | 71 ++ power/models/network_address_group_create.go | 74 ++ power/models/network_address_group_member.go | 88 +++ power/models/network_address_group_update.go | 50 ++ power/models/network_address_groups.go | 121 +++ power/models/network_interface.go | 258 +++++++ power/models/network_interface_create.go | 56 ++ power/models/network_interface_update.go | 56 ++ power/models/network_interfaces.go | 124 +++ power/models/network_security_group.go | 238 ++++++ .../network_security_group_add_member.go | 124 +++ .../models/network_security_group_add_rule.go | 381 ++++++++++ power/models/network_security_group_create.go | 74 ++ power/models/network_security_group_member.go | 144 ++++ power/models/network_security_group_rule.go | 398 ++++++++++ .../network_security_group_rule_port.go | 53 ++ .../network_security_group_rule_protocol.go | 182 +++++ ...k_security_group_rule_protocol_tcp_flag.go | 126 ++++ .../network_security_group_rule_remote.go | 111 +++ power/models/network_security_group_update.go | 50 ++ power/models/network_security_groups.go | 121 +++ .../models/network_security_groups_action.go | 107 +++ power/models/volume_group.go | 2 +- power/models/volume_group_details.go | 2 +- power/models/workspace_details.go | 51 ++ ...rkspace_network_security_groups_details.go | 116 +++ 77 files changed, 20561 insertions(+), 2 deletions(-) create mode 100644 power/client/network_address_groups/network_address_groups_client.go create mode 100644 power/client/network_address_groups/v1_network_address_groups_get_parameters.go create mode 100644 power/client/network_address_groups/v1_network_address_groups_get_responses.go create mode 100644 power/client/network_address_groups/v1_network_address_groups_id_delete_parameters.go create mode 100644 power/client/network_address_groups/v1_network_address_groups_id_delete_responses.go create mode 100644 power/client/network_address_groups/v1_network_address_groups_id_get_parameters.go create mode 100644 power/client/network_address_groups/v1_network_address_groups_id_get_responses.go create mode 100644 power/client/network_address_groups/v1_network_address_groups_id_put_parameters.go create mode 100644 power/client/network_address_groups/v1_network_address_groups_id_put_responses.go create mode 100644 power/client/network_address_groups/v1_network_address_groups_members_delete_parameters.go create mode 100644 power/client/network_address_groups/v1_network_address_groups_members_delete_responses.go create mode 100644 power/client/network_address_groups/v1_network_address_groups_members_post_parameters.go create mode 100644 power/client/network_address_groups/v1_network_address_groups_members_post_responses.go create mode 100644 power/client/network_address_groups/v1_network_address_groups_post_parameters.go create mode 100644 power/client/network_address_groups/v1_network_address_groups_post_responses.go create mode 100644 power/client/network_security_groups/network_security_groups_client.go create mode 100644 power/client/network_security_groups/v1_network_security_groups_action_post_parameters.go create mode 100644 power/client/network_security_groups/v1_network_security_groups_action_post_responses.go create mode 100644 power/client/network_security_groups/v1_network_security_groups_id_delete_parameters.go create mode 100644 power/client/network_security_groups/v1_network_security_groups_id_delete_responses.go create mode 100644 power/client/network_security_groups/v1_network_security_groups_id_get_parameters.go create mode 100644 power/client/network_security_groups/v1_network_security_groups_id_get_responses.go create mode 100644 power/client/network_security_groups/v1_network_security_groups_id_put_parameters.go create mode 100644 power/client/network_security_groups/v1_network_security_groups_id_put_responses.go create mode 100644 power/client/network_security_groups/v1_network_security_groups_list_parameters.go create mode 100644 power/client/network_security_groups/v1_network_security_groups_list_responses.go create mode 100644 power/client/network_security_groups/v1_network_security_groups_members_delete_parameters.go create mode 100644 power/client/network_security_groups/v1_network_security_groups_members_delete_responses.go create mode 100644 power/client/network_security_groups/v1_network_security_groups_members_post_parameters.go create mode 100644 power/client/network_security_groups/v1_network_security_groups_members_post_responses.go create mode 100644 power/client/network_security_groups/v1_network_security_groups_post_parameters.go create mode 100644 power/client/network_security_groups/v1_network_security_groups_post_responses.go create mode 100644 power/client/network_security_groups/v1_network_security_groups_rules_delete_parameters.go create mode 100644 power/client/network_security_groups/v1_network_security_groups_rules_delete_responses.go create mode 100644 power/client/network_security_groups/v1_network_security_groups_rules_post_parameters.go create mode 100644 power/client/network_security_groups/v1_network_security_groups_rules_post_responses.go create mode 100644 power/client/networks/networks_client.go create mode 100644 power/client/networks/v1_networks_network_interfaces_delete_parameters.go create mode 100644 power/client/networks/v1_networks_network_interfaces_delete_responses.go create mode 100644 power/client/networks/v1_networks_network_interfaces_get_parameters.go create mode 100644 power/client/networks/v1_networks_network_interfaces_get_responses.go create mode 100644 power/client/networks/v1_networks_network_interfaces_getall_parameters.go create mode 100644 power/client/networks/v1_networks_network_interfaces_getall_responses.go create mode 100644 power/client/networks/v1_networks_network_interfaces_post_parameters.go create mode 100644 power/client/networks/v1_networks_network_interfaces_post_responses.go create mode 100644 power/client/networks/v1_networks_network_interfaces_put_parameters.go create mode 100644 power/client/networks/v1_networks_network_interfaces_put_responses.go create mode 100644 power/models/network_address_group.go create mode 100644 power/models/network_address_group_add_member.go create mode 100644 power/models/network_address_group_create.go create mode 100644 power/models/network_address_group_member.go create mode 100644 power/models/network_address_group_update.go create mode 100644 power/models/network_address_groups.go create mode 100644 power/models/network_interface.go create mode 100644 power/models/network_interface_create.go create mode 100644 power/models/network_interface_update.go create mode 100644 power/models/network_interfaces.go create mode 100644 power/models/network_security_group.go create mode 100644 power/models/network_security_group_add_member.go create mode 100644 power/models/network_security_group_add_rule.go create mode 100644 power/models/network_security_group_create.go create mode 100644 power/models/network_security_group_member.go create mode 100644 power/models/network_security_group_rule.go create mode 100644 power/models/network_security_group_rule_port.go create mode 100644 power/models/network_security_group_rule_protocol.go create mode 100644 power/models/network_security_group_rule_protocol_tcp_flag.go create mode 100644 power/models/network_security_group_rule_remote.go create mode 100644 power/models/network_security_group_update.go create mode 100644 power/models/network_security_groups.go create mode 100644 power/models/network_security_groups_action.go create mode 100644 power/models/workspace_network_security_groups_details.go diff --git a/power/client/network_address_groups/network_address_groups_client.go b/power/client/network_address_groups/network_address_groups_client.go new file mode 100644 index 00000000..e2e3af98 --- /dev/null +++ b/power/client/network_address_groups/network_address_groups_client.go @@ -0,0 +1,353 @@ +// 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 new file mode 100644 index 00000000..6e230a35 --- /dev/null +++ b/power/client/network_address_groups/v1_network_address_groups_get_parameters.go @@ -0,0 +1,128 @@ +// 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 new file mode 100644 index 00000000..5716e64c --- /dev/null +++ b/power/client/network_address_groups/v1_network_address_groups_get_responses.go @@ -0,0 +1,486 @@ +// 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 new file mode 100644 index 00000000..fb6028a1 --- /dev/null +++ b/power/client/network_address_groups/v1_network_address_groups_id_delete_parameters.go @@ -0,0 +1,151 @@ +// 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 new file mode 100644 index 00000000..92768813 --- /dev/null +++ b/power/client/network_address_groups/v1_network_address_groups_id_delete_responses.go @@ -0,0 +1,560 @@ +// 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 new file mode 100644 index 00000000..0e9784c9 --- /dev/null +++ b/power/client/network_address_groups/v1_network_address_groups_id_get_parameters.go @@ -0,0 +1,151 @@ +// 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 new file mode 100644 index 00000000..fb0df93b --- /dev/null +++ b/power/client/network_address_groups/v1_network_address_groups_id_get_responses.go @@ -0,0 +1,486 @@ +// 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 new file mode 100644 index 00000000..c09279ba --- /dev/null +++ b/power/client/network_address_groups/v1_network_address_groups_id_put_parameters.go @@ -0,0 +1,175 @@ +// 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 new file mode 100644 index 00000000..0c86e3a0 --- /dev/null +++ b/power/client/network_address_groups/v1_network_address_groups_id_put_responses.go @@ -0,0 +1,486 @@ +// 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 new file mode 100644 index 00000000..9351b40f --- /dev/null +++ b/power/client/network_address_groups/v1_network_address_groups_members_delete_parameters.go @@ -0,0 +1,173 @@ +// 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 new file mode 100644 index 00000000..86199912 --- /dev/null +++ b/power/client/network_address_groups/v1_network_address_groups_members_delete_responses.go @@ -0,0 +1,562 @@ +// 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.NetworkAddressGroup +} + +// 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.NetworkAddressGroup { + return o.Payload +} + +func (o *V1NetworkAddressGroupsMembersDeleteOK) 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 +} + +// 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 new file mode 100644 index 00000000..b178cd0f --- /dev/null +++ b/power/client/network_address_groups/v1_network_address_groups_members_post_parameters.go @@ -0,0 +1,175 @@ +// 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 new file mode 100644 index 00000000..76f6e5e0 --- /dev/null +++ b/power/client/network_address_groups/v1_network_address_groups_members_post_responses.go @@ -0,0 +1,638 @@ +// 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.NetworkAddressGroup +} + +// 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.NetworkAddressGroup { + return o.Payload +} + +func (o *V1NetworkAddressGroupsMembersPostOK) 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 +} + +// 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 new file mode 100644 index 00000000..508919b2 --- /dev/null +++ b/power/client/network_address_groups/v1_network_address_groups_post_parameters.go @@ -0,0 +1,153 @@ +// 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 new file mode 100644 index 00000000..2a7b9597 --- /dev/null +++ b/power/client/network_address_groups/v1_network_address_groups_post_responses.go @@ -0,0 +1,714 @@ +// 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 new file mode 100644 index 00000000..6822d35e --- /dev/null +++ b/power/client/network_security_groups/network_security_groups_client.go @@ -0,0 +1,477 @@ +// 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 new file mode 100644 index 00000000..7481ad9c --- /dev/null +++ b/power/client/network_security_groups/v1_network_security_groups_action_post_parameters.go @@ -0,0 +1,153 @@ +// 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 new file mode 100644 index 00000000..2baaa04e --- /dev/null +++ b/power/client/network_security_groups/v1_network_security_groups_action_post_responses.go @@ -0,0 +1,634 @@ +// 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 + 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 +} 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 new file mode 100644 index 00000000..b0f6b1f8 --- /dev/null +++ b/power/client/network_security_groups/v1_network_security_groups_id_delete_parameters.go @@ -0,0 +1,151 @@ +// 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 new file mode 100644 index 00000000..dcffcfb4 --- /dev/null +++ b/power/client/network_security_groups/v1_network_security_groups_id_delete_responses.go @@ -0,0 +1,560 @@ +// 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 new file mode 100644 index 00000000..fe003a1a --- /dev/null +++ b/power/client/network_security_groups/v1_network_security_groups_id_get_parameters.go @@ -0,0 +1,151 @@ +// 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 new file mode 100644 index 00000000..9f2baad3 --- /dev/null +++ b/power/client/network_security_groups/v1_network_security_groups_id_get_responses.go @@ -0,0 +1,486 @@ +// 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 new file mode 100644 index 00000000..be90c89b --- /dev/null +++ b/power/client/network_security_groups/v1_network_security_groups_id_put_parameters.go @@ -0,0 +1,175 @@ +// 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 new file mode 100644 index 00000000..2910a395 --- /dev/null +++ b/power/client/network_security_groups/v1_network_security_groups_id_put_responses.go @@ -0,0 +1,486 @@ +// 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 new file mode 100644 index 00000000..db9a44a7 --- /dev/null +++ b/power/client/network_security_groups/v1_network_security_groups_list_parameters.go @@ -0,0 +1,128 @@ +// 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 new file mode 100644 index 00000000..4b71837d --- /dev/null +++ b/power/client/network_security_groups/v1_network_security_groups_list_responses.go @@ -0,0 +1,486 @@ +// 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 new file mode 100644 index 00000000..1fce6b31 --- /dev/null +++ b/power/client/network_security_groups/v1_network_security_groups_members_delete_parameters.go @@ -0,0 +1,173 @@ +// 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 new file mode 100644 index 00000000..8d5336ab --- /dev/null +++ b/power/client/network_security_groups/v1_network_security_groups_members_delete_responses.go @@ -0,0 +1,562 @@ +// 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.NetworkSecurityGroup +} + +// 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.NetworkSecurityGroup { + return o.Payload +} + +func (o *V1NetworkSecurityGroupsMembersDeleteOK) 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 +} + +// 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 new file mode 100644 index 00000000..52edfdc8 --- /dev/null +++ b/power/client/network_security_groups/v1_network_security_groups_members_post_parameters.go @@ -0,0 +1,175 @@ +// 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 new file mode 100644 index 00000000..41faba80 --- /dev/null +++ b/power/client/network_security_groups/v1_network_security_groups_members_post_responses.go @@ -0,0 +1,638 @@ +// 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.NetworkSecurityGroup +} + +// 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.NetworkSecurityGroup { + return o.Payload +} + +func (o *V1NetworkSecurityGroupsMembersPostOK) 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 +} + +// 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 new file mode 100644 index 00000000..d827078a --- /dev/null +++ b/power/client/network_security_groups/v1_network_security_groups_post_parameters.go @@ -0,0 +1,153 @@ +// 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 new file mode 100644 index 00000000..a384c457 --- /dev/null +++ b/power/client/network_security_groups/v1_network_security_groups_post_responses.go @@ -0,0 +1,714 @@ +// 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 new file mode 100644 index 00000000..c83eb86b --- /dev/null +++ b/power/client/network_security_groups/v1_network_security_groups_rules_delete_parameters.go @@ -0,0 +1,173 @@ +// 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 new file mode 100644 index 00000000..d7aec462 --- /dev/null +++ b/power/client/network_security_groups/v1_network_security_groups_rules_delete_responses.go @@ -0,0 +1,562 @@ +// 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.NetworkSecurityGroup +} + +// 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.NetworkSecurityGroup { + return o.Payload +} + +func (o *V1NetworkSecurityGroupsRulesDeleteOK) 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 +} + +// 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 new file mode 100644 index 00000000..c5ba2923 --- /dev/null +++ b/power/client/network_security_groups/v1_network_security_groups_rules_post_parameters.go @@ -0,0 +1,175 @@ +// 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 new file mode 100644 index 00000000..27ae7369 --- /dev/null +++ b/power/client/network_security_groups/v1_network_security_groups_rules_post_responses.go @@ -0,0 +1,638 @@ +// 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.NetworkSecurityGroup +} + +// 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.NetworkSecurityGroup { + return o.Payload +} + +func (o *V1NetworkSecurityGroupsRulesPostOK) 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 +} + +// 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 new file mode 100644 index 00000000..3358bc96 --- /dev/null +++ b/power/client/networks/networks_client.go @@ -0,0 +1,270 @@ +// 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 new file mode 100644 index 00000000..e68d59ee --- /dev/null +++ b/power/client/networks/v1_networks_network_interfaces_delete_parameters.go @@ -0,0 +1,173 @@ +// 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 new file mode 100644 index 00000000..8c525d4a --- /dev/null +++ b/power/client/networks/v1_networks_network_interfaces_delete_responses.go @@ -0,0 +1,560 @@ +// 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 new file mode 100644 index 00000000..431fd192 --- /dev/null +++ b/power/client/networks/v1_networks_network_interfaces_get_parameters.go @@ -0,0 +1,173 @@ +// 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 new file mode 100644 index 00000000..8efe1ce3 --- /dev/null +++ b/power/client/networks/v1_networks_network_interfaces_get_responses.go @@ -0,0 +1,486 @@ +// 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 new file mode 100644 index 00000000..2e7b75a2 --- /dev/null +++ b/power/client/networks/v1_networks_network_interfaces_getall_parameters.go @@ -0,0 +1,151 @@ +// 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 new file mode 100644 index 00000000..753cc0a9 --- /dev/null +++ b/power/client/networks/v1_networks_network_interfaces_getall_responses.go @@ -0,0 +1,486 @@ +// 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 new file mode 100644 index 00000000..46a62892 --- /dev/null +++ b/power/client/networks/v1_networks_network_interfaces_post_parameters.go @@ -0,0 +1,175 @@ +// 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 new file mode 100644 index 00000000..c071669c --- /dev/null +++ b/power/client/networks/v1_networks_network_interfaces_post_responses.go @@ -0,0 +1,638 @@ +// 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 new file mode 100644 index 00000000..77e8d3d2 --- /dev/null +++ b/power/client/networks/v1_networks_network_interfaces_put_parameters.go @@ -0,0 +1,197 @@ +// 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 new file mode 100644 index 00000000..81898478 --- /dev/null +++ b/power/client/networks/v1_networks_network_interfaces_put_responses.go @@ -0,0 +1,562 @@ +// 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/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 index c1c3e716..60397da2 100644 --- 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 @@ -60,6 +60,12 @@ func (o *PcloudPvminstancesClonePostReader) ReadResponse(response runtime.Client 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 { @@ -497,6 +503,76 @@ func (o *PcloudPvminstancesClonePostConflict) readResponse(response runtime.Clie 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{} diff --git a/power/client/power_iaas_api_client.go b/power/client/power_iaas_api_client.go index 43c7c298..6a25d818 100644 --- a/power/client/power_iaas_api_client.go +++ b/power/client/power_iaas_api_client.go @@ -21,6 +21,9 @@ import ( "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" @@ -110,6 +113,9 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *PowerIaasA 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) @@ -210,6 +216,12 @@ type PowerIaasAPI struct { 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 @@ -295,6 +307,9 @@ func (c *PowerIaasAPI) SetTransport(transport runtime.ClientTransport) { 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) diff --git a/power/models/network.go b/power/models/network.go index 848f5280..5e5d2153 100644 --- a/power/models/network.go +++ b/power/models/network.go @@ -31,6 +31,9 @@ type Network struct { // (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"` @@ -73,6 +76,9 @@ type Network struct { // 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"` diff --git a/power/models/network_address_group.go b/power/models/network_address_group.go new file mode 100644 index 00000000..e14ebff5 --- /dev/null +++ b/power/models/network_address_group.go @@ -0,0 +1,176 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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"` +} + +// 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 new file mode 100644 index 00000000..8f12580c --- /dev/null +++ b/power/models/network_address_group_add_member.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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 new file mode 100644 index 00000000..a41f1880 --- /dev/null +++ b/power/models/network_address_group_create.go @@ -0,0 +1,74 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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"` +} + +// 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 new file mode 100644 index 00000000..8df76aaf --- /dev/null +++ b/power/models/network_address_group_member.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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 new file mode 100644 index 00000000..a6e4dca0 --- /dev/null +++ b/power/models/network_address_group_update.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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 new file mode 100644 index 00000000..425077d8 --- /dev/null +++ b/power/models/network_address_groups.go @@ -0,0 +1,121 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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_interface.go b/power/models/network_interface.go new file mode 100644 index 00000000..26ff1457 --- /dev/null +++ b/power/models/network_interface.go @@ -0,0 +1,258 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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"` + + // 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"` + + // pvm instance + PvmInstance *NetworkInterfacePvmInstance `json:"pvmInstance,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.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.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 *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) 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) 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 *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.contextValidatePvmInstance(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NetworkInterface) 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 *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 +} + +// NetworkInterfacePvmInstance The attached pvm-instance to this Network Interface +// +// swagger:model NetworkInterfacePvmInstance +type NetworkInterfacePvmInstance struct { + + // Link to pvm-instance resource + Href string `json:"href,omitempty"` + + // The attahed pvm-instance ID + PvmInstanceID string `json:"pvmInstanceID,omitempty"` +} + +// Validate validates this network interface pvm instance +func (m *NetworkInterfacePvmInstance) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this network interface pvm instance based on context it is used +func (m *NetworkInterfacePvmInstance) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *NetworkInterfacePvmInstance) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NetworkInterfacePvmInstance) UnmarshalBinary(b []byte) error { + var res NetworkInterfacePvmInstance + 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 new file mode 100644 index 00000000..fab1c643 --- /dev/null +++ b/power/models/network_interface_create.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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 new file mode 100644 index 00000000..b9104cfa --- /dev/null +++ b/power/models/network_interface_update.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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 { + + // Name of the Network Interface + Name *string `json:"name,omitempty"` + + // ID of the Network Security Group the network interface will be added to, if empty detaches from Network Security Group + NetworkSecurityGroupID string `json:"networkSecurityGroupID,omitempty"` + + // If supplied populated it attaches to the PVMInstanceID, if empty detaches from PVMInstanceID + PvmInstanceID *string `json:"pvmInstanceID,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 new file mode 100644 index 00000000..a9ec76a7 --- /dev/null +++ b/power/models/network_interfaces.go @@ -0,0 +1,124 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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_security_group.go b/power/models/network_security_group.go new file mode 100644 index 00000000..d62dc774 --- /dev/null +++ b/power/models/network_security_group.go @@ -0,0 +1,238 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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"` +} + +// 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 new file mode 100644 index 00000000..abb75b1b --- /dev/null +++ b/power/models/network_security_group_add_member.go @@ -0,0 +1,124 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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 new file mode 100644 index 00000000..69b9bcd4 --- /dev/null +++ b/power/models/network_security_group_add_rule.go @@ -0,0 +1,381 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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"` + + // The direction of the network traffic + // Required: true + // Enum: ["inbound","outbound"] + Direction *string `json:"direction"` + + // The unique name of the Network Security Group rule + // Required: true + Name *string `json:"name"` + + // 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.validateDirection(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(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 +} + +var networkSecurityGroupAddRuleTypeDirectionPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["inbound","outbound"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + networkSecurityGroupAddRuleTypeDirectionPropEnum = append(networkSecurityGroupAddRuleTypeDirectionPropEnum, v) + } +} + +const ( + + // NetworkSecurityGroupAddRuleDirectionInbound captures enum value "inbound" + NetworkSecurityGroupAddRuleDirectionInbound string = "inbound" + + // NetworkSecurityGroupAddRuleDirectionOutbound captures enum value "outbound" + NetworkSecurityGroupAddRuleDirectionOutbound string = "outbound" +) + +// prop value enum +func (m *NetworkSecurityGroupAddRule) validateDirectionEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, networkSecurityGroupAddRuleTypeDirectionPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *NetworkSecurityGroupAddRule) validateDirection(formats strfmt.Registry) error { + + if err := validate.Required("direction", "body", m.Direction); err != nil { + return err + } + + // value enum + if err := m.validateDirectionEnum("direction", "body", *m.Direction); err != nil { + return err + } + + return nil +} + +func (m *NetworkSecurityGroupAddRule) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + 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 new file mode 100644 index 00000000..fc0bd27e --- /dev/null +++ b/power/models/network_security_group_create.go @@ -0,0 +1,74 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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"` +} + +// 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 new file mode 100644 index 00000000..533ffe59 --- /dev/null +++ b/power/models/network_security_group_member.go @@ -0,0 +1,144 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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 new file mode 100644 index 00000000..00c26042 --- /dev/null +++ b/power/models/network_security_group_rule.go @@ -0,0 +1,398 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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 direction of the network traffic + // Required: true + // Enum: ["inbound","outbound"] + Direction *string `json:"direction"` + + // The ID of the rule in a Network Security Group + // Required: true + ID *string `json:"id"` + + // The unique name of the Network Security Group rule + // Required: true + Name *string `json:"name"` + + // 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.validateDirection(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.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 +} + +var networkSecurityGroupRuleTypeDirectionPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["inbound","outbound"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + networkSecurityGroupRuleTypeDirectionPropEnum = append(networkSecurityGroupRuleTypeDirectionPropEnum, v) + } +} + +const ( + + // NetworkSecurityGroupRuleDirectionInbound captures enum value "inbound" + NetworkSecurityGroupRuleDirectionInbound string = "inbound" + + // NetworkSecurityGroupRuleDirectionOutbound captures enum value "outbound" + NetworkSecurityGroupRuleDirectionOutbound string = "outbound" +) + +// prop value enum +func (m *NetworkSecurityGroupRule) validateDirectionEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, networkSecurityGroupRuleTypeDirectionPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *NetworkSecurityGroupRule) validateDirection(formats strfmt.Registry) error { + + if err := validate.Required("direction", "body", m.Direction); err != nil { + return err + } + + // value enum + if err := m.validateDirectionEnum("direction", "body", *m.Direction); err != nil { + 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) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); 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 new file mode 100644 index 00000000..9038f803 --- /dev/null +++ b/power/models/network_security_group_rule_port.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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" +) + +// NetworkSecurityGroupRulePort network security group rule port +// +// swagger:model NetworkSecurityGroupRulePort +type NetworkSecurityGroupRulePort struct { + + // The end of the port range, if applicable, If values are not present then all ports are in the range + Maximum float64 `json:"maximum,omitempty"` + + // The start of the port range, if applicable. If values are not present then all ports are in the range + Minimum float64 `json:"minimum,omitempty"` +} + +// Validate validates this network security group rule port +func (m *NetworkSecurityGroupRulePort) Validate(formats strfmt.Registry) error { + 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 new file mode 100644 index 00000000..e76368cc --- /dev/null +++ b/power/models/network_security_group_rule_protocol.go @@ -0,0 +1,182 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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, the list of ICMP packet types (by numbers) affected by ICMP rules and if not present then all types are matched + IcmpTypes []float64 `json:"icmpTypes"` + + // 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.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 +} + +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 new file mode 100644 index 00000000..559651c5 --- /dev/null +++ b/power/models/network_security_group_rule_protocol_tcp_flag.go @@ -0,0 +1,126 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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 new file mode 100644 index 00000000..47426697 --- /dev/null +++ b/power/models/network_security_group_rule_remote.go @@ -0,0 +1,111 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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 new file mode 100644 index 00000000..a9d97709 --- /dev/null +++ b/power/models/network_security_group_update.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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 new file mode 100644 index 00000000..82d72f87 --- /dev/null +++ b/power/models/network_security_groups.go @@ -0,0 +1,121 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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 new file mode 100644 index 00000000..ad9b218a --- /dev/null +++ b/power/models/network_security_groups_action.go @@ -0,0 +1,107 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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/volume_group.go b/power/models/volume_group.go index af67ef92..77e8f9dc 100644 --- a/power/models/volume_group.go +++ b/power/models/volume_group.go @@ -20,7 +20,7 @@ import ( type VolumeGroup struct { // Indicates whether the volume group is for auxiliary volumes or master volumes - Auxiliary bool `json:"auxiliary,omitempty"` + Auxiliary *bool `json:"auxiliary,omitempty"` // The name of consistencyGroup at storage host level ConsistencyGroupName string `json:"consistencyGroupName,omitempty"` diff --git a/power/models/volume_group_details.go b/power/models/volume_group_details.go index 9656e882..fb9a4edf 100644 --- a/power/models/volume_group_details.go +++ b/power/models/volume_group_details.go @@ -20,7 +20,7 @@ import ( type VolumeGroupDetails struct { // Indicates whether the volume group is for auxiliary volumes or master volumes - Auxiliary bool `json:"auxiliary,omitempty"` + Auxiliary *bool `json:"auxiliary,omitempty"` // The name of volume group at storage host level ConsistencyGroupName string `json:"consistencyGroupName,omitempty"` diff --git a/power/models/workspace_details.go b/power/models/workspace_details.go index a74e2ebe..a26cc6ea 100644 --- a/power/models/workspace_details.go +++ b/power/models/workspace_details.go @@ -31,6 +31,9 @@ type WorkspaceDetails struct { // 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"` } @@ -47,6 +50,10 @@ func (m *WorkspaceDetails) Validate(formats strfmt.Registry) error { 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) } @@ -79,6 +86,25 @@ func (m *WorkspaceDetails) validateCrn(formats strfmt.Registry) error { 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 @@ -102,6 +128,10 @@ func (m *WorkspaceDetails) validatePowerEdgeRouter(formats strfmt.Registry) erro 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) } @@ -112,6 +142,27 @@ func (m *WorkspaceDetails) ContextValidate(ctx context.Context, formats strfmt.R 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 { diff --git a/power/models/workspace_network_security_groups_details.go b/power/models/workspace_network_security_groups_details.go new file mode 100644 index 00000000..b2977339 --- /dev/null +++ b/power/models/workspace_network_security_groups_details.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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 +} From 024c63c16017197ebe012d4e76472361cf85e1e6 Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Mon, 29 Jul 2024 12:01:48 -0500 Subject: [PATCH 094/118] Generated Swagger client from service-broker commit 94340a77d5b13ff1055439c17c7a0202e88b1590 (#433) --- power/models/add_host.go | 49 +++++++++- power/models/c_r_n.go | 27 ++++++ power/models/create_cos_image_import_job.go | 42 ++++++++ power/models/create_data_volume.go | 49 +++++++++- power/models/create_image.go | 42 ++++++++ power/models/host.go | 88 +++++++++++++++++ power/models/image.go | 88 +++++++++++++++++ power/models/image_reference.go | 46 +++++++++ power/models/multi_volumes_create.go | 49 +++++++++- power/models/network.go | 90 +++++++++++++++++- power/models/network_create.go | 42 ++++++++ power/models/network_port.go | 2 +- power/models/network_port_create.go | 55 ++++++++++- power/models/network_reference.go | 46 +++++++++ power/models/p_vm_instance.go | 88 +++++++++++++++++ power/models/p_vm_instance_capture.go | 49 +++++++++- power/models/p_vm_instance_create.go | 42 ++++++++ power/models/p_vm_instance_reference.go | 46 +++++++++ power/models/p_vm_instance_reference_v2.go | 46 +++++++++ power/models/p_vm_instance_update_response.go | 2 +- power/models/s_a_p_create.go | 45 +++++++++ power/models/shared_processor_pool.go | 88 +++++++++++++++++ power/models/shared_processor_pool_create.go | 49 +++++++++- power/models/snapshot.go | 53 ++++++++++- power/models/snapshot_create.go | 49 +++++++++- power/models/snapshot_create_response.go | 95 ++++++++++++++++++- power/models/snapshot_v1.go | 53 ++++++++++- power/models/tags.go | 27 ++++++ power/models/volume.go | 95 ++++++++++++++++++- power/models/volume_info.go | 59 +++++++++++- power/models/volume_reference.go | 95 ++++++++++++++++++- power/models/volumes_clone_async_request.go | 49 +++++++++- power/models/volumes_clone_execute.go | 49 +++++++++- 33 files changed, 1773 insertions(+), 21 deletions(-) create mode 100644 power/models/c_r_n.go create mode 100644 power/models/tags.go diff --git a/power/models/add_host.go b/power/models/add_host.go index b0e6358a..b4220ea7 100644 --- a/power/models/add_host.go +++ b/power/models/add_host.go @@ -26,6 +26,9 @@ type AddHost struct { // System type // Required: true SysType *string `json:"sysType"` + + // user tags + UserTags Tags `json:"userTags,omitempty"` } // Validate validates this add host @@ -40,6 +43,10 @@ func (m *AddHost) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateUserTags(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -64,8 +71,48 @@ func (m *AddHost) validateSysType(formats strfmt.Registry) error { return nil } -// ContextValidate validates this add host based on context it is used +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 } diff --git a/power/models/c_r_n.go b/power/models/c_r_n.go new file mode 100644 index 00000000..5dbfb827 --- /dev/null +++ b/power/models/c_r_n.go @@ -0,0 +1,27 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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/create_cos_image_import_job.go b/power/models/create_cos_image_import_job.go index 642f5675..9c83a7b5 100644 --- a/power/models/create_cos_image_import_job.go +++ b/power/models/create_cos_image_import_job.go @@ -64,6 +64,9 @@ type CreateCosImageImportJob struct { // 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 @@ -102,6 +105,10 @@ func (m *CreateCosImageImportJob) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateUserTags(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -272,6 +279,23 @@ func (m *CreateCosImageImportJob) validateStorageAffinity(formats strfmt.Registr 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 @@ -284,6 +308,10 @@ func (m *CreateCosImageImportJob) ContextValidate(ctx context.Context, formats s res = append(res, err) } + if err := m.contextValidateUserTags(ctx, formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -332,6 +360,20 @@ func (m *CreateCosImageImportJob) contextValidateStorageAffinity(ctx context.Con 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 { diff --git a/power/models/create_data_volume.go b/power/models/create_data_volume.go index 2743ff2f..aa2aafc2 100644 --- a/power/models/create_data_volume.go +++ b/power/models/create_data_volume.go @@ -56,6 +56,9 @@ type CreateDataVolume struct { // 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"` } @@ -76,6 +79,10 @@ func (m *CreateDataVolume) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateUserTags(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -142,8 +149,48 @@ func (m *CreateDataVolume) validateSize(formats strfmt.Registry) error { return nil } -// ContextValidate validates this create data volume based on context it is used +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 } diff --git a/power/models/create_image.go b/power/models/create_image.go index d109378b..6603970b 100644 --- a/power/models/create_image.go +++ b/power/models/create_image.go @@ -63,6 +63,9 @@ type CreateImage struct { // 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 @@ -81,6 +84,10 @@ func (m *CreateImage) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateUserTags(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -197,6 +204,23 @@ func (m *CreateImage) validateStorageAffinity(formats strfmt.Registry) error { 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 @@ -205,6 +229,10 @@ func (m *CreateImage) ContextValidate(ctx context.Context, formats strfmt.Regist res = append(res, err) } + if err := m.contextValidateUserTags(ctx, formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -232,6 +260,20 @@ func (m *CreateImage) contextValidateStorageAffinity(ctx context.Context, format 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 { diff --git a/power/models/host.go b/power/models/host.go index 51e2d4a4..d1a86cc8 100644 --- a/power/models/host.go +++ b/power/models/host.go @@ -21,6 +21,9 @@ 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"` @@ -38,6 +41,9 @@ type Host struct { // System type SysType string `json:"sysType,omitempty"` + + // user tags + UserTags Tags `json:"userTags,omitempty"` } // Validate validates this host @@ -48,10 +54,18 @@ func (m *Host) Validate(formats strfmt.Registry) error { 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...) } @@ -77,6 +91,23 @@ func (m *Host) validateCapacity(formats strfmt.Registry) error { 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 @@ -96,6 +127,23 @@ func (m *Host) validateHostGroup(formats strfmt.Registry) error { 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 @@ -104,10 +152,18 @@ func (m *Host) ContextValidate(ctx context.Context, formats strfmt.Registry) err 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...) } @@ -135,6 +191,24 @@ func (m *Host) contextValidateCapacity(ctx context.Context, formats strfmt.Regis 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 { @@ -156,6 +230,20 @@ func (m *Host) contextValidateHostGroup(ctx context.Context, formats strfmt.Regi 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 { diff --git a/power/models/image.go b/power/models/image.go index 97b0ba08..20bc26d8 100644 --- a/power/models/image.go +++ b/power/models/image.go @@ -25,6 +25,9 @@ type Image struct { // Format: date-time CreationDate *strfmt.DateTime `json:"creationDate"` + // crn + Crn CRN `json:"crn,omitempty"` + // Description Description string `json:"description,omitempty"` @@ -69,6 +72,9 @@ type Image struct { // taskref Taskref *TaskReference `json:"taskref,omitempty"` + // user tags + UserTags Tags `json:"userTags,omitempty"` + // Image Volumes Volumes []*ImageVolume `json:"volumes"` } @@ -81,6 +87,10 @@ func (m *Image) Validate(formats strfmt.Registry) error { 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) } @@ -117,6 +127,10 @@ func (m *Image) Validate(formats strfmt.Registry) error { 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) } @@ -140,6 +154,23 @@ func (m *Image) validateCreationDate(formats strfmt.Registry) error { 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 { @@ -245,6 +276,23 @@ func (m *Image) validateTaskref(formats strfmt.Registry) error { 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 @@ -275,6 +323,10 @@ func (m *Image) validateVolumes(formats strfmt.Registry) error { 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) } @@ -283,6 +335,10 @@ func (m *Image) ContextValidate(ctx context.Context, formats strfmt.Registry) er 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) } @@ -293,6 +349,24 @@ func (m *Image) ContextValidate(ctx context.Context, formats strfmt.Registry) er 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 { @@ -335,6 +409,20 @@ func (m *Image) contextValidateTaskref(ctx context.Context, formats strfmt.Regis 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++ { diff --git a/power/models/image_reference.go b/power/models/image_reference.go index bd1811be..02a984cb 100644 --- a/power/models/image_reference.go +++ b/power/models/image_reference.go @@ -24,6 +24,9 @@ type ImageReference struct { // Format: date-time CreationDate *strfmt.DateTime `json:"creationDate"` + // crn + Crn CRN `json:"crn,omitempty"` + // Description // Required: true Description *string `json:"description"` @@ -70,6 +73,10 @@ func (m *ImageReference) Validate(formats strfmt.Registry) error { 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) } @@ -125,6 +132,23 @@ func (m *ImageReference) validateCreationDate(formats strfmt.Registry) error { 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 { @@ -225,6 +249,10 @@ func (m *ImageReference) validateStorageType(formats strfmt.Registry) error { 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) } @@ -235,6 +263,24 @@ func (m *ImageReference) ContextValidate(ctx context.Context, formats strfmt.Reg 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 { diff --git a/power/models/multi_volumes_create.go b/power/models/multi_volumes_create.go index eb98deb2..61aaa4f4 100644 --- a/power/models/multi_volumes_create.go +++ b/power/models/multi_volumes_create.go @@ -59,6 +59,9 @@ type MultiVolumesCreate struct { // 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"` } @@ -79,6 +82,10 @@ func (m *MultiVolumesCreate) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateUserTags(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -145,8 +152,48 @@ func (m *MultiVolumesCreate) validateSize(formats strfmt.Registry) error { return nil } -// ContextValidate validates this multi volumes create based on context it is used +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 } diff --git a/power/models/network.go b/power/models/network.go index 5e5d2153..db5ea45e 100644 --- a/power/models/network.go +++ b/power/models/network.go @@ -31,8 +31,8 @@ type Network struct { // (currently not available) cloud connections this network is attached CloudConnections []*NetworkCloudConnectionsItems0 `json:"cloudConnections,omitempty"` - // The CRN for this resource - Crn string `json:"crn,omitempty"` + // crn + Crn CRN `json:"crn,omitempty"` // DHCP Managed Network DhcpManaged bool `json:"dhcpManaged,omitempty"` @@ -76,8 +76,8 @@ type Network struct { // Enum: ["vlan","pub-vlan","dhcp-vlan"] Type *string `json:"type"` - // The user tags associated with this resource. - UserTags []string `json:"userTags,omitempty"` + // user tags + UserTags Tags `json:"userTags,omitempty"` // VLAN ID // Required: true @@ -100,6 +100,10 @@ func (m *Network) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateCrn(formats); err != nil { + res = append(res, err) + } + if err := m.validateDNSServers(formats); err != nil { res = append(res, err) } @@ -132,6 +136,10 @@ func (m *Network) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateUserTags(formats); err != nil { + res = append(res, err) + } + if err := m.validateVlanID(formats); err != nil { res = append(res, err) } @@ -194,6 +202,23 @@ func (m *Network) validateCloudConnections(formats strfmt.Registry) error { return nil } +func (m *Network) 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 *Network) validateDNSServers(formats strfmt.Registry) error { if err := validate.Required("dnsServers", "body", m.DNSServers); err != nil { @@ -356,6 +381,23 @@ func (m *Network) validateType(formats strfmt.Registry) error { return nil } +func (m *Network) 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 *Network) validateVlanID(formats strfmt.Registry) error { if err := validate.Required("vlanID", "body", m.VlanID); err != nil { @@ -377,6 +419,10 @@ func (m *Network) ContextValidate(ctx context.Context, formats strfmt.Registry) res = append(res, err) } + if err := m.contextValidateCrn(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateIPAddressMetrics(ctx, formats); err != nil { res = append(res, err) } @@ -389,6 +435,10 @@ func (m *Network) ContextValidate(ctx context.Context, formats strfmt.Registry) res = append(res, err) } + if err := m.contextValidateUserTags(ctx, formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -438,6 +488,24 @@ func (m *Network) contextValidateCloudConnections(ctx context.Context, formats s return nil } +func (m *Network) 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 *Network) contextValidateIPAddressMetrics(ctx context.Context, formats strfmt.Registry) error { if m.IPAddressMetrics != nil { @@ -505,6 +573,20 @@ func (m *Network) contextValidatePublicIPAddressRanges(ctx context.Context, form return nil } +func (m *Network) 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 *Network) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/power/models/network_create.go b/power/models/network_create.go index 093cbaa0..21508e23 100644 --- a/power/models/network_create.go +++ b/power/models/network_create.go @@ -52,6 +52,9 @@ type NetworkCreate struct { // Required: true // Enum: ["vlan","pub-vlan","dhcp-vlan"] Type *string `json:"type"` + + // user tags + UserTags Tags `json:"userTags,omitempty"` } // Validate validates this network create @@ -74,6 +77,10 @@ func (m *NetworkCreate) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateUserTags(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -185,6 +192,23 @@ func (m *NetworkCreate) validateType(formats strfmt.Registry) error { 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 @@ -197,6 +221,10 @@ func (m *NetworkCreate) ContextValidate(ctx context.Context, formats strfmt.Regi res = append(res, err) } + if err := m.contextValidateUserTags(ctx, formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -246,6 +274,20 @@ func (m *NetworkCreate) contextValidateIPAddressRanges(ctx context.Context, form 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 { diff --git a/power/models/network_port.go b/power/models/network_port.go index bcd23747..997c0cfa 100644 --- a/power/models/network_port.go +++ b/power/models/network_port.go @@ -208,7 +208,7 @@ type NetworkPortPvmInstance struct { // Link to pvm-instance resource Href string `json:"href,omitempty"` - // The attahed pvm-instance ID + // The attached pvm-instance ID PvmInstanceID string `json:"pvmInstanceID,omitempty"` } diff --git a/power/models/network_port_create.go b/power/models/network_port_create.go index d9c99e85..d3ebbb1b 100644 --- a/power/models/network_port_create.go +++ b/power/models/network_port_create.go @@ -8,6 +8,7 @@ package models import ( "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -22,15 +23,67 @@ type NetworkPortCreate struct { // 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 validates this network port create based on context it is used +// 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 } diff --git a/power/models/network_reference.go b/power/models/network_reference.go index f4e765c6..a912a1e4 100644 --- a/power/models/network_reference.go +++ b/power/models/network_reference.go @@ -23,6 +23,9 @@ type NetworkReference struct { // access config AccessConfig AccessConfig `json:"accessConfig,omitempty"` + // crn + Crn CRN `json:"crn,omitempty"` + // DHCP Managed Network DhcpManaged bool `json:"dhcpManaged,omitempty"` @@ -64,6 +67,10 @@ func (m *NetworkReference) Validate(formats strfmt.Registry) error { 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) } @@ -111,6 +118,23 @@ func (m *NetworkReference) validateAccessConfig(formats strfmt.Registry) error { 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 { @@ -217,6 +241,10 @@ func (m *NetworkReference) ContextValidate(ctx context.Context, formats strfmt.R res = append(res, err) } + if err := m.contextValidateCrn(ctx, formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -241,6 +269,24 @@ func (m *NetworkReference) contextValidateAccessConfig(ctx context.Context, form 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 { diff --git a/power/models/p_vm_instance.go b/power/models/p_vm_instance.go index 525c15d6..457affd7 100644 --- a/power/models/p_vm_instance.go +++ b/power/models/p_vm_instance.go @@ -31,6 +31,9 @@ type PVMInstance struct { // Format: date-time CreationDate strfmt.DateTime `json:"creationDate,omitempty"` + // crn + Crn CRN `json:"crn,omitempty"` + // The custom deployment type DeploymentType string `json:"deploymentType,omitempty"` @@ -155,6 +158,9 @@ type PVMInstance struct { // 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"` @@ -179,6 +185,10 @@ func (m *PVMInstance) Validate(formats strfmt.Registry) error { 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) } @@ -251,6 +261,10 @@ func (m *PVMInstance) Validate(formats strfmt.Registry) error { 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) } @@ -322,6 +336,23 @@ func (m *PVMInstance) validateCreationDate(formats strfmt.Registry) error { 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 { @@ -605,6 +636,23 @@ func (m *PVMInstance) validateUpdatedDate(formats strfmt.Registry) error { 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 @@ -645,6 +693,10 @@ func (m *PVMInstance) ContextValidate(ctx context.Context, formats strfmt.Regist 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) } @@ -669,6 +721,10 @@ func (m *PVMInstance) ContextValidate(ctx context.Context, formats strfmt.Regist 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) } @@ -725,6 +781,24 @@ func (m *PVMInstance) contextValidateConsoleLanguage(ctx context.Context, format 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 { @@ -863,6 +937,20 @@ func (m *PVMInstance) contextValidateSrcs(ctx context.Context, formats strfmt.Re 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 { diff --git a/power/models/p_vm_instance_capture.go b/power/models/p_vm_instance_capture.go index 1f0976d1..1094909f 100644 --- a/power/models/p_vm_instance_capture.go +++ b/power/models/p_vm_instance_capture.go @@ -46,6 +46,9 @@ type PVMInstanceCapture struct { // Cloud Storage Secret key CloudStorageSecretKey string `json:"cloudStorageSecretKey,omitempty"` + + // user tags + UserTags Tags `json:"userTags,omitempty"` } // Validate validates this p VM instance capture @@ -60,6 +63,10 @@ func (m *PVMInstanceCapture) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateUserTags(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -121,8 +128,48 @@ func (m *PVMInstanceCapture) validateCaptureName(formats strfmt.Registry) error return nil } -// ContextValidate validates this p VM instance capture based on context it is used +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 } diff --git a/power/models/p_vm_instance_create.go b/power/models/p_vm_instance_create.go index e81b20e4..a44538bb 100644 --- a/power/models/p_vm_instance_create.go +++ b/power/models/p_vm_instance_create.go @@ -118,6 +118,9 @@ type PVMInstanceCreate struct { // 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"` @@ -185,6 +188,10 @@ func (m *PVMInstanceCreate) Validate(formats strfmt.Registry) error { 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) } @@ -548,6 +555,23 @@ func (m *PVMInstanceCreate) validateStorageConnectionV2(formats strfmt.Registry) 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 @@ -591,6 +615,10 @@ func (m *PVMInstanceCreate) ContextValidate(ctx context.Context, formats strfmt. 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) } @@ -707,6 +735,20 @@ func (m *PVMInstanceCreate) contextValidateStorageAffinity(ctx context.Context, 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 { diff --git a/power/models/p_vm_instance_reference.go b/power/models/p_vm_instance_reference.go index 54e5d7b1..d15a4159 100644 --- a/power/models/p_vm_instance_reference.go +++ b/power/models/p_vm_instance_reference.go @@ -31,6 +31,9 @@ type PVMInstanceReference struct { // 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"` @@ -168,6 +171,10 @@ func (m *PVMInstanceReference) Validate(formats strfmt.Registry) error { 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) } @@ -303,6 +310,23 @@ func (m *PVMInstanceReference) validateCreationDate(formats strfmt.Registry) 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 { @@ -605,6 +629,10 @@ func (m *PVMInstanceReference) ContextValidate(ctx context.Context, formats strf 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) } @@ -685,6 +713,24 @@ func (m *PVMInstanceReference) contextValidateConsoleLanguage(ctx context.Contex 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 { diff --git a/power/models/p_vm_instance_reference_v2.go b/power/models/p_vm_instance_reference_v2.go index 4fcc6864..929e93a8 100644 --- a/power/models/p_vm_instance_reference_v2.go +++ b/power/models/p_vm_instance_reference_v2.go @@ -31,6 +31,9 @@ type PVMInstanceReferenceV2 struct { // 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"` @@ -92,6 +95,10 @@ func (m *PVMInstanceReferenceV2) Validate(formats strfmt.Registry) error { 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) } @@ -197,6 +204,23 @@ func (m *PVMInstanceReferenceV2) validateCreationDate(formats strfmt.Registry) e 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 { @@ -408,6 +432,10 @@ func (m *PVMInstanceReferenceV2) ContextValidate(ctx context.Context, formats st 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) } @@ -484,6 +512,24 @@ func (m *PVMInstanceReferenceV2) contextValidateCores(ctx context.Context, forma 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 { diff --git a/power/models/p_vm_instance_update_response.go b/power/models/p_vm_instance_update_response.go index 21176e39..4a373de2 100644 --- a/power/models/p_vm_instance_update_response.go +++ b/power/models/p_vm_instance_update_response.go @@ -36,7 +36,7 @@ type PVMInstanceUpdateResponse struct { // Number of processors allocated Processors float64 `json:"processors,omitempty"` - // Name of the server to create + // 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) diff --git a/power/models/s_a_p_create.go b/power/models/s_a_p_create.go index 967ec274..830973ef 100644 --- a/power/models/s_a_p_create.go +++ b/power/models/s_a_p_create.go @@ -54,6 +54,9 @@ type SAPCreate struct { // 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"` @@ -72,6 +75,9 @@ type SAPCreate struct { // 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"` } @@ -112,6 +118,10 @@ func (m *SAPCreate) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateUserTags(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -246,6 +256,23 @@ func (m *SAPCreate) validateStorageAffinity(formats strfmt.Registry) error { 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 @@ -270,6 +297,10 @@ func (m *SAPCreate) ContextValidate(ctx context.Context, formats strfmt.Registry res = append(res, err) } + if err := m.contextValidateUserTags(ctx, formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -382,6 +413,20 @@ func (m *SAPCreate) contextValidateStorageAffinity(ctx context.Context, formats 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 { diff --git a/power/models/shared_processor_pool.go b/power/models/shared_processor_pool.go index 6cd9a57f..2a627441 100644 --- a/power/models/shared_processor_pool.go +++ b/power/models/shared_processor_pool.go @@ -28,6 +28,9 @@ type SharedProcessorPool struct { // Required: true AvailableCores *float64 `json:"availableCores"` + // crn + Crn CRN `json:"crn,omitempty"` + // The host group the host belongs to HostGroup string `json:"hostGroup,omitempty"` @@ -54,6 +57,9 @@ type SharedProcessorPool struct { // 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 @@ -68,6 +74,10 @@ func (m *SharedProcessorPool) Validate(formats strfmt.Registry) error { 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) } @@ -84,6 +94,10 @@ func (m *SharedProcessorPool) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateUserTags(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -108,6 +122,23 @@ func (m *SharedProcessorPool) validateAvailableCores(formats strfmt.Registry) er 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 { @@ -161,20 +192,63 @@ func (m *SharedProcessorPool) validateSharedProcessorPoolPlacementGroups(formats 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++ { @@ -200,6 +274,20 @@ func (m *SharedProcessorPool) contextValidateSharedProcessorPoolPlacementGroups( 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 { diff --git a/power/models/shared_processor_pool_create.go b/power/models/shared_processor_pool_create.go index a951586a..95eaf671 100644 --- a/power/models/shared_processor_pool_create.go +++ b/power/models/shared_processor_pool_create.go @@ -36,6 +36,9 @@ type SharedProcessorPoolCreate struct { // 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 @@ -54,6 +57,10 @@ func (m *SharedProcessorPoolCreate) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateUserTags(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -87,8 +94,48 @@ func (m *SharedProcessorPoolCreate) validateReservedCores(formats strfmt.Registr return nil } -// ContextValidate validates this shared processor pool create based on context it is used +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 } diff --git a/power/models/snapshot.go b/power/models/snapshot.go index c5d2fc31..3d7319f7 100644 --- a/power/models/snapshot.go +++ b/power/models/snapshot.go @@ -26,6 +26,9 @@ type Snapshot struct { // 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"` @@ -64,6 +67,10 @@ func (m *Snapshot) Validate(formats strfmt.Registry) error { 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) } @@ -102,6 +109,23 @@ func (m *Snapshot) validateCreationDate(formats strfmt.Registry) error { 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 @@ -150,8 +174,35 @@ func (m *Snapshot) validateVolumeSnapshots(formats strfmt.Registry) error { return nil } -// ContextValidate validates this snapshot based on context it is used +// 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 } diff --git a/power/models/snapshot_create.go b/power/models/snapshot_create.go index 00377110..8d85520a 100644 --- a/power/models/snapshot_create.go +++ b/power/models/snapshot_create.go @@ -26,6 +26,9 @@ type SnapshotCreate struct { // 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"` } @@ -38,6 +41,10 @@ func (m *SnapshotCreate) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateUserTags(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -53,8 +60,48 @@ func (m *SnapshotCreate) validateName(formats strfmt.Registry) error { return nil } -// ContextValidate validates this snapshot create based on context it is used +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 } diff --git a/power/models/snapshot_create_response.go b/power/models/snapshot_create_response.go index 61214fb3..eda2822b 100644 --- a/power/models/snapshot_create_response.go +++ b/power/models/snapshot_create_response.go @@ -19,25 +19,56 @@ import ( // 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 { @@ -47,8 +78,70 @@ func (m *SnapshotCreateResponse) validateSnapshotID(formats strfmt.Registry) err return nil } -// ContextValidate validates this snapshot create response based on context it is used +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 } diff --git a/power/models/snapshot_v1.go b/power/models/snapshot_v1.go index 2974fef6..674c2ef2 100644 --- a/power/models/snapshot_v1.go +++ b/power/models/snapshot_v1.go @@ -23,6 +23,9 @@ type SnapshotV1 struct { // Format: date-time CreationDate strfmt.DateTime `json:"creationDate,omitempty"` + // crn + Crn CRN `json:"crn,omitempty"` + // The snapshot UUID. // Required: true ID *string `json:"id"` @@ -56,6 +59,10 @@ func (m *SnapshotV1) Validate(formats strfmt.Registry) error { 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) } @@ -98,6 +105,23 @@ func (m *SnapshotV1) validateCreationDate(formats strfmt.Registry) error { 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 { @@ -155,8 +179,35 @@ func (m *SnapshotV1) validateVolumeID(formats strfmt.Registry) error { return nil } -// ContextValidate validates this snapshot v1 based on context it is used +// 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 } diff --git a/power/models/tags.go b/power/models/tags.go new file mode 100644 index 00000000..477c7687 --- /dev/null +++ b/power/models/tags.go @@ -0,0 +1,27 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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/volume.go b/power/models/volume.go index 96e80ee7..b572dfb6 100644 --- a/power/models/volume.go +++ b/power/models/volume.go @@ -40,6 +40,9 @@ type Volume struct { // 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"` @@ -103,6 +106,9 @@ type Volume struct { // Volume State State string `json:"state,omitempty"` + // user tags + UserTags Tags `json:"userTags,omitempty"` + // Volume ID // Required: true VolumeID *string `json:"volumeID"` @@ -125,6 +131,10 @@ func (m *Volume) Validate(formats strfmt.Registry) error { 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) } @@ -145,6 +155,10 @@ func (m *Volume) Validate(formats strfmt.Registry) error { 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) } @@ -168,6 +182,23 @@ func (m *Volume) validateCreationDate(formats strfmt.Registry) error { 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 @@ -253,6 +284,23 @@ func (m *Volume) validateSize(formats strfmt.Registry) error { 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 { @@ -262,8 +310,53 @@ func (m *Volume) validateVolumeID(formats strfmt.Registry) error { return nil } -// ContextValidate validates this volume based on context it is used +// 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 } diff --git a/power/models/volume_info.go b/power/models/volume_info.go index 26f5b3f2..59905e25 100644 --- a/power/models/volume_info.go +++ b/power/models/volume_info.go @@ -8,6 +8,7 @@ package models import ( "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -17,6 +18,9 @@ import ( // swagger:model VolumeInfo type VolumeInfo struct { + // crn + Crn CRN `json:"crn,omitempty"` + // Name of the volume Name string `json:"name,omitempty"` @@ -26,11 +30,64 @@ type VolumeInfo struct { // 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 validates this volume info based on context it is used +// 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 } diff --git a/power/models/volume_reference.go b/power/models/volume_reference.go index cfae6698..ada9e4a4 100644 --- a/power/models/volume_reference.go +++ b/power/models/volume_reference.go @@ -41,6 +41,9 @@ type VolumeReference struct { // 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"` @@ -111,6 +114,9 @@ type VolumeReference struct { // Required: true State *string `json:"state"` + // user tags + UserTags Tags `json:"userTags,omitempty"` + // Volume ID // Required: true VolumeID *string `json:"volumeID"` @@ -138,6 +144,10 @@ func (m *VolumeReference) Validate(formats strfmt.Registry) error { 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) } @@ -174,6 +184,10 @@ func (m *VolumeReference) Validate(formats strfmt.Registry) error { 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) } @@ -210,6 +224,23 @@ func (m *VolumeReference) validateCreationDate(formats strfmt.Registry) error { 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 { @@ -331,6 +362,23 @@ func (m *VolumeReference) validateState(formats strfmt.Registry) error { 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 { @@ -349,8 +397,53 @@ func (m *VolumeReference) validateWwn(formats strfmt.Registry) error { return nil } -// ContextValidate validates this volume reference based on context it is used +// 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 } diff --git a/power/models/volumes_clone_async_request.go b/power/models/volumes_clone_async_request.go index 1b0993a1..6d9f8c3b 100644 --- a/power/models/volumes_clone_async_request.go +++ b/power/models/volumes_clone_async_request.go @@ -40,6 +40,9 @@ type VolumesCloneAsyncRequest struct { // TargetStorageTier string `json:"targetStorageTier,omitempty"` + // user tags + UserTags Tags `json:"userTags,omitempty"` + // List of volumes to be cloned // Required: true VolumeIDs []string `json:"volumeIDs"` @@ -53,6 +56,10 @@ func (m *VolumesCloneAsyncRequest) Validate(formats strfmt.Registry) error { 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) } @@ -72,6 +79,23 @@ func (m *VolumesCloneAsyncRequest) validateName(formats strfmt.Registry) error { 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 { @@ -81,8 +105,31 @@ func (m *VolumesCloneAsyncRequest) validateVolumeIDs(formats strfmt.Registry) er return nil } -// ContextValidate validates this volumes clone async request based on context it is used +// 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 } diff --git a/power/models/volumes_clone_execute.go b/power/models/volumes_clone_execute.go index b470cb78..e118ea23 100644 --- a/power/models/volumes_clone_execute.go +++ b/power/models/volumes_clone_execute.go @@ -44,6 +44,9 @@ type VolumesCloneExecute struct { // the source volumes. // TargetStorageTier string `json:"targetStorageTier,omitempty"` + + // user tags + UserTags Tags `json:"userTags,omitempty"` } // Validate validates this volumes clone execute @@ -54,6 +57,10 @@ func (m *VolumesCloneExecute) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateUserTags(formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -69,8 +76,48 @@ func (m *VolumesCloneExecute) validateName(formats strfmt.Registry) error { return nil } -// ContextValidate validates this volumes clone execute based on context it is used +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 } From 4710183925ba7616f1e058ba5af764ccab03da0d Mon Sep 17 00:00:00 2001 From: ismirlia <90468712+ismirlia@users.noreply.github.com> Date: Mon, 29 Jul 2024 15:16:40 -0500 Subject: [PATCH 095/118] Block gateway network update for stratos (#429) --- clients/instance/ibm-pi-network.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/clients/instance/ibm-pi-network.go b/clients/instance/ibm-pi-network.go index 1b823234..63eb90e0 100644 --- a/clients/instance/ibm-pi-network.go +++ b/clients/instance/ibm-pi-network.go @@ -78,6 +78,10 @@ func (f *IBMPINetworkClient) Create(body *models.NetworkCreate) (*models.Network // Update a Network func (f *IBMPINetworkClient) Update(id string, body *models.NetworkUpdate) (*models.Network, error) { + // Check for satellite differences in this endpoint + if f.session.IsOnPrem() && body.Gateway != nil { + return nil, fmt.Errorf("gateway parameter is not supported in satellite location, check documentation") + } params := p_cloud_networks.NewPcloudNetworksPutParams(). WithContext(f.ctx).WithTimeout(helpers.PIUpdateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithNetworkID(id). From 177b78e7a979bfd58e25d675f8df75f4384ccf69 Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Tue, 6 Aug 2024 17:29:35 -0500 Subject: [PATCH 096/118] Generated Swagger client from service-broker commit f82abb1277ab5b723c24869c6428d76919342fed (#438) --- ...ity_details.go => capabilities_details.go} | 28 +-- power/models/datacenter.go | 32 ++-- power/models/datacenter_location.go | 17 ++ power/models/disaster_recovery.go | 81 +++++++-- power/models/replication_services.go | 159 ------------------ 5 files changed, 113 insertions(+), 204 deletions(-) rename power/models/{capability_details.go => capabilities_details.go} (75%) delete mode 100644 power/models/replication_services.go diff --git a/power/models/capability_details.go b/power/models/capabilities_details.go similarity index 75% rename from power/models/capability_details.go rename to power/models/capabilities_details.go index 1b2c0f42..9f11c204 100644 --- a/power/models/capability_details.go +++ b/power/models/capabilities_details.go @@ -14,10 +14,10 @@ import ( "github.com/go-openapi/validate" ) -// CapabilityDetails capability details +// CapabilitiesDetails capabilities details // -// swagger:model CapabilityDetails -type CapabilityDetails struct { +// swagger:model CapabilitiesDetails +type CapabilitiesDetails struct { // Disaster Recovery Information // Required: true @@ -28,8 +28,8 @@ type CapabilityDetails struct { SupportedSystems *SupportedSystems `json:"supportedSystems"` } -// Validate validates this capability details -func (m *CapabilityDetails) Validate(formats strfmt.Registry) error { +// Validate validates this capabilities details +func (m *CapabilitiesDetails) Validate(formats strfmt.Registry) error { var res []error if err := m.validateDisasterRecovery(formats); err != nil { @@ -46,7 +46,7 @@ func (m *CapabilityDetails) Validate(formats strfmt.Registry) error { return nil } -func (m *CapabilityDetails) validateDisasterRecovery(formats strfmt.Registry) error { +func (m *CapabilitiesDetails) validateDisasterRecovery(formats strfmt.Registry) error { if err := validate.Required("disasterRecovery", "body", m.DisasterRecovery); err != nil { return err @@ -66,7 +66,7 @@ func (m *CapabilityDetails) validateDisasterRecovery(formats strfmt.Registry) er return nil } -func (m *CapabilityDetails) validateSupportedSystems(formats strfmt.Registry) error { +func (m *CapabilitiesDetails) validateSupportedSystems(formats strfmt.Registry) error { if err := validate.Required("supportedSystems", "body", m.SupportedSystems); err != nil { return err @@ -86,8 +86,8 @@ func (m *CapabilityDetails) validateSupportedSystems(formats strfmt.Registry) er return nil } -// ContextValidate validate this capability details based on the context it is used -func (m *CapabilityDetails) ContextValidate(ctx context.Context, formats strfmt.Registry) error { +// 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 { @@ -104,7 +104,7 @@ func (m *CapabilityDetails) ContextValidate(ctx context.Context, formats strfmt. return nil } -func (m *CapabilityDetails) contextValidateDisasterRecovery(ctx context.Context, formats strfmt.Registry) error { +func (m *CapabilitiesDetails) contextValidateDisasterRecovery(ctx context.Context, formats strfmt.Registry) error { if m.DisasterRecovery != nil { @@ -121,7 +121,7 @@ func (m *CapabilityDetails) contextValidateDisasterRecovery(ctx context.Context, return nil } -func (m *CapabilityDetails) contextValidateSupportedSystems(ctx context.Context, formats strfmt.Registry) error { +func (m *CapabilitiesDetails) contextValidateSupportedSystems(ctx context.Context, formats strfmt.Registry) error { if m.SupportedSystems != nil { @@ -139,7 +139,7 @@ func (m *CapabilityDetails) contextValidateSupportedSystems(ctx context.Context, } // MarshalBinary interface implementation -func (m *CapabilityDetails) MarshalBinary() ([]byte, error) { +func (m *CapabilitiesDetails) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -147,8 +147,8 @@ func (m *CapabilityDetails) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *CapabilityDetails) UnmarshalBinary(b []byte) error { - var res CapabilityDetails +func (m *CapabilitiesDetails) UnmarshalBinary(b []byte) error { + var res CapabilitiesDetails if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/power/models/datacenter.go b/power/models/datacenter.go index 9fce52be..4dae0a17 100644 --- a/power/models/datacenter.go +++ b/power/models/datacenter.go @@ -24,8 +24,8 @@ type Datacenter struct { // Required: true Capabilities map[string]bool `json:"capabilities"` - // Additional Datacenter Capability Details - CapabilityDetails *CapabilityDetails `json:"capabilityDetails,omitempty"` + // Additional Datacenter Capabilities Details + CapabilitiesDetails *CapabilitiesDetails `json:"capabilitiesDetails,omitempty"` // Link to Datacenter Region Href string `json:"href,omitempty"` @@ -53,7 +53,7 @@ func (m *Datacenter) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateCapabilityDetails(formats); err != nil { + if err := m.validateCapabilitiesDetails(formats); err != nil { res = append(res, err) } @@ -84,17 +84,17 @@ func (m *Datacenter) validateCapabilities(formats strfmt.Registry) error { return nil } -func (m *Datacenter) validateCapabilityDetails(formats strfmt.Registry) error { - if swag.IsZero(m.CapabilityDetails) { // not required +func (m *Datacenter) validateCapabilitiesDetails(formats strfmt.Registry) error { + if swag.IsZero(m.CapabilitiesDetails) { // not required return nil } - if m.CapabilityDetails != nil { - if err := m.CapabilityDetails.Validate(formats); err != nil { + if m.CapabilitiesDetails != nil { + if err := m.CapabilitiesDetails.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("capabilityDetails") + return ve.ValidateName("capabilitiesDetails") } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("capabilityDetails") + return ce.ValidateName("capabilitiesDetails") } return err } @@ -216,7 +216,7 @@ func (m *Datacenter) validateType(formats strfmt.Registry) error { func (m *Datacenter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error - if err := m.contextValidateCapabilityDetails(ctx, formats); err != nil { + if err := m.contextValidateCapabilitiesDetails(ctx, formats); err != nil { res = append(res, err) } @@ -230,19 +230,19 @@ func (m *Datacenter) ContextValidate(ctx context.Context, formats strfmt.Registr return nil } -func (m *Datacenter) contextValidateCapabilityDetails(ctx context.Context, formats strfmt.Registry) error { +func (m *Datacenter) contextValidateCapabilitiesDetails(ctx context.Context, formats strfmt.Registry) error { - if m.CapabilityDetails != nil { + if m.CapabilitiesDetails != nil { - if swag.IsZero(m.CapabilityDetails) { // not required + if swag.IsZero(m.CapabilitiesDetails) { // not required return nil } - if err := m.CapabilityDetails.ContextValidate(ctx, formats); err != nil { + if err := m.CapabilitiesDetails.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("capabilityDetails") + return ve.ValidateName("capabilitiesDetails") } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("capabilityDetails") + return ce.ValidateName("capabilitiesDetails") } return err } diff --git a/power/models/datacenter_location.go b/power/models/datacenter_location.go index 2e0fb838..a3bbcd91 100644 --- a/power/models/datacenter_location.go +++ b/power/models/datacenter_location.go @@ -23,6 +23,10 @@ type DatacenterLocation struct { // 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"` @@ -40,6 +44,10 @@ func (m *DatacenterLocation) Validate(formats strfmt.Registry) error { 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) } @@ -63,6 +71,15 @@ func (m *DatacenterLocation) validateRegion(formats strfmt.Registry) error { 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 { diff --git a/power/models/disaster_recovery.go b/power/models/disaster_recovery.go index 852793de..f3e56e0c 100644 --- a/power/models/disaster_recovery.go +++ b/power/models/disaster_recovery.go @@ -19,16 +19,23 @@ import ( // swagger:model DisasterRecovery type DisasterRecovery struct { - // Disaster Recovery Information + // Asynchronous Replication Target Information // Required: true - ReplicationServices *ReplicationServices `json:"replicationServices"` + 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.validateReplicationServices(formats); err != nil { + if err := m.validateAsynchronousReplication(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSynchronousReplication(formats); err != nil { res = append(res, err) } @@ -38,18 +45,37 @@ func (m *DisasterRecovery) Validate(formats strfmt.Registry) error { return nil } -func (m *DisasterRecovery) validateReplicationServices(formats strfmt.Registry) error { +func (m *DisasterRecovery) validateAsynchronousReplication(formats strfmt.Registry) error { - if err := validate.Required("replicationServices", "body", m.ReplicationServices); err != nil { + if err := validate.Required("asynchronousReplication", "body", m.AsynchronousReplication); err != nil { return err } - if m.ReplicationServices != nil { - if err := m.ReplicationServices.Validate(formats); err != nil { + if m.AsynchronousReplication != nil { + if err := m.AsynchronousReplication.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("replicationServices") + return ve.ValidateName("asynchronousReplication") } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("replicationServices") + 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 } @@ -62,7 +88,11 @@ func (m *DisasterRecovery) validateReplicationServices(formats strfmt.Registry) func (m *DisasterRecovery) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error - if err := m.contextValidateReplicationServices(ctx, formats); err != nil { + if err := m.contextValidateAsynchronousReplication(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSynchronousReplication(ctx, formats); err != nil { res = append(res, err) } @@ -72,15 +102,36 @@ func (m *DisasterRecovery) ContextValidate(ctx context.Context, formats strfmt.R return nil } -func (m *DisasterRecovery) contextValidateReplicationServices(ctx context.Context, formats strfmt.Registry) error { +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.ReplicationServices != nil { + if m.SynchronousReplication != nil { + + if swag.IsZero(m.SynchronousReplication) { // not required + return nil + } - if err := m.ReplicationServices.ContextValidate(ctx, formats); err != nil { + if err := m.SynchronousReplication.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("replicationServices") + return ve.ValidateName("synchronousReplication") } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("replicationServices") + return ce.ValidateName("synchronousReplication") } return err } diff --git a/power/models/replication_services.go b/power/models/replication_services.go deleted file mode 100644 index 637125d0..00000000 --- a/power/models/replication_services.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" -) - -// ReplicationServices replication services -// -// swagger:model ReplicationServices -type ReplicationServices struct { - - // Asynchronous Replication Target Information - // Required: true - AsynchronousReplication *ReplicationService `json:"asynchronousReplication"` - - // Synchronous Replication Target Information - SynchronousReplication *ReplicationService `json:"synchronousReplication,omitempty"` -} - -// Validate validates this replication services -func (m *ReplicationServices) 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 *ReplicationServices) 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 *ReplicationServices) 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 replication services based on the context it is used -func (m *ReplicationServices) 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 *ReplicationServices) 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 *ReplicationServices) 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 *ReplicationServices) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ReplicationServices) UnmarshalBinary(b []byte) error { - var res ReplicationServices - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} From 94f14bccf3e4234467329772c71465412b083272 Mon Sep 17 00:00:00 2001 From: michaelkad <45772690+michaelkad@users.noreply.github.com> Date: Tue, 6 Aug 2024 17:30:31 -0500 Subject: [PATCH 097/118] Add Network Address Group (#435) --- .../instance/ibmi-pi-network-address-group.go | 117 ++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 clients/instance/ibmi-pi-network-address-group.go diff --git a/clients/instance/ibmi-pi-network-address-group.go b/clients/instance/ibmi-pi-network-address-group.go new file mode 100644 index 00000000..16695a20 --- /dev/null +++ b/clients/instance/ibmi-pi-network-address-group.go @@ -0,0 +1,117 @@ +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_address_groups" + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// IBMPINetworkAddressGroupClient +type IBMPINetworkAddressGroupClient struct { + IBMPIClient +} + +// NewIBMPINetworkAddressGroupClient +func NewIBMPINetworkAddressGroupClient(ctx context.Context, sess *ibmpisession.IBMPISession, cloudInstanceID string) *IBMPINetworkAddressGroupClient { + return &IBMPINetworkAddressGroupClient{ + *NewIBMPIClient(ctx, sess, cloudInstanceID), + } +} + +// Create a new Network Address Group +func (f *IBMPINetworkAddressGroupClient) Create(body *models.NetworkAddressGroupCreate) (*models.NetworkAddressGroup, error) { + params := network_address_groups.NewV1NetworkAddressGroupsPostParams().WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).WithBody(body) + postok, postcreated, err := f.session.Power.NetworkAddressGroups.V1NetworkAddressGroupsPost(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to create a network address group %s", err)) + } + if postok != nil && postok.Payload != nil { + return postok.Payload, nil + } + if postcreated != nil && postcreated.Payload != nil { + return postcreated.Payload, nil + } + return nil, fmt.Errorf("failed to create a network address group") +} + +// Get the list of Network Address Groups for a workspace +func (f *IBMPINetworkAddressGroupClient) GetAll() (*models.NetworkAddressGroups, error) { + params := network_address_groups.NewV1NetworkAddressGroupsGetParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut) + resp, err := f.session.Power.NetworkAddressGroups.V1NetworkAddressGroupsGet(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to get network address groups %s", err)) + } + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to get network address groups") + } + return resp.Payload, nil + +} + +// Get the detail of a Network Address Group +func (f *IBMPINetworkAddressGroupClient) Get(id string) (*models.NetworkAddressGroup, error) { + params := network_address_groups.NewV1NetworkAddressGroupsIDGetParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).WithNetworkAddressGroupID(id) + resp, err := f.session.Power.NetworkAddressGroups.V1NetworkAddressGroupsIDGet(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to get network address group %s: %w", id, err)) + } + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to get network address group %s", id) + } + return resp.Payload, nil + +} + +// Update a Network Address Group +func (f *IBMPINetworkAddressGroupClient) Update(id string, body *models.NetworkAddressGroupUpdate) (*models.NetworkAddressGroup, error) { + params := network_address_groups.NewV1NetworkAddressGroupsIDPutParams().WithContext(f.ctx).WithTimeout(helpers.PIUpdateTimeOut) + resp, err := f.session.Power.NetworkAddressGroups.V1NetworkAddressGroupsIDPut(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to update network address group %s: %w", id, err)) + } + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to update network address group %s", id) + } + return resp.Payload, nil +} + +// Delete a Network Address Group from a workspace +func (f *IBMPINetworkAddressGroupClient) Delete(id string) error { + params := network_address_groups.NewV1NetworkAddressGroupsIDDeleteParams().WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut).WithNetworkAddressGroupID(id) + _, err := f.session.Power.NetworkAddressGroups.V1NetworkAddressGroupsIDDelete(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return fmt.Errorf("failed to delete network address group %s: %w", id, err) + } + return nil +} + +// Add a member to a Network Address Group +func (f *IBMPINetworkAddressGroupClient) AddMember(id string, body *models.NetworkAddressGroupAddMember) (*models.NetworkAddressGroup, error) { + params := network_address_groups.NewV1NetworkAddressGroupsMembersPostParams().WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).WithNetworkAddressGroupID(id) + resp, err := f.session.Power.NetworkAddressGroups.V1NetworkAddressGroupsMembersPost(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to add member to network address group %s: %w", id, err)) + } + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to add member to network address group %s", id) + } + return resp.Payload, nil +} + +// Delete the member from a Network Address Group +func (f *IBMPINetworkAddressGroupClient) DeleteMember(id, memberId string) (*models.NetworkAddressGroup, error) { + params := network_address_groups.NewV1NetworkAddressGroupsMembersDeleteParams().WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut).WithNetworkAddressGroupID(id).WithNetworkAddressGroupMemberID(memberId) + resp, err := f.session.Power.NetworkAddressGroups.V1NetworkAddressGroupsMembersDelete(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to delete member %s from network address group %s: %w", memberId, id, err)) + } + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to delete member %s from network address group %s", memberId, id) + } + return resp.Payload, nil + +} From a301b30333fe574093a7e2bd4102527aac8ed8dc Mon Sep 17 00:00:00 2001 From: michaelkad <45772690+michaelkad@users.noreply.github.com> Date: Wed, 7 Aug 2024 09:17:57 -0500 Subject: [PATCH 098/118] Network Security Group (#434) * Network Security Group * Add nsg action --- .../instance/ibm-pi-network-security-group.go | 150 ++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 clients/instance/ibm-pi-network-security-group.go diff --git a/clients/instance/ibm-pi-network-security-group.go b/clients/instance/ibm-pi-network-security-group.go new file mode 100644 index 00000000..e5ba9ce4 --- /dev/null +++ b/clients/instance/ibm-pi-network-security-group.go @@ -0,0 +1,150 @@ +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_security_groups" + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// IBMPINetworkSecurityGroupClient +type IBMPINetworkSecurityGroupClient struct { + IBMPIClient +} + +// NewIBMIPINetworkSecurityGroupClient +func NewIBMIPINetworkSecurityGroupClient(ctx context.Context, sess *ibmpisession.IBMPISession, cloudInstanceID string) *IBMPINetworkSecurityGroupClient { + return &IBMPINetworkSecurityGroupClient{ + *NewIBMPIClient(ctx, sess, cloudInstanceID), + } +} + +// Get a network security group +func (f *IBMPINetworkSecurityGroupClient) Get(id string) (*models.NetworkSecurityGroup, error) { + params := network_security_groups.NewV1NetworkSecurityGroupsIDGetParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).WithNetworkSecurityGroupID(id) + resp, err := f.session.Power.NetworkSecurityGroups.V1NetworkSecurityGroupsIDGet(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to get network security group %s: %w", id, err)) + } + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to get network security group %s", id) + } + return resp.Payload, nil +} + +// Get all network security groups +func (f *IBMPINetworkSecurityGroupClient) GetAll() (*models.NetworkSecurityGroups, error) { + params := network_security_groups.NewV1NetworkSecurityGroupsListParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut) + resp, err := f.session.Power.NetworkSecurityGroups.V1NetworkSecurityGroupsList(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to get network security groups %s", err)) + } + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to get network security groups") + } + return resp.Payload, nil +} + +// Create a network security group +func (f *IBMPINetworkSecurityGroupClient) Create(body *models.NetworkSecurityGroupCreate) (*models.NetworkSecurityGroup, error) { + params := network_security_groups.NewV1NetworkSecurityGroupsPostParams().WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).WithBody(body) + postok, postcreated, err := f.session.Power.NetworkSecurityGroups.V1NetworkSecurityGroupsPost(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to create a network security group %s", err)) + } + if postok != nil && postok.Payload != nil { + return postok.Payload, nil + } + if postcreated != nil && postcreated.Payload != nil { + return postcreated.Payload, nil + } + return nil, fmt.Errorf("failed to create a network security group") +} + +// Update a network security group +func (f *IBMPINetworkSecurityGroupClient) Update(id string, body *models.NetworkSecurityGroupUpdate) (*models.NetworkSecurityGroup, error) { + params := network_security_groups.NewV1NetworkSecurityGroupsIDPutParams().WithContext(f.ctx).WithTimeout(helpers.PIUpdateTimeOut).WithNetworkSecurityGroupID(id).WithBody(body) + resp, err := f.session.Power.NetworkSecurityGroups.V1NetworkSecurityGroupsIDPut(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to update network security group %s: %w", id, err)) + } + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to update network security group %s", id) + } + return resp.Payload, nil +} + +// Delete a network security group +func (f *IBMPINetworkSecurityGroupClient) Delete(id string) error { + params := network_security_groups.NewV1NetworkSecurityGroupsIDDeleteParams().WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut).WithNetworkSecurityGroupID(id) + _, err := f.session.Power.NetworkSecurityGroups.V1NetworkSecurityGroupsIDDelete(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return fmt.Errorf("failed to delete network security group %s: %w", id, err) + } + return nil +} + +// Add a member to a network security group +func (f *IBMPINetworkSecurityGroupClient) AddMember(id string, body *models.NetworkSecurityGroupAddMember) (*models.NetworkSecurityGroup, error) { + params := network_security_groups.NewV1NetworkSecurityGroupsMembersPostParams().WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).WithNetworkSecurityGroupID(id).WithBody(body) + resp, err := f.session.Power.NetworkSecurityGroups.V1NetworkSecurityGroupsMembersPost(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to add member to network security group %s: %w", id, err)) + } + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to add member to network security group %s", id) + } + return resp.Payload, nil +} + +// Deleta a member from a network securti group +func (f *IBMPINetworkSecurityGroupClient) DeleteMember(id, memberId string) (*models.NetworkSecurityGroup, error) { + params := network_security_groups.NewV1NetworkSecurityGroupsMembersDeleteParams().WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut).WithNetworkSecurityGroupID(id).WithNetworkSecurityGroupMemberID(memberId) + resp, err := f.session.Power.NetworkSecurityGroups.V1NetworkSecurityGroupsMembersDelete(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to delete member %s from network security group %s: %w", memberId, id, err)) + } + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to delete member %s from network security group %s", memberId, id) + } + return resp.Payload, nil +} + +// Add a rule to a network security group +func (f *IBMPINetworkSecurityGroupClient) AddRule(id string, body *models.NetworkSecurityGroupAddRule) (*models.NetworkSecurityGroup, error) { + params := network_security_groups.NewV1NetworkSecurityGroupsRulesPostParams().WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).WithNetworkSecurityGroupID(id).WithBody(body) + resp, err := f.session.Power.NetworkSecurityGroups.V1NetworkSecurityGroupsRulesPost(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to add rule to network security group %s: %w", id, err)) + } + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to add rule to network security group %s", id) + } + return resp.Payload, nil +} + +// Delete a rule from a network security group +func (f *IBMPINetworkSecurityGroupClient) DeleteRule(id, ruleId string) (*models.NetworkSecurityGroup, error) { + params := network_security_groups.NewV1NetworkSecurityGroupsRulesDeleteParams().WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut).WithNetworkSecurityGroupID(id).WithNetworkSecurityGroupRuleID(ruleId) + resp, err := f.session.Power.NetworkSecurityGroups.V1NetworkSecurityGroupsRulesDelete(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to delete rule %s from network security group %s: %w", ruleId, id, err)) + } + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to delete rule %s from network security group %s", ruleId, id) + } + return resp.Payload, nil +} + +// Action on a network security group +func (f *IBMPINetworkSecurityGroupClient) Action(body *models.NetworkSecurityGroupsAction) error { + params := network_security_groups.NewV1NetworkSecurityGroupsActionPostParams().WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).WithBody(body) + _, _, err := f.session.Power.NetworkSecurityGroups.V1NetworkSecurityGroupsActionPost(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return fmt.Errorf("failed to perform action :%w", err) + } + return nil +} From 8f7134cbdf64a81c0e5ad367ae2ba8b38a30d85b Mon Sep 17 00:00:00 2001 From: michaelkad <45772690+michaelkad@users.noreply.github.com> Date: Wed, 7 Aug 2024 09:18:16 -0500 Subject: [PATCH 099/118] Add Network Interface (#437) * Add Network Interface * Update clients/instance/ibm-pi-network.go Co-authored-by: ismirlia <90468712+ismirlia@users.noreply.github.com> * Update clients/instance/ibm-pi-network.go Co-authored-by: ismirlia <90468712+ismirlia@users.noreply.github.com> * Update clients/instance/ibm-pi-network.go Co-authored-by: ismirlia <90468712+ismirlia@users.noreply.github.com> --------- Co-authored-by: ismirlia <90468712+ismirlia@users.noreply.github.com> --- clients/instance/ibm-pi-network.go | 63 ++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/clients/instance/ibm-pi-network.go b/clients/instance/ibm-pi-network.go index 63eb90e0..28ec4be0 100644 --- a/clients/instance/ibm-pi-network.go +++ b/clients/instance/ibm-pi-network.go @@ -8,6 +8,7 @@ import ( "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/networks" "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks" "github.com/IBM-Cloud/power-go-client/power/models" ) @@ -200,3 +201,65 @@ func (f *IBMPINetworkClient) UpdatePort(id, networkPortID string, body *models.N } return resp.Payload, nil } + +// Create a network interface +func (f *IBMPINetworkClient) CreateNetworkInterface(id string, body *models.NetworkInterfaceCreate) (*models.NetworkInterface, error) { + params := networks.NewV1NetworksNetworkInterfacesPostParams().WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).WithNetworkID(id).WithBody(body) + resp, err := f.session.Power.Networks.V1NetworksNetworkInterfacesPost(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to create network interface for network %s with %w", id, err)) + } + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to create network interface for network %s", id) + } + return resp.Payload, nil +} + +// Get all Create a network interface +func (f *IBMPINetworkClient) GetAllNetworkInterfaces(id string) (*models.NetworkInterfaces, error) { + params := networks.NewV1NetworksNetworkInterfacesGetallParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).WithNetworkID(id) + resp, err := f.session.Power.Networks.V1NetworksNetworkInterfacesGetall(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to get all network interfaces for network %s: %w", id, err)) + } + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to get all network interfaces for network %s", id) + } + return resp.Payload, nil +} + +// Get a network interface +func (f *IBMPINetworkClient) GetNetworkInterface(id, netIntID string) (*models.NetworkInterface, error) { + params := networks.NewV1NetworksNetworkInterfacesGetParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).WithNetworkID(id).WithNetworkInterfaceID(netIntID) + resp, err := f.session.Power.Networks.V1NetworksNetworkInterfacesGet(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to get network interace %s for network %s: %w", netIntID, id, err)) + } + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to get network interface %s for network %s", netIntID, id) + } + return resp.Payload, nil +} + +// Update a network interface +func (f *IBMPINetworkClient) UpdateNetworkInterface(id, netIntID string, body *models.NetworkInterfaceUpdate) (*models.NetworkInterface, error) { + params := networks.NewV1NetworksNetworkInterfacesPutParams().WithContext(f.ctx).WithTimeout(helpers.PIUpdateTimeOut).WithNetworkID(id).WithNetworkInterfaceID(netIntID).WithBody(body) + resp, err := f.session.Power.Networks.V1NetworksNetworkInterfacesPut(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to update network interface %s and network %s with error %w", netIntID, id, err)) + } + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to update network interface %s and network %s", netIntID, id) + } + return resp.Payload, nil +} + +// Delete a network interface +func (f *IBMPINetworkClient) DeleteNetworkInterface(id, netIntID string) error { + params := networks.NewV1NetworksNetworkInterfacesDeleteParams().WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut).WithNetworkID(id).WithNetworkInterfaceID(netIntID) + _, err := f.session.Power.Networks.V1NetworksNetworkInterfacesDelete(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return fmt.Errorf("failed to delete network interface %s for network %s with error %w", netIntID, id, err) + } + return nil +} From 64a56d5f26efe56c99009c907be6faa25d68b01c Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Wed, 7 Aug 2024 13:19:24 -0500 Subject: [PATCH 100/118] Generated Swagger client from service-broker commit 8ef4989190f08ba3544a8958ccbb5aeb3cab15dd (#439) --- .../p_cloud_virtual_serial_number_client.go | 106 ++++ ...virtual_serial_number_getall_parameters.go | 151 ++++++ ..._virtual_serial_number_getall_responses.go | 484 ++++++++++++++++++ power/client/power_iaas_api_client.go | 5 + power/models/virtual_serial_number.go | 56 ++ power/models/virtual_serial_number_list.go | 78 +++ 6 files changed, 880 insertions(+) create mode 100644 power/client/p_cloud_virtual_serial_number/p_cloud_virtual_serial_number_client.go create mode 100644 power/client/p_cloud_virtual_serial_number/pcloud_cloudinstances_virtual_serial_number_getall_parameters.go create mode 100644 power/client/p_cloud_virtual_serial_number/pcloud_cloudinstances_virtual_serial_number_getall_responses.go create mode 100644 power/models/virtual_serial_number.go create mode 100644 power/models/virtual_serial_number_list.go diff --git a/power/client/p_cloud_virtual_serial_number/p_cloud_virtual_serial_number_client.go b/power/client/p_cloud_virtual_serial_number/p_cloud_virtual_serial_number_client.go new file mode 100644 index 00000000..3366927f --- /dev/null +++ b/power/client/p_cloud_virtual_serial_number/p_cloud_virtual_serial_number_client.go @@ -0,0 +1,106 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package p_cloud_virtual_serial_number + +// 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 virtual serial number API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +// New creates a new p cloud virtual serial number 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 virtual serial number 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 virtual serial number 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 { + PcloudCloudinstancesVirtualSerialNumberGetall(params *PcloudCloudinstancesVirtualSerialNumberGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesVirtualSerialNumberGetallOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +PcloudCloudinstancesVirtualSerialNumberGetall lists all retained v s ns this cloud instance +*/ +func (a *Client) PcloudCloudinstancesVirtualSerialNumberGetall(params *PcloudCloudinstancesVirtualSerialNumberGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesVirtualSerialNumberGetallOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudCloudinstancesVirtualSerialNumberGetallParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.cloudinstances.virtual-serial-number.getall", + Method: "GET", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/virtual-serial-number", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudCloudinstancesVirtualSerialNumberGetallReader{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.(*PcloudCloudinstancesVirtualSerialNumberGetallOK) + 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.virtual-serial-number.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_virtual_serial_number/pcloud_cloudinstances_virtual_serial_number_getall_parameters.go b/power/client/p_cloud_virtual_serial_number/pcloud_cloudinstances_virtual_serial_number_getall_parameters.go new file mode 100644 index 00000000..3f54fca4 --- /dev/null +++ b/power/client/p_cloud_virtual_serial_number/pcloud_cloudinstances_virtual_serial_number_getall_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package p_cloud_virtual_serial_number + +// 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" +) + +// NewPcloudCloudinstancesVirtualSerialNumberGetallParams creates a new PcloudCloudinstancesVirtualSerialNumberGetallParams 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 NewPcloudCloudinstancesVirtualSerialNumberGetallParams() *PcloudCloudinstancesVirtualSerialNumberGetallParams { + return &PcloudCloudinstancesVirtualSerialNumberGetallParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPcloudCloudinstancesVirtualSerialNumberGetallParamsWithTimeout creates a new PcloudCloudinstancesVirtualSerialNumberGetallParams object +// with the ability to set a timeout on a request. +func NewPcloudCloudinstancesVirtualSerialNumberGetallParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesVirtualSerialNumberGetallParams { + return &PcloudCloudinstancesVirtualSerialNumberGetallParams{ + timeout: timeout, + } +} + +// NewPcloudCloudinstancesVirtualSerialNumberGetallParamsWithContext creates a new PcloudCloudinstancesVirtualSerialNumberGetallParams object +// with the ability to set a context for a request. +func NewPcloudCloudinstancesVirtualSerialNumberGetallParamsWithContext(ctx context.Context) *PcloudCloudinstancesVirtualSerialNumberGetallParams { + return &PcloudCloudinstancesVirtualSerialNumberGetallParams{ + Context: ctx, + } +} + +// NewPcloudCloudinstancesVirtualSerialNumberGetallParamsWithHTTPClient creates a new PcloudCloudinstancesVirtualSerialNumberGetallParams object +// with the ability to set a custom HTTPClient for a request. +func NewPcloudCloudinstancesVirtualSerialNumberGetallParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesVirtualSerialNumberGetallParams { + return &PcloudCloudinstancesVirtualSerialNumberGetallParams{ + HTTPClient: client, + } +} + +/* +PcloudCloudinstancesVirtualSerialNumberGetallParams contains all the parameters to send to the API endpoint + + for the pcloud cloudinstances virtual serial number getall operation. + + Typically these are written to a http.Request. +*/ +type PcloudCloudinstancesVirtualSerialNumberGetallParams 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 virtual serial number getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesVirtualSerialNumberGetallParams) WithDefaults() *PcloudCloudinstancesVirtualSerialNumberGetallParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud cloudinstances virtual serial number getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudCloudinstancesVirtualSerialNumberGetallParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the pcloud cloudinstances virtual serial number getall params +func (o *PcloudCloudinstancesVirtualSerialNumberGetallParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesVirtualSerialNumberGetallParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the pcloud cloudinstances virtual serial number getall params +func (o *PcloudCloudinstancesVirtualSerialNumberGetallParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the pcloud cloudinstances virtual serial number getall params +func (o *PcloudCloudinstancesVirtualSerialNumberGetallParams) WithContext(ctx context.Context) *PcloudCloudinstancesVirtualSerialNumberGetallParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the pcloud cloudinstances virtual serial number getall params +func (o *PcloudCloudinstancesVirtualSerialNumberGetallParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the pcloud cloudinstances virtual serial number getall params +func (o *PcloudCloudinstancesVirtualSerialNumberGetallParams) WithHTTPClient(client *http.Client) *PcloudCloudinstancesVirtualSerialNumberGetallParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the pcloud cloudinstances virtual serial number getall params +func (o *PcloudCloudinstancesVirtualSerialNumberGetallParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCloudInstanceID adds the cloudInstanceID to the pcloud cloudinstances virtual serial number getall params +func (o *PcloudCloudinstancesVirtualSerialNumberGetallParams) WithCloudInstanceID(cloudInstanceID string) *PcloudCloudinstancesVirtualSerialNumberGetallParams { + o.SetCloudInstanceID(cloudInstanceID) + return o +} + +// SetCloudInstanceID adds the cloudInstanceId to the pcloud cloudinstances virtual serial number getall params +func (o *PcloudCloudinstancesVirtualSerialNumberGetallParams) SetCloudInstanceID(cloudInstanceID string) { + o.CloudInstanceID = cloudInstanceID +} + +// WriteToRequest writes these params to a swagger request +func (o *PcloudCloudinstancesVirtualSerialNumberGetallParams) 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_virtual_serial_number/pcloud_cloudinstances_virtual_serial_number_getall_responses.go b/power/client/p_cloud_virtual_serial_number/pcloud_cloudinstances_virtual_serial_number_getall_responses.go new file mode 100644 index 00000000..37efbafd --- /dev/null +++ b/power/client/p_cloud_virtual_serial_number/pcloud_cloudinstances_virtual_serial_number_getall_responses.go @@ -0,0 +1,484 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package p_cloud_virtual_serial_number + +// 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" +) + +// PcloudCloudinstancesVirtualSerialNumberGetallReader is a Reader for the PcloudCloudinstancesVirtualSerialNumberGetall structure. +type PcloudCloudinstancesVirtualSerialNumberGetallReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PcloudCloudinstancesVirtualSerialNumberGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPcloudCloudinstancesVirtualSerialNumberGetallOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewPcloudCloudinstancesVirtualSerialNumberGetallBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewPcloudCloudinstancesVirtualSerialNumberGetallUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPcloudCloudinstancesVirtualSerialNumberGetallForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPcloudCloudinstancesVirtualSerialNumberGetallNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPcloudCloudinstancesVirtualSerialNumberGetallInternalServerError() + 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}/virtual-serial-number] pcloud.cloudinstances.virtual-serial-number.getall", response, response.Code()) + } +} + +// NewPcloudCloudinstancesVirtualSerialNumberGetallOK creates a PcloudCloudinstancesVirtualSerialNumberGetallOK with default headers values +func NewPcloudCloudinstancesVirtualSerialNumberGetallOK() *PcloudCloudinstancesVirtualSerialNumberGetallOK { + return &PcloudCloudinstancesVirtualSerialNumberGetallOK{} +} + +/* +PcloudCloudinstancesVirtualSerialNumberGetallOK describes a response with status code 200, with default header values. + +OK +*/ +type PcloudCloudinstancesVirtualSerialNumberGetallOK struct { + Payload models.VirtualSerialNumberList +} + +// IsSuccess returns true when this pcloud cloudinstances virtual serial number getall o k response has a 2xx status code +func (o *PcloudCloudinstancesVirtualSerialNumberGetallOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this pcloud cloudinstances virtual serial number getall o k response has a 3xx status code +func (o *PcloudCloudinstancesVirtualSerialNumberGetallOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this pcloud cloudinstances virtual serial number getall o k response has a 4xx status code +func (o *PcloudCloudinstancesVirtualSerialNumberGetallOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this pcloud cloudinstances virtual serial number getall o k response has a 5xx status code +func (o *PcloudCloudinstancesVirtualSerialNumberGetallOK) IsServerError() bool { + return false +} + +// IsCode returns true when this pcloud cloudinstances virtual serial number getall o k response a status code equal to that given +func (o *PcloudCloudinstancesVirtualSerialNumberGetallOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the pcloud cloudinstances virtual serial number getall o k response +func (o *PcloudCloudinstancesVirtualSerialNumberGetallOK) Code() int { + return 200 +} + +func (o *PcloudCloudinstancesVirtualSerialNumberGetallOK) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/virtual-serial-number][%d] pcloudCloudinstancesVirtualSerialNumberGetallOK %s", 200, payload) +} + +func (o *PcloudCloudinstancesVirtualSerialNumberGetallOK) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/virtual-serial-number][%d] pcloudCloudinstancesVirtualSerialNumberGetallOK %s", 200, payload) +} + +func (o *PcloudCloudinstancesVirtualSerialNumberGetallOK) GetPayload() models.VirtualSerialNumberList { + return o.Payload +} + +func (o *PcloudCloudinstancesVirtualSerialNumberGetallOK) 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 +} + +// NewPcloudCloudinstancesVirtualSerialNumberGetallBadRequest creates a PcloudCloudinstancesVirtualSerialNumberGetallBadRequest with default headers values +func NewPcloudCloudinstancesVirtualSerialNumberGetallBadRequest() *PcloudCloudinstancesVirtualSerialNumberGetallBadRequest { + return &PcloudCloudinstancesVirtualSerialNumberGetallBadRequest{} +} + +/* +PcloudCloudinstancesVirtualSerialNumberGetallBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type PcloudCloudinstancesVirtualSerialNumberGetallBadRequest struct { + Payload *models.Error +} + +// IsSuccess returns true when this pcloud cloudinstances virtual serial number getall bad request response has a 2xx status code +func (o *PcloudCloudinstancesVirtualSerialNumberGetallBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this pcloud cloudinstances virtual serial number getall bad request response has a 3xx status code +func (o *PcloudCloudinstancesVirtualSerialNumberGetallBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this pcloud cloudinstances virtual serial number getall bad request response has a 4xx status code +func (o *PcloudCloudinstancesVirtualSerialNumberGetallBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this pcloud cloudinstances virtual serial number getall bad request response has a 5xx status code +func (o *PcloudCloudinstancesVirtualSerialNumberGetallBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this pcloud cloudinstances virtual serial number getall bad request response a status code equal to that given +func (o *PcloudCloudinstancesVirtualSerialNumberGetallBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the pcloud cloudinstances virtual serial number getall bad request response +func (o *PcloudCloudinstancesVirtualSerialNumberGetallBadRequest) Code() int { + return 400 +} + +func (o *PcloudCloudinstancesVirtualSerialNumberGetallBadRequest) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/virtual-serial-number][%d] pcloudCloudinstancesVirtualSerialNumberGetallBadRequest %s", 400, payload) +} + +func (o *PcloudCloudinstancesVirtualSerialNumberGetallBadRequest) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/virtual-serial-number][%d] pcloudCloudinstancesVirtualSerialNumberGetallBadRequest %s", 400, payload) +} + +func (o *PcloudCloudinstancesVirtualSerialNumberGetallBadRequest) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudCloudinstancesVirtualSerialNumberGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudCloudinstancesVirtualSerialNumberGetallUnauthorized creates a PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized with default headers values +func NewPcloudCloudinstancesVirtualSerialNumberGetallUnauthorized() *PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized { + return &PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized{} +} + +/* +PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized struct { + Payload *models.Error +} + +// IsSuccess returns true when this pcloud cloudinstances virtual serial number getall unauthorized response has a 2xx status code +func (o *PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this pcloud cloudinstances virtual serial number getall unauthorized response has a 3xx status code +func (o *PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this pcloud cloudinstances virtual serial number getall unauthorized response has a 4xx status code +func (o *PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this pcloud cloudinstances virtual serial number getall unauthorized response has a 5xx status code +func (o *PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this pcloud cloudinstances virtual serial number getall unauthorized response a status code equal to that given +func (o *PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the pcloud cloudinstances virtual serial number getall unauthorized response +func (o *PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized) Code() int { + return 401 +} + +func (o *PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/virtual-serial-number][%d] pcloudCloudinstancesVirtualSerialNumberGetallUnauthorized %s", 401, payload) +} + +func (o *PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/virtual-serial-number][%d] pcloudCloudinstancesVirtualSerialNumberGetallUnauthorized %s", 401, payload) +} + +func (o *PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudCloudinstancesVirtualSerialNumberGetallForbidden creates a PcloudCloudinstancesVirtualSerialNumberGetallForbidden with default headers values +func NewPcloudCloudinstancesVirtualSerialNumberGetallForbidden() *PcloudCloudinstancesVirtualSerialNumberGetallForbidden { + return &PcloudCloudinstancesVirtualSerialNumberGetallForbidden{} +} + +/* +PcloudCloudinstancesVirtualSerialNumberGetallForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type PcloudCloudinstancesVirtualSerialNumberGetallForbidden struct { + Payload *models.Error +} + +// IsSuccess returns true when this pcloud cloudinstances virtual serial number getall forbidden response has a 2xx status code +func (o *PcloudCloudinstancesVirtualSerialNumberGetallForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this pcloud cloudinstances virtual serial number getall forbidden response has a 3xx status code +func (o *PcloudCloudinstancesVirtualSerialNumberGetallForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this pcloud cloudinstances virtual serial number getall forbidden response has a 4xx status code +func (o *PcloudCloudinstancesVirtualSerialNumberGetallForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this pcloud cloudinstances virtual serial number getall forbidden response has a 5xx status code +func (o *PcloudCloudinstancesVirtualSerialNumberGetallForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this pcloud cloudinstances virtual serial number getall forbidden response a status code equal to that given +func (o *PcloudCloudinstancesVirtualSerialNumberGetallForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the pcloud cloudinstances virtual serial number getall forbidden response +func (o *PcloudCloudinstancesVirtualSerialNumberGetallForbidden) Code() int { + return 403 +} + +func (o *PcloudCloudinstancesVirtualSerialNumberGetallForbidden) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/virtual-serial-number][%d] pcloudCloudinstancesVirtualSerialNumberGetallForbidden %s", 403, payload) +} + +func (o *PcloudCloudinstancesVirtualSerialNumberGetallForbidden) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/virtual-serial-number][%d] pcloudCloudinstancesVirtualSerialNumberGetallForbidden %s", 403, payload) +} + +func (o *PcloudCloudinstancesVirtualSerialNumberGetallForbidden) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudCloudinstancesVirtualSerialNumberGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudCloudinstancesVirtualSerialNumberGetallNotFound creates a PcloudCloudinstancesVirtualSerialNumberGetallNotFound with default headers values +func NewPcloudCloudinstancesVirtualSerialNumberGetallNotFound() *PcloudCloudinstancesVirtualSerialNumberGetallNotFound { + return &PcloudCloudinstancesVirtualSerialNumberGetallNotFound{} +} + +/* +PcloudCloudinstancesVirtualSerialNumberGetallNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type PcloudCloudinstancesVirtualSerialNumberGetallNotFound struct { + Payload *models.Error +} + +// IsSuccess returns true when this pcloud cloudinstances virtual serial number getall not found response has a 2xx status code +func (o *PcloudCloudinstancesVirtualSerialNumberGetallNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this pcloud cloudinstances virtual serial number getall not found response has a 3xx status code +func (o *PcloudCloudinstancesVirtualSerialNumberGetallNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this pcloud cloudinstances virtual serial number getall not found response has a 4xx status code +func (o *PcloudCloudinstancesVirtualSerialNumberGetallNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this pcloud cloudinstances virtual serial number getall not found response has a 5xx status code +func (o *PcloudCloudinstancesVirtualSerialNumberGetallNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this pcloud cloudinstances virtual serial number getall not found response a status code equal to that given +func (o *PcloudCloudinstancesVirtualSerialNumberGetallNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the pcloud cloudinstances virtual serial number getall not found response +func (o *PcloudCloudinstancesVirtualSerialNumberGetallNotFound) Code() int { + return 404 +} + +func (o *PcloudCloudinstancesVirtualSerialNumberGetallNotFound) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/virtual-serial-number][%d] pcloudCloudinstancesVirtualSerialNumberGetallNotFound %s", 404, payload) +} + +func (o *PcloudCloudinstancesVirtualSerialNumberGetallNotFound) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/virtual-serial-number][%d] pcloudCloudinstancesVirtualSerialNumberGetallNotFound %s", 404, payload) +} + +func (o *PcloudCloudinstancesVirtualSerialNumberGetallNotFound) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudCloudinstancesVirtualSerialNumberGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudCloudinstancesVirtualSerialNumberGetallInternalServerError creates a PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError with default headers values +func NewPcloudCloudinstancesVirtualSerialNumberGetallInternalServerError() *PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError { + return &PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError{} +} + +/* +PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError struct { + Payload *models.Error +} + +// IsSuccess returns true when this pcloud cloudinstances virtual serial number getall internal server error response has a 2xx status code +func (o *PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this pcloud cloudinstances virtual serial number getall internal server error response has a 3xx status code +func (o *PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this pcloud cloudinstances virtual serial number getall internal server error response has a 4xx status code +func (o *PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this pcloud cloudinstances virtual serial number getall internal server error response has a 5xx status code +func (o *PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this pcloud cloudinstances virtual serial number getall internal server error response a status code equal to that given +func (o *PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the pcloud cloudinstances virtual serial number getall internal server error response +func (o *PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError) Code() int { + return 500 +} + +func (o *PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/virtual-serial-number][%d] pcloudCloudinstancesVirtualSerialNumberGetallInternalServerError %s", 500, payload) +} + +func (o *PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/virtual-serial-number][%d] pcloudCloudinstancesVirtualSerialNumberGetallInternalServerError %s", 500, payload) +} + +func (o *PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + 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 index 6a25d818..4f41fd5a 100644 --- a/power/client/power_iaas_api_client.go +++ b/power/client/power_iaas_api_client.go @@ -48,6 +48,7 @@ import ( "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_virtual_serial_number" "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" @@ -140,6 +141,7 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *PowerIaasA 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.PCloudVirtualSerialNumber = p_cloud_virtual_serial_number.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) @@ -270,6 +272,8 @@ type PowerIaasAPI struct { PCloudvpnPolicies p_cloud_v_p_n_policies.ClientService + PCloudVirtualSerialNumber p_cloud_virtual_serial_number.ClientService + PCloudVolumeGroups p_cloud_volume_groups.ClientService PCloudVolumeOnboarding p_cloud_volume_onboarding.ClientService @@ -334,6 +338,7 @@ func (c *PowerIaasAPI) SetTransport(transport runtime.ClientTransport) { c.PCloudTenantsSSHKeys.SetTransport(transport) c.PCloudvpnConnections.SetTransport(transport) c.PCloudvpnPolicies.SetTransport(transport) + c.PCloudVirtualSerialNumber.SetTransport(transport) c.PCloudVolumeGroups.SetTransport(transport) c.PCloudVolumeOnboarding.SetTransport(transport) c.PCloudVolumes.SetTransport(transport) diff --git a/power/models/virtual_serial_number.go b/power/models/virtual_serial_number.go new file mode 100644 index 00000000..51f35b38 --- /dev/null +++ b/power/models/virtual_serial_number.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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" +) + +// VirtualSerialNumber VSN Details +// +// swagger:model VirtualSerialNumber +type VirtualSerialNumber struct { + + // Description of the retained VSN + Description string `json:"description,omitempty"` + + // HostID of the retained VSN + Host string `json:"host,omitempty"` + + // ID of the retained VSN + VirtualSerialNumber string `json:"virtual-serial-number,omitempty"` +} + +// Validate validates this virtual serial number +func (m *VirtualSerialNumber) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this virtual serial number based on context it is used +func (m *VirtualSerialNumber) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *VirtualSerialNumber) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VirtualSerialNumber) UnmarshalBinary(b []byte) error { + var res VirtualSerialNumber + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/power/models/virtual_serial_number_list.go b/power/models/virtual_serial_number_list.go new file mode 100644 index 00000000..0ef19e24 --- /dev/null +++ b/power/models/virtual_serial_number_list.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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" +) + +// VirtualSerialNumberList An array of retained VSNs +// +// swagger:model VirtualSerialNumberList +type VirtualSerialNumberList []*VirtualSerialNumber + +// Validate validates this virtual serial number list +func (m VirtualSerialNumberList) 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 virtual serial number list based on the context it is used +func (m VirtualSerialNumberList) 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 +} From 20f888760558f58d1b9d084e0c81103ef68f9cac Mon Sep 17 00:00:00 2001 From: michaelkad <45772690+michaelkad@users.noreply.github.com> Date: Thu, 8 Aug 2024 08:26:22 -0500 Subject: [PATCH 101/118] Fix typo in file name (#442) --- ...i-network-address-group.go => ibm-pi-network-address-group.go} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename clients/instance/{ibmi-pi-network-address-group.go => ibm-pi-network-address-group.go} (100%) diff --git a/clients/instance/ibmi-pi-network-address-group.go b/clients/instance/ibm-pi-network-address-group.go similarity index 100% rename from clients/instance/ibmi-pi-network-address-group.go rename to clients/instance/ibm-pi-network-address-group.go From c09cf27c4cd1f6fc9aefce27c301656c934d8f7b Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Thu, 8 Aug 2024 08:28:03 -0500 Subject: [PATCH 102/118] Generated Swagger client from service-broker commit dcdebb6b0053044d882d02b44116455004075bf5 (#440) --- power/models/p_vm_instance.go | 3 +++ power/models/p_vm_instance_create.go | 3 +++ power/models/p_vm_instance_update.go | 3 +++ 3 files changed, 9 insertions(+) diff --git a/power/models/p_vm_instance.go b/power/models/p_vm_instance.go index 457affd7..31e49515 100644 --- a/power/models/p_vm_instance.go +++ b/power/models/p_vm_instance.go @@ -164,6 +164,9 @@ type PVMInstance struct { // The pvm instance virtual CPU information VirtualCores *VirtualCores `json:"virtualCores,omitempty"` + // VSN id allocated to the Virtual Machine + VirtualSerialNumber string `json:"virtualSerialNumber,omitempty"` + // List of volume IDs // Required: true VolumeIDs []string `json:"volumeIDs"` diff --git a/power/models/p_vm_instance_create.go b/power/models/p_vm_instance_create.go index a44538bb..3ad1d277 100644 --- a/power/models/p_vm_instance_create.go +++ b/power/models/p_vm_instance_create.go @@ -124,6 +124,9 @@ type PVMInstanceCreate struct { // The pvm instance virtual CPU information VirtualCores *VirtualCores `json:"virtualCores,omitempty"` + // VSN ID of a retained VSN or specify 'auto-assign' to have a new VSN ID generated. + VirtualSerialNumber string `json:"virtualSerialNumber,omitempty"` + // List of volume IDs VolumeIDs []string `json:"volumeIDs"` } diff --git a/power/models/p_vm_instance_update.go b/power/models/p_vm_instance_update.go index 56e06295..232b2c70 100644 --- a/power/models/p_vm_instance_update.go +++ b/power/models/p_vm_instance_update.go @@ -56,6 +56,9 @@ type PVMInstanceUpdate struct { // The pvm instance virtual CPU information VirtualCores *VirtualCores `json:"virtualCores,omitempty"` + + // VSN ID of a retained VSN or specify 'auto-assign' to have a new VSN ID generated. + VirtualSerialNumber string `json:"virtualSerialNumber,omitempty"` } // Validate validates this p VM instance update From e992b4c236f9a4c9f0b79dfd3939c7e9513c847c Mon Sep 17 00:00:00 2001 From: ismirlia <90468712+ismirlia@users.noreply.github.com> Date: Thu, 8 Aug 2024 08:43:20 -0500 Subject: [PATCH 103/118] Revert "Block gateway network update for stratos (#429)" (#441) This reverts commit 4710183925ba7616f1e058ba5af764ccab03da0d. --- clients/instance/ibm-pi-network.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/clients/instance/ibm-pi-network.go b/clients/instance/ibm-pi-network.go index 28ec4be0..a813bc42 100644 --- a/clients/instance/ibm-pi-network.go +++ b/clients/instance/ibm-pi-network.go @@ -79,10 +79,6 @@ func (f *IBMPINetworkClient) Create(body *models.NetworkCreate) (*models.Network // Update a Network func (f *IBMPINetworkClient) Update(id string, body *models.NetworkUpdate) (*models.Network, error) { - // Check for satellite differences in this endpoint - if f.session.IsOnPrem() && body.Gateway != nil { - return nil, fmt.Errorf("gateway parameter is not supported in satellite location, check documentation") - } params := p_cloud_networks.NewPcloudNetworksPutParams(). WithContext(f.ctx).WithTimeout(helpers.PIUpdateTimeOut). WithCloudInstanceID(f.cloudInstanceID).WithNetworkID(id). From 0f5b587f0de545d1fdbfaefdc1fc82ebad447414 Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Fri, 9 Aug 2024 13:31:00 -0500 Subject: [PATCH 104/118] Generated Swagger client from service-broker commit 20f660a90900d9ca627b9178a00f5ebf1fdc0e51 (#443) --- .../pcloud_cloudconnections_post_responses.go | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) 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 index 485b02fb..edd642b6 100644 --- a/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_post_responses.go +++ b/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_post_responses.go @@ -66,6 +66,12 @@ func (o *PcloudCloudconnectionsPostReader) ReadResponse(response runtime.ClientR 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 { @@ -597,6 +603,76 @@ func (o *PcloudCloudconnectionsPostNotFound) readResponse(response runtime.Clien 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{} From 6b99ec8bc99115e316966f4c18bbb81ba8156d55 Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Thu, 15 Aug 2024 16:43:31 -0500 Subject: [PATCH 105/118] Update NSG[rm direction], NI[ch PvmInstance ->Instance, rm NetworkSecurityGroupID](#445) --- power/models/network_interface.go | 92 ++++++++++----------- power/models/network_interface_update.go | 9 +- power/models/network_security_group_rule.go | 52 ------------ 3 files changed, 49 insertions(+), 104 deletions(-) diff --git a/power/models/network_interface.go b/power/models/network_interface.go index 26ff1457..4c4792b9 100644 --- a/power/models/network_interface.go +++ b/power/models/network_interface.go @@ -27,6 +27,9 @@ type NetworkInterface struct { // 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"` @@ -42,9 +45,6 @@ type NetworkInterface struct { // ID of the Network Security Group the network interface will be added to NetworkSecurityGroupID string `json:"networkSecurityGroupID,omitempty"` - // pvm instance - PvmInstance *NetworkInterfacePvmInstance `json:"pvmInstance,omitempty"` - // The status of the network address group // Required: true Status *string `json:"status"` @@ -65,19 +65,19 @@ func (m *NetworkInterface) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateIPAddress(formats); err != nil { + if err := m.validateInstance(formats); err != nil { res = append(res, err) } - if err := m.validateMacAddress(formats); err != nil { + if err := m.validateIPAddress(formats); err != nil { res = append(res, err) } - if err := m.validateName(formats); err != nil { + if err := m.validateMacAddress(formats); err != nil { res = append(res, err) } - if err := m.validatePvmInstance(formats); err != nil { + if err := m.validateName(formats); err != nil { res = append(res, err) } @@ -109,6 +109,25 @@ func (m *NetworkInterface) validateID(formats strfmt.Registry) error { 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 { @@ -136,25 +155,6 @@ func (m *NetworkInterface) validateName(formats strfmt.Registry) error { return nil } -func (m *NetworkInterface) 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 *NetworkInterface) validateStatus(formats strfmt.Registry) error { if err := validate.Required("status", "body", m.Status); err != nil { @@ -168,7 +168,7 @@ func (m *NetworkInterface) validateStatus(formats strfmt.Registry) error { func (m *NetworkInterface) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error - if err := m.contextValidatePvmInstance(ctx, formats); err != nil { + if err := m.contextValidateInstance(ctx, formats); err != nil { res = append(res, err) } @@ -178,19 +178,19 @@ func (m *NetworkInterface) ContextValidate(ctx context.Context, formats strfmt.R return nil } -func (m *NetworkInterface) contextValidatePvmInstance(ctx context.Context, formats strfmt.Registry) error { +func (m *NetworkInterface) contextValidateInstance(ctx context.Context, formats strfmt.Registry) error { - if m.PvmInstance != nil { + if m.Instance != nil { - if swag.IsZero(m.PvmInstance) { // not required + if swag.IsZero(m.Instance) { // not required return nil } - if err := m.PvmInstance.ContextValidate(ctx, formats); err != nil { + if err := m.Instance.ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pvmInstance") + return ve.ValidateName("instance") } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pvmInstance") + return ce.ValidateName("instance") } return err } @@ -217,30 +217,30 @@ func (m *NetworkInterface) UnmarshalBinary(b []byte) error { return nil } -// NetworkInterfacePvmInstance The attached pvm-instance to this Network Interface +// NetworkInterfaceInstance The attached instance to this Network Interface // -// swagger:model NetworkInterfacePvmInstance -type NetworkInterfacePvmInstance struct { +// swagger:model NetworkInterfaceInstance +type NetworkInterfaceInstance struct { - // Link to pvm-instance resource + // Link to instance resource Href string `json:"href,omitempty"` - // The attahed pvm-instance ID - PvmInstanceID string `json:"pvmInstanceID,omitempty"` + // The attached instance ID + InstanceID string `json:"instanceID,omitempty"` } -// Validate validates this network interface pvm instance -func (m *NetworkInterfacePvmInstance) Validate(formats strfmt.Registry) error { +// Validate validates this network interface instance +func (m *NetworkInterfaceInstance) Validate(formats strfmt.Registry) error { return nil } -// ContextValidate validates this network interface pvm instance based on context it is used -func (m *NetworkInterfacePvmInstance) ContextValidate(ctx context.Context, formats strfmt.Registry) error { +// 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 *NetworkInterfacePvmInstance) MarshalBinary() ([]byte, error) { +func (m *NetworkInterfaceInstance) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -248,8 +248,8 @@ func (m *NetworkInterfacePvmInstance) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *NetworkInterfacePvmInstance) UnmarshalBinary(b []byte) error { - var res NetworkInterfacePvmInstance +func (m *NetworkInterfaceInstance) UnmarshalBinary(b []byte) error { + var res NetworkInterfaceInstance if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/power/models/network_interface_update.go b/power/models/network_interface_update.go index b9104cfa..c6c981e0 100644 --- a/power/models/network_interface_update.go +++ b/power/models/network_interface_update.go @@ -17,14 +17,11 @@ import ( // 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"` - - // ID of the Network Security Group the network interface will be added to, if empty detaches from Network Security Group - NetworkSecurityGroupID string `json:"networkSecurityGroupID,omitempty"` - - // If supplied populated it attaches to the PVMInstanceID, if empty detaches from PVMInstanceID - PvmInstanceID *string `json:"pvmInstanceID,omitempty"` } // Validate validates this network interface update diff --git a/power/models/network_security_group_rule.go b/power/models/network_security_group_rule.go index 00c26042..58901232 100644 --- a/power/models/network_security_group_rule.go +++ b/power/models/network_security_group_rule.go @@ -28,11 +28,6 @@ type NetworkSecurityGroupRule struct { // destination port DestinationPort *NetworkSecurityGroupRulePort `json:"destinationPort,omitempty"` - // The direction of the network traffic - // Required: true - // Enum: ["inbound","outbound"] - Direction *string `json:"direction"` - // The ID of the rule in a Network Security Group // Required: true ID *string `json:"id"` @@ -65,10 +60,6 @@ func (m *NetworkSecurityGroupRule) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateDirection(formats); err != nil { - res = append(res, err) - } - if err := m.validateID(formats); err != nil { res = append(res, err) } @@ -157,49 +148,6 @@ func (m *NetworkSecurityGroupRule) validateDestinationPort(formats strfmt.Regist return nil } -var networkSecurityGroupRuleTypeDirectionPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["inbound","outbound"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - networkSecurityGroupRuleTypeDirectionPropEnum = append(networkSecurityGroupRuleTypeDirectionPropEnum, v) - } -} - -const ( - - // NetworkSecurityGroupRuleDirectionInbound captures enum value "inbound" - NetworkSecurityGroupRuleDirectionInbound string = "inbound" - - // NetworkSecurityGroupRuleDirectionOutbound captures enum value "outbound" - NetworkSecurityGroupRuleDirectionOutbound string = "outbound" -) - -// prop value enum -func (m *NetworkSecurityGroupRule) validateDirectionEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, networkSecurityGroupRuleTypeDirectionPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *NetworkSecurityGroupRule) validateDirection(formats strfmt.Registry) error { - - if err := validate.Required("direction", "body", m.Direction); err != nil { - return err - } - - // value enum - if err := m.validateDirectionEnum("direction", "body", *m.Direction); err != nil { - return err - } - - return nil -} - func (m *NetworkSecurityGroupRule) validateID(formats strfmt.Registry) error { if err := validate.Required("id", "body", m.ID); err != nil { From ebd8fb5dc6550c5513a5fd5f9cba47a6568bf81e Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Tue, 20 Aug 2024 08:19:17 -0500 Subject: [PATCH 106/118] V1VolumeSnapshots SB commit 993d71eee3199d4805cab774d50d7edad91f067c (#447) --- power/client/snapshots/snapshots_client.go | 98 ++- .../v1_volume_snapshots_get_parameters.go | 151 +++++ .../v1_volume_snapshots_get_responses.go | 562 ++++++++++++++++++ .../v1_volume_snapshots_getall_parameters.go | 128 ++++ .../v1_volume_snapshots_getall_responses.go | 486 +++++++++++++++ power/models/snapshot_list.go | 2 +- power/models/snapshot_v1.go | 12 +- power/models/volume_snapshot_list.go | 121 ++++ 8 files changed, 1551 insertions(+), 9 deletions(-) create mode 100644 power/client/snapshots/v1_volume_snapshots_get_parameters.go create mode 100644 power/client/snapshots/v1_volume_snapshots_get_responses.go create mode 100644 power/client/snapshots/v1_volume_snapshots_getall_parameters.go create mode 100644 power/client/snapshots/v1_volume_snapshots_getall_responses.go create mode 100644 power/models/volume_snapshot_list.go diff --git a/power/client/snapshots/snapshots_client.go b/power/client/snapshots/snapshots_client.go index dc26c54c..a4864748 100644 --- a/power/client/snapshots/snapshots_client.go +++ b/power/client/snapshots/snapshots_client.go @@ -60,11 +60,19 @@ type ClientService interface { 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 + 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. */ @@ -105,7 +113,11 @@ func (a *Client) V1SnapshotsGet(params *V1SnapshotsGetParams, authInfo runtime.C } /* -V1SnapshotsGetall gets a list of all the snapshots on a workspace + 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. */ @@ -145,6 +157,88 @@ func (a *Client) V1SnapshotsGetall(params *V1SnapshotsGetallParams, authInfo run 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_volume_snapshots_get_parameters.go b/power/client/snapshots/v1_volume_snapshots_get_parameters.go new file mode 100644 index 00000000..2d739ce6 --- /dev/null +++ b/power/client/snapshots/v1_volume_snapshots_get_parameters.go @@ -0,0 +1,151 @@ +// 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 new file mode 100644 index 00000000..4402d278 --- /dev/null +++ b/power/client/snapshots/v1_volume_snapshots_get_responses.go @@ -0,0 +1,562 @@ +// 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 new file mode 100644 index 00000000..5b96fcd1 --- /dev/null +++ b/power/client/snapshots/v1_volume_snapshots_getall_parameters.go @@ -0,0 +1,128 @@ +// 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 new file mode 100644 index 00000000..525835e8 --- /dev/null +++ b/power/client/snapshots/v1_volume_snapshots_getall_responses.go @@ -0,0 +1,486 @@ +// 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/models/snapshot_list.go b/power/models/snapshot_list.go index a1e6fd10..ee6a7d7b 100644 --- a/power/models/snapshot_list.go +++ b/power/models/snapshot_list.go @@ -20,7 +20,7 @@ import ( // swagger:model SnapshotList type SnapshotList struct { - // The list of snapshots. + // The list of volume snapshots. // Required: true Snapshots []*SnapshotV1 `json:"snapshots"` } diff --git a/power/models/snapshot_v1.go b/power/models/snapshot_v1.go index 674c2ef2..570c3a4f 100644 --- a/power/models/snapshot_v1.go +++ b/power/models/snapshot_v1.go @@ -19,30 +19,30 @@ import ( // swagger:model SnapshotV1 type SnapshotV1 struct { - // The date and time when the snapshot was created. + // 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 snapshot UUID. + // The volume snapshot UUID. // Required: true ID *string `json:"id"` - // The snapshot name. + // The volume snapshot name. // Required: true Name *string `json:"name"` - // The size of the snapshot, in gibibytes (GiB). + // The size of the volume snapshot, in gibibytes (GiB). // Required: true Size *float64 `json:"size"` - // The status for the snapshot. + // The status for the volume snapshot. // Required: true Status *string `json:"status"` - // The date and time when the snapshot was last updated. + // The date and time when the volume snapshot was last updated. // Format: date-time UpdatedDate strfmt.DateTime `json:"updatedDate,omitempty"` diff --git a/power/models/volume_snapshot_list.go b/power/models/volume_snapshot_list.go new file mode 100644 index 00000000..9190cd33 --- /dev/null +++ b/power/models/volume_snapshot_list.go @@ -0,0 +1,121 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// 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 +} From 0c0b2a0416810b23319c25c13015ba1eaf4d96d2 Mon Sep 17 00:00:00 2001 From: michaelkad <45772690+michaelkad@users.noreply.github.com> Date: Tue, 20 Aug 2024 09:31:41 -0500 Subject: [PATCH 107/118] Add Volume Snapshot/s V1 (#448) --- clients/instance/ibm-pi-snapshot.go | 32 +++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/clients/instance/ibm-pi-snapshot.go b/clients/instance/ibm-pi-snapshot.go index 5fe18aae..f1560d91 100644 --- a/clients/instance/ibm-pi-snapshot.go +++ b/clients/instance/ibm-pi-snapshot.go @@ -99,7 +99,35 @@ func (f *IBMPISnapshotClient) Create(instanceID, snapshotID, restoreFailAction s return resp.Payload, nil } -// Get a SnapshotV1 +// Get a Volume SnapshotV1 +func (f *IBMPISnapshotClient) V1VolumeSnapshotsGet(id string) (*models.SnapshotV1, error) { + params := snapshots.NewV1VolumeSnapshotsGetParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).WithVolumeSnapshotUUID(id) + resp, err := f.session.Power.Snapshots.V1VolumeSnapshotsGet(params, f.session.AuthInfo(f.cloudInstanceID)) + + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Get volume snapshot %s: %w", id, err)) + } + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to Get PI Snapshot %s", id) + } + return resp.Payload, nil +} + +// Get Volume All SnapshotsV1 +func (f *IBMPISnapshotClient) V1VolumeSnapshotsGetall() (*models.VolumeSnapshotList, error) { + params := snapshots.NewV1VolumeSnapshotsGetallParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut) + resp, err := f.session.Power.Snapshots.V1VolumeSnapshotsGetall(params, f.session.AuthInfo(f.cloudInstanceID)) + + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to Get all volume snapshots: %w", err)) + } + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed to Get all volume Snapshots") + } + return resp.Payload, nil +} + +// Deprecated Get a SnapshotV1 func (f *IBMPISnapshotClient) V1SnapshotsGet(id string) (*models.SnapshotV1, error) { params := snapshots.NewV1SnapshotsGetParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).WithSnapshotID(id) resp, err := f.session.Power.Snapshots.V1SnapshotsGet(params, f.session.AuthInfo(f.cloudInstanceID)) @@ -113,7 +141,7 @@ func (f *IBMPISnapshotClient) V1SnapshotsGet(id string) (*models.SnapshotV1, err return resp.Payload, nil } -// Get All SnapshotsV1 +// Deprecated Get All SnapshotsV1 func (f *IBMPISnapshotClient) V1SnapshotsGetall() (*models.SnapshotList, error) { params := snapshots.NewV1SnapshotsGetallParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut) resp, err := f.session.Power.Snapshots.V1SnapshotsGetall(params, f.session.AuthInfo(f.cloudInstanceID)) From 0f6acd9d4c71f5ce586b2562dad175a6565de40f Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Fri, 23 Aug 2024 13:01:34 -0500 Subject: [PATCH 108/118] Update [M]NAg,NSG: member, rules; SysPool: CoreIncrement SB commit c78e75aa6d199faa5196e1bac0488071a074b8c9 (#451) --- ...address_groups_members_delete_responses.go | 8 +- ...k_address_groups_members_post_responses.go | 6 +- ...k_security_groups_action_post_responses.go | 76 +++++++++++++++++++ ...ecurity_groups_members_delete_responses.go | 8 +- ..._security_groups_members_post_responses.go | 6 +- ..._security_groups_rules_delete_responses.go | 8 +- ...rk_security_groups_rules_post_responses.go | 6 +- .../network_security_group_rule_port.go | 4 +- power/models/system_pool.go | 3 + 9 files changed, 99 insertions(+), 26 deletions(-) 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 index 86199912..6105c1f6 100644 --- 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 @@ -82,7 +82,7 @@ V1NetworkAddressGroupsMembersDeleteOK describes a response with status code 200, OK */ type V1NetworkAddressGroupsMembersDeleteOK struct { - Payload *models.NetworkAddressGroup + Payload models.Object } // IsSuccess returns true when this v1 network address groups members delete o k response has a 2xx status code @@ -125,16 +125,14 @@ func (o *V1NetworkAddressGroupsMembersDeleteOK) String() string { 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.NetworkAddressGroup { +func (o *V1NetworkAddressGroupsMembersDeleteOK) GetPayload() models.Object { return o.Payload } func (o *V1NetworkAddressGroupsMembersDeleteOK) 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 { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { return err } 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 index 76f6e5e0..ea8d2ce3 100644 --- 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 @@ -88,7 +88,7 @@ V1NetworkAddressGroupsMembersPostOK describes a response with status code 200, w OK */ type V1NetworkAddressGroupsMembersPostOK struct { - Payload *models.NetworkAddressGroup + Payload *models.NetworkAddressGroupMember } // IsSuccess returns true when this v1 network address groups members post o k response has a 2xx status code @@ -131,13 +131,13 @@ func (o *V1NetworkAddressGroupsMembersPostOK) String() string { return fmt.Sprintf("[POST /v1/network-address-groups/{network_address_group_id}/members][%d] v1NetworkAddressGroupsMembersPostOK %s", 200, payload) } -func (o *V1NetworkAddressGroupsMembersPostOK) GetPayload() *models.NetworkAddressGroup { +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.NetworkAddressGroup) + o.Payload = new(models.NetworkAddressGroupMember) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { 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 index 2baaa04e..b1536f9f 100644 --- 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 @@ -72,6 +72,12 @@ func (o *V1NetworkSecurityGroupsActionPostReader) ReadResponse(response runtime. 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()) } @@ -632,3 +638,73 @@ func (o *V1NetworkSecurityGroupsActionPostInternalServerError) readResponse(resp 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_members_delete_responses.go b/power/client/network_security_groups/v1_network_security_groups_members_delete_responses.go index 8d5336ab..da71f1b2 100644 --- 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 @@ -82,7 +82,7 @@ V1NetworkSecurityGroupsMembersDeleteOK describes a response with status code 200 OK */ type V1NetworkSecurityGroupsMembersDeleteOK struct { - Payload *models.NetworkSecurityGroup + Payload models.Object } // IsSuccess returns true when this v1 network security groups members delete o k response has a 2xx status code @@ -125,16 +125,14 @@ func (o *V1NetworkSecurityGroupsMembersDeleteOK) String() string { 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.NetworkSecurityGroup { +func (o *V1NetworkSecurityGroupsMembersDeleteOK) GetPayload() models.Object { return o.Payload } func (o *V1NetworkSecurityGroupsMembersDeleteOK) 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 { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { return err } 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 index 41faba80..c273addc 100644 --- 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 @@ -88,7 +88,7 @@ V1NetworkSecurityGroupsMembersPostOK describes a response with status code 200, OK */ type V1NetworkSecurityGroupsMembersPostOK struct { - Payload *models.NetworkSecurityGroup + Payload *models.NetworkSecurityGroupMember } // IsSuccess returns true when this v1 network security groups members post o k response has a 2xx status code @@ -131,13 +131,13 @@ func (o *V1NetworkSecurityGroupsMembersPostOK) String() string { return fmt.Sprintf("[POST /v1/network-security-groups/{network_security_group_id}/members][%d] v1NetworkSecurityGroupsMembersPostOK %s", 200, payload) } -func (o *V1NetworkSecurityGroupsMembersPostOK) GetPayload() *models.NetworkSecurityGroup { +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.NetworkSecurityGroup) + o.Payload = new(models.NetworkSecurityGroupMember) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { 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 index d7aec462..e318eb64 100644 --- 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 @@ -82,7 +82,7 @@ V1NetworkSecurityGroupsRulesDeleteOK describes a response with status code 200, OK */ type V1NetworkSecurityGroupsRulesDeleteOK struct { - Payload *models.NetworkSecurityGroup + Payload models.Object } // IsSuccess returns true when this v1 network security groups rules delete o k response has a 2xx status code @@ -125,16 +125,14 @@ func (o *V1NetworkSecurityGroupsRulesDeleteOK) String() string { 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.NetworkSecurityGroup { +func (o *V1NetworkSecurityGroupsRulesDeleteOK) GetPayload() models.Object { return o.Payload } func (o *V1NetworkSecurityGroupsRulesDeleteOK) 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 { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { return err } 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 index 27ae7369..5d519da4 100644 --- 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 @@ -88,7 +88,7 @@ V1NetworkSecurityGroupsRulesPostOK describes a response with status code 200, wi OK */ type V1NetworkSecurityGroupsRulesPostOK struct { - Payload *models.NetworkSecurityGroup + Payload *models.NetworkSecurityGroupRule } // IsSuccess returns true when this v1 network security groups rules post o k response has a 2xx status code @@ -131,13 +131,13 @@ func (o *V1NetworkSecurityGroupsRulesPostOK) String() string { return fmt.Sprintf("[POST /v1/network-security-groups/{network_security_group_id}/rules][%d] v1NetworkSecurityGroupsRulesPostOK %s", 200, payload) } -func (o *V1NetworkSecurityGroupsRulesPostOK) GetPayload() *models.NetworkSecurityGroup { +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.NetworkSecurityGroup) + o.Payload = new(models.NetworkSecurityGroupRule) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/power/models/network_security_group_rule_port.go b/power/models/network_security_group_rule_port.go index 9038f803..bb8cc5f5 100644 --- a/power/models/network_security_group_rule_port.go +++ b/power/models/network_security_group_rule_port.go @@ -18,10 +18,10 @@ import ( type NetworkSecurityGroupRulePort struct { // The end of the port range, if applicable, If values are not present then all ports are in the range - Maximum float64 `json:"maximum,omitempty"` + Maximum int64 `json:"maximum,omitempty"` // The start of the port range, if applicable. If values are not present then all ports are in the range - Minimum float64 `json:"minimum,omitempty"` + Minimum int64 `json:"minimum,omitempty"` } // Validate validates this network security group rule port diff --git a/power/models/system_pool.go b/power/models/system_pool.go index fc5ed175..42d0c350 100644 --- a/power/models/system_pool.go +++ b/power/models/system_pool.go @@ -22,6 +22,9 @@ 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"` From 81afc73d306b172ea78452c40182eeb21973853e Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Mon, 26 Aug 2024 08:52:44 -0500 Subject: [PATCH 109/118] Update [M] Volumes: bootvolume description SB commit 12b759fc126a30ce8537daef3f9bf56e2f3ddbaf (#453) --- power/models/volume.go | 2 +- power/models/volume_reference.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/power/models/volume.go b/power/models/volume.go index b572dfb6..5394c368 100644 --- a/power/models/volume.go +++ b/power/models/volume.go @@ -26,7 +26,7 @@ type Volume struct { // true if volume is auxiliary otherwise false Auxiliary *bool `json:"auxiliary,omitempty"` - // Indicates if the volume is the server's boot volume + // 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 diff --git a/power/models/volume_reference.go b/power/models/volume_reference.go index ada9e4a4..037c3b43 100644 --- a/power/models/volume_reference.go +++ b/power/models/volume_reference.go @@ -26,7 +26,7 @@ type VolumeReference struct { // true if volume is auxiliary otherwise false Auxiliary *bool `json:"auxiliary,omitempty"` - // Indicates if the volume is the server's boot volume + // 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 From 5d12ac1b1dc849bc1e82c75d4dca6ec2a2a08eec Mon Sep 17 00:00:00 2001 From: Alexander-Kita Date: Mon, 26 Aug 2024 08:56:45 -0500 Subject: [PATCH 110/118] Update NSG and NAG types (#452) * Change NSG and NAG response types * Fix deletes --- .../instance/ibm-pi-network-address-group.go | 13 ++++------ .../instance/ibm-pi-network-security-group.go | 26 +++++++------------ 2 files changed, 15 insertions(+), 24 deletions(-) diff --git a/clients/instance/ibm-pi-network-address-group.go b/clients/instance/ibm-pi-network-address-group.go index 16695a20..0d42788c 100644 --- a/clients/instance/ibm-pi-network-address-group.go +++ b/clients/instance/ibm-pi-network-address-group.go @@ -90,7 +90,7 @@ func (f *IBMPINetworkAddressGroupClient) Delete(id string) error { } // Add a member to a Network Address Group -func (f *IBMPINetworkAddressGroupClient) AddMember(id string, body *models.NetworkAddressGroupAddMember) (*models.NetworkAddressGroup, error) { +func (f *IBMPINetworkAddressGroupClient) AddMember(id string, body *models.NetworkAddressGroupAddMember) (*models.NetworkAddressGroupMember, error) { params := network_address_groups.NewV1NetworkAddressGroupsMembersPostParams().WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).WithNetworkAddressGroupID(id) resp, err := f.session.Power.NetworkAddressGroups.V1NetworkAddressGroupsMembersPost(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { @@ -103,15 +103,12 @@ func (f *IBMPINetworkAddressGroupClient) AddMember(id string, body *models.Netwo } // Delete the member from a Network Address Group -func (f *IBMPINetworkAddressGroupClient) DeleteMember(id, memberId string) (*models.NetworkAddressGroup, error) { +func (f *IBMPINetworkAddressGroupClient) DeleteMember(id, memberId string) error { params := network_address_groups.NewV1NetworkAddressGroupsMembersDeleteParams().WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut).WithNetworkAddressGroupID(id).WithNetworkAddressGroupMemberID(memberId) - resp, err := f.session.Power.NetworkAddressGroups.V1NetworkAddressGroupsMembersDelete(params, f.session.AuthInfo(f.cloudInstanceID)) + _, err := f.session.Power.NetworkAddressGroups.V1NetworkAddressGroupsMembersDelete(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { - return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to delete member %s from network address group %s: %w", memberId, id, err)) + return ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to delete member %s from network address group %s: %w", memberId, id, err)) } - if resp == nil || resp.Payload == nil { - return nil, fmt.Errorf("failed to delete member %s from network address group %s", memberId, id) - } - return resp.Payload, nil + return nil } diff --git a/clients/instance/ibm-pi-network-security-group.go b/clients/instance/ibm-pi-network-security-group.go index e5ba9ce4..d9d4bf52 100644 --- a/clients/instance/ibm-pi-network-security-group.go +++ b/clients/instance/ibm-pi-network-security-group.go @@ -88,7 +88,7 @@ func (f *IBMPINetworkSecurityGroupClient) Delete(id string) error { } // Add a member to a network security group -func (f *IBMPINetworkSecurityGroupClient) AddMember(id string, body *models.NetworkSecurityGroupAddMember) (*models.NetworkSecurityGroup, error) { +func (f *IBMPINetworkSecurityGroupClient) AddMember(id string, body *models.NetworkSecurityGroupAddMember) (*models.NetworkSecurityGroupMember, error) { params := network_security_groups.NewV1NetworkSecurityGroupsMembersPostParams().WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).WithNetworkSecurityGroupID(id).WithBody(body) resp, err := f.session.Power.NetworkSecurityGroups.V1NetworkSecurityGroupsMembersPost(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { @@ -101,20 +101,17 @@ func (f *IBMPINetworkSecurityGroupClient) AddMember(id string, body *models.Netw } // Deleta a member from a network securti group -func (f *IBMPINetworkSecurityGroupClient) DeleteMember(id, memberId string) (*models.NetworkSecurityGroup, error) { +func (f *IBMPINetworkSecurityGroupClient) DeleteMember(id, memberId string) error { params := network_security_groups.NewV1NetworkSecurityGroupsMembersDeleteParams().WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut).WithNetworkSecurityGroupID(id).WithNetworkSecurityGroupMemberID(memberId) - resp, err := f.session.Power.NetworkSecurityGroups.V1NetworkSecurityGroupsMembersDelete(params, f.session.AuthInfo(f.cloudInstanceID)) + _, err := f.session.Power.NetworkSecurityGroups.V1NetworkSecurityGroupsMembersDelete(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { - return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to delete member %s from network security group %s: %w", memberId, id, err)) + return ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to delete member %s from network security group %s: %w", memberId, id, err)) } - if resp == nil || resp.Payload == nil { - return nil, fmt.Errorf("failed to delete member %s from network security group %s", memberId, id) - } - return resp.Payload, nil + return nil } // Add a rule to a network security group -func (f *IBMPINetworkSecurityGroupClient) AddRule(id string, body *models.NetworkSecurityGroupAddRule) (*models.NetworkSecurityGroup, error) { +func (f *IBMPINetworkSecurityGroupClient) AddRule(id string, body *models.NetworkSecurityGroupAddRule) (*models.NetworkSecurityGroupRule, error) { params := network_security_groups.NewV1NetworkSecurityGroupsRulesPostParams().WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).WithNetworkSecurityGroupID(id).WithBody(body) resp, err := f.session.Power.NetworkSecurityGroups.V1NetworkSecurityGroupsRulesPost(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { @@ -127,16 +124,13 @@ func (f *IBMPINetworkSecurityGroupClient) AddRule(id string, body *models.Networ } // Delete a rule from a network security group -func (f *IBMPINetworkSecurityGroupClient) DeleteRule(id, ruleId string) (*models.NetworkSecurityGroup, error) { +func (f *IBMPINetworkSecurityGroupClient) DeleteRule(id, ruleId string) error { params := network_security_groups.NewV1NetworkSecurityGroupsRulesDeleteParams().WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut).WithNetworkSecurityGroupID(id).WithNetworkSecurityGroupRuleID(ruleId) - resp, err := f.session.Power.NetworkSecurityGroups.V1NetworkSecurityGroupsRulesDelete(params, f.session.AuthInfo(f.cloudInstanceID)) + _, err := f.session.Power.NetworkSecurityGroups.V1NetworkSecurityGroupsRulesDelete(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { - return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to delete rule %s from network security group %s: %w", ruleId, id, err)) + return ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to delete rule %s from network security group %s: %w", ruleId, id, err)) } - if resp == nil || resp.Payload == nil { - return nil, fmt.Errorf("failed to delete rule %s from network security group %s", ruleId, id) - } - return resp.Payload, nil + return nil } // Action on a network security group From b8ee1c714b4a62436cdcf85dfa3bd5ddeaee70e2 Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Tue, 27 Aug 2024 10:13:43 -0500 Subject: [PATCH 111/118] [M] NetworkSecurityGroupRuleProtocol: IcmpTypes float64-> int64 SB commit 8052ef5f496669f885519678a3e9fe6fe638cf5d (#454) --- power/models/network_security_group_rule_protocol.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/power/models/network_security_group_rule_protocol.go b/power/models/network_security_group_rule_protocol.go index e76368cc..f55e1272 100644 --- a/power/models/network_security_group_rule_protocol.go +++ b/power/models/network_security_group_rule_protocol.go @@ -22,7 +22,7 @@ import ( type NetworkSecurityGroupRuleProtocol struct { // If icmp type, the list of ICMP packet types (by numbers) affected by ICMP rules and if not present then all types are matched - IcmpTypes []float64 `json:"icmpTypes"` + IcmpTypes []int64 `json:"icmpTypes"` // If tcp type, the list of TCP flags and if not present then all flags are matched TCPFlags []*NetworkSecurityGroupRuleProtocolTCPFlag `json:"tcpFlags"` From 72a2e4abb9c9e67d9846aff6613d5a140ed90030 Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Wed, 28 Aug 2024 16:03:27 -0500 Subject: [PATCH 112/118] [M] NetworkSecurityGroupRulePort: min and max limit, NSG Rule: rm Direction and Name SB commit 4a6fb79d2076748aedcfcfa65b727fc413e8a7df (#455) --- .../models/network_security_group_add_rule.go | 69 ------------------- power/models/network_security_group_rule.go | 17 ----- .../network_security_group_rule_port.go | 45 +++++++++++- 3 files changed, 43 insertions(+), 88 deletions(-) diff --git a/power/models/network_security_group_add_rule.go b/power/models/network_security_group_add_rule.go index 69b9bcd4..2d4037c8 100644 --- a/power/models/network_security_group_add_rule.go +++ b/power/models/network_security_group_add_rule.go @@ -28,15 +28,6 @@ type NetworkSecurityGroupAddRule struct { // destination ports DestinationPorts *NetworkSecurityGroupRulePort `json:"destinationPorts,omitempty"` - // The direction of the network traffic - // Required: true - // Enum: ["inbound","outbound"] - Direction *string `json:"direction"` - - // The unique name of the Network Security Group rule - // Required: true - Name *string `json:"name"` - // protocol // Required: true Protocol *NetworkSecurityGroupRuleProtocol `json:"protocol"` @@ -61,14 +52,6 @@ func (m *NetworkSecurityGroupAddRule) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateDirection(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - if err := m.validateProtocol(formats); err != nil { res = append(res, err) } @@ -149,58 +132,6 @@ func (m *NetworkSecurityGroupAddRule) validateDestinationPorts(formats strfmt.Re return nil } -var networkSecurityGroupAddRuleTypeDirectionPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["inbound","outbound"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - networkSecurityGroupAddRuleTypeDirectionPropEnum = append(networkSecurityGroupAddRuleTypeDirectionPropEnum, v) - } -} - -const ( - - // NetworkSecurityGroupAddRuleDirectionInbound captures enum value "inbound" - NetworkSecurityGroupAddRuleDirectionInbound string = "inbound" - - // NetworkSecurityGroupAddRuleDirectionOutbound captures enum value "outbound" - NetworkSecurityGroupAddRuleDirectionOutbound string = "outbound" -) - -// prop value enum -func (m *NetworkSecurityGroupAddRule) validateDirectionEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, networkSecurityGroupAddRuleTypeDirectionPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *NetworkSecurityGroupAddRule) validateDirection(formats strfmt.Registry) error { - - if err := validate.Required("direction", "body", m.Direction); err != nil { - return err - } - - // value enum - if err := m.validateDirectionEnum("direction", "body", *m.Direction); err != nil { - return err - } - - return nil -} - -func (m *NetworkSecurityGroupAddRule) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - func (m *NetworkSecurityGroupAddRule) validateProtocol(formats strfmt.Registry) error { if err := validate.Required("protocol", "body", m.Protocol); err != nil { diff --git a/power/models/network_security_group_rule.go b/power/models/network_security_group_rule.go index 58901232..a1be84f9 100644 --- a/power/models/network_security_group_rule.go +++ b/power/models/network_security_group_rule.go @@ -32,10 +32,6 @@ type NetworkSecurityGroupRule struct { // Required: true ID *string `json:"id"` - // The unique name of the Network Security Group rule - // Required: true - Name *string `json:"name"` - // protocol // Required: true Protocol *NetworkSecurityGroupRuleProtocol `json:"protocol"` @@ -64,10 +60,6 @@ func (m *NetworkSecurityGroupRule) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - if err := m.validateProtocol(formats); err != nil { res = append(res, err) } @@ -157,15 +149,6 @@ func (m *NetworkSecurityGroupRule) validateID(formats strfmt.Registry) error { return nil } -func (m *NetworkSecurityGroupRule) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - func (m *NetworkSecurityGroupRule) validateProtocol(formats strfmt.Registry) error { if err := validate.Required("protocol", "body", m.Protocol); err != nil { diff --git a/power/models/network_security_group_rule_port.go b/power/models/network_security_group_rule_port.go index bb8cc5f5..296b98ab 100644 --- a/power/models/network_security_group_rule_port.go +++ b/power/models/network_security_group_rule_port.go @@ -8,8 +8,10 @@ package models 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 @@ -17,15 +19,54 @@ import ( // swagger:model NetworkSecurityGroupRulePort type NetworkSecurityGroupRulePort struct { - // The end of the port range, if applicable, If values are not present then all ports are in the range + // 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 values are not present then all ports are in the range + // 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 } From 22634bf62cf25efd7603472240fa5116a56928fb Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Thu, 5 Sep 2024 14:52:24 -0500 Subject: [PATCH 113/118] Update [M] NAG, NSG: UserTags add omitempty SB commit 6b88f9d59f3ce12ee6b320cfa7b7727243bc661a (#456) Update [M] NAG, NSG: UserTags add omitempty --- power/models/network_address_group.go | 2 +- power/models/network_address_group_create.go | 2 +- power/models/network_security_group.go | 2 +- power/models/network_security_group_create.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/power/models/network_address_group.go b/power/models/network_address_group.go index e14ebff5..6a7d2a9c 100644 --- a/power/models/network_address_group.go +++ b/power/models/network_address_group.go @@ -36,7 +36,7 @@ type NetworkAddressGroup struct { Name *string `json:"name"` // The user tags associated with this resource. - UserTags []string `json:"userTags"` + UserTags []string `json:"userTags,omitempty"` } // Validate validates this network address group diff --git a/power/models/network_address_group_create.go b/power/models/network_address_group_create.go index a41f1880..24a83dfb 100644 --- a/power/models/network_address_group_create.go +++ b/power/models/network_address_group_create.go @@ -24,7 +24,7 @@ type NetworkAddressGroupCreate struct { Name *string `json:"name"` // The user tags associated with this resource. - UserTags []string `json:"userTags"` + UserTags []string `json:"userTags,omitempty"` } // Validate validates this network address group create diff --git a/power/models/network_security_group.go b/power/models/network_security_group.go index d62dc774..7305e141 100644 --- a/power/models/network_security_group.go +++ b/power/models/network_security_group.go @@ -39,7 +39,7 @@ type NetworkSecurityGroup struct { Rules []*NetworkSecurityGroupRule `json:"rules"` // The user tags associated with this resource. - UserTags []string `json:"userTags"` + UserTags []string `json:"userTags,omitempty"` } // Validate validates this network security group diff --git a/power/models/network_security_group_create.go b/power/models/network_security_group_create.go index fc0bd27e..fdafaa42 100644 --- a/power/models/network_security_group_create.go +++ b/power/models/network_security_group_create.go @@ -24,7 +24,7 @@ type NetworkSecurityGroupCreate struct { Name *string `json:"name"` // The user tags associated with this resource. - UserTags []string `json:"userTags"` + UserTags []string `json:"userTags,omitempty"` } // Validate validates this network security group create From 07ab0db9dbd277c02b681fb7bbc038e952b77e2d Mon Sep 17 00:00:00 2001 From: michaelkad <45772690+michaelkad@users.noreply.github.com> Date: Fri, 6 Sep 2024 08:37:46 -0500 Subject: [PATCH 114/118] Fix NAG Update (#457) --- clients/instance/ibm-pi-network-address-group.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clients/instance/ibm-pi-network-address-group.go b/clients/instance/ibm-pi-network-address-group.go index 0d42788c..a80fed33 100644 --- a/clients/instance/ibm-pi-network-address-group.go +++ b/clients/instance/ibm-pi-network-address-group.go @@ -68,7 +68,7 @@ func (f *IBMPINetworkAddressGroupClient) Get(id string) (*models.NetworkAddressG // Update a Network Address Group func (f *IBMPINetworkAddressGroupClient) Update(id string, body *models.NetworkAddressGroupUpdate) (*models.NetworkAddressGroup, error) { - params := network_address_groups.NewV1NetworkAddressGroupsIDPutParams().WithContext(f.ctx).WithTimeout(helpers.PIUpdateTimeOut) + params := network_address_groups.NewV1NetworkAddressGroupsIDPutParams().WithContext(f.ctx).WithTimeout(helpers.PIUpdateTimeOut).WithNetworkAddressGroupID(id).WithBody(body) resp, err := f.session.Power.NetworkAddressGroups.V1NetworkAddressGroupsIDPut(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to update network address group %s: %w", id, err)) From b0aa76c52fe44b158a025180825a07a979adfe32 Mon Sep 17 00:00:00 2001 From: michaelkad <45772690+michaelkad@users.noreply.github.com> Date: Fri, 6 Sep 2024 11:10:16 -0500 Subject: [PATCH 115/118] Fix NAG Member Create (#458) --- clients/instance/ibm-pi-network-address-group.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clients/instance/ibm-pi-network-address-group.go b/clients/instance/ibm-pi-network-address-group.go index a80fed33..d35dd019 100644 --- a/clients/instance/ibm-pi-network-address-group.go +++ b/clients/instance/ibm-pi-network-address-group.go @@ -91,7 +91,7 @@ func (f *IBMPINetworkAddressGroupClient) Delete(id string) error { // Add a member to a Network Address Group func (f *IBMPINetworkAddressGroupClient) AddMember(id string, body *models.NetworkAddressGroupAddMember) (*models.NetworkAddressGroupMember, error) { - params := network_address_groups.NewV1NetworkAddressGroupsMembersPostParams().WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).WithNetworkAddressGroupID(id) + params := network_address_groups.NewV1NetworkAddressGroupsMembersPostParams().WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).WithNetworkAddressGroupID(id).WithBody(body) resp, err := f.session.Power.NetworkAddressGroups.V1NetworkAddressGroupsMembersPost(params, f.session.AuthInfo(f.cloudInstanceID)) if err != nil { return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to add member to network address group %s: %w", id, err)) From 5e003d16b1ebf6f8d3e36bf16bda710c5b2a60ed Mon Sep 17 00:00:00 2001 From: michaelkad <45772690+michaelkad@users.noreply.github.com> Date: Tue, 18 Jun 2024 13:42:55 -0500 Subject: [PATCH 116/118] Gate ibmi 500 (#414) * Bump github.com/IBM/platform-services-go-sdk from 0.56.4 to 0.57.0 Bumps [github.com/IBM/platform-services-go-sdk](https://github.com/IBM/platform-services-go-sdk) from 0.56.4 to 0.57.0. - [Release notes](https://github.com/IBM/platform-services-go-sdk/releases) - [Changelog](https://github.com/IBM/platform-services-go-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/platform-services-go-sdk/compare/v0.56.4...v0.57.0) --- updated-dependencies: - dependency-name: github.com/IBM/platform-services-go-sdk dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Bump github.com/IBM/platform-services-go-sdk from 0.57.0 to 0.58.0 Bumps [github.com/IBM/platform-services-go-sdk](https://github.com/IBM/platform-services-go-sdk) from 0.57.0 to 0.58.0. - [Release notes](https://github.com/IBM/platform-services-go-sdk/releases) - [Changelog](https://github.com/IBM/platform-services-go-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/platform-services-go-sdk/compare/v0.57.0...v0.58.0) --- updated-dependencies: - dependency-name: github.com/IBM/platform-services-go-sdk dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Bump github.com/IBM/platform-services-go-sdk from 0.58.0 to 0.59.0 Bumps [github.com/IBM/platform-services-go-sdk](https://github.com/IBM/platform-services-go-sdk) from 0.58.0 to 0.59.0. - [Release notes](https://github.com/IBM/platform-services-go-sdk/releases) - [Changelog](https://github.com/IBM/platform-services-go-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/platform-services-go-sdk/compare/v0.58.0...v0.59.0) --- updated-dependencies: - dependency-name: github.com/IBM/platform-services-go-sdk dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Bump github.com/IBM/platform-services-go-sdk from 0.59.0 to 0.59.1 Bumps [github.com/IBM/platform-services-go-sdk](https://github.com/IBM/platform-services-go-sdk) from 0.59.0 to 0.59.1. - [Release notes](https://github.com/IBM/platform-services-go-sdk/releases) - [Changelog](https://github.com/IBM/platform-services-go-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/platform-services-go-sdk/compare/v0.59.0...v0.59.1) --- updated-dependencies: - dependency-name: github.com/IBM/platform-services-go-sdk dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Bump github.com/IBM/go-sdk-core/v5 from 5.15.1 to 5.15.3 Bumps [github.com/IBM/go-sdk-core/v5](https://github.com/IBM/go-sdk-core) from 5.15.1 to 5.15.3. - [Release notes](https://github.com/IBM/go-sdk-core/releases) - [Changelog](https://github.com/IBM/go-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/go-sdk-core/compare/v5.15.1...v5.15.3) --- updated-dependencies: - dependency-name: github.com/IBM/go-sdk-core/v5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Bump github.com/stretchr/testify from 1.8.4 to 1.9.0 Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.4 to 1.9.0. - [Release notes](https://github.com/stretchr/testify/releases) - [Commits](https://github.com/stretchr/testify/compare/v1.8.4...v1.9.0) --- updated-dependencies: - dependency-name: github.com/stretchr/testify dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Bump github.com/IBM/platform-services-go-sdk from 0.59.1 to 0.60.0 Bumps [github.com/IBM/platform-services-go-sdk](https://github.com/IBM/platform-services-go-sdk) from 0.59.1 to 0.60.0. - [Release notes](https://github.com/IBM/platform-services-go-sdk/releases) - [Changelog](https://github.com/IBM/platform-services-go-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/platform-services-go-sdk/compare/v0.59.1...v0.60.0) --- updated-dependencies: - dependency-name: github.com/IBM/platform-services-go-sdk dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Update to go 1.22 * Gate ibmi 500 update go sum --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- clients/instance/ibm-pi-volume.go | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/clients/instance/ibm-pi-volume.go b/clients/instance/ibm-pi-volume.go index a05849c3..e5a628ba 100644 --- a/clients/instance/ibm-pi-volume.go +++ b/clients/instance/ibm-pi-volume.go @@ -257,34 +257,12 @@ func (f *IBMPIVolumeClient) GetVolumeFlashCopyMappings(id string) (models.FlashC // Bulk volume detach func (f *IBMPIVolumeClient) BulkVolumeDetach(pvmID string, body *models.VolumesDetach) (*models.VolumesDetachmentResponse, error) { - params := p_cloud_volumes.NewPcloudV2PvminstancesVolumesDeleteParams(). - WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut).WithCloudInstanceID(f.cloudInstanceID).WithPvmInstanceID(pvmID). - WithBody(body) - resp, err := f.session.Power.PCloudVolumes.PcloudV2PvminstancesVolumesDelete(params, f.session.AuthInfo(f.cloudInstanceID)) - if err != nil { - return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf(errors.DetachVolumesOperationFailed, pvmID, f.cloudInstanceID, err)) - } - if resp == nil || resp.Payload == nil { - return nil, fmt.Errorf("failed detaching volumes for %s", pvmID) - } - return resp.Payload, nil + return nil, fmt.Errorf("operation not supported") } // Bulk volume delete func (f *IBMPIVolumeClient) BulkVolumeDelete(body *models.VolumesDelete) (*models.VolumesDeleteResponse, error) { - params := p_cloud_volumes.NewPcloudV2VolumesDeleteParams().WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut). - WithCloudInstanceID(f.cloudInstanceID).WithBody(body) - respOk, respPartial, err := f.session.Power.PCloudVolumes.PcloudV2VolumesDelete(params, f.session.AuthInfo(f.cloudInstanceID)) - if err != nil { - return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf(errors.DeleteVolumeOperationFailed, body.VolumeIDs, err)) - } - if respOk != nil && respOk.Payload != nil { - return respOk.Payload, nil - } - if respPartial != nil && respPartial.Payload != nil { - return respPartial.Payload, nil - } - return nil, fmt.Errorf("failed Deleting volumes : %s", body.VolumeIDs) + return nil, fmt.Errorf("operation not supported") } // Bulk volutme attach From a5728ca81ed1368307c9eab722544e61241f538b Mon Sep 17 00:00:00 2001 From: Axel Ismirlian Date: Tue, 10 Sep 2024 14:23:49 -0500 Subject: [PATCH 117/118] Remove Q4 features from SDK --- .../instance/ibm-pi-network-address-group.go | 114 --- .../instance/ibm-pi-network-security-group.go | 144 ---- clients/instance/ibm-pi-network.go | 63 -- .../network_address_groups_client.go | 353 --------- ...1_network_address_groups_get_parameters.go | 128 ---- ...v1_network_address_groups_get_responses.go | 486 ------------ ...ork_address_groups_id_delete_parameters.go | 151 ---- ...work_address_groups_id_delete_responses.go | 560 -------------- ...etwork_address_groups_id_get_parameters.go | 151 ---- ...network_address_groups_id_get_responses.go | 486 ------------ ...etwork_address_groups_id_put_parameters.go | 175 ----- ...network_address_groups_id_put_responses.go | 486 ------------ ...ddress_groups_members_delete_parameters.go | 173 ----- ...address_groups_members_delete_responses.go | 560 -------------- ..._address_groups_members_post_parameters.go | 175 ----- ...k_address_groups_members_post_responses.go | 638 ---------------- ..._network_address_groups_post_parameters.go | 153 ---- ...1_network_address_groups_post_responses.go | 714 ------------------ .../network_security_groups_client.go | 477 ------------ ..._security_groups_action_post_parameters.go | 153 ---- ...k_security_groups_action_post_responses.go | 710 ----------------- ...rk_security_groups_id_delete_parameters.go | 151 ---- ...ork_security_groups_id_delete_responses.go | 560 -------------- ...twork_security_groups_id_get_parameters.go | 151 ---- ...etwork_security_groups_id_get_responses.go | 486 ------------ ...twork_security_groups_id_put_parameters.go | 175 ----- ...etwork_security_groups_id_put_responses.go | 486 ------------ ...network_security_groups_list_parameters.go | 128 ---- ..._network_security_groups_list_responses.go | 486 ------------ ...curity_groups_members_delete_parameters.go | 173 ----- ...ecurity_groups_members_delete_responses.go | 560 -------------- ...security_groups_members_post_parameters.go | 175 ----- ..._security_groups_members_post_responses.go | 638 ---------------- ...network_security_groups_post_parameters.go | 153 ---- ..._network_security_groups_post_responses.go | 714 ------------------ ...security_groups_rules_delete_parameters.go | 173 ----- ..._security_groups_rules_delete_responses.go | 560 -------------- ...k_security_groups_rules_post_parameters.go | 175 ----- ...rk_security_groups_rules_post_responses.go | 638 ---------------- power/client/networks/networks_client.go | 270 ------- ...ks_network_interfaces_delete_parameters.go | 173 ----- ...rks_network_interfaces_delete_responses.go | 560 -------------- ...works_network_interfaces_get_parameters.go | 173 ----- ...tworks_network_interfaces_get_responses.go | 486 ------------ ...ks_network_interfaces_getall_parameters.go | 151 ---- ...rks_network_interfaces_getall_responses.go | 486 ------------ ...orks_network_interfaces_post_parameters.go | 175 ----- ...works_network_interfaces_post_responses.go | 638 ---------------- ...works_network_interfaces_put_parameters.go | 197 ----- ...tworks_network_interfaces_put_responses.go | 562 -------------- .../p_cloud_virtual_serial_number_client.go | 106 --- ...virtual_serial_number_getall_parameters.go | 151 ---- ..._virtual_serial_number_getall_responses.go | 484 ------------ power/client/power_iaas_api_client.go | 20 - power/models/network_address_group.go | 176 ----- .../network_address_group_add_member.go | 71 -- power/models/network_address_group_create.go | 74 -- power/models/network_address_group_member.go | 88 --- power/models/network_address_group_update.go | 50 -- power/models/network_address_groups.go | 121 --- power/models/network_interface.go | 258 ------- power/models/network_interface_create.go | 56 -- power/models/network_interface_update.go | 53 -- power/models/network_interfaces.go | 124 --- power/models/network_security_group.go | 238 ------ .../network_security_group_add_member.go | 124 --- .../models/network_security_group_add_rule.go | 312 -------- power/models/network_security_group_create.go | 74 -- power/models/network_security_group_member.go | 144 ---- power/models/network_security_group_rule.go | 329 -------- .../network_security_group_rule_port.go | 94 --- .../network_security_group_rule_protocol.go | 182 ----- ...k_security_group_rule_protocol_tcp_flag.go | 126 ---- .../network_security_group_rule_remote.go | 111 --- power/models/network_security_group_update.go | 50 -- power/models/network_security_groups.go | 121 --- .../models/network_security_groups_action.go | 107 --- power/models/p_vm_instance.go | 3 - power/models/p_vm_instance_create.go | 3 - power/models/p_vm_instance_update.go | 3 - power/models/virtual_serial_number.go | 56 -- power/models/virtual_serial_number_list.go | 78 -- power/models/workspace_details.go | 51 -- ...rkspace_network_security_groups_details.go | 116 --- 84 files changed, 21657 deletions(-) delete mode 100644 clients/instance/ibm-pi-network-address-group.go delete mode 100644 clients/instance/ibm-pi-network-security-group.go delete mode 100644 power/client/network_address_groups/network_address_groups_client.go delete mode 100644 power/client/network_address_groups/v1_network_address_groups_get_parameters.go delete mode 100644 power/client/network_address_groups/v1_network_address_groups_get_responses.go delete mode 100644 power/client/network_address_groups/v1_network_address_groups_id_delete_parameters.go delete mode 100644 power/client/network_address_groups/v1_network_address_groups_id_delete_responses.go delete mode 100644 power/client/network_address_groups/v1_network_address_groups_id_get_parameters.go delete mode 100644 power/client/network_address_groups/v1_network_address_groups_id_get_responses.go delete mode 100644 power/client/network_address_groups/v1_network_address_groups_id_put_parameters.go delete mode 100644 power/client/network_address_groups/v1_network_address_groups_id_put_responses.go delete mode 100644 power/client/network_address_groups/v1_network_address_groups_members_delete_parameters.go delete mode 100644 power/client/network_address_groups/v1_network_address_groups_members_delete_responses.go delete mode 100644 power/client/network_address_groups/v1_network_address_groups_members_post_parameters.go delete mode 100644 power/client/network_address_groups/v1_network_address_groups_members_post_responses.go delete mode 100644 power/client/network_address_groups/v1_network_address_groups_post_parameters.go delete mode 100644 power/client/network_address_groups/v1_network_address_groups_post_responses.go delete mode 100644 power/client/network_security_groups/network_security_groups_client.go delete mode 100644 power/client/network_security_groups/v1_network_security_groups_action_post_parameters.go delete mode 100644 power/client/network_security_groups/v1_network_security_groups_action_post_responses.go delete mode 100644 power/client/network_security_groups/v1_network_security_groups_id_delete_parameters.go delete mode 100644 power/client/network_security_groups/v1_network_security_groups_id_delete_responses.go delete mode 100644 power/client/network_security_groups/v1_network_security_groups_id_get_parameters.go delete mode 100644 power/client/network_security_groups/v1_network_security_groups_id_get_responses.go delete mode 100644 power/client/network_security_groups/v1_network_security_groups_id_put_parameters.go delete mode 100644 power/client/network_security_groups/v1_network_security_groups_id_put_responses.go delete mode 100644 power/client/network_security_groups/v1_network_security_groups_list_parameters.go delete mode 100644 power/client/network_security_groups/v1_network_security_groups_list_responses.go delete mode 100644 power/client/network_security_groups/v1_network_security_groups_members_delete_parameters.go delete mode 100644 power/client/network_security_groups/v1_network_security_groups_members_delete_responses.go delete mode 100644 power/client/network_security_groups/v1_network_security_groups_members_post_parameters.go delete mode 100644 power/client/network_security_groups/v1_network_security_groups_members_post_responses.go delete mode 100644 power/client/network_security_groups/v1_network_security_groups_post_parameters.go delete mode 100644 power/client/network_security_groups/v1_network_security_groups_post_responses.go delete mode 100644 power/client/network_security_groups/v1_network_security_groups_rules_delete_parameters.go delete mode 100644 power/client/network_security_groups/v1_network_security_groups_rules_delete_responses.go delete mode 100644 power/client/network_security_groups/v1_network_security_groups_rules_post_parameters.go delete mode 100644 power/client/network_security_groups/v1_network_security_groups_rules_post_responses.go delete mode 100644 power/client/networks/networks_client.go delete mode 100644 power/client/networks/v1_networks_network_interfaces_delete_parameters.go delete mode 100644 power/client/networks/v1_networks_network_interfaces_delete_responses.go delete mode 100644 power/client/networks/v1_networks_network_interfaces_get_parameters.go delete mode 100644 power/client/networks/v1_networks_network_interfaces_get_responses.go delete mode 100644 power/client/networks/v1_networks_network_interfaces_getall_parameters.go delete mode 100644 power/client/networks/v1_networks_network_interfaces_getall_responses.go delete mode 100644 power/client/networks/v1_networks_network_interfaces_post_parameters.go delete mode 100644 power/client/networks/v1_networks_network_interfaces_post_responses.go delete mode 100644 power/client/networks/v1_networks_network_interfaces_put_parameters.go delete mode 100644 power/client/networks/v1_networks_network_interfaces_put_responses.go delete mode 100644 power/client/p_cloud_virtual_serial_number/p_cloud_virtual_serial_number_client.go delete mode 100644 power/client/p_cloud_virtual_serial_number/pcloud_cloudinstances_virtual_serial_number_getall_parameters.go delete mode 100644 power/client/p_cloud_virtual_serial_number/pcloud_cloudinstances_virtual_serial_number_getall_responses.go delete mode 100644 power/models/network_address_group.go delete mode 100644 power/models/network_address_group_add_member.go delete mode 100644 power/models/network_address_group_create.go delete mode 100644 power/models/network_address_group_member.go delete mode 100644 power/models/network_address_group_update.go delete mode 100644 power/models/network_address_groups.go delete mode 100644 power/models/network_interface.go delete mode 100644 power/models/network_interface_create.go delete mode 100644 power/models/network_interface_update.go delete mode 100644 power/models/network_interfaces.go delete mode 100644 power/models/network_security_group.go delete mode 100644 power/models/network_security_group_add_member.go delete mode 100644 power/models/network_security_group_add_rule.go delete mode 100644 power/models/network_security_group_create.go delete mode 100644 power/models/network_security_group_member.go delete mode 100644 power/models/network_security_group_rule.go delete mode 100644 power/models/network_security_group_rule_port.go delete mode 100644 power/models/network_security_group_rule_protocol.go delete mode 100644 power/models/network_security_group_rule_protocol_tcp_flag.go delete mode 100644 power/models/network_security_group_rule_remote.go delete mode 100644 power/models/network_security_group_update.go delete mode 100644 power/models/network_security_groups.go delete mode 100644 power/models/network_security_groups_action.go delete mode 100644 power/models/virtual_serial_number.go delete mode 100644 power/models/virtual_serial_number_list.go delete mode 100644 power/models/workspace_network_security_groups_details.go diff --git a/clients/instance/ibm-pi-network-address-group.go b/clients/instance/ibm-pi-network-address-group.go deleted file mode 100644 index d35dd019..00000000 --- a/clients/instance/ibm-pi-network-address-group.go +++ /dev/null @@ -1,114 +0,0 @@ -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_address_groups" - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// IBMPINetworkAddressGroupClient -type IBMPINetworkAddressGroupClient struct { - IBMPIClient -} - -// NewIBMPINetworkAddressGroupClient -func NewIBMPINetworkAddressGroupClient(ctx context.Context, sess *ibmpisession.IBMPISession, cloudInstanceID string) *IBMPINetworkAddressGroupClient { - return &IBMPINetworkAddressGroupClient{ - *NewIBMPIClient(ctx, sess, cloudInstanceID), - } -} - -// Create a new Network Address Group -func (f *IBMPINetworkAddressGroupClient) Create(body *models.NetworkAddressGroupCreate) (*models.NetworkAddressGroup, error) { - params := network_address_groups.NewV1NetworkAddressGroupsPostParams().WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).WithBody(body) - postok, postcreated, err := f.session.Power.NetworkAddressGroups.V1NetworkAddressGroupsPost(params, f.session.AuthInfo(f.cloudInstanceID)) - if err != nil { - return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to create a network address group %s", err)) - } - if postok != nil && postok.Payload != nil { - return postok.Payload, nil - } - if postcreated != nil && postcreated.Payload != nil { - return postcreated.Payload, nil - } - return nil, fmt.Errorf("failed to create a network address group") -} - -// Get the list of Network Address Groups for a workspace -func (f *IBMPINetworkAddressGroupClient) GetAll() (*models.NetworkAddressGroups, error) { - params := network_address_groups.NewV1NetworkAddressGroupsGetParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut) - resp, err := f.session.Power.NetworkAddressGroups.V1NetworkAddressGroupsGet(params, f.session.AuthInfo(f.cloudInstanceID)) - if err != nil { - return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to get network address groups %s", err)) - } - if resp == nil || resp.Payload == nil { - return nil, fmt.Errorf("failed to get network address groups") - } - return resp.Payload, nil - -} - -// Get the detail of a Network Address Group -func (f *IBMPINetworkAddressGroupClient) Get(id string) (*models.NetworkAddressGroup, error) { - params := network_address_groups.NewV1NetworkAddressGroupsIDGetParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).WithNetworkAddressGroupID(id) - resp, err := f.session.Power.NetworkAddressGroups.V1NetworkAddressGroupsIDGet(params, f.session.AuthInfo(f.cloudInstanceID)) - if err != nil { - return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to get network address group %s: %w", id, err)) - } - if resp == nil || resp.Payload == nil { - return nil, fmt.Errorf("failed to get network address group %s", id) - } - return resp.Payload, nil - -} - -// Update a Network Address Group -func (f *IBMPINetworkAddressGroupClient) Update(id string, body *models.NetworkAddressGroupUpdate) (*models.NetworkAddressGroup, error) { - params := network_address_groups.NewV1NetworkAddressGroupsIDPutParams().WithContext(f.ctx).WithTimeout(helpers.PIUpdateTimeOut).WithNetworkAddressGroupID(id).WithBody(body) - resp, err := f.session.Power.NetworkAddressGroups.V1NetworkAddressGroupsIDPut(params, f.session.AuthInfo(f.cloudInstanceID)) - if err != nil { - return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to update network address group %s: %w", id, err)) - } - if resp == nil || resp.Payload == nil { - return nil, fmt.Errorf("failed to update network address group %s", id) - } - return resp.Payload, nil -} - -// Delete a Network Address Group from a workspace -func (f *IBMPINetworkAddressGroupClient) Delete(id string) error { - params := network_address_groups.NewV1NetworkAddressGroupsIDDeleteParams().WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut).WithNetworkAddressGroupID(id) - _, err := f.session.Power.NetworkAddressGroups.V1NetworkAddressGroupsIDDelete(params, f.session.AuthInfo(f.cloudInstanceID)) - if err != nil { - return fmt.Errorf("failed to delete network address group %s: %w", id, err) - } - return nil -} - -// Add a member to a Network Address Group -func (f *IBMPINetworkAddressGroupClient) AddMember(id string, body *models.NetworkAddressGroupAddMember) (*models.NetworkAddressGroupMember, error) { - params := network_address_groups.NewV1NetworkAddressGroupsMembersPostParams().WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).WithNetworkAddressGroupID(id).WithBody(body) - resp, err := f.session.Power.NetworkAddressGroups.V1NetworkAddressGroupsMembersPost(params, f.session.AuthInfo(f.cloudInstanceID)) - if err != nil { - return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to add member to network address group %s: %w", id, err)) - } - if resp == nil || resp.Payload == nil { - return nil, fmt.Errorf("failed to add member to network address group %s", id) - } - return resp.Payload, nil -} - -// Delete the member from a Network Address Group -func (f *IBMPINetworkAddressGroupClient) DeleteMember(id, memberId string) error { - params := network_address_groups.NewV1NetworkAddressGroupsMembersDeleteParams().WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut).WithNetworkAddressGroupID(id).WithNetworkAddressGroupMemberID(memberId) - _, err := f.session.Power.NetworkAddressGroups.V1NetworkAddressGroupsMembersDelete(params, f.session.AuthInfo(f.cloudInstanceID)) - if err != nil { - return ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to delete member %s from network address group %s: %w", memberId, id, err)) - } - - return nil -} diff --git a/clients/instance/ibm-pi-network-security-group.go b/clients/instance/ibm-pi-network-security-group.go deleted file mode 100644 index d9d4bf52..00000000 --- a/clients/instance/ibm-pi-network-security-group.go +++ /dev/null @@ -1,144 +0,0 @@ -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_security_groups" - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// IBMPINetworkSecurityGroupClient -type IBMPINetworkSecurityGroupClient struct { - IBMPIClient -} - -// NewIBMIPINetworkSecurityGroupClient -func NewIBMIPINetworkSecurityGroupClient(ctx context.Context, sess *ibmpisession.IBMPISession, cloudInstanceID string) *IBMPINetworkSecurityGroupClient { - return &IBMPINetworkSecurityGroupClient{ - *NewIBMPIClient(ctx, sess, cloudInstanceID), - } -} - -// Get a network security group -func (f *IBMPINetworkSecurityGroupClient) Get(id string) (*models.NetworkSecurityGroup, error) { - params := network_security_groups.NewV1NetworkSecurityGroupsIDGetParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).WithNetworkSecurityGroupID(id) - resp, err := f.session.Power.NetworkSecurityGroups.V1NetworkSecurityGroupsIDGet(params, f.session.AuthInfo(f.cloudInstanceID)) - if err != nil { - return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to get network security group %s: %w", id, err)) - } - if resp == nil || resp.Payload == nil { - return nil, fmt.Errorf("failed to get network security group %s", id) - } - return resp.Payload, nil -} - -// Get all network security groups -func (f *IBMPINetworkSecurityGroupClient) GetAll() (*models.NetworkSecurityGroups, error) { - params := network_security_groups.NewV1NetworkSecurityGroupsListParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut) - resp, err := f.session.Power.NetworkSecurityGroups.V1NetworkSecurityGroupsList(params, f.session.AuthInfo(f.cloudInstanceID)) - if err != nil { - return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to get network security groups %s", err)) - } - if resp == nil || resp.Payload == nil { - return nil, fmt.Errorf("failed to get network security groups") - } - return resp.Payload, nil -} - -// Create a network security group -func (f *IBMPINetworkSecurityGroupClient) Create(body *models.NetworkSecurityGroupCreate) (*models.NetworkSecurityGroup, error) { - params := network_security_groups.NewV1NetworkSecurityGroupsPostParams().WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).WithBody(body) - postok, postcreated, err := f.session.Power.NetworkSecurityGroups.V1NetworkSecurityGroupsPost(params, f.session.AuthInfo(f.cloudInstanceID)) - if err != nil { - return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to create a network security group %s", err)) - } - if postok != nil && postok.Payload != nil { - return postok.Payload, nil - } - if postcreated != nil && postcreated.Payload != nil { - return postcreated.Payload, nil - } - return nil, fmt.Errorf("failed to create a network security group") -} - -// Update a network security group -func (f *IBMPINetworkSecurityGroupClient) Update(id string, body *models.NetworkSecurityGroupUpdate) (*models.NetworkSecurityGroup, error) { - params := network_security_groups.NewV1NetworkSecurityGroupsIDPutParams().WithContext(f.ctx).WithTimeout(helpers.PIUpdateTimeOut).WithNetworkSecurityGroupID(id).WithBody(body) - resp, err := f.session.Power.NetworkSecurityGroups.V1NetworkSecurityGroupsIDPut(params, f.session.AuthInfo(f.cloudInstanceID)) - if err != nil { - return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to update network security group %s: %w", id, err)) - } - if resp == nil || resp.Payload == nil { - return nil, fmt.Errorf("failed to update network security group %s", id) - } - return resp.Payload, nil -} - -// Delete a network security group -func (f *IBMPINetworkSecurityGroupClient) Delete(id string) error { - params := network_security_groups.NewV1NetworkSecurityGroupsIDDeleteParams().WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut).WithNetworkSecurityGroupID(id) - _, err := f.session.Power.NetworkSecurityGroups.V1NetworkSecurityGroupsIDDelete(params, f.session.AuthInfo(f.cloudInstanceID)) - if err != nil { - return fmt.Errorf("failed to delete network security group %s: %w", id, err) - } - return nil -} - -// Add a member to a network security group -func (f *IBMPINetworkSecurityGroupClient) AddMember(id string, body *models.NetworkSecurityGroupAddMember) (*models.NetworkSecurityGroupMember, error) { - params := network_security_groups.NewV1NetworkSecurityGroupsMembersPostParams().WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).WithNetworkSecurityGroupID(id).WithBody(body) - resp, err := f.session.Power.NetworkSecurityGroups.V1NetworkSecurityGroupsMembersPost(params, f.session.AuthInfo(f.cloudInstanceID)) - if err != nil { - return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to add member to network security group %s: %w", id, err)) - } - if resp == nil || resp.Payload == nil { - return nil, fmt.Errorf("failed to add member to network security group %s", id) - } - return resp.Payload, nil -} - -// Deleta a member from a network securti group -func (f *IBMPINetworkSecurityGroupClient) DeleteMember(id, memberId string) error { - params := network_security_groups.NewV1NetworkSecurityGroupsMembersDeleteParams().WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut).WithNetworkSecurityGroupID(id).WithNetworkSecurityGroupMemberID(memberId) - _, err := f.session.Power.NetworkSecurityGroups.V1NetworkSecurityGroupsMembersDelete(params, f.session.AuthInfo(f.cloudInstanceID)) - if err != nil { - return ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to delete member %s from network security group %s: %w", memberId, id, err)) - } - return nil -} - -// Add a rule to a network security group -func (f *IBMPINetworkSecurityGroupClient) AddRule(id string, body *models.NetworkSecurityGroupAddRule) (*models.NetworkSecurityGroupRule, error) { - params := network_security_groups.NewV1NetworkSecurityGroupsRulesPostParams().WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).WithNetworkSecurityGroupID(id).WithBody(body) - resp, err := f.session.Power.NetworkSecurityGroups.V1NetworkSecurityGroupsRulesPost(params, f.session.AuthInfo(f.cloudInstanceID)) - if err != nil { - return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to add rule to network security group %s: %w", id, err)) - } - if resp == nil || resp.Payload == nil { - return nil, fmt.Errorf("failed to add rule to network security group %s", id) - } - return resp.Payload, nil -} - -// Delete a rule from a network security group -func (f *IBMPINetworkSecurityGroupClient) DeleteRule(id, ruleId string) error { - params := network_security_groups.NewV1NetworkSecurityGroupsRulesDeleteParams().WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut).WithNetworkSecurityGroupID(id).WithNetworkSecurityGroupRuleID(ruleId) - _, err := f.session.Power.NetworkSecurityGroups.V1NetworkSecurityGroupsRulesDelete(params, f.session.AuthInfo(f.cloudInstanceID)) - if err != nil { - return ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to delete rule %s from network security group %s: %w", ruleId, id, err)) - } - return nil -} - -// Action on a network security group -func (f *IBMPINetworkSecurityGroupClient) Action(body *models.NetworkSecurityGroupsAction) error { - params := network_security_groups.NewV1NetworkSecurityGroupsActionPostParams().WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).WithBody(body) - _, _, err := f.session.Power.NetworkSecurityGroups.V1NetworkSecurityGroupsActionPost(params, f.session.AuthInfo(f.cloudInstanceID)) - if err != nil { - return fmt.Errorf("failed to perform action :%w", err) - } - return nil -} diff --git a/clients/instance/ibm-pi-network.go b/clients/instance/ibm-pi-network.go index a813bc42..1b823234 100644 --- a/clients/instance/ibm-pi-network.go +++ b/clients/instance/ibm-pi-network.go @@ -8,7 +8,6 @@ import ( "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/networks" "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_networks" "github.com/IBM-Cloud/power-go-client/power/models" ) @@ -197,65 +196,3 @@ func (f *IBMPINetworkClient) UpdatePort(id, networkPortID string, body *models.N } return resp.Payload, nil } - -// Create a network interface -func (f *IBMPINetworkClient) CreateNetworkInterface(id string, body *models.NetworkInterfaceCreate) (*models.NetworkInterface, error) { - params := networks.NewV1NetworksNetworkInterfacesPostParams().WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).WithNetworkID(id).WithBody(body) - resp, err := f.session.Power.Networks.V1NetworksNetworkInterfacesPost(params, f.session.AuthInfo(f.cloudInstanceID)) - if err != nil { - return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to create network interface for network %s with %w", id, err)) - } - if resp == nil || resp.Payload == nil { - return nil, fmt.Errorf("failed to create network interface for network %s", id) - } - return resp.Payload, nil -} - -// Get all Create a network interface -func (f *IBMPINetworkClient) GetAllNetworkInterfaces(id string) (*models.NetworkInterfaces, error) { - params := networks.NewV1NetworksNetworkInterfacesGetallParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).WithNetworkID(id) - resp, err := f.session.Power.Networks.V1NetworksNetworkInterfacesGetall(params, f.session.AuthInfo(f.cloudInstanceID)) - if err != nil { - return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to get all network interfaces for network %s: %w", id, err)) - } - if resp == nil || resp.Payload == nil { - return nil, fmt.Errorf("failed to get all network interfaces for network %s", id) - } - return resp.Payload, nil -} - -// Get a network interface -func (f *IBMPINetworkClient) GetNetworkInterface(id, netIntID string) (*models.NetworkInterface, error) { - params := networks.NewV1NetworksNetworkInterfacesGetParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).WithNetworkID(id).WithNetworkInterfaceID(netIntID) - resp, err := f.session.Power.Networks.V1NetworksNetworkInterfacesGet(params, f.session.AuthInfo(f.cloudInstanceID)) - if err != nil { - return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to get network interace %s for network %s: %w", netIntID, id, err)) - } - if resp == nil || resp.Payload == nil { - return nil, fmt.Errorf("failed to get network interface %s for network %s", netIntID, id) - } - return resp.Payload, nil -} - -// Update a network interface -func (f *IBMPINetworkClient) UpdateNetworkInterface(id, netIntID string, body *models.NetworkInterfaceUpdate) (*models.NetworkInterface, error) { - params := networks.NewV1NetworksNetworkInterfacesPutParams().WithContext(f.ctx).WithTimeout(helpers.PIUpdateTimeOut).WithNetworkID(id).WithNetworkInterfaceID(netIntID).WithBody(body) - resp, err := f.session.Power.Networks.V1NetworksNetworkInterfacesPut(params, f.session.AuthInfo(f.cloudInstanceID)) - if err != nil { - return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to update network interface %s and network %s with error %w", netIntID, id, err)) - } - if resp == nil || resp.Payload == nil { - return nil, fmt.Errorf("failed to update network interface %s and network %s", netIntID, id) - } - return resp.Payload, nil -} - -// Delete a network interface -func (f *IBMPINetworkClient) DeleteNetworkInterface(id, netIntID string) error { - params := networks.NewV1NetworksNetworkInterfacesDeleteParams().WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut).WithNetworkID(id).WithNetworkInterfaceID(netIntID) - _, err := f.session.Power.Networks.V1NetworksNetworkInterfacesDelete(params, f.session.AuthInfo(f.cloudInstanceID)) - if err != nil { - return fmt.Errorf("failed to delete network interface %s for network %s with error %w", netIntID, id, 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/p_cloud_virtual_serial_number/p_cloud_virtual_serial_number_client.go b/power/client/p_cloud_virtual_serial_number/p_cloud_virtual_serial_number_client.go deleted file mode 100644 index 3366927f..00000000 --- a/power/client/p_cloud_virtual_serial_number/p_cloud_virtual_serial_number_client.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_virtual_serial_number - -// 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 virtual serial number API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -// New creates a new p cloud virtual serial number 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 virtual serial number 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 virtual serial number 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 { - PcloudCloudinstancesVirtualSerialNumberGetall(params *PcloudCloudinstancesVirtualSerialNumberGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesVirtualSerialNumberGetallOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -PcloudCloudinstancesVirtualSerialNumberGetall lists all retained v s ns this cloud instance -*/ -func (a *Client) PcloudCloudinstancesVirtualSerialNumberGetall(params *PcloudCloudinstancesVirtualSerialNumberGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudCloudinstancesVirtualSerialNumberGetallOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudCloudinstancesVirtualSerialNumberGetallParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.cloudinstances.virtual-serial-number.getall", - Method: "GET", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/virtual-serial-number", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudCloudinstancesVirtualSerialNumberGetallReader{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.(*PcloudCloudinstancesVirtualSerialNumberGetallOK) - 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.virtual-serial-number.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_virtual_serial_number/pcloud_cloudinstances_virtual_serial_number_getall_parameters.go b/power/client/p_cloud_virtual_serial_number/pcloud_cloudinstances_virtual_serial_number_getall_parameters.go deleted file mode 100644 index 3f54fca4..00000000 --- a/power/client/p_cloud_virtual_serial_number/pcloud_cloudinstances_virtual_serial_number_getall_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_virtual_serial_number - -// 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" -) - -// NewPcloudCloudinstancesVirtualSerialNumberGetallParams creates a new PcloudCloudinstancesVirtualSerialNumberGetallParams 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 NewPcloudCloudinstancesVirtualSerialNumberGetallParams() *PcloudCloudinstancesVirtualSerialNumberGetallParams { - return &PcloudCloudinstancesVirtualSerialNumberGetallParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudCloudinstancesVirtualSerialNumberGetallParamsWithTimeout creates a new PcloudCloudinstancesVirtualSerialNumberGetallParams object -// with the ability to set a timeout on a request. -func NewPcloudCloudinstancesVirtualSerialNumberGetallParamsWithTimeout(timeout time.Duration) *PcloudCloudinstancesVirtualSerialNumberGetallParams { - return &PcloudCloudinstancesVirtualSerialNumberGetallParams{ - timeout: timeout, - } -} - -// NewPcloudCloudinstancesVirtualSerialNumberGetallParamsWithContext creates a new PcloudCloudinstancesVirtualSerialNumberGetallParams object -// with the ability to set a context for a request. -func NewPcloudCloudinstancesVirtualSerialNumberGetallParamsWithContext(ctx context.Context) *PcloudCloudinstancesVirtualSerialNumberGetallParams { - return &PcloudCloudinstancesVirtualSerialNumberGetallParams{ - Context: ctx, - } -} - -// NewPcloudCloudinstancesVirtualSerialNumberGetallParamsWithHTTPClient creates a new PcloudCloudinstancesVirtualSerialNumberGetallParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudCloudinstancesVirtualSerialNumberGetallParamsWithHTTPClient(client *http.Client) *PcloudCloudinstancesVirtualSerialNumberGetallParams { - return &PcloudCloudinstancesVirtualSerialNumberGetallParams{ - HTTPClient: client, - } -} - -/* -PcloudCloudinstancesVirtualSerialNumberGetallParams contains all the parameters to send to the API endpoint - - for the pcloud cloudinstances virtual serial number getall operation. - - Typically these are written to a http.Request. -*/ -type PcloudCloudinstancesVirtualSerialNumberGetallParams 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 virtual serial number getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesVirtualSerialNumberGetallParams) WithDefaults() *PcloudCloudinstancesVirtualSerialNumberGetallParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud cloudinstances virtual serial number getall params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudCloudinstancesVirtualSerialNumberGetallParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud cloudinstances virtual serial number getall params -func (o *PcloudCloudinstancesVirtualSerialNumberGetallParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesVirtualSerialNumberGetallParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud cloudinstances virtual serial number getall params -func (o *PcloudCloudinstancesVirtualSerialNumberGetallParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud cloudinstances virtual serial number getall params -func (o *PcloudCloudinstancesVirtualSerialNumberGetallParams) WithContext(ctx context.Context) *PcloudCloudinstancesVirtualSerialNumberGetallParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud cloudinstances virtual serial number getall params -func (o *PcloudCloudinstancesVirtualSerialNumberGetallParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud cloudinstances virtual serial number getall params -func (o *PcloudCloudinstancesVirtualSerialNumberGetallParams) WithHTTPClient(client *http.Client) *PcloudCloudinstancesVirtualSerialNumberGetallParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud cloudinstances virtual serial number getall params -func (o *PcloudCloudinstancesVirtualSerialNumberGetallParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud cloudinstances virtual serial number getall params -func (o *PcloudCloudinstancesVirtualSerialNumberGetallParams) WithCloudInstanceID(cloudInstanceID string) *PcloudCloudinstancesVirtualSerialNumberGetallParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud cloudinstances virtual serial number getall params -func (o *PcloudCloudinstancesVirtualSerialNumberGetallParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudCloudinstancesVirtualSerialNumberGetallParams) 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_virtual_serial_number/pcloud_cloudinstances_virtual_serial_number_getall_responses.go b/power/client/p_cloud_virtual_serial_number/pcloud_cloudinstances_virtual_serial_number_getall_responses.go deleted file mode 100644 index 37efbafd..00000000 --- a/power/client/p_cloud_virtual_serial_number/pcloud_cloudinstances_virtual_serial_number_getall_responses.go +++ /dev/null @@ -1,484 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_virtual_serial_number - -// 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" -) - -// PcloudCloudinstancesVirtualSerialNumberGetallReader is a Reader for the PcloudCloudinstancesVirtualSerialNumberGetall structure. -type PcloudCloudinstancesVirtualSerialNumberGetallReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudCloudinstancesVirtualSerialNumberGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudCloudinstancesVirtualSerialNumberGetallOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudCloudinstancesVirtualSerialNumberGetallBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPcloudCloudinstancesVirtualSerialNumberGetallUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewPcloudCloudinstancesVirtualSerialNumberGetallForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPcloudCloudinstancesVirtualSerialNumberGetallNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudCloudinstancesVirtualSerialNumberGetallInternalServerError() - 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}/virtual-serial-number] pcloud.cloudinstances.virtual-serial-number.getall", response, response.Code()) - } -} - -// NewPcloudCloudinstancesVirtualSerialNumberGetallOK creates a PcloudCloudinstancesVirtualSerialNumberGetallOK with default headers values -func NewPcloudCloudinstancesVirtualSerialNumberGetallOK() *PcloudCloudinstancesVirtualSerialNumberGetallOK { - return &PcloudCloudinstancesVirtualSerialNumberGetallOK{} -} - -/* -PcloudCloudinstancesVirtualSerialNumberGetallOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudCloudinstancesVirtualSerialNumberGetallOK struct { - Payload models.VirtualSerialNumberList -} - -// IsSuccess returns true when this pcloud cloudinstances virtual serial number getall o k response has a 2xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this pcloud cloudinstances virtual serial number getall o k response has a 3xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances virtual serial number getall o k response has a 4xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances virtual serial number getall o k response has a 5xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallOK) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances virtual serial number getall o k response a status code equal to that given -func (o *PcloudCloudinstancesVirtualSerialNumberGetallOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the pcloud cloudinstances virtual serial number getall o k response -func (o *PcloudCloudinstancesVirtualSerialNumberGetallOK) Code() int { - return 200 -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallOK) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/virtual-serial-number][%d] pcloudCloudinstancesVirtualSerialNumberGetallOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallOK) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/virtual-serial-number][%d] pcloudCloudinstancesVirtualSerialNumberGetallOK %s", 200, payload) -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallOK) GetPayload() models.VirtualSerialNumberList { - return o.Payload -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallOK) 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 -} - -// NewPcloudCloudinstancesVirtualSerialNumberGetallBadRequest creates a PcloudCloudinstancesVirtualSerialNumberGetallBadRequest with default headers values -func NewPcloudCloudinstancesVirtualSerialNumberGetallBadRequest() *PcloudCloudinstancesVirtualSerialNumberGetallBadRequest { - return &PcloudCloudinstancesVirtualSerialNumberGetallBadRequest{} -} - -/* -PcloudCloudinstancesVirtualSerialNumberGetallBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudCloudinstancesVirtualSerialNumberGetallBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances virtual serial number getall bad request response has a 2xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances virtual serial number getall bad request response has a 3xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances virtual serial number getall bad request response has a 4xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances virtual serial number getall bad request response has a 5xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances virtual serial number getall bad request response a status code equal to that given -func (o *PcloudCloudinstancesVirtualSerialNumberGetallBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the pcloud cloudinstances virtual serial number getall bad request response -func (o *PcloudCloudinstancesVirtualSerialNumberGetallBadRequest) Code() int { - return 400 -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallBadRequest) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/virtual-serial-number][%d] pcloudCloudinstancesVirtualSerialNumberGetallBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallBadRequest) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/virtual-serial-number][%d] pcloudCloudinstancesVirtualSerialNumberGetallBadRequest %s", 400, payload) -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVirtualSerialNumberGetallUnauthorized creates a PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized with default headers values -func NewPcloudCloudinstancesVirtualSerialNumberGetallUnauthorized() *PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized { - return &PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized{} -} - -/* -PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances virtual serial number getall unauthorized response has a 2xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances virtual serial number getall unauthorized response has a 3xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances virtual serial number getall unauthorized response has a 4xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances virtual serial number getall unauthorized response has a 5xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances virtual serial number getall unauthorized response a status code equal to that given -func (o *PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the pcloud cloudinstances virtual serial number getall unauthorized response -func (o *PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized) Code() int { - return 401 -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/virtual-serial-number][%d] pcloudCloudinstancesVirtualSerialNumberGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/virtual-serial-number][%d] pcloudCloudinstancesVirtualSerialNumberGetallUnauthorized %s", 401, payload) -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVirtualSerialNumberGetallForbidden creates a PcloudCloudinstancesVirtualSerialNumberGetallForbidden with default headers values -func NewPcloudCloudinstancesVirtualSerialNumberGetallForbidden() *PcloudCloudinstancesVirtualSerialNumberGetallForbidden { - return &PcloudCloudinstancesVirtualSerialNumberGetallForbidden{} -} - -/* -PcloudCloudinstancesVirtualSerialNumberGetallForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type PcloudCloudinstancesVirtualSerialNumberGetallForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances virtual serial number getall forbidden response has a 2xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances virtual serial number getall forbidden response has a 3xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances virtual serial number getall forbidden response has a 4xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances virtual serial number getall forbidden response has a 5xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances virtual serial number getall forbidden response a status code equal to that given -func (o *PcloudCloudinstancesVirtualSerialNumberGetallForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the pcloud cloudinstances virtual serial number getall forbidden response -func (o *PcloudCloudinstancesVirtualSerialNumberGetallForbidden) Code() int { - return 403 -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallForbidden) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/virtual-serial-number][%d] pcloudCloudinstancesVirtualSerialNumberGetallForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallForbidden) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/virtual-serial-number][%d] pcloudCloudinstancesVirtualSerialNumberGetallForbidden %s", 403, payload) -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVirtualSerialNumberGetallNotFound creates a PcloudCloudinstancesVirtualSerialNumberGetallNotFound with default headers values -func NewPcloudCloudinstancesVirtualSerialNumberGetallNotFound() *PcloudCloudinstancesVirtualSerialNumberGetallNotFound { - return &PcloudCloudinstancesVirtualSerialNumberGetallNotFound{} -} - -/* -PcloudCloudinstancesVirtualSerialNumberGetallNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type PcloudCloudinstancesVirtualSerialNumberGetallNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances virtual serial number getall not found response has a 2xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances virtual serial number getall not found response has a 3xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances virtual serial number getall not found response has a 4xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this pcloud cloudinstances virtual serial number getall not found response has a 5xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this pcloud cloudinstances virtual serial number getall not found response a status code equal to that given -func (o *PcloudCloudinstancesVirtualSerialNumberGetallNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the pcloud cloudinstances virtual serial number getall not found response -func (o *PcloudCloudinstancesVirtualSerialNumberGetallNotFound) Code() int { - return 404 -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallNotFound) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/virtual-serial-number][%d] pcloudCloudinstancesVirtualSerialNumberGetallNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallNotFound) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/virtual-serial-number][%d] pcloudCloudinstancesVirtualSerialNumberGetallNotFound %s", 404, payload) -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudCloudinstancesVirtualSerialNumberGetallInternalServerError creates a PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError with default headers values -func NewPcloudCloudinstancesVirtualSerialNumberGetallInternalServerError() *PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError { - return &PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError{} -} - -/* -PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this pcloud cloudinstances virtual serial number getall internal server error response has a 2xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this pcloud cloudinstances virtual serial number getall internal server error response has a 3xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this pcloud cloudinstances virtual serial number getall internal server error response has a 4xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this pcloud cloudinstances virtual serial number getall internal server error response has a 5xx status code -func (o *PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this pcloud cloudinstances virtual serial number getall internal server error response a status code equal to that given -func (o *PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the pcloud cloudinstances virtual serial number getall internal server error response -func (o *PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError) Code() int { - return 500 -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError) Error() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/virtual-serial-number][%d] pcloudCloudinstancesVirtualSerialNumberGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError) String() string { - payload, _ := json.Marshal(o.Payload) - return fmt.Sprintf("[GET /pcloud/v1/cloud-instances/{cloud_instance_id}/virtual-serial-number][%d] pcloudCloudinstancesVirtualSerialNumberGetallInternalServerError %s", 500, payload) -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudCloudinstancesVirtualSerialNumberGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - 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 index 4f41fd5a..43c7c298 100644 --- a/power/client/power_iaas_api_client.go +++ b/power/client/power_iaas_api_client.go @@ -21,9 +21,6 @@ import ( "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" @@ -48,7 +45,6 @@ import ( "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_virtual_serial_number" "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" @@ -114,9 +110,6 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *PowerIaasA 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) @@ -141,7 +134,6 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *PowerIaasA 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.PCloudVirtualSerialNumber = p_cloud_virtual_serial_number.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) @@ -218,12 +210,6 @@ type PowerIaasAPI struct { 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 @@ -272,8 +258,6 @@ type PowerIaasAPI struct { PCloudvpnPolicies p_cloud_v_p_n_policies.ClientService - PCloudVirtualSerialNumber p_cloud_virtual_serial_number.ClientService - PCloudVolumeGroups p_cloud_volume_groups.ClientService PCloudVolumeOnboarding p_cloud_volume_onboarding.ClientService @@ -311,9 +295,6 @@ func (c *PowerIaasAPI) SetTransport(transport runtime.ClientTransport) { 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) @@ -338,7 +319,6 @@ func (c *PowerIaasAPI) SetTransport(transport runtime.ClientTransport) { c.PCloudTenantsSSHKeys.SetTransport(transport) c.PCloudvpnConnections.SetTransport(transport) c.PCloudvpnPolicies.SetTransport(transport) - c.PCloudVirtualSerialNumber.SetTransport(transport) c.PCloudVolumeGroups.SetTransport(transport) c.PCloudVolumeOnboarding.SetTransport(transport) c.PCloudVolumes.SetTransport(transport) 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_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_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 f55e1272..00000000 --- a/power/models/network_security_group_rule_protocol.go +++ /dev/null @@ -1,182 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// 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, the list of ICMP packet types (by numbers) affected by ICMP rules and if not present then all types are matched - IcmpTypes []int64 `json:"icmpTypes"` - - // 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.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 -} - -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/p_vm_instance.go b/power/models/p_vm_instance.go index 31e49515..457affd7 100644 --- a/power/models/p_vm_instance.go +++ b/power/models/p_vm_instance.go @@ -164,9 +164,6 @@ type PVMInstance struct { // The pvm instance virtual CPU information VirtualCores *VirtualCores `json:"virtualCores,omitempty"` - // VSN id allocated to the Virtual Machine - VirtualSerialNumber string `json:"virtualSerialNumber,omitempty"` - // List of volume IDs // Required: true VolumeIDs []string `json:"volumeIDs"` diff --git a/power/models/p_vm_instance_create.go b/power/models/p_vm_instance_create.go index 3ad1d277..a44538bb 100644 --- a/power/models/p_vm_instance_create.go +++ b/power/models/p_vm_instance_create.go @@ -124,9 +124,6 @@ type PVMInstanceCreate struct { // The pvm instance virtual CPU information VirtualCores *VirtualCores `json:"virtualCores,omitempty"` - // VSN ID of a retained VSN or specify 'auto-assign' to have a new VSN ID generated. - VirtualSerialNumber string `json:"virtualSerialNumber,omitempty"` - // List of volume IDs VolumeIDs []string `json:"volumeIDs"` } diff --git a/power/models/p_vm_instance_update.go b/power/models/p_vm_instance_update.go index 232b2c70..56e06295 100644 --- a/power/models/p_vm_instance_update.go +++ b/power/models/p_vm_instance_update.go @@ -56,9 +56,6 @@ type PVMInstanceUpdate struct { // The pvm instance virtual CPU information VirtualCores *VirtualCores `json:"virtualCores,omitempty"` - - // VSN ID of a retained VSN or specify 'auto-assign' to have a new VSN ID generated. - VirtualSerialNumber string `json:"virtualSerialNumber,omitempty"` } // Validate validates this p VM instance update diff --git a/power/models/virtual_serial_number.go b/power/models/virtual_serial_number.go deleted file mode 100644 index 51f35b38..00000000 --- a/power/models/virtual_serial_number.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" -) - -// VirtualSerialNumber VSN Details -// -// swagger:model VirtualSerialNumber -type VirtualSerialNumber struct { - - // Description of the retained VSN - Description string `json:"description,omitempty"` - - // HostID of the retained VSN - Host string `json:"host,omitempty"` - - // ID of the retained VSN - VirtualSerialNumber string `json:"virtual-serial-number,omitempty"` -} - -// Validate validates this virtual serial number -func (m *VirtualSerialNumber) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this virtual serial number based on context it is used -func (m *VirtualSerialNumber) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *VirtualSerialNumber) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VirtualSerialNumber) UnmarshalBinary(b []byte) error { - var res VirtualSerialNumber - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/virtual_serial_number_list.go b/power/models/virtual_serial_number_list.go deleted file mode 100644 index 0ef19e24..00000000 --- a/power/models/virtual_serial_number_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" -) - -// VirtualSerialNumberList An array of retained VSNs -// -// swagger:model VirtualSerialNumberList -type VirtualSerialNumberList []*VirtualSerialNumber - -// Validate validates this virtual serial number list -func (m VirtualSerialNumberList) 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 virtual serial number list based on the context it is used -func (m VirtualSerialNumberList) 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/workspace_details.go b/power/models/workspace_details.go index a26cc6ea..a74e2ebe 100644 --- a/power/models/workspace_details.go +++ b/power/models/workspace_details.go @@ -31,9 +31,6 @@ type WorkspaceDetails struct { // 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"` } @@ -50,10 +47,6 @@ func (m *WorkspaceDetails) Validate(formats strfmt.Registry) error { 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) } @@ -86,25 +79,6 @@ func (m *WorkspaceDetails) validateCrn(formats strfmt.Registry) error { 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 @@ -128,10 +102,6 @@ func (m *WorkspaceDetails) validatePowerEdgeRouter(formats strfmt.Registry) erro 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) } @@ -142,27 +112,6 @@ func (m *WorkspaceDetails) ContextValidate(ctx context.Context, formats strfmt.R 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 { 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 -} From e23d300d35665265386675c0754b24ecf2964479 Mon Sep 17 00:00:00 2001 From: Axel Ismirlian Date: Wed, 11 Sep 2024 09:30:22 -0500 Subject: [PATCH 118/118] Enable bulk-detach and bulk-delete for Q3 --- clients/instance/ibm-pi-volume.go | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/clients/instance/ibm-pi-volume.go b/clients/instance/ibm-pi-volume.go index e5a628ba..a05849c3 100644 --- a/clients/instance/ibm-pi-volume.go +++ b/clients/instance/ibm-pi-volume.go @@ -257,12 +257,34 @@ func (f *IBMPIVolumeClient) GetVolumeFlashCopyMappings(id string) (models.FlashC // Bulk volume detach func (f *IBMPIVolumeClient) BulkVolumeDetach(pvmID string, body *models.VolumesDetach) (*models.VolumesDetachmentResponse, error) { - return nil, fmt.Errorf("operation not supported") + params := p_cloud_volumes.NewPcloudV2PvminstancesVolumesDeleteParams(). + WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut).WithCloudInstanceID(f.cloudInstanceID).WithPvmInstanceID(pvmID). + WithBody(body) + resp, err := f.session.Power.PCloudVolumes.PcloudV2PvminstancesVolumesDelete(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf(errors.DetachVolumesOperationFailed, pvmID, f.cloudInstanceID, err)) + } + if resp == nil || resp.Payload == nil { + return nil, fmt.Errorf("failed detaching volumes for %s", pvmID) + } + return resp.Payload, nil } // Bulk volume delete func (f *IBMPIVolumeClient) BulkVolumeDelete(body *models.VolumesDelete) (*models.VolumesDeleteResponse, error) { - return nil, fmt.Errorf("operation not supported") + params := p_cloud_volumes.NewPcloudV2VolumesDeleteParams().WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut). + WithCloudInstanceID(f.cloudInstanceID).WithBody(body) + respOk, respPartial, err := f.session.Power.PCloudVolumes.PcloudV2VolumesDelete(params, f.session.AuthInfo(f.cloudInstanceID)) + if err != nil { + return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf(errors.DeleteVolumeOperationFailed, body.VolumeIDs, err)) + } + if respOk != nil && respOk.Payload != nil { + return respOk.Payload, nil + } + if respPartial != nil && respPartial.Payload != nil { + return respPartial.Payload, nil + } + return nil, fmt.Errorf("failed Deleting volumes : %s", body.VolumeIDs) } // Bulk volutme attach