From 5d2e09c33a33f94a15334c9a548ded995ce2ac1f Mon Sep 17 00:00:00 2001 From: Chase Austin Date: Thu, 7 Jul 2022 08:30:33 -0500 Subject: [PATCH] Update Service-Broker to v1.97.2 --- .../p_cloud_disaster_recovery_client.go | 41 ++++ ...ions_disasterrecovery_getall_parameters.go | 126 ++++++++++++ ...tions_disasterrecovery_getall_responses.go | 181 ++++++++++++++++++ ...cloudinstances_volumes_delete_responses.go | 38 ++++ power/models/d_h_c_p_server_create.go | 3 + power/models/disaster_recovery_locations.go | 119 ++++++++++++ power/models/power_v_s_instance.go | 4 + 7 files changed, 512 insertions(+) create mode 100644 power/client/p_cloud_disaster_recovery/pcloud_locations_disasterrecovery_getall_parameters.go create mode 100644 power/client/p_cloud_disaster_recovery/pcloud_locations_disasterrecovery_getall_responses.go create mode 100644 power/models/disaster_recovery_locations.go 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 6efc89a1..377f9a16 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 @@ -32,6 +32,8 @@ type ClientOption func(*runtime.ClientOperation) type ClientService interface { PcloudLocationsDisasterrecoveryGet(params *PcloudLocationsDisasterrecoveryGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudLocationsDisasterrecoveryGetOK, error) + PcloudLocationsDisasterrecoveryGetall(params *PcloudLocationsDisasterrecoveryGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudLocationsDisasterrecoveryGetallOK, error) + SetTransport(transport runtime.ClientTransport) } @@ -74,6 +76,45 @@ func (a *Client) PcloudLocationsDisasterrecoveryGet(params *PcloudLocationsDisas panic(msg) } +/* + PcloudLocationsDisasterrecoveryGetall gets all disaster recovery locations supported by power virtual server +*/ +func (a *Client) PcloudLocationsDisasterrecoveryGetall(params *PcloudLocationsDisasterrecoveryGetallParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudLocationsDisasterrecoveryGetallOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudLocationsDisasterrecoveryGetallParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.locations.disasterrecovery.getall", + Method: "GET", + PathPattern: "/pcloud/v1/locations/disaster-recovery", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudLocationsDisasterrecoveryGetallReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudLocationsDisasterrecoveryGetallOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.locations.disasterrecovery.getall: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + // SetTransport changes the transport on the client func (a *Client) SetTransport(transport runtime.ClientTransport) { a.transport = transport diff --git a/power/client/p_cloud_disaster_recovery/pcloud_locations_disasterrecovery_getall_parameters.go b/power/client/p_cloud_disaster_recovery/pcloud_locations_disasterrecovery_getall_parameters.go new file mode 100644 index 00000000..4c92f7d7 --- /dev/null +++ b/power/client/p_cloud_disaster_recovery/pcloud_locations_disasterrecovery_getall_parameters.go @@ -0,0 +1,126 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package p_cloud_disaster_recovery + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewPcloudLocationsDisasterrecoveryGetallParams creates a new PcloudLocationsDisasterrecoveryGetallParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewPcloudLocationsDisasterrecoveryGetallParams() *PcloudLocationsDisasterrecoveryGetallParams { + return &PcloudLocationsDisasterrecoveryGetallParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPcloudLocationsDisasterrecoveryGetallParamsWithTimeout creates a new PcloudLocationsDisasterrecoveryGetallParams object +// with the ability to set a timeout on a request. +func NewPcloudLocationsDisasterrecoveryGetallParamsWithTimeout(timeout time.Duration) *PcloudLocationsDisasterrecoveryGetallParams { + return &PcloudLocationsDisasterrecoveryGetallParams{ + timeout: timeout, + } +} + +// NewPcloudLocationsDisasterrecoveryGetallParamsWithContext creates a new PcloudLocationsDisasterrecoveryGetallParams object +// with the ability to set a context for a request. +func NewPcloudLocationsDisasterrecoveryGetallParamsWithContext(ctx context.Context) *PcloudLocationsDisasterrecoveryGetallParams { + return &PcloudLocationsDisasterrecoveryGetallParams{ + Context: ctx, + } +} + +// NewPcloudLocationsDisasterrecoveryGetallParamsWithHTTPClient creates a new PcloudLocationsDisasterrecoveryGetallParams object +// with the ability to set a custom HTTPClient for a request. +func NewPcloudLocationsDisasterrecoveryGetallParamsWithHTTPClient(client *http.Client) *PcloudLocationsDisasterrecoveryGetallParams { + return &PcloudLocationsDisasterrecoveryGetallParams{ + HTTPClient: client, + } +} + +/* PcloudLocationsDisasterrecoveryGetallParams contains all the parameters to send to the API endpoint + for the pcloud locations disasterrecovery getall operation. + + Typically these are written to a http.Request. +*/ +type PcloudLocationsDisasterrecoveryGetallParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the pcloud locations disasterrecovery getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudLocationsDisasterrecoveryGetallParams) WithDefaults() *PcloudLocationsDisasterrecoveryGetallParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud locations disasterrecovery getall params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudLocationsDisasterrecoveryGetallParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the pcloud locations disasterrecovery getall params +func (o *PcloudLocationsDisasterrecoveryGetallParams) WithTimeout(timeout time.Duration) *PcloudLocationsDisasterrecoveryGetallParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the pcloud locations disasterrecovery getall params +func (o *PcloudLocationsDisasterrecoveryGetallParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the pcloud locations disasterrecovery getall params +func (o *PcloudLocationsDisasterrecoveryGetallParams) WithContext(ctx context.Context) *PcloudLocationsDisasterrecoveryGetallParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the pcloud locations disasterrecovery getall params +func (o *PcloudLocationsDisasterrecoveryGetallParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the pcloud locations disasterrecovery getall params +func (o *PcloudLocationsDisasterrecoveryGetallParams) WithHTTPClient(client *http.Client) *PcloudLocationsDisasterrecoveryGetallParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the pcloud locations disasterrecovery getall params +func (o *PcloudLocationsDisasterrecoveryGetallParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *PcloudLocationsDisasterrecoveryGetallParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/power/client/p_cloud_disaster_recovery/pcloud_locations_disasterrecovery_getall_responses.go b/power/client/p_cloud_disaster_recovery/pcloud_locations_disasterrecovery_getall_responses.go new file mode 100644 index 00000000..6af89762 --- /dev/null +++ b/power/client/p_cloud_disaster_recovery/pcloud_locations_disasterrecovery_getall_responses.go @@ -0,0 +1,181 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package p_cloud_disaster_recovery + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// PcloudLocationsDisasterrecoveryGetallReader is a Reader for the PcloudLocationsDisasterrecoveryGetall structure. +type PcloudLocationsDisasterrecoveryGetallReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PcloudLocationsDisasterrecoveryGetallReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPcloudLocationsDisasterrecoveryGetallOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewPcloudLocationsDisasterrecoveryGetallUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewPcloudLocationsDisasterrecoveryGetallNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPcloudLocationsDisasterrecoveryGetallInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewPcloudLocationsDisasterrecoveryGetallOK creates a PcloudLocationsDisasterrecoveryGetallOK with default headers values +func NewPcloudLocationsDisasterrecoveryGetallOK() *PcloudLocationsDisasterrecoveryGetallOK { + return &PcloudLocationsDisasterrecoveryGetallOK{} +} + +/* PcloudLocationsDisasterrecoveryGetallOK describes a response with status code 200, with default header values. + +OK +*/ +type PcloudLocationsDisasterrecoveryGetallOK struct { + Payload *models.DisasterRecoveryLocations +} + +func (o *PcloudLocationsDisasterrecoveryGetallOK) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetallOK %+v", 200, o.Payload) +} +func (o *PcloudLocationsDisasterrecoveryGetallOK) GetPayload() *models.DisasterRecoveryLocations { + return o.Payload +} + +func (o *PcloudLocationsDisasterrecoveryGetallOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DisasterRecoveryLocations) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudLocationsDisasterrecoveryGetallUnauthorized creates a PcloudLocationsDisasterrecoveryGetallUnauthorized with default headers values +func NewPcloudLocationsDisasterrecoveryGetallUnauthorized() *PcloudLocationsDisasterrecoveryGetallUnauthorized { + return &PcloudLocationsDisasterrecoveryGetallUnauthorized{} +} + +/* PcloudLocationsDisasterrecoveryGetallUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type PcloudLocationsDisasterrecoveryGetallUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudLocationsDisasterrecoveryGetallUnauthorized) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetallUnauthorized %+v", 401, o.Payload) +} +func (o *PcloudLocationsDisasterrecoveryGetallUnauthorized) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudLocationsDisasterrecoveryGetallUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudLocationsDisasterrecoveryGetallNotFound creates a PcloudLocationsDisasterrecoveryGetallNotFound with default headers values +func NewPcloudLocationsDisasterrecoveryGetallNotFound() *PcloudLocationsDisasterrecoveryGetallNotFound { + return &PcloudLocationsDisasterrecoveryGetallNotFound{} +} + +/* PcloudLocationsDisasterrecoveryGetallNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type PcloudLocationsDisasterrecoveryGetallNotFound struct { + Payload *models.Error +} + +func (o *PcloudLocationsDisasterrecoveryGetallNotFound) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetallNotFound %+v", 404, o.Payload) +} +func (o *PcloudLocationsDisasterrecoveryGetallNotFound) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudLocationsDisasterrecoveryGetallNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudLocationsDisasterrecoveryGetallInternalServerError creates a PcloudLocationsDisasterrecoveryGetallInternalServerError with default headers values +func NewPcloudLocationsDisasterrecoveryGetallInternalServerError() *PcloudLocationsDisasterrecoveryGetallInternalServerError { + return &PcloudLocationsDisasterrecoveryGetallInternalServerError{} +} + +/* PcloudLocationsDisasterrecoveryGetallInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type PcloudLocationsDisasterrecoveryGetallInternalServerError struct { + Payload *models.Error +} + +func (o *PcloudLocationsDisasterrecoveryGetallInternalServerError) Error() string { + return fmt.Sprintf("[GET /pcloud/v1/locations/disaster-recovery][%d] pcloudLocationsDisasterrecoveryGetallInternalServerError %+v", 500, o.Payload) +} +func (o *PcloudLocationsDisasterrecoveryGetallInternalServerError) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudLocationsDisasterrecoveryGetallInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_delete_responses.go b/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_delete_responses.go index eb7f8fbf..b8da1c3b 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 @@ -41,6 +41,12 @@ func (o *PcloudCloudinstancesVolumesDeleteReader) ReadResponse(response runtime. return nil, err } return nil, result + case 403: + result := NewPcloudCloudinstancesVolumesDeleteForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result case 410: result := NewPcloudCloudinstancesVolumesDeleteGone() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -152,6 +158,38 @@ func (o *PcloudCloudinstancesVolumesDeleteUnauthorized) readResponse(response ru return nil } +// NewPcloudCloudinstancesVolumesDeleteForbidden creates a PcloudCloudinstancesVolumesDeleteForbidden with default headers values +func NewPcloudCloudinstancesVolumesDeleteForbidden() *PcloudCloudinstancesVolumesDeleteForbidden { + return &PcloudCloudinstancesVolumesDeleteForbidden{} +} + +/* PcloudCloudinstancesVolumesDeleteForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type PcloudCloudinstancesVolumesDeleteForbidden struct { + Payload *models.Error +} + +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) +} +func (o *PcloudCloudinstancesVolumesDeleteForbidden) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudCloudinstancesVolumesDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudCloudinstancesVolumesDeleteGone creates a PcloudCloudinstancesVolumesDeleteGone with default headers values func NewPcloudCloudinstancesVolumesDeleteGone() *PcloudCloudinstancesVolumesDeleteGone { return &PcloudCloudinstancesVolumesDeleteGone{} diff --git a/power/models/d_h_c_p_server_create.go b/power/models/d_h_c_p_server_create.go index 5935e7cd..5497b606 100644 --- a/power/models/d_h_c_p_server_create.go +++ b/power/models/d_h_c_p_server_create.go @@ -17,6 +17,9 @@ import ( // swagger:model DHCPServerCreate type DHCPServerCreate struct { + // Optional cidr for DHCP private network + Cidr *string `json:"cidr,omitempty"` + // Optional cloud connection uuid to connect with DHCP private network CloudConnectionID *string `json:"cloudConnectionID,omitempty"` diff --git a/power/models/disaster_recovery_locations.go b/power/models/disaster_recovery_locations.go new file mode 100644 index 00000000..f1f4910a --- /dev/null +++ b/power/models/disaster_recovery_locations.go @@ -0,0 +1,119 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DisasterRecoveryLocations disaster recovery locations +// +// swagger:model DisasterRecoveryLocations +type DisasterRecoveryLocations struct { + + // The list of Disaster Recovery Locations + // Required: true + DisasterRecoryLocations []*DisasterRecoveryLocation `json:"disasterRecoryLocations"` +} + +// Validate validates this disaster recovery locations +func (m *DisasterRecoveryLocations) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDisasterRecoryLocations(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DisasterRecoveryLocations) validateDisasterRecoryLocations(formats strfmt.Registry) error { + + if err := validate.Required("disasterRecoryLocations", "body", m.DisasterRecoryLocations); err != nil { + return err + } + + for i := 0; i < len(m.DisasterRecoryLocations); i++ { + if swag.IsZero(m.DisasterRecoryLocations[i]) { // not required + continue + } + + if m.DisasterRecoryLocations[i] != nil { + if err := m.DisasterRecoryLocations[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("disasterRecoryLocations" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("disasterRecoryLocations" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this disaster recovery locations based on the context it is used +func (m *DisasterRecoveryLocations) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDisasterRecoryLocations(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DisasterRecoveryLocations) contextValidateDisasterRecoryLocations(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.DisasterRecoryLocations); i++ { + + if m.DisasterRecoryLocations[i] != nil { + if err := m.DisasterRecoryLocations[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("disasterRecoryLocations" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("disasterRecoryLocations" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DisasterRecoveryLocations) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DisasterRecoveryLocations) UnmarshalBinary(b []byte) error { + var res DisasterRecoveryLocations + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/power/models/power_v_s_instance.go b/power/models/power_v_s_instance.go index e2617564..2ecfe4d9 100644 --- a/power/models/power_v_s_instance.go +++ b/power/models/power_v_s_instance.go @@ -49,6 +49,10 @@ type PowerVSInstance struct { // Example: Test Name Name string `json:"name,omitempty"` + // Defines if the user has administrator privileges + // Example: true + PrivilegedUser bool `json:"privilegedUser,omitempty"` + // IBM Resource Group ID associated with the PowerVS Service Instance (This field will be empty for old accounts as PowerVS did not previously saved the Resource Group ID) // Example: 2bf1887bf5c947b1966de2bd88220489 ResourceGroupID string `json:"resourceGroupId,omitempty"`