From 4959a5507561f7048ea6f988f43ff0d820ae6491 Mon Sep 17 00:00:00 2001 From: powervs-ibm Date: Wed, 1 Nov 2023 01:16:21 +0000 Subject: [PATCH] Generated Swagger client from service-broker commit 30f4034c2ecd7b7d6326113e49f8bb5c5eb75db5 --- .../pcloud_vpnconnections_post_responses.go | 74 +++++++++++++++++++ power/models/workspace.go | 38 ---------- 2 files changed, 74 insertions(+), 38 deletions(-) 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 9611191b..8f25af04 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 @@ -53,6 +53,12 @@ func (o *PcloudVpnconnectionsPostReader) ReadResponse(response runtime.ClientRes return nil, err } return nil, result + case 405: + result := NewPcloudVpnconnectionsPostMethodNotAllowed() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result case 409: result := NewPcloudVpnconnectionsPostConflict() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -416,6 +422,74 @@ func (o *PcloudVpnconnectionsPostNotFound) readResponse(response runtime.ClientR return nil } +// NewPcloudVpnconnectionsPostMethodNotAllowed creates a PcloudVpnconnectionsPostMethodNotAllowed with default headers values +func NewPcloudVpnconnectionsPostMethodNotAllowed() *PcloudVpnconnectionsPostMethodNotAllowed { + return &PcloudVpnconnectionsPostMethodNotAllowed{} +} + +/* +PcloudVpnconnectionsPostMethodNotAllowed describes a response with status code 405, with default header values. + +Method Not Allowed +*/ +type PcloudVpnconnectionsPostMethodNotAllowed struct { + Payload *models.Error +} + +// IsSuccess returns true when this pcloud vpnconnections post method not allowed response has a 2xx status code +func (o *PcloudVpnconnectionsPostMethodNotAllowed) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this pcloud vpnconnections post method not allowed response has a 3xx status code +func (o *PcloudVpnconnectionsPostMethodNotAllowed) IsRedirect() bool { + return false +} + +// IsClientError returns true when this pcloud vpnconnections post method not allowed response has a 4xx status code +func (o *PcloudVpnconnectionsPostMethodNotAllowed) IsClientError() bool { + return true +} + +// IsServerError returns true when this pcloud vpnconnections post method not allowed response has a 5xx status code +func (o *PcloudVpnconnectionsPostMethodNotAllowed) IsServerError() bool { + return false +} + +// IsCode returns true when this pcloud vpnconnections post method not allowed response a status code equal to that given +func (o *PcloudVpnconnectionsPostMethodNotAllowed) IsCode(code int) bool { + return code == 405 +} + +// Code gets the status code for the pcloud vpnconnections post method not allowed response +func (o *PcloudVpnconnectionsPostMethodNotAllowed) Code() int { + return 405 +} + +func (o *PcloudVpnconnectionsPostMethodNotAllowed) Error() string { + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/vpn/vpn-connections][%d] pcloudVpnconnectionsPostMethodNotAllowed %+v", 405, o.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) +} + +func (o *PcloudVpnconnectionsPostMethodNotAllowed) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudVpnconnectionsPostMethodNotAllowed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudVpnconnectionsPostConflict creates a PcloudVpnconnectionsPostConflict with default headers values func NewPcloudVpnconnectionsPostConflict() *PcloudVpnconnectionsPostConflict { return &PcloudVpnconnectionsPostConflict{} diff --git a/power/models/workspace.go b/power/models/workspace.go index 62902f51..635a5664 100644 --- a/power/models/workspace.go +++ b/power/models/workspace.go @@ -42,7 +42,6 @@ type Workspace struct { // The Workspace status // Required: true - // Enum: [Active Failed Provisioning] Status *string `json:"status"` // The Workspace type @@ -156,49 +155,12 @@ func (m *Workspace) validateName(formats strfmt.Registry) error { return nil } -var workspaceTypeStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["Active","Failed","Provisioning"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - workspaceTypeStatusPropEnum = append(workspaceTypeStatusPropEnum, v) - } -} - -const ( - - // WorkspaceStatusActive captures enum value "Active" - WorkspaceStatusActive string = "Active" - - // WorkspaceStatusFailed captures enum value "Failed" - WorkspaceStatusFailed string = "Failed" - - // WorkspaceStatusProvisioning captures enum value "Provisioning" - WorkspaceStatusProvisioning string = "Provisioning" -) - -// prop value enum -func (m *Workspace) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, workspaceTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - func (m *Workspace) validateStatus(formats strfmt.Registry) error { if err := validate.Required("status", "body", m.Status); err != nil { return err } - // value enum - if err := m.validateStatusEnum("status", "body", *m.Status); err != nil { - return err - } - return nil }