From 9ad5ccdf1303c3022f7c31385cf2498965999d8e Mon Sep 17 00:00:00 2001 From: Yussuf Shaikh Date: Fri, 8 Apr 2022 18:45:18 +0530 Subject: [PATCH] Update Service-Broker to v1.91.0 Signed-off-by: Yussuf Shaikh --- .../p_cloud_shared_proc_pools_client.go | 80 ----- .../pcloud_sharedprocpools_post_parameters.go | 173 ---------- .../pcloud_sharedprocpools_post_responses.go | 219 ------------- .../p_cloud_shared_processor_pools_client.go | 121 +++++++ ..._sharedprocessorpools_delete_parameters.go | 171 ++++++++++ ...d_sharedprocessorpools_delete_responses.go | 217 +++++++++++++ ...ud_sharedprocessorpools_post_parameters.go | 173 ++++++++++ ...oud_sharedprocessorpools_post_responses.go | 219 +++++++++++++ .../p_cloud_volume_groups_client.go | 41 +++ ...loud_volumegroups_get_details_responses.go | 6 +- .../pcloud_volumegroups_post_parameters.go | 173 ++++++++++ .../pcloud_volumegroups_post_responses.go | 295 ++++++++++++++++++ ...instances_volumes_action_post_responses.go | 38 +++ ..._v2_pvminstances_volumes_post_responses.go | 38 +++ power/client/power_iaas_api_client.go | 8 +- ..._proc_pool.go => shared_processor_pool.go} | 26 +- ...ate.go => shared_processor_pool_create.go} | 28 +- power/models/volume_group_create.go | 77 +++++ power/models/volume_group_create_response.go | 88 ++++++ 19 files changed, 1685 insertions(+), 506 deletions(-) delete mode 100644 power/client/p_cloud_shared_proc_pools/p_cloud_shared_proc_pools_client.go delete mode 100644 power/client/p_cloud_shared_proc_pools/pcloud_sharedprocpools_post_parameters.go delete mode 100644 power/client/p_cloud_shared_proc_pools/pcloud_sharedprocpools_post_responses.go create mode 100644 power/client/p_cloud_shared_processor_pools/p_cloud_shared_processor_pools_client.go create mode 100644 power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_delete_parameters.go create mode 100644 power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_delete_responses.go create mode 100644 power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_post_parameters.go create mode 100644 power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_post_responses.go create mode 100644 power/client/p_cloud_volume_groups/pcloud_volumegroups_post_parameters.go create mode 100644 power/client/p_cloud_volume_groups/pcloud_volumegroups_post_responses.go rename power/models/{shared_proc_pool.go => shared_processor_pool.go} (71%) rename power/models/{shared_proc_pool_create.go => shared_processor_pool_create.go} (64%) create mode 100644 power/models/volume_group_create.go create mode 100644 power/models/volume_group_create_response.go diff --git a/power/client/p_cloud_shared_proc_pools/p_cloud_shared_proc_pools_client.go b/power/client/p_cloud_shared_proc_pools/p_cloud_shared_proc_pools_client.go deleted file mode 100644 index 9c31a976..00000000 --- a/power/client/p_cloud_shared_proc_pools/p_cloud_shared_proc_pools_client.go +++ /dev/null @@ -1,80 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_shared_proc_pools - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new p cloud shared proc pools API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for p cloud shared proc pools 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 { - PcloudSharedprocpoolsPost(params *PcloudSharedprocpoolsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSharedprocpoolsPostOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - PcloudSharedprocpoolsPost creates a new shared processor pool -*/ -func (a *Client) PcloudSharedprocpoolsPost(params *PcloudSharedprocpoolsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSharedprocpoolsPostOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPcloudSharedprocpoolsPostParams() - } - op := &runtime.ClientOperation{ - ID: "pcloud.sharedprocpools.post", - Method: "POST", - PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/shared-proc-pools", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &PcloudSharedprocpoolsPostReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PcloudSharedprocpoolsPostOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, 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.sharedprocpools.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/power/client/p_cloud_shared_proc_pools/pcloud_sharedprocpools_post_parameters.go b/power/client/p_cloud_shared_proc_pools/pcloud_sharedprocpools_post_parameters.go deleted file mode 100644 index e5fb16b2..00000000 --- a/power/client/p_cloud_shared_proc_pools/pcloud_sharedprocpools_post_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_shared_proc_pools - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewPcloudSharedprocpoolsPostParams creates a new PcloudSharedprocpoolsPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPcloudSharedprocpoolsPostParams() *PcloudSharedprocpoolsPostParams { - return &PcloudSharedprocpoolsPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPcloudSharedprocpoolsPostParamsWithTimeout creates a new PcloudSharedprocpoolsPostParams object -// with the ability to set a timeout on a request. -func NewPcloudSharedprocpoolsPostParamsWithTimeout(timeout time.Duration) *PcloudSharedprocpoolsPostParams { - return &PcloudSharedprocpoolsPostParams{ - timeout: timeout, - } -} - -// NewPcloudSharedprocpoolsPostParamsWithContext creates a new PcloudSharedprocpoolsPostParams object -// with the ability to set a context for a request. -func NewPcloudSharedprocpoolsPostParamsWithContext(ctx context.Context) *PcloudSharedprocpoolsPostParams { - return &PcloudSharedprocpoolsPostParams{ - Context: ctx, - } -} - -// NewPcloudSharedprocpoolsPostParamsWithHTTPClient creates a new PcloudSharedprocpoolsPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewPcloudSharedprocpoolsPostParamsWithHTTPClient(client *http.Client) *PcloudSharedprocpoolsPostParams { - return &PcloudSharedprocpoolsPostParams{ - HTTPClient: client, - } -} - -/* PcloudSharedprocpoolsPostParams contains all the parameters to send to the API endpoint - for the pcloud sharedprocpools post operation. - - Typically these are written to a http.Request. -*/ -type PcloudSharedprocpoolsPostParams struct { - - /* Body. - - Parameters for the creation of a new Shared Processor Pool - */ - Body *models.SharedProcPoolCreate - - /* 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 sharedprocpools post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudSharedprocpoolsPostParams) WithDefaults() *PcloudSharedprocpoolsPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the pcloud sharedprocpools post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PcloudSharedprocpoolsPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the pcloud sharedprocpools post params -func (o *PcloudSharedprocpoolsPostParams) WithTimeout(timeout time.Duration) *PcloudSharedprocpoolsPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the pcloud sharedprocpools post params -func (o *PcloudSharedprocpoolsPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the pcloud sharedprocpools post params -func (o *PcloudSharedprocpoolsPostParams) WithContext(ctx context.Context) *PcloudSharedprocpoolsPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the pcloud sharedprocpools post params -func (o *PcloudSharedprocpoolsPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the pcloud sharedprocpools post params -func (o *PcloudSharedprocpoolsPostParams) WithHTTPClient(client *http.Client) *PcloudSharedprocpoolsPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the pcloud sharedprocpools post params -func (o *PcloudSharedprocpoolsPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the pcloud sharedprocpools post params -func (o *PcloudSharedprocpoolsPostParams) WithBody(body *models.SharedProcPoolCreate) *PcloudSharedprocpoolsPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the pcloud sharedprocpools post params -func (o *PcloudSharedprocpoolsPostParams) SetBody(body *models.SharedProcPoolCreate) { - o.Body = body -} - -// WithCloudInstanceID adds the cloudInstanceID to the pcloud sharedprocpools post params -func (o *PcloudSharedprocpoolsPostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudSharedprocpoolsPostParams { - o.SetCloudInstanceID(cloudInstanceID) - return o -} - -// SetCloudInstanceID adds the cloudInstanceId to the pcloud sharedprocpools post params -func (o *PcloudSharedprocpoolsPostParams) SetCloudInstanceID(cloudInstanceID string) { - o.CloudInstanceID = cloudInstanceID -} - -// WriteToRequest writes these params to a swagger request -func (o *PcloudSharedprocpoolsPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param cloud_instance_id - if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/p_cloud_shared_proc_pools/pcloud_sharedprocpools_post_responses.go b/power/client/p_cloud_shared_proc_pools/pcloud_sharedprocpools_post_responses.go deleted file mode 100644 index 9214417d..00000000 --- a/power/client/p_cloud_shared_proc_pools/pcloud_sharedprocpools_post_responses.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package p_cloud_shared_proc_pools - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// PcloudSharedprocpoolsPostReader is a Reader for the PcloudSharedprocpoolsPost structure. -type PcloudSharedprocpoolsPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PcloudSharedprocpoolsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPcloudSharedprocpoolsPostOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPcloudSharedprocpoolsPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewPcloudSharedprocpoolsPostConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewPcloudSharedprocpoolsPostUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewPcloudSharedprocpoolsPostInternalServerError() - 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()) - } -} - -// NewPcloudSharedprocpoolsPostOK creates a PcloudSharedprocpoolsPostOK with default headers values -func NewPcloudSharedprocpoolsPostOK() *PcloudSharedprocpoolsPostOK { - return &PcloudSharedprocpoolsPostOK{} -} - -/* PcloudSharedprocpoolsPostOK describes a response with status code 200, with default header values. - -OK -*/ -type PcloudSharedprocpoolsPostOK struct { - Payload *models.SharedProcPool -} - -func (o *PcloudSharedprocpoolsPostOK) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-proc-pools][%d] pcloudSharedprocpoolsPostOK %+v", 200, o.Payload) -} -func (o *PcloudSharedprocpoolsPostOK) GetPayload() *models.SharedProcPool { - return o.Payload -} - -func (o *PcloudSharedprocpoolsPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.SharedProcPool) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSharedprocpoolsPostBadRequest creates a PcloudSharedprocpoolsPostBadRequest with default headers values -func NewPcloudSharedprocpoolsPostBadRequest() *PcloudSharedprocpoolsPostBadRequest { - return &PcloudSharedprocpoolsPostBadRequest{} -} - -/* PcloudSharedprocpoolsPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type PcloudSharedprocpoolsPostBadRequest struct { - Payload *models.Error -} - -func (o *PcloudSharedprocpoolsPostBadRequest) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-proc-pools][%d] pcloudSharedprocpoolsPostBadRequest %+v", 400, o.Payload) -} -func (o *PcloudSharedprocpoolsPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSharedprocpoolsPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSharedprocpoolsPostConflict creates a PcloudSharedprocpoolsPostConflict with default headers values -func NewPcloudSharedprocpoolsPostConflict() *PcloudSharedprocpoolsPostConflict { - return &PcloudSharedprocpoolsPostConflict{} -} - -/* PcloudSharedprocpoolsPostConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type PcloudSharedprocpoolsPostConflict struct { - Payload *models.Error -} - -func (o *PcloudSharedprocpoolsPostConflict) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-proc-pools][%d] pcloudSharedprocpoolsPostConflict %+v", 409, o.Payload) -} -func (o *PcloudSharedprocpoolsPostConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSharedprocpoolsPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSharedprocpoolsPostUnprocessableEntity creates a PcloudSharedprocpoolsPostUnprocessableEntity with default headers values -func NewPcloudSharedprocpoolsPostUnprocessableEntity() *PcloudSharedprocpoolsPostUnprocessableEntity { - return &PcloudSharedprocpoolsPostUnprocessableEntity{} -} - -/* PcloudSharedprocpoolsPostUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type PcloudSharedprocpoolsPostUnprocessableEntity struct { - Payload *models.Error -} - -func (o *PcloudSharedprocpoolsPostUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-proc-pools][%d] pcloudSharedprocpoolsPostUnprocessableEntity %+v", 422, o.Payload) -} -func (o *PcloudSharedprocpoolsPostUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSharedprocpoolsPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPcloudSharedprocpoolsPostInternalServerError creates a PcloudSharedprocpoolsPostInternalServerError with default headers values -func NewPcloudSharedprocpoolsPostInternalServerError() *PcloudSharedprocpoolsPostInternalServerError { - return &PcloudSharedprocpoolsPostInternalServerError{} -} - -/* PcloudSharedprocpoolsPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type PcloudSharedprocpoolsPostInternalServerError struct { - Payload *models.Error -} - -func (o *PcloudSharedprocpoolsPostInternalServerError) Error() string { - return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-proc-pools][%d] pcloudSharedprocpoolsPostInternalServerError %+v", 500, o.Payload) -} -func (o *PcloudSharedprocpoolsPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *PcloudSharedprocpoolsPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_shared_processor_pools/p_cloud_shared_processor_pools_client.go b/power/client/p_cloud_shared_processor_pools/p_cloud_shared_processor_pools_client.go new file mode 100644 index 00000000..6b2b8f38 --- /dev/null +++ b/power/client/p_cloud_shared_processor_pools/p_cloud_shared_processor_pools_client.go @@ -0,0 +1,121 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package p_cloud_shared_processor_pools + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new p cloud shared processor pools API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for p cloud shared processor pools 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 { + PcloudSharedprocessorpoolsDelete(params *PcloudSharedprocessorpoolsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSharedprocessorpoolsDeleteOK, error) + + PcloudSharedprocessorpoolsPost(params *PcloudSharedprocessorpoolsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSharedprocessorpoolsPostOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + PcloudSharedprocessorpoolsDelete deletes a shared processor pool from a cloud instance +*/ +func (a *Client) PcloudSharedprocessorpoolsDelete(params *PcloudSharedprocessorpoolsDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSharedprocessorpoolsDeleteOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudSharedprocessorpoolsDeleteParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.sharedprocessorpools.delete", + Method: "DELETE", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools/{shared_processor_pool_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudSharedprocessorpoolsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudSharedprocessorpoolsDeleteOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.sharedprocessorpools.delete: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + PcloudSharedprocessorpoolsPost creates a new shared processor pool +*/ +func (a *Client) PcloudSharedprocessorpoolsPost(params *PcloudSharedprocessorpoolsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudSharedprocessorpoolsPostOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudSharedprocessorpoolsPostParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.sharedprocessorpools.post", + Method: "POST", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudSharedprocessorpoolsPostReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudSharedprocessorpoolsPostOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.sharedprocessorpools.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_delete_parameters.go b/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_delete_parameters.go new file mode 100644 index 00000000..5213b17c --- /dev/null +++ b/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_delete_parameters.go @@ -0,0 +1,171 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package p_cloud_shared_processor_pools + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewPcloudSharedprocessorpoolsDeleteParams creates a new PcloudSharedprocessorpoolsDeleteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewPcloudSharedprocessorpoolsDeleteParams() *PcloudSharedprocessorpoolsDeleteParams { + return &PcloudSharedprocessorpoolsDeleteParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPcloudSharedprocessorpoolsDeleteParamsWithTimeout creates a new PcloudSharedprocessorpoolsDeleteParams object +// with the ability to set a timeout on a request. +func NewPcloudSharedprocessorpoolsDeleteParamsWithTimeout(timeout time.Duration) *PcloudSharedprocessorpoolsDeleteParams { + return &PcloudSharedprocessorpoolsDeleteParams{ + timeout: timeout, + } +} + +// NewPcloudSharedprocessorpoolsDeleteParamsWithContext creates a new PcloudSharedprocessorpoolsDeleteParams object +// with the ability to set a context for a request. +func NewPcloudSharedprocessorpoolsDeleteParamsWithContext(ctx context.Context) *PcloudSharedprocessorpoolsDeleteParams { + return &PcloudSharedprocessorpoolsDeleteParams{ + Context: ctx, + } +} + +// NewPcloudSharedprocessorpoolsDeleteParamsWithHTTPClient creates a new PcloudSharedprocessorpoolsDeleteParams object +// with the ability to set a custom HTTPClient for a request. +func NewPcloudSharedprocessorpoolsDeleteParamsWithHTTPClient(client *http.Client) *PcloudSharedprocessorpoolsDeleteParams { + return &PcloudSharedprocessorpoolsDeleteParams{ + HTTPClient: client, + } +} + +/* PcloudSharedprocessorpoolsDeleteParams contains all the parameters to send to the API endpoint + for the pcloud sharedprocessorpools delete operation. + + Typically these are written to a http.Request. +*/ +type PcloudSharedprocessorpoolsDeleteParams struct { + + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance + */ + CloudInstanceID string + + /* SharedProcessorPoolID. + + Shared Processor Pool ID + */ + SharedProcessorPoolID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the pcloud sharedprocessorpools delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudSharedprocessorpoolsDeleteParams) WithDefaults() *PcloudSharedprocessorpoolsDeleteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud sharedprocessorpools delete params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudSharedprocessorpoolsDeleteParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the pcloud sharedprocessorpools delete params +func (o *PcloudSharedprocessorpoolsDeleteParams) WithTimeout(timeout time.Duration) *PcloudSharedprocessorpoolsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the pcloud sharedprocessorpools delete params +func (o *PcloudSharedprocessorpoolsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the pcloud sharedprocessorpools delete params +func (o *PcloudSharedprocessorpoolsDeleteParams) WithContext(ctx context.Context) *PcloudSharedprocessorpoolsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the pcloud sharedprocessorpools delete params +func (o *PcloudSharedprocessorpoolsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the pcloud sharedprocessorpools delete params +func (o *PcloudSharedprocessorpoolsDeleteParams) WithHTTPClient(client *http.Client) *PcloudSharedprocessorpoolsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the pcloud sharedprocessorpools delete params +func (o *PcloudSharedprocessorpoolsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCloudInstanceID adds the cloudInstanceID to the pcloud sharedprocessorpools delete params +func (o *PcloudSharedprocessorpoolsDeleteParams) WithCloudInstanceID(cloudInstanceID string) *PcloudSharedprocessorpoolsDeleteParams { + o.SetCloudInstanceID(cloudInstanceID) + return o +} + +// SetCloudInstanceID adds the cloudInstanceId to the pcloud sharedprocessorpools delete params +func (o *PcloudSharedprocessorpoolsDeleteParams) SetCloudInstanceID(cloudInstanceID string) { + o.CloudInstanceID = cloudInstanceID +} + +// WithSharedProcessorPoolID adds the sharedProcessorPoolID to the pcloud sharedprocessorpools delete params +func (o *PcloudSharedprocessorpoolsDeleteParams) WithSharedProcessorPoolID(sharedProcessorPoolID string) *PcloudSharedprocessorpoolsDeleteParams { + o.SetSharedProcessorPoolID(sharedProcessorPoolID) + return o +} + +// SetSharedProcessorPoolID adds the sharedProcessorPoolId to the pcloud sharedprocessorpools delete params +func (o *PcloudSharedprocessorpoolsDeleteParams) SetSharedProcessorPoolID(sharedProcessorPoolID string) { + o.SharedProcessorPoolID = sharedProcessorPoolID +} + +// WriteToRequest writes these params to a swagger request +func (o *PcloudSharedprocessorpoolsDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param cloud_instance_id + if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { + return err + } + + // path param shared_processor_pool_id + if err := r.SetPathParam("shared_processor_pool_id", o.SharedProcessorPoolID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_delete_responses.go b/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_delete_responses.go new file mode 100644 index 00000000..9e23420b --- /dev/null +++ b/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_delete_responses.go @@ -0,0 +1,217 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package p_cloud_shared_processor_pools + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// PcloudSharedprocessorpoolsDeleteReader is a Reader for the PcloudSharedprocessorpoolsDelete structure. +type PcloudSharedprocessorpoolsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PcloudSharedprocessorpoolsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPcloudSharedprocessorpoolsDeleteOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewPcloudSharedprocessorpoolsDeleteBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewPcloudSharedprocessorpoolsDeleteUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewPcloudSharedprocessorpoolsDeleteConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPcloudSharedprocessorpoolsDeleteInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewPcloudSharedprocessorpoolsDeleteOK creates a PcloudSharedprocessorpoolsDeleteOK with default headers values +func NewPcloudSharedprocessorpoolsDeleteOK() *PcloudSharedprocessorpoolsDeleteOK { + return &PcloudSharedprocessorpoolsDeleteOK{} +} + +/* PcloudSharedprocessorpoolsDeleteOK describes a response with status code 200, with default header values. + +OK +*/ +type PcloudSharedprocessorpoolsDeleteOK struct { + Payload models.Object +} + +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) +} +func (o *PcloudSharedprocessorpoolsDeleteOK) GetPayload() models.Object { + return o.Payload +} + +func (o *PcloudSharedprocessorpoolsDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudSharedprocessorpoolsDeleteBadRequest creates a PcloudSharedprocessorpoolsDeleteBadRequest with default headers values +func NewPcloudSharedprocessorpoolsDeleteBadRequest() *PcloudSharedprocessorpoolsDeleteBadRequest { + return &PcloudSharedprocessorpoolsDeleteBadRequest{} +} + +/* PcloudSharedprocessorpoolsDeleteBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type PcloudSharedprocessorpoolsDeleteBadRequest struct { + Payload *models.Error +} + +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) +} +func (o *PcloudSharedprocessorpoolsDeleteBadRequest) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudSharedprocessorpoolsDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudSharedprocessorpoolsDeleteUnauthorized creates a PcloudSharedprocessorpoolsDeleteUnauthorized with default headers values +func NewPcloudSharedprocessorpoolsDeleteUnauthorized() *PcloudSharedprocessorpoolsDeleteUnauthorized { + return &PcloudSharedprocessorpoolsDeleteUnauthorized{} +} + +/* PcloudSharedprocessorpoolsDeleteUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type PcloudSharedprocessorpoolsDeleteUnauthorized struct { + Payload *models.Error +} + +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) +} +func (o *PcloudSharedprocessorpoolsDeleteUnauthorized) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudSharedprocessorpoolsDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudSharedprocessorpoolsDeleteConflict creates a PcloudSharedprocessorpoolsDeleteConflict with default headers values +func NewPcloudSharedprocessorpoolsDeleteConflict() *PcloudSharedprocessorpoolsDeleteConflict { + return &PcloudSharedprocessorpoolsDeleteConflict{} +} + +/* PcloudSharedprocessorpoolsDeleteConflict describes a response with status code 409, with default header values. + +Conflict +*/ +type PcloudSharedprocessorpoolsDeleteConflict struct { + Payload *models.Error +} + +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) +} +func (o *PcloudSharedprocessorpoolsDeleteConflict) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudSharedprocessorpoolsDeleteConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudSharedprocessorpoolsDeleteInternalServerError creates a PcloudSharedprocessorpoolsDeleteInternalServerError with default headers values +func NewPcloudSharedprocessorpoolsDeleteInternalServerError() *PcloudSharedprocessorpoolsDeleteInternalServerError { + return &PcloudSharedprocessorpoolsDeleteInternalServerError{} +} + +/* PcloudSharedprocessorpoolsDeleteInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type PcloudSharedprocessorpoolsDeleteInternalServerError struct { + Payload *models.Error +} + +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) +} +func (o *PcloudSharedprocessorpoolsDeleteInternalServerError) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudSharedprocessorpoolsDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_post_parameters.go b/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_post_parameters.go new file mode 100644 index 00000000..79362013 --- /dev/null +++ b/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_post_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package p_cloud_shared_processor_pools + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// NewPcloudSharedprocessorpoolsPostParams creates a new PcloudSharedprocessorpoolsPostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewPcloudSharedprocessorpoolsPostParams() *PcloudSharedprocessorpoolsPostParams { + return &PcloudSharedprocessorpoolsPostParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPcloudSharedprocessorpoolsPostParamsWithTimeout creates a new PcloudSharedprocessorpoolsPostParams object +// with the ability to set a timeout on a request. +func NewPcloudSharedprocessorpoolsPostParamsWithTimeout(timeout time.Duration) *PcloudSharedprocessorpoolsPostParams { + return &PcloudSharedprocessorpoolsPostParams{ + timeout: timeout, + } +} + +// NewPcloudSharedprocessorpoolsPostParamsWithContext creates a new PcloudSharedprocessorpoolsPostParams object +// with the ability to set a context for a request. +func NewPcloudSharedprocessorpoolsPostParamsWithContext(ctx context.Context) *PcloudSharedprocessorpoolsPostParams { + return &PcloudSharedprocessorpoolsPostParams{ + Context: ctx, + } +} + +// NewPcloudSharedprocessorpoolsPostParamsWithHTTPClient creates a new PcloudSharedprocessorpoolsPostParams object +// with the ability to set a custom HTTPClient for a request. +func NewPcloudSharedprocessorpoolsPostParamsWithHTTPClient(client *http.Client) *PcloudSharedprocessorpoolsPostParams { + return &PcloudSharedprocessorpoolsPostParams{ + HTTPClient: client, + } +} + +/* PcloudSharedprocessorpoolsPostParams contains all the parameters to send to the API endpoint + for the pcloud sharedprocessorpools post operation. + + Typically these are written to a http.Request. +*/ +type PcloudSharedprocessorpoolsPostParams struct { + + /* Body. + + Parameters for the creation of a new Shared Processor Pool + */ + Body *models.SharedProcessorPoolCreate + + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance + */ + CloudInstanceID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the pcloud sharedprocessorpools post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudSharedprocessorpoolsPostParams) WithDefaults() *PcloudSharedprocessorpoolsPostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud sharedprocessorpools post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudSharedprocessorpoolsPostParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the pcloud sharedprocessorpools post params +func (o *PcloudSharedprocessorpoolsPostParams) WithTimeout(timeout time.Duration) *PcloudSharedprocessorpoolsPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the pcloud sharedprocessorpools post params +func (o *PcloudSharedprocessorpoolsPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the pcloud sharedprocessorpools post params +func (o *PcloudSharedprocessorpoolsPostParams) WithContext(ctx context.Context) *PcloudSharedprocessorpoolsPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the pcloud sharedprocessorpools post params +func (o *PcloudSharedprocessorpoolsPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the pcloud sharedprocessorpools post params +func (o *PcloudSharedprocessorpoolsPostParams) WithHTTPClient(client *http.Client) *PcloudSharedprocessorpoolsPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the pcloud sharedprocessorpools post params +func (o *PcloudSharedprocessorpoolsPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the pcloud sharedprocessorpools post params +func (o *PcloudSharedprocessorpoolsPostParams) WithBody(body *models.SharedProcessorPoolCreate) *PcloudSharedprocessorpoolsPostParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the pcloud sharedprocessorpools post params +func (o *PcloudSharedprocessorpoolsPostParams) SetBody(body *models.SharedProcessorPoolCreate) { + o.Body = body +} + +// WithCloudInstanceID adds the cloudInstanceID to the pcloud sharedprocessorpools post params +func (o *PcloudSharedprocessorpoolsPostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudSharedprocessorpoolsPostParams { + o.SetCloudInstanceID(cloudInstanceID) + return o +} + +// SetCloudInstanceID adds the cloudInstanceId to the pcloud sharedprocessorpools post params +func (o *PcloudSharedprocessorpoolsPostParams) SetCloudInstanceID(cloudInstanceID string) { + o.CloudInstanceID = cloudInstanceID +} + +// WriteToRequest writes these params to a swagger request +func (o *PcloudSharedprocessorpoolsPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // path param cloud_instance_id + if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_post_responses.go b/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_post_responses.go new file mode 100644 index 00000000..54fd3661 --- /dev/null +++ b/power/client/p_cloud_shared_processor_pools/pcloud_sharedprocessorpools_post_responses.go @@ -0,0 +1,219 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package p_cloud_shared_processor_pools + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// PcloudSharedprocessorpoolsPostReader is a Reader for the PcloudSharedprocessorpoolsPost structure. +type PcloudSharedprocessorpoolsPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PcloudSharedprocessorpoolsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPcloudSharedprocessorpoolsPostOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewPcloudSharedprocessorpoolsPostBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewPcloudSharedprocessorpoolsPostConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPcloudSharedprocessorpoolsPostUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPcloudSharedprocessorpoolsPostInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewPcloudSharedprocessorpoolsPostOK creates a PcloudSharedprocessorpoolsPostOK with default headers values +func NewPcloudSharedprocessorpoolsPostOK() *PcloudSharedprocessorpoolsPostOK { + return &PcloudSharedprocessorpoolsPostOK{} +} + +/* PcloudSharedprocessorpoolsPostOK describes a response with status code 200, with default header values. + +OK +*/ +type PcloudSharedprocessorpoolsPostOK struct { + Payload *models.SharedProcessorPool +} + +func (o *PcloudSharedprocessorpoolsPostOK) Error() string { + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/shared-processor-pools][%d] pcloudSharedprocessorpoolsPostOK %+v", 200, o.Payload) +} +func (o *PcloudSharedprocessorpoolsPostOK) GetPayload() *models.SharedProcessorPool { + return o.Payload +} + +func (o *PcloudSharedprocessorpoolsPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SharedProcessorPool) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudSharedprocessorpoolsPostBadRequest creates a PcloudSharedprocessorpoolsPostBadRequest with default headers values +func NewPcloudSharedprocessorpoolsPostBadRequest() *PcloudSharedprocessorpoolsPostBadRequest { + return &PcloudSharedprocessorpoolsPostBadRequest{} +} + +/* PcloudSharedprocessorpoolsPostBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type PcloudSharedprocessorpoolsPostBadRequest struct { + Payload *models.Error +} + +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) +} +func (o *PcloudSharedprocessorpoolsPostBadRequest) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudSharedprocessorpoolsPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudSharedprocessorpoolsPostConflict creates a PcloudSharedprocessorpoolsPostConflict with default headers values +func NewPcloudSharedprocessorpoolsPostConflict() *PcloudSharedprocessorpoolsPostConflict { + return &PcloudSharedprocessorpoolsPostConflict{} +} + +/* PcloudSharedprocessorpoolsPostConflict describes a response with status code 409, with default header values. + +Conflict +*/ +type PcloudSharedprocessorpoolsPostConflict struct { + Payload *models.Error +} + +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) +} +func (o *PcloudSharedprocessorpoolsPostConflict) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudSharedprocessorpoolsPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudSharedprocessorpoolsPostUnprocessableEntity creates a PcloudSharedprocessorpoolsPostUnprocessableEntity with default headers values +func NewPcloudSharedprocessorpoolsPostUnprocessableEntity() *PcloudSharedprocessorpoolsPostUnprocessableEntity { + return &PcloudSharedprocessorpoolsPostUnprocessableEntity{} +} + +/* PcloudSharedprocessorpoolsPostUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity +*/ +type PcloudSharedprocessorpoolsPostUnprocessableEntity struct { + Payload *models.Error +} + +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) +} +func (o *PcloudSharedprocessorpoolsPostUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudSharedprocessorpoolsPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudSharedprocessorpoolsPostInternalServerError creates a PcloudSharedprocessorpoolsPostInternalServerError with default headers values +func NewPcloudSharedprocessorpoolsPostInternalServerError() *PcloudSharedprocessorpoolsPostInternalServerError { + return &PcloudSharedprocessorpoolsPostInternalServerError{} +} + +/* PcloudSharedprocessorpoolsPostInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type PcloudSharedprocessorpoolsPostInternalServerError struct { + Payload *models.Error +} + +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) +} +func (o *PcloudSharedprocessorpoolsPostInternalServerError) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudSharedprocessorpoolsPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/power/client/p_cloud_volume_groups/p_cloud_volume_groups_client.go b/power/client/p_cloud_volume_groups/p_cloud_volume_groups_client.go index de54bc8c..5680f37e 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 @@ -40,6 +40,8 @@ type ClientService interface { PcloudVolumegroupsGetallDetails(params *PcloudVolumegroupsGetallDetailsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumegroupsGetallDetailsOK, error) + PcloudVolumegroupsPost(params *PcloudVolumegroupsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumegroupsPostAccepted, error) + SetTransport(transport runtime.ClientTransport) } @@ -238,6 +240,45 @@ func (a *Client) PcloudVolumegroupsGetallDetails(params *PcloudVolumegroupsGetal panic(msg) } +/* + PcloudVolumegroupsPost creates a new volume group +*/ +func (a *Client) PcloudVolumegroupsPost(params *PcloudVolumegroupsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudVolumegroupsPostAccepted, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPcloudVolumegroupsPostParams() + } + op := &runtime.ClientOperation{ + ID: "pcloud.volumegroups.post", + Method: "POST", + PathPattern: "/pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &PcloudVolumegroupsPostReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PcloudVolumegroupsPostAccepted) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for pcloud.volumegroups.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + // SetTransport changes the transport on the client func (a *Client) SetTransport(transport runtime.ClientTransport) { a.transport = transport diff --git a/power/client/p_cloud_volume_groups/pcloud_volumegroups_get_details_responses.go b/power/client/p_cloud_volume_groups/pcloud_volumegroups_get_details_responses.go index c3811889..77d3962e 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 @@ -62,19 +62,19 @@ func NewPcloudVolumegroupsGetDetailsOK() *PcloudVolumegroupsGetDetailsOK { OK */ type PcloudVolumegroupsGetDetailsOK struct { - Payload *models.VolumeGroupDetails + Payload *models.VolumeGroupCreateResponse } 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) } -func (o *PcloudVolumegroupsGetDetailsOK) GetPayload() *models.VolumeGroupDetails { +func (o *PcloudVolumegroupsGetDetailsOK) GetPayload() *models.VolumeGroupCreateResponse { return o.Payload } func (o *PcloudVolumegroupsGetDetailsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.VolumeGroupDetails) + o.Payload = new(models.VolumeGroupCreateResponse) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/power/client/p_cloud_volume_groups/pcloud_volumegroups_post_parameters.go b/power/client/p_cloud_volume_groups/pcloud_volumegroups_post_parameters.go new file mode 100644 index 00000000..9c43bbb6 --- /dev/null +++ b/power/client/p_cloud_volume_groups/pcloud_volumegroups_post_parameters.go @@ -0,0 +1,173 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package p_cloud_volume_groups + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// NewPcloudVolumegroupsPostParams creates a new PcloudVolumegroupsPostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewPcloudVolumegroupsPostParams() *PcloudVolumegroupsPostParams { + return &PcloudVolumegroupsPostParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPcloudVolumegroupsPostParamsWithTimeout creates a new PcloudVolumegroupsPostParams object +// with the ability to set a timeout on a request. +func NewPcloudVolumegroupsPostParamsWithTimeout(timeout time.Duration) *PcloudVolumegroupsPostParams { + return &PcloudVolumegroupsPostParams{ + timeout: timeout, + } +} + +// NewPcloudVolumegroupsPostParamsWithContext creates a new PcloudVolumegroupsPostParams object +// with the ability to set a context for a request. +func NewPcloudVolumegroupsPostParamsWithContext(ctx context.Context) *PcloudVolumegroupsPostParams { + return &PcloudVolumegroupsPostParams{ + Context: ctx, + } +} + +// NewPcloudVolumegroupsPostParamsWithHTTPClient creates a new PcloudVolumegroupsPostParams object +// with the ability to set a custom HTTPClient for a request. +func NewPcloudVolumegroupsPostParamsWithHTTPClient(client *http.Client) *PcloudVolumegroupsPostParams { + return &PcloudVolumegroupsPostParams{ + HTTPClient: client, + } +} + +/* PcloudVolumegroupsPostParams contains all the parameters to send to the API endpoint + for the pcloud volumegroups post operation. + + Typically these are written to a http.Request. +*/ +type PcloudVolumegroupsPostParams struct { + + /* Body. + + Parameters for the creation of a new volume group + */ + Body *models.VolumeGroupCreate + + /* CloudInstanceID. + + Cloud Instance ID of a PCloud Instance + */ + CloudInstanceID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the pcloud volumegroups post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudVolumegroupsPostParams) WithDefaults() *PcloudVolumegroupsPostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the pcloud volumegroups post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PcloudVolumegroupsPostParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the pcloud volumegroups post params +func (o *PcloudVolumegroupsPostParams) WithTimeout(timeout time.Duration) *PcloudVolumegroupsPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the pcloud volumegroups post params +func (o *PcloudVolumegroupsPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the pcloud volumegroups post params +func (o *PcloudVolumegroupsPostParams) WithContext(ctx context.Context) *PcloudVolumegroupsPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the pcloud volumegroups post params +func (o *PcloudVolumegroupsPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the pcloud volumegroups post params +func (o *PcloudVolumegroupsPostParams) WithHTTPClient(client *http.Client) *PcloudVolumegroupsPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the pcloud volumegroups post params +func (o *PcloudVolumegroupsPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the pcloud volumegroups post params +func (o *PcloudVolumegroupsPostParams) WithBody(body *models.VolumeGroupCreate) *PcloudVolumegroupsPostParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the pcloud volumegroups post params +func (o *PcloudVolumegroupsPostParams) SetBody(body *models.VolumeGroupCreate) { + o.Body = body +} + +// WithCloudInstanceID adds the cloudInstanceID to the pcloud volumegroups post params +func (o *PcloudVolumegroupsPostParams) WithCloudInstanceID(cloudInstanceID string) *PcloudVolumegroupsPostParams { + o.SetCloudInstanceID(cloudInstanceID) + return o +} + +// SetCloudInstanceID adds the cloudInstanceId to the pcloud volumegroups post params +func (o *PcloudVolumegroupsPostParams) SetCloudInstanceID(cloudInstanceID string) { + o.CloudInstanceID = cloudInstanceID +} + +// WriteToRequest writes these params to a swagger request +func (o *PcloudVolumegroupsPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // path param cloud_instance_id + if err := r.SetPathParam("cloud_instance_id", o.CloudInstanceID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/power/client/p_cloud_volume_groups/pcloud_volumegroups_post_responses.go b/power/client/p_cloud_volume_groups/pcloud_volumegroups_post_responses.go new file mode 100644 index 00000000..bee3d631 --- /dev/null +++ b/power/client/p_cloud_volume_groups/pcloud_volumegroups_post_responses.go @@ -0,0 +1,295 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package p_cloud_volume_groups + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// PcloudVolumegroupsPostReader is a Reader for the PcloudVolumegroupsPost structure. +type PcloudVolumegroupsPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PcloudVolumegroupsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 202: + result := NewPcloudVolumegroupsPostAccepted() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewPcloudVolumegroupsPostBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewPcloudVolumegroupsPostUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewPcloudVolumegroupsPostConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewPcloudVolumegroupsPostUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPcloudVolumegroupsPostInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 504: + result := NewPcloudVolumegroupsPostGatewayTimeout() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewPcloudVolumegroupsPostAccepted creates a PcloudVolumegroupsPostAccepted with default headers values +func NewPcloudVolumegroupsPostAccepted() *PcloudVolumegroupsPostAccepted { + return &PcloudVolumegroupsPostAccepted{} +} + +/* PcloudVolumegroupsPostAccepted describes a response with status code 202, with default header values. + +Accepted +*/ +type PcloudVolumegroupsPostAccepted struct { + Payload *models.VolumeGroupCreateResponse +} + +func (o *PcloudVolumegroupsPostAccepted) Error() string { + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostAccepted %+v", 202, o.Payload) +} +func (o *PcloudVolumegroupsPostAccepted) GetPayload() *models.VolumeGroupCreateResponse { + return o.Payload +} + +func (o *PcloudVolumegroupsPostAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.VolumeGroupCreateResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudVolumegroupsPostBadRequest creates a PcloudVolumegroupsPostBadRequest with default headers values +func NewPcloudVolumegroupsPostBadRequest() *PcloudVolumegroupsPostBadRequest { + return &PcloudVolumegroupsPostBadRequest{} +} + +/* PcloudVolumegroupsPostBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type PcloudVolumegroupsPostBadRequest struct { + Payload *models.Error +} + +func (o *PcloudVolumegroupsPostBadRequest) Error() string { + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostBadRequest %+v", 400, o.Payload) +} +func (o *PcloudVolumegroupsPostBadRequest) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudVolumegroupsPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudVolumegroupsPostUnauthorized creates a PcloudVolumegroupsPostUnauthorized with default headers values +func NewPcloudVolumegroupsPostUnauthorized() *PcloudVolumegroupsPostUnauthorized { + return &PcloudVolumegroupsPostUnauthorized{} +} + +/* PcloudVolumegroupsPostUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type PcloudVolumegroupsPostUnauthorized struct { + Payload *models.Error +} + +func (o *PcloudVolumegroupsPostUnauthorized) Error() string { + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostUnauthorized %+v", 401, o.Payload) +} +func (o *PcloudVolumegroupsPostUnauthorized) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudVolumegroupsPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudVolumegroupsPostConflict creates a PcloudVolumegroupsPostConflict with default headers values +func NewPcloudVolumegroupsPostConflict() *PcloudVolumegroupsPostConflict { + return &PcloudVolumegroupsPostConflict{} +} + +/* PcloudVolumegroupsPostConflict describes a response with status code 409, with default header values. + +Conflict +*/ +type PcloudVolumegroupsPostConflict struct { + Payload *models.Error +} + +func (o *PcloudVolumegroupsPostConflict) Error() string { + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostConflict %+v", 409, o.Payload) +} +func (o *PcloudVolumegroupsPostConflict) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudVolumegroupsPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudVolumegroupsPostUnprocessableEntity creates a PcloudVolumegroupsPostUnprocessableEntity with default headers values +func NewPcloudVolumegroupsPostUnprocessableEntity() *PcloudVolumegroupsPostUnprocessableEntity { + return &PcloudVolumegroupsPostUnprocessableEntity{} +} + +/* PcloudVolumegroupsPostUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity +*/ +type PcloudVolumegroupsPostUnprocessableEntity struct { + Payload *models.Error +} + +func (o *PcloudVolumegroupsPostUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostUnprocessableEntity %+v", 422, o.Payload) +} +func (o *PcloudVolumegroupsPostUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudVolumegroupsPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudVolumegroupsPostInternalServerError creates a PcloudVolumegroupsPostInternalServerError with default headers values +func NewPcloudVolumegroupsPostInternalServerError() *PcloudVolumegroupsPostInternalServerError { + return &PcloudVolumegroupsPostInternalServerError{} +} + +/* PcloudVolumegroupsPostInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type PcloudVolumegroupsPostInternalServerError struct { + Payload *models.Error +} + +func (o *PcloudVolumegroupsPostInternalServerError) Error() string { + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostInternalServerError %+v", 500, o.Payload) +} +func (o *PcloudVolumegroupsPostInternalServerError) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudVolumegroupsPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPcloudVolumegroupsPostGatewayTimeout creates a PcloudVolumegroupsPostGatewayTimeout with default headers values +func NewPcloudVolumegroupsPostGatewayTimeout() *PcloudVolumegroupsPostGatewayTimeout { + return &PcloudVolumegroupsPostGatewayTimeout{} +} + +/* PcloudVolumegroupsPostGatewayTimeout describes a response with status code 504, with default header values. + +Gateway Timeout. Request is still processing and taking longer than expected. +*/ +type PcloudVolumegroupsPostGatewayTimeout struct { + Payload *models.Error +} + +func (o *PcloudVolumegroupsPostGatewayTimeout) Error() string { + return fmt.Sprintf("[POST /pcloud/v1/cloud-instances/{cloud_instance_id}/volume-groups][%d] pcloudVolumegroupsPostGatewayTimeout %+v", 504, o.Payload) +} +func (o *PcloudVolumegroupsPostGatewayTimeout) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudVolumegroupsPostGatewayTimeout) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_action_post_responses.go b/power/client/p_cloud_volumes/pcloud_cloudinstances_volumes_action_post_responses.go index 24d75e2c..11e70e85 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 @@ -47,6 +47,12 @@ func (o *PcloudCloudinstancesVolumesActionPostReader) ReadResponse(response runt return nil, err } return nil, result + case 409: + result := NewPcloudCloudinstancesVolumesActionPostConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result case 500: result := NewPcloudCloudinstancesVolumesActionPostInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -184,6 +190,38 @@ func (o *PcloudCloudinstancesVolumesActionPostNotFound) readResponse(response ru return nil } +// NewPcloudCloudinstancesVolumesActionPostConflict creates a PcloudCloudinstancesVolumesActionPostConflict with default headers values +func NewPcloudCloudinstancesVolumesActionPostConflict() *PcloudCloudinstancesVolumesActionPostConflict { + return &PcloudCloudinstancesVolumesActionPostConflict{} +} + +/* PcloudCloudinstancesVolumesActionPostConflict describes a response with status code 409, with default header values. + +Conflict +*/ +type PcloudCloudinstancesVolumesActionPostConflict struct { + Payload *models.Error +} + +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) +} +func (o *PcloudCloudinstancesVolumesActionPostConflict) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudCloudinstancesVolumesActionPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudCloudinstancesVolumesActionPostInternalServerError creates a PcloudCloudinstancesVolumesActionPostInternalServerError with default headers values func NewPcloudCloudinstancesVolumesActionPostInternalServerError() *PcloudCloudinstancesVolumesActionPostInternalServerError { return &PcloudCloudinstancesVolumesActionPostInternalServerError{} 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 e7c8a6c5..38479deb 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 @@ -47,6 +47,12 @@ func (o *PcloudV2PvminstancesVolumesPostReader) ReadResponse(response runtime.Cl return nil, err } return nil, result + case 409: + result := NewPcloudV2PvminstancesVolumesPostConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result case 500: result := NewPcloudV2PvminstancesVolumesPostInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -186,6 +192,38 @@ func (o *PcloudV2PvminstancesVolumesPostNotFound) readResponse(response runtime. return nil } +// NewPcloudV2PvminstancesVolumesPostConflict creates a PcloudV2PvminstancesVolumesPostConflict with default headers values +func NewPcloudV2PvminstancesVolumesPostConflict() *PcloudV2PvminstancesVolumesPostConflict { + return &PcloudV2PvminstancesVolumesPostConflict{} +} + +/* PcloudV2PvminstancesVolumesPostConflict describes a response with status code 409, with default header values. + +Conflict +*/ +type PcloudV2PvminstancesVolumesPostConflict struct { + Payload *models.Error +} + +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) +} +func (o *PcloudV2PvminstancesVolumesPostConflict) GetPayload() *models.Error { + return o.Payload +} + +func (o *PcloudV2PvminstancesVolumesPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + // NewPcloudV2PvminstancesVolumesPostInternalServerError creates a PcloudV2PvminstancesVolumesPostInternalServerError with default headers values func NewPcloudV2PvminstancesVolumesPostInternalServerError() *PcloudV2PvminstancesVolumesPostInternalServerError { return &PcloudV2PvminstancesVolumesPostInternalServerError{} diff --git a/power/client/power_iaas_api_client.go b/power/client/power_iaas_api_client.go index 3a172e39..d79ff0a3 100644 --- a/power/client/power_iaas_api_client.go +++ b/power/client/power_iaas_api_client.go @@ -27,7 +27,7 @@ import ( "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_placement_groups" "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_s_a_p" "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_service_d_h_c_p" - "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_shared_proc_pools" + "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_shared_processor_pools" "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_snapshots" "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_storage_capacity" "github.com/IBM-Cloud/power-go-client/power/client/p_cloud_system_pools" @@ -103,7 +103,7 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *PowerIaasA cli.PCloudPlacementGroups = p_cloud_placement_groups.New(transport, formats) cli.PCloudsap = p_cloud_s_a_p.New(transport, formats) cli.PCloudServicedhcp = p_cloud_service_d_h_c_p.New(transport, formats) - cli.PCloudSharedProcPools = p_cloud_shared_proc_pools.New(transport, formats) + cli.PCloudSharedProcessorPools = p_cloud_shared_processor_pools.New(transport, formats) cli.PCloudSnapshots = p_cloud_snapshots.New(transport, formats) cli.PCloudStorageCapacity = p_cloud_storage_capacity.New(transport, formats) cli.PCloudSystemPools = p_cloud_system_pools.New(transport, formats) @@ -196,7 +196,7 @@ type PowerIaasAPI struct { PCloudServicedhcp p_cloud_service_d_h_c_p.ClientService - PCloudSharedProcPools p_cloud_shared_proc_pools.ClientService + PCloudSharedProcessorPools p_cloud_shared_processor_pools.ClientService PCloudSnapshots p_cloud_snapshots.ClientService @@ -249,7 +249,7 @@ func (c *PowerIaasAPI) SetTransport(transport runtime.ClientTransport) { c.PCloudPlacementGroups.SetTransport(transport) c.PCloudsap.SetTransport(transport) c.PCloudServicedhcp.SetTransport(transport) - c.PCloudSharedProcPools.SetTransport(transport) + c.PCloudSharedProcessorPools.SetTransport(transport) c.PCloudSnapshots.SetTransport(transport) c.PCloudStorageCapacity.SetTransport(transport) c.PCloudSystemPools.SetTransport(transport) diff --git a/power/models/shared_proc_pool.go b/power/models/shared_processor_pool.go similarity index 71% rename from power/models/shared_proc_pool.go rename to power/models/shared_processor_pool.go index 3807f33f..41b487e4 100644 --- a/power/models/shared_proc_pool.go +++ b/power/models/shared_processor_pool.go @@ -14,10 +14,10 @@ import ( "github.com/go-openapi/validate" ) -// SharedProcPool shared proc pool +// SharedProcessorPool shared processor pool // -// swagger:model SharedProcPool -type SharedProcPool struct { +// swagger:model SharedProcessorPool +type SharedProcessorPool struct { // The available processor units for the Shared Processor Pool Available float64 `json:"available,omitempty"` @@ -47,8 +47,8 @@ type SharedProcPool struct { Utilization float64 `json:"utilization,omitempty"` } -// Validate validates this shared proc pool -func (m *SharedProcPool) Validate(formats strfmt.Registry) error { +// Validate validates this shared processor pool +func (m *SharedProcessorPool) Validate(formats strfmt.Registry) error { var res []error if err := m.validateID(formats); err != nil { @@ -69,7 +69,7 @@ func (m *SharedProcPool) Validate(formats strfmt.Registry) error { return nil } -func (m *SharedProcPool) validateID(formats strfmt.Registry) error { +func (m *SharedProcessorPool) validateID(formats strfmt.Registry) error { if err := validate.Required("id", "body", m.ID); err != nil { return err @@ -78,7 +78,7 @@ func (m *SharedProcPool) validateID(formats strfmt.Registry) error { return nil } -func (m *SharedProcPool) validateMaxProcUnits(formats strfmt.Registry) error { +func (m *SharedProcessorPool) validateMaxProcUnits(formats strfmt.Registry) error { if err := validate.Required("maxProcUnits", "body", m.MaxProcUnits); err != nil { return err @@ -87,7 +87,7 @@ func (m *SharedProcPool) validateMaxProcUnits(formats strfmt.Registry) error { return nil } -func (m *SharedProcPool) validateName(formats strfmt.Registry) error { +func (m *SharedProcessorPool) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { return err @@ -96,13 +96,13 @@ func (m *SharedProcPool) validateName(formats strfmt.Registry) error { return nil } -// ContextValidate validates this shared proc pool based on context it is used -func (m *SharedProcPool) ContextValidate(ctx context.Context, formats strfmt.Registry) error { +// ContextValidate validates this shared processor pool based on context it is used +func (m *SharedProcessorPool) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (m *SharedProcPool) MarshalBinary() ([]byte, error) { +func (m *SharedProcessorPool) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -110,8 +110,8 @@ func (m *SharedProcPool) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *SharedProcPool) UnmarshalBinary(b []byte) error { - var res SharedProcPool +func (m *SharedProcessorPool) UnmarshalBinary(b []byte) error { + var res SharedProcessorPool if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/power/models/shared_proc_pool_create.go b/power/models/shared_processor_pool_create.go similarity index 64% rename from power/models/shared_proc_pool_create.go rename to power/models/shared_processor_pool_create.go index e05b5b42..646e40e8 100644 --- a/power/models/shared_proc_pool_create.go +++ b/power/models/shared_processor_pool_create.go @@ -14,10 +14,10 @@ import ( "github.com/go-openapi/validate" ) -// SharedProcPoolCreate shared proc pool create +// SharedProcessorPoolCreate shared processor pool create // -// swagger:model SharedProcPoolCreate -type SharedProcPoolCreate struct { +// swagger:model SharedProcessorPoolCreate +type SharedProcessorPoolCreate struct { // The host group where the host will be chosen if not provided // Required: true @@ -27,7 +27,7 @@ type SharedProcPoolCreate struct { // Required: true MaxProcUnits *float64 `json:"maxProcUnits"` - // The name of the Processor Pool + // The name of the Shared Processor Pool // Required: true Name *string `json:"name"` @@ -35,8 +35,8 @@ type SharedProcPoolCreate struct { PlacementGroupID string `json:"placementGroupID,omitempty"` } -// Validate validates this shared proc pool create -func (m *SharedProcPoolCreate) Validate(formats strfmt.Registry) error { +// Validate validates this shared processor pool create +func (m *SharedProcessorPoolCreate) Validate(formats strfmt.Registry) error { var res []error if err := m.validateHostGroup(formats); err != nil { @@ -57,7 +57,7 @@ func (m *SharedProcPoolCreate) Validate(formats strfmt.Registry) error { return nil } -func (m *SharedProcPoolCreate) validateHostGroup(formats strfmt.Registry) error { +func (m *SharedProcessorPoolCreate) validateHostGroup(formats strfmt.Registry) error { if err := validate.Required("hostGroup", "body", m.HostGroup); err != nil { return err @@ -66,7 +66,7 @@ func (m *SharedProcPoolCreate) validateHostGroup(formats strfmt.Registry) error return nil } -func (m *SharedProcPoolCreate) validateMaxProcUnits(formats strfmt.Registry) error { +func (m *SharedProcessorPoolCreate) validateMaxProcUnits(formats strfmt.Registry) error { if err := validate.Required("maxProcUnits", "body", m.MaxProcUnits); err != nil { return err @@ -75,7 +75,7 @@ func (m *SharedProcPoolCreate) validateMaxProcUnits(formats strfmt.Registry) err return nil } -func (m *SharedProcPoolCreate) validateName(formats strfmt.Registry) error { +func (m *SharedProcessorPoolCreate) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { return err @@ -84,13 +84,13 @@ func (m *SharedProcPoolCreate) validateName(formats strfmt.Registry) error { return nil } -// ContextValidate validates this shared proc pool create based on context it is used -func (m *SharedProcPoolCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { +// ContextValidate validates this shared processor pool create based on context it is used +func (m *SharedProcessorPoolCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation -func (m *SharedProcPoolCreate) MarshalBinary() ([]byte, error) { +func (m *SharedProcessorPoolCreate) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -98,8 +98,8 @@ func (m *SharedProcPoolCreate) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *SharedProcPoolCreate) UnmarshalBinary(b []byte) error { - var res SharedProcPoolCreate +func (m *SharedProcessorPoolCreate) UnmarshalBinary(b []byte) error { + var res SharedProcessorPoolCreate if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/power/models/volume_group_create.go b/power/models/volume_group_create.go new file mode 100644 index 00000000..dffb0ae9 --- /dev/null +++ b/power/models/volume_group_create.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// VolumeGroupCreate volume group create +// +// swagger:model VolumeGroupCreate +type VolumeGroupCreate struct { + + // storage volume group name. This is required to onboard existing voluem group on the target site for DR set up. + ConsistencyGroupName string `json:"consistencyGroupName,omitempty"` + + // name of the volume group. This field is required for creation of new volume group. + Name string `json:"name,omitempty"` + + // List of volume IDs,member of VolumeGroup + // Required: true + VolumeIDs []string `json:"volumeIDs"` +} + +// Validate validates this volume group create +func (m *VolumeGroupCreate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateVolumeIDs(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VolumeGroupCreate) validateVolumeIDs(formats strfmt.Registry) error { + + if err := validate.Required("volumeIDs", "body", m.VolumeIDs); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this volume group create based on context it is used +func (m *VolumeGroupCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *VolumeGroupCreate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VolumeGroupCreate) UnmarshalBinary(b []byte) error { + var res VolumeGroupCreate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/power/models/volume_group_create_response.go b/power/models/volume_group_create_response.go new file mode 100644 index 00000000..e5d183ed --- /dev/null +++ b/power/models/volume_group_create_response.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" +) + +// VolumeGroupCreateResponse volume group create response +// +// swagger:model VolumeGroupCreateResponse +type VolumeGroupCreateResponse struct { + + // The ID of the volume group + // Required: true + ID *string `json:"id"` + + // name of the volume group + // Required: true + Name *string `json:"name"` +} + +// Validate validates this volume group create response +func (m *VolumeGroupCreateResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VolumeGroupCreateResponse) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +func (m *VolumeGroupCreateResponse) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this volume group create response based on context it is used +func (m *VolumeGroupCreateResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *VolumeGroupCreateResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VolumeGroupCreateResponse) UnmarshalBinary(b []byte) error { + var res VolumeGroupCreateResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +}