From a49a1e4fae0612036219c5ce65f60fbfc62f8a60 Mon Sep 17 00:00:00 2001 From: powervs-ibm Date: Thu, 21 Mar 2024 12:59:13 +0000 Subject: [PATCH] Generated Swagger client from service-broker commit e98a290ebdfbe53e5fec9ff5100a299bc77a6014 --- .../host_groups_client.go} | 82 +-- .../v1_available_hosts_parameters.go | 2 +- .../v1_available_hosts_responses.go | 2 +- .../v1_host_groups_get_parameters.go | 128 ++++ .../v1_host_groups_get_responses.go | 471 +++++++++++++ .../v1_host_groups_id_get_parameters.go | 151 +++++ .../v1_host_groups_id_get_responses.go | 547 +++++++++++++++ .../v1_host_groups_id_put_parameters.go | 175 +++++ .../v1_host_groups_id_put_responses.go | 621 ++++++++++++++++++ .../v1_host_groups_post_parameters.go | 153 +++++ .../v1_host_groups_post_responses.go | 621 ++++++++++++++++++ .../v1_hosts_get_parameters.go | 2 +- .../v1_hosts_get_responses.go | 2 +- .../v1_hosts_id_delete_parameters.go | 2 +- .../v1_hosts_id_delete_responses.go | 2 +- .../v1_hosts_id_get_parameters.go | 2 +- .../v1_hosts_id_get_responses.go | 2 +- .../v1_hosts_id_put_parameters.go | 2 +- .../v1_hosts_id_put_responses.go | 2 +- .../v1_hosts_post_parameters.go | 4 +- .../v1_hosts_post_responses.go | 10 +- .../v1_hostgroups_get_parameters.go | 128 ---- .../hostgroups/v1_hostgroups_get_responses.go | 471 ------------- .../v1_hostgroups_id_get_parameters.go | 151 ----- .../v1_hostgroups_id_get_responses.go | 547 --------------- .../v1_hostgroups_id_put_parameters.go | 175 ----- .../v1_hostgroups_id_put_responses.go | 621 ------------------ .../v1_hostgroups_post_parameters.go | 153 ----- .../v1_hostgroups_post_responses.go | 621 ------------------ .../p_cloud_volumes/p_cloud_volumes_client.go | 18 +- power/client/power_iaas_api_client.go | 8 +- power/models/add_host.go | 2 +- power/models/available_host.go | 2 +- power/models/available_host_capacity.go | 160 +++++ .../available_host_resource_capacity.go | 50 ++ power/models/create_cos_image_import_job.go | 51 ++ power/models/host.go | 49 +- power/models/host_available_capacity.go | 53 -- power/models/host_capacity.go | 127 +++- power/models/host_create.go | 78 ++- power/models/{hostgroup.go => host_group.go} | 36 +- ...stgroup_create.go => host_group_create.go} | 36 +- .../{hostgroup_list.go => host_group_list.go} | 14 +- ...oup_share_op.go => host_group_share_op.go} | 28 +- power/models/host_group_summary.go | 56 ++ power/models/host_resource_capacity.go | 59 ++ power/models/hostgroup_href.go | 27 - power/models/image_import_details.go | 205 ++++++ power/models/p_vm_instance_create.go | 4 +- power/models/s_a_p_create.go | 2 +- power/models/s_a_p_profile.go | 3 + power/models/secondary.go | 6 +- power/models/volumes_clone_async_request.go | 1 + power/models/volumes_clone_execute.go | 1 + power/models/volumes_clone_request.go | 1 + 55 files changed, 3777 insertions(+), 3150 deletions(-) rename power/client/{hostgroups/hostgroups_client.go => host_groups/host_groups_client.go} (83%) rename power/client/{hostgroups => host_groups}/v1_available_hosts_parameters.go (99%) rename power/client/{hostgroups => host_groups}/v1_available_hosts_responses.go (99%) create mode 100644 power/client/host_groups/v1_host_groups_get_parameters.go create mode 100644 power/client/host_groups/v1_host_groups_get_responses.go create mode 100644 power/client/host_groups/v1_host_groups_id_get_parameters.go create mode 100644 power/client/host_groups/v1_host_groups_id_get_responses.go create mode 100644 power/client/host_groups/v1_host_groups_id_put_parameters.go create mode 100644 power/client/host_groups/v1_host_groups_id_put_responses.go create mode 100644 power/client/host_groups/v1_host_groups_post_parameters.go create mode 100644 power/client/host_groups/v1_host_groups_post_responses.go rename power/client/{hostgroups => host_groups}/v1_hosts_get_parameters.go (99%) rename power/client/{hostgroups => host_groups}/v1_hosts_get_responses.go (99%) rename power/client/{hostgroups => host_groups}/v1_hosts_id_delete_parameters.go (99%) rename power/client/{hostgroups => host_groups}/v1_hosts_id_delete_responses.go (99%) rename power/client/{hostgroups => host_groups}/v1_hosts_id_get_parameters.go (99%) rename power/client/{hostgroups => host_groups}/v1_hosts_id_get_responses.go (99%) rename power/client/{hostgroups => host_groups}/v1_hosts_id_put_parameters.go (99%) rename power/client/{hostgroups => host_groups}/v1_hosts_id_put_responses.go (99%) rename power/client/{hostgroups => host_groups}/v1_hosts_post_parameters.go (98%) rename power/client/{hostgroups => host_groups}/v1_hosts_post_responses.go (98%) delete mode 100644 power/client/hostgroups/v1_hostgroups_get_parameters.go delete mode 100644 power/client/hostgroups/v1_hostgroups_get_responses.go delete mode 100644 power/client/hostgroups/v1_hostgroups_id_get_parameters.go delete mode 100644 power/client/hostgroups/v1_hostgroups_id_get_responses.go delete mode 100644 power/client/hostgroups/v1_hostgroups_id_put_parameters.go delete mode 100644 power/client/hostgroups/v1_hostgroups_id_put_responses.go delete mode 100644 power/client/hostgroups/v1_hostgroups_post_parameters.go delete mode 100644 power/client/hostgroups/v1_hostgroups_post_responses.go create mode 100644 power/models/available_host_capacity.go create mode 100644 power/models/available_host_resource_capacity.go delete mode 100644 power/models/host_available_capacity.go rename power/models/{hostgroup.go => host_group.go} (74%) rename power/models/{hostgroup_create.go => host_group_create.go} (78%) rename power/models/{hostgroup_list.go => host_group_list.go} (79%) rename power/models/{hostgroup_share_op.go => host_group_share_op.go} (72%) create mode 100644 power/models/host_group_summary.go create mode 100644 power/models/host_resource_capacity.go delete mode 100644 power/models/hostgroup_href.go create mode 100644 power/models/image_import_details.go diff --git a/power/client/hostgroups/hostgroups_client.go b/power/client/host_groups/host_groups_client.go similarity index 83% rename from power/client/hostgroups/hostgroups_client.go rename to power/client/host_groups/host_groups_client.go index 19daf7c8..9ccc05d1 100644 --- a/power/client/hostgroups/hostgroups_client.go +++ b/power/client/host_groups/host_groups_client.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +package host_groups // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command @@ -12,13 +12,13 @@ import ( "github.com/go-openapi/strfmt" ) -// New creates a new hostgroups API client. +// New creates a new host groups API client. func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { return &Client{transport: transport, formats: formats} } /* -Client for hostgroups API +Client for host groups API */ type Client struct { transport runtime.ClientTransport @@ -32,13 +32,13 @@ type ClientOption func(*runtime.ClientOperation) type ClientService interface { V1AvailableHosts(params *V1AvailableHostsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1AvailableHostsOK, error) - V1HostgroupsGet(params *V1HostgroupsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostgroupsGetOK, error) + V1HostGroupsGet(params *V1HostGroupsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostGroupsGetOK, error) - V1HostgroupsIDGet(params *V1HostgroupsIDGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostgroupsIDGetOK, error) + V1HostGroupsIDGet(params *V1HostGroupsIDGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostGroupsIDGetOK, error) - V1HostgroupsIDPut(params *V1HostgroupsIDPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostgroupsIDPutOK, error) + V1HostGroupsIDPut(params *V1HostGroupsIDPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostGroupsIDPutOK, error) - V1HostgroupsPost(params *V1HostgroupsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostgroupsPostCreated, error) + V1HostGroupsPost(params *V1HostGroupsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostGroupsPostCreated, error) V1HostsGet(params *V1HostsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostsGetOK, error) @@ -93,22 +93,22 @@ func (a *Client) V1AvailableHosts(params *V1AvailableHostsParams, authInfo runti } /* -V1HostgroupsGet gets the list of hostgroups for the workspace +V1HostGroupsGet gets the list of host groups for the workspace */ -func (a *Client) V1HostgroupsGet(params *V1HostgroupsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostgroupsGetOK, error) { +func (a *Client) V1HostGroupsGet(params *V1HostGroupsGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostGroupsGetOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewV1HostgroupsGetParams() + params = NewV1HostGroupsGetParams() } op := &runtime.ClientOperation{ - ID: "v1.hostgroups.get", + ID: "v1.hostGroups.get", Method: "GET", - PathPattern: "/v1/hostgroups", + PathPattern: "/v1/host-groups", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &V1HostgroupsGetReader{formats: a.formats}, + Reader: &V1HostGroupsGetReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -121,33 +121,33 @@ func (a *Client) V1HostgroupsGet(params *V1HostgroupsGetParams, authInfo runtime if err != nil { return nil, err } - success, ok := result.(*V1HostgroupsGetOK) + success, ok := result.(*V1HostGroupsGetOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for v1.hostgroups.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for v1.hostGroups.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -V1HostgroupsIDGet gets the details of a hostgroup +V1HostGroupsIDGet gets the details of a host group */ -func (a *Client) V1HostgroupsIDGet(params *V1HostgroupsIDGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostgroupsIDGetOK, error) { +func (a *Client) V1HostGroupsIDGet(params *V1HostGroupsIDGetParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostGroupsIDGetOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewV1HostgroupsIDGetParams() + params = NewV1HostGroupsIDGetParams() } op := &runtime.ClientOperation{ - ID: "v1.hostgroups.id.get", + ID: "v1.hostGroups.id.get", Method: "GET", - PathPattern: "/v1/hostgroups/{hostgroup_id}", + PathPattern: "/v1/host-groups/{host_group_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &V1HostgroupsIDGetReader{formats: a.formats}, + Reader: &V1HostGroupsIDGetReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -160,33 +160,33 @@ func (a *Client) V1HostgroupsIDGet(params *V1HostgroupsIDGetParams, authInfo run if err != nil { return nil, err } - success, ok := result.(*V1HostgroupsIDGetOK) + success, ok := result.(*V1HostGroupsIDGetOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for v1.hostgroups.id.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for v1.hostGroups.id.get: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -V1HostgroupsIDPut shares unshare a hostgroup with another workspace +V1HostGroupsIDPut shares unshare a host group with another workspace */ -func (a *Client) V1HostgroupsIDPut(params *V1HostgroupsIDPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostgroupsIDPutOK, error) { +func (a *Client) V1HostGroupsIDPut(params *V1HostGroupsIDPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostGroupsIDPutOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewV1HostgroupsIDPutParams() + params = NewV1HostGroupsIDPutParams() } op := &runtime.ClientOperation{ - ID: "v1.hostgroups.id.put", + ID: "v1.hostGroups.id.put", Method: "PUT", - PathPattern: "/v1/hostgroups/{hostgroup_id}", + PathPattern: "/v1/host-groups/{host_group_id}", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &V1HostgroupsIDPutReader{formats: a.formats}, + Reader: &V1HostGroupsIDPutReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -199,33 +199,33 @@ func (a *Client) V1HostgroupsIDPut(params *V1HostgroupsIDPutParams, authInfo run if err != nil { return nil, err } - success, ok := result.(*V1HostgroupsIDPutOK) + success, ok := result.(*V1HostGroupsIDPutOK) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for v1.hostgroups.id.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for v1.hostGroups.id.put: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } /* -V1HostgroupsPost creates a hostgroup with one or more host +V1HostGroupsPost creates a host group with one or more host */ -func (a *Client) V1HostgroupsPost(params *V1HostgroupsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostgroupsPostCreated, error) { +func (a *Client) V1HostGroupsPost(params *V1HostGroupsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostGroupsPostCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewV1HostgroupsPostParams() + params = NewV1HostGroupsPostParams() } op := &runtime.ClientOperation{ - ID: "v1.hostgroups.post", + ID: "v1.hostGroups.post", Method: "POST", - PathPattern: "/v1/hostgroups", + PathPattern: "/v1/host-groups", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &V1HostgroupsPostReader{formats: a.formats}, + Reader: &V1HostGroupsPostReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -238,13 +238,13 @@ func (a *Client) V1HostgroupsPost(params *V1HostgroupsPostParams, authInfo runti if err != nil { return nil, err } - success, ok := result.(*V1HostgroupsPostCreated) + success, ok := result.(*V1HostGroupsPostCreated) if ok { return success, nil } // unexpected success response // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for v1.hostgroups.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) + msg := fmt.Sprintf("unexpected success response for v1.hostGroups.post: API contract not enforced by server. Client expected to get an error, but got: %T", result) panic(msg) } @@ -288,7 +288,7 @@ func (a *Client) V1HostsGet(params *V1HostsGetParams, authInfo runtime.ClientAut } /* -V1HostsIDDelete releases a host from its hostgroup +V1HostsIDDelete releases a host from its host group */ func (a *Client) V1HostsIDDelete(params *V1HostsIDDeleteParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostsIDDeleteAccepted, error) { // TODO: Validate the params before sending @@ -405,7 +405,7 @@ func (a *Client) V1HostsIDPut(params *V1HostsIDPutParams, authInfo runtime.Clien } /* -V1HostsPost adds new host s to an existing hostgroup +V1HostsPost adds new host s to an existing host group */ func (a *Client) V1HostsPost(params *V1HostsPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*V1HostsPostCreated, error) { // TODO: Validate the params before sending diff --git a/power/client/hostgroups/v1_available_hosts_parameters.go b/power/client/host_groups/v1_available_hosts_parameters.go similarity index 99% rename from power/client/hostgroups/v1_available_hosts_parameters.go rename to power/client/host_groups/v1_available_hosts_parameters.go index f2c3babf..8a26b9cd 100644 --- a/power/client/hostgroups/v1_available_hosts_parameters.go +++ b/power/client/host_groups/v1_available_hosts_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +package host_groups // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command diff --git a/power/client/hostgroups/v1_available_hosts_responses.go b/power/client/host_groups/v1_available_hosts_responses.go similarity index 99% rename from power/client/hostgroups/v1_available_hosts_responses.go rename to power/client/host_groups/v1_available_hosts_responses.go index a591b6e1..8ef00909 100644 --- a/power/client/hostgroups/v1_available_hosts_responses.go +++ b/power/client/host_groups/v1_available_hosts_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +package host_groups // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command diff --git a/power/client/host_groups/v1_host_groups_get_parameters.go b/power/client/host_groups/v1_host_groups_get_parameters.go new file mode 100644 index 00000000..91bf33de --- /dev/null +++ b/power/client/host_groups/v1_host_groups_get_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package host_groups + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewV1HostGroupsGetParams creates a new V1HostGroupsGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewV1HostGroupsGetParams() *V1HostGroupsGetParams { + return &V1HostGroupsGetParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewV1HostGroupsGetParamsWithTimeout creates a new V1HostGroupsGetParams object +// with the ability to set a timeout on a request. +func NewV1HostGroupsGetParamsWithTimeout(timeout time.Duration) *V1HostGroupsGetParams { + return &V1HostGroupsGetParams{ + timeout: timeout, + } +} + +// NewV1HostGroupsGetParamsWithContext creates a new V1HostGroupsGetParams object +// with the ability to set a context for a request. +func NewV1HostGroupsGetParamsWithContext(ctx context.Context) *V1HostGroupsGetParams { + return &V1HostGroupsGetParams{ + Context: ctx, + } +} + +// NewV1HostGroupsGetParamsWithHTTPClient creates a new V1HostGroupsGetParams object +// with the ability to set a custom HTTPClient for a request. +func NewV1HostGroupsGetParamsWithHTTPClient(client *http.Client) *V1HostGroupsGetParams { + return &V1HostGroupsGetParams{ + HTTPClient: client, + } +} + +/* +V1HostGroupsGetParams contains all the parameters to send to the API endpoint + + for the v1 host groups get operation. + + Typically these are written to a http.Request. +*/ +type V1HostGroupsGetParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the v1 host groups get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *V1HostGroupsGetParams) WithDefaults() *V1HostGroupsGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the v1 host groups get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *V1HostGroupsGetParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the v1 host groups get params +func (o *V1HostGroupsGetParams) WithTimeout(timeout time.Duration) *V1HostGroupsGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the v1 host groups get params +func (o *V1HostGroupsGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the v1 host groups get params +func (o *V1HostGroupsGetParams) WithContext(ctx context.Context) *V1HostGroupsGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the v1 host groups get params +func (o *V1HostGroupsGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the v1 host groups get params +func (o *V1HostGroupsGetParams) WithHTTPClient(client *http.Client) *V1HostGroupsGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the v1 host groups get params +func (o *V1HostGroupsGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *V1HostGroupsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/power/client/host_groups/v1_host_groups_get_responses.go b/power/client/host_groups/v1_host_groups_get_responses.go new file mode 100644 index 00000000..8801484f --- /dev/null +++ b/power/client/host_groups/v1_host_groups_get_responses.go @@ -0,0 +1,471 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package host_groups + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// V1HostGroupsGetReader is a Reader for the V1HostGroupsGet structure. +type V1HostGroupsGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *V1HostGroupsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewV1HostGroupsGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewV1HostGroupsGetBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewV1HostGroupsGetUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewV1HostGroupsGetForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewV1HostGroupsGetInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 504: + result := NewV1HostGroupsGetGatewayTimeout() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /v1/host-groups] v1.hostGroups.get", response, response.Code()) + } +} + +// NewV1HostGroupsGetOK creates a V1HostGroupsGetOK with default headers values +func NewV1HostGroupsGetOK() *V1HostGroupsGetOK { + return &V1HostGroupsGetOK{} +} + +/* +V1HostGroupsGetOK describes a response with status code 200, with default header values. + +OK +*/ +type V1HostGroupsGetOK struct { + Payload models.HostGroupList +} + +// IsSuccess returns true when this v1 host groups get o k response has a 2xx status code +func (o *V1HostGroupsGetOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this v1 host groups get o k response has a 3xx status code +func (o *V1HostGroupsGetOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 host groups get o k response has a 4xx status code +func (o *V1HostGroupsGetOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this v1 host groups get o k response has a 5xx status code +func (o *V1HostGroupsGetOK) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 host groups get o k response a status code equal to that given +func (o *V1HostGroupsGetOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the v1 host groups get o k response +func (o *V1HostGroupsGetOK) Code() int { + return 200 +} + +func (o *V1HostGroupsGetOK) Error() string { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetOK %+v", 200, o.Payload) +} + +func (o *V1HostGroupsGetOK) String() string { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetOK %+v", 200, o.Payload) +} + +func (o *V1HostGroupsGetOK) GetPayload() models.HostGroupList { + return o.Payload +} + +func (o *V1HostGroupsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewV1HostGroupsGetBadRequest creates a V1HostGroupsGetBadRequest with default headers values +func NewV1HostGroupsGetBadRequest() *V1HostGroupsGetBadRequest { + return &V1HostGroupsGetBadRequest{} +} + +/* +V1HostGroupsGetBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type V1HostGroupsGetBadRequest struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 host groups get bad request response has a 2xx status code +func (o *V1HostGroupsGetBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 host groups get bad request response has a 3xx status code +func (o *V1HostGroupsGetBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 host groups get bad request response has a 4xx status code +func (o *V1HostGroupsGetBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 host groups get bad request response has a 5xx status code +func (o *V1HostGroupsGetBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 host groups get bad request response a status code equal to that given +func (o *V1HostGroupsGetBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the v1 host groups get bad request response +func (o *V1HostGroupsGetBadRequest) Code() int { + return 400 +} + +func (o *V1HostGroupsGetBadRequest) Error() string { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetBadRequest %+v", 400, o.Payload) +} + +func (o *V1HostGroupsGetBadRequest) String() string { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetBadRequest %+v", 400, o.Payload) +} + +func (o *V1HostGroupsGetBadRequest) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1HostGroupsGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewV1HostGroupsGetUnauthorized creates a V1HostGroupsGetUnauthorized with default headers values +func NewV1HostGroupsGetUnauthorized() *V1HostGroupsGetUnauthorized { + return &V1HostGroupsGetUnauthorized{} +} + +/* +V1HostGroupsGetUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type V1HostGroupsGetUnauthorized struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 host groups get unauthorized response has a 2xx status code +func (o *V1HostGroupsGetUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 host groups get unauthorized response has a 3xx status code +func (o *V1HostGroupsGetUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 host groups get unauthorized response has a 4xx status code +func (o *V1HostGroupsGetUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 host groups get unauthorized response has a 5xx status code +func (o *V1HostGroupsGetUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 host groups get unauthorized response a status code equal to that given +func (o *V1HostGroupsGetUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the v1 host groups get unauthorized response +func (o *V1HostGroupsGetUnauthorized) Code() int { + return 401 +} + +func (o *V1HostGroupsGetUnauthorized) Error() string { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetUnauthorized %+v", 401, o.Payload) +} + +func (o *V1HostGroupsGetUnauthorized) String() string { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetUnauthorized %+v", 401, o.Payload) +} + +func (o *V1HostGroupsGetUnauthorized) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1HostGroupsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewV1HostGroupsGetForbidden creates a V1HostGroupsGetForbidden with default headers values +func NewV1HostGroupsGetForbidden() *V1HostGroupsGetForbidden { + return &V1HostGroupsGetForbidden{} +} + +/* +V1HostGroupsGetForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type V1HostGroupsGetForbidden struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 host groups get forbidden response has a 2xx status code +func (o *V1HostGroupsGetForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 host groups get forbidden response has a 3xx status code +func (o *V1HostGroupsGetForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 host groups get forbidden response has a 4xx status code +func (o *V1HostGroupsGetForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 host groups get forbidden response has a 5xx status code +func (o *V1HostGroupsGetForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 host groups get forbidden response a status code equal to that given +func (o *V1HostGroupsGetForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the v1 host groups get forbidden response +func (o *V1HostGroupsGetForbidden) Code() int { + return 403 +} + +func (o *V1HostGroupsGetForbidden) Error() string { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetForbidden %+v", 403, o.Payload) +} + +func (o *V1HostGroupsGetForbidden) String() string { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetForbidden %+v", 403, o.Payload) +} + +func (o *V1HostGroupsGetForbidden) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1HostGroupsGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewV1HostGroupsGetInternalServerError creates a V1HostGroupsGetInternalServerError with default headers values +func NewV1HostGroupsGetInternalServerError() *V1HostGroupsGetInternalServerError { + return &V1HostGroupsGetInternalServerError{} +} + +/* +V1HostGroupsGetInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type V1HostGroupsGetInternalServerError struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 host groups get internal server error response has a 2xx status code +func (o *V1HostGroupsGetInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 host groups get internal server error response has a 3xx status code +func (o *V1HostGroupsGetInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 host groups get internal server error response has a 4xx status code +func (o *V1HostGroupsGetInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this v1 host groups get internal server error response has a 5xx status code +func (o *V1HostGroupsGetInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this v1 host groups get internal server error response a status code equal to that given +func (o *V1HostGroupsGetInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the v1 host groups get internal server error response +func (o *V1HostGroupsGetInternalServerError) Code() int { + return 500 +} + +func (o *V1HostGroupsGetInternalServerError) Error() string { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetInternalServerError %+v", 500, o.Payload) +} + +func (o *V1HostGroupsGetInternalServerError) String() string { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetInternalServerError %+v", 500, o.Payload) +} + +func (o *V1HostGroupsGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1HostGroupsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewV1HostGroupsGetGatewayTimeout creates a V1HostGroupsGetGatewayTimeout with default headers values +func NewV1HostGroupsGetGatewayTimeout() *V1HostGroupsGetGatewayTimeout { + return &V1HostGroupsGetGatewayTimeout{} +} + +/* +V1HostGroupsGetGatewayTimeout describes a response with status code 504, with default header values. + +Gateway Timeout. Request is still processing and taking longer than expected. +*/ +type V1HostGroupsGetGatewayTimeout struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 host groups get gateway timeout response has a 2xx status code +func (o *V1HostGroupsGetGatewayTimeout) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 host groups get gateway timeout response has a 3xx status code +func (o *V1HostGroupsGetGatewayTimeout) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 host groups get gateway timeout response has a 4xx status code +func (o *V1HostGroupsGetGatewayTimeout) IsClientError() bool { + return false +} + +// IsServerError returns true when this v1 host groups get gateway timeout response has a 5xx status code +func (o *V1HostGroupsGetGatewayTimeout) IsServerError() bool { + return true +} + +// IsCode returns true when this v1 host groups get gateway timeout response a status code equal to that given +func (o *V1HostGroupsGetGatewayTimeout) IsCode(code int) bool { + return code == 504 +} + +// Code gets the status code for the v1 host groups get gateway timeout response +func (o *V1HostGroupsGetGatewayTimeout) Code() int { + return 504 +} + +func (o *V1HostGroupsGetGatewayTimeout) Error() string { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetGatewayTimeout %+v", 504, o.Payload) +} + +func (o *V1HostGroupsGetGatewayTimeout) String() string { + return fmt.Sprintf("[GET /v1/host-groups][%d] v1HostGroupsGetGatewayTimeout %+v", 504, o.Payload) +} + +func (o *V1HostGroupsGetGatewayTimeout) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1HostGroupsGetGatewayTimeout) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/power/client/host_groups/v1_host_groups_id_get_parameters.go b/power/client/host_groups/v1_host_groups_id_get_parameters.go new file mode 100644 index 00000000..2952b90a --- /dev/null +++ b/power/client/host_groups/v1_host_groups_id_get_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package host_groups + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewV1HostGroupsIDGetParams creates a new V1HostGroupsIDGetParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewV1HostGroupsIDGetParams() *V1HostGroupsIDGetParams { + return &V1HostGroupsIDGetParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewV1HostGroupsIDGetParamsWithTimeout creates a new V1HostGroupsIDGetParams object +// with the ability to set a timeout on a request. +func NewV1HostGroupsIDGetParamsWithTimeout(timeout time.Duration) *V1HostGroupsIDGetParams { + return &V1HostGroupsIDGetParams{ + timeout: timeout, + } +} + +// NewV1HostGroupsIDGetParamsWithContext creates a new V1HostGroupsIDGetParams object +// with the ability to set a context for a request. +func NewV1HostGroupsIDGetParamsWithContext(ctx context.Context) *V1HostGroupsIDGetParams { + return &V1HostGroupsIDGetParams{ + Context: ctx, + } +} + +// NewV1HostGroupsIDGetParamsWithHTTPClient creates a new V1HostGroupsIDGetParams object +// with the ability to set a custom HTTPClient for a request. +func NewV1HostGroupsIDGetParamsWithHTTPClient(client *http.Client) *V1HostGroupsIDGetParams { + return &V1HostGroupsIDGetParams{ + HTTPClient: client, + } +} + +/* +V1HostGroupsIDGetParams contains all the parameters to send to the API endpoint + + for the v1 host groups id get operation. + + Typically these are written to a http.Request. +*/ +type V1HostGroupsIDGetParams struct { + + /* HostGroupID. + + Hostgroup ID + */ + HostGroupID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the v1 host groups id get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *V1HostGroupsIDGetParams) WithDefaults() *V1HostGroupsIDGetParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the v1 host groups id get params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *V1HostGroupsIDGetParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the v1 host groups id get params +func (o *V1HostGroupsIDGetParams) WithTimeout(timeout time.Duration) *V1HostGroupsIDGetParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the v1 host groups id get params +func (o *V1HostGroupsIDGetParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the v1 host groups id get params +func (o *V1HostGroupsIDGetParams) WithContext(ctx context.Context) *V1HostGroupsIDGetParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the v1 host groups id get params +func (o *V1HostGroupsIDGetParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the v1 host groups id get params +func (o *V1HostGroupsIDGetParams) WithHTTPClient(client *http.Client) *V1HostGroupsIDGetParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the v1 host groups id get params +func (o *V1HostGroupsIDGetParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithHostGroupID adds the hostGroupID to the v1 host groups id get params +func (o *V1HostGroupsIDGetParams) WithHostGroupID(hostGroupID string) *V1HostGroupsIDGetParams { + o.SetHostGroupID(hostGroupID) + return o +} + +// SetHostGroupID adds the hostGroupId to the v1 host groups id get params +func (o *V1HostGroupsIDGetParams) SetHostGroupID(hostGroupID string) { + o.HostGroupID = hostGroupID +} + +// WriteToRequest writes these params to a swagger request +func (o *V1HostGroupsIDGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param host_group_id + if err := r.SetPathParam("host_group_id", o.HostGroupID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/power/client/host_groups/v1_host_groups_id_get_responses.go b/power/client/host_groups/v1_host_groups_id_get_responses.go new file mode 100644 index 00000000..72b372e7 --- /dev/null +++ b/power/client/host_groups/v1_host_groups_id_get_responses.go @@ -0,0 +1,547 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package host_groups + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// V1HostGroupsIDGetReader is a Reader for the V1HostGroupsIDGet structure. +type V1HostGroupsIDGetReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *V1HostGroupsIDGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewV1HostGroupsIDGetOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewV1HostGroupsIDGetBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewV1HostGroupsIDGetUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewV1HostGroupsIDGetForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewV1HostGroupsIDGetNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewV1HostGroupsIDGetInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 504: + result := NewV1HostGroupsIDGetGatewayTimeout() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /v1/host-groups/{host_group_id}] v1.hostGroups.id.get", response, response.Code()) + } +} + +// NewV1HostGroupsIDGetOK creates a V1HostGroupsIDGetOK with default headers values +func NewV1HostGroupsIDGetOK() *V1HostGroupsIDGetOK { + return &V1HostGroupsIDGetOK{} +} + +/* +V1HostGroupsIDGetOK describes a response with status code 200, with default header values. + +OK +*/ +type V1HostGroupsIDGetOK struct { + Payload *models.HostGroup +} + +// IsSuccess returns true when this v1 host groups Id get o k response has a 2xx status code +func (o *V1HostGroupsIDGetOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this v1 host groups Id get o k response has a 3xx status code +func (o *V1HostGroupsIDGetOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 host groups Id get o k response has a 4xx status code +func (o *V1HostGroupsIDGetOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this v1 host groups Id get o k response has a 5xx status code +func (o *V1HostGroupsIDGetOK) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 host groups Id get o k response a status code equal to that given +func (o *V1HostGroupsIDGetOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the v1 host groups Id get o k response +func (o *V1HostGroupsIDGetOK) Code() int { + return 200 +} + +func (o *V1HostGroupsIDGetOK) Error() string { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetOK %+v", 200, o.Payload) +} + +func (o *V1HostGroupsIDGetOK) String() string { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetOK %+v", 200, o.Payload) +} + +func (o *V1HostGroupsIDGetOK) GetPayload() *models.HostGroup { + return o.Payload +} + +func (o *V1HostGroupsIDGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HostGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewV1HostGroupsIDGetBadRequest creates a V1HostGroupsIDGetBadRequest with default headers values +func NewV1HostGroupsIDGetBadRequest() *V1HostGroupsIDGetBadRequest { + return &V1HostGroupsIDGetBadRequest{} +} + +/* +V1HostGroupsIDGetBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type V1HostGroupsIDGetBadRequest struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 host groups Id get bad request response has a 2xx status code +func (o *V1HostGroupsIDGetBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 host groups Id get bad request response has a 3xx status code +func (o *V1HostGroupsIDGetBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 host groups Id get bad request response has a 4xx status code +func (o *V1HostGroupsIDGetBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 host groups Id get bad request response has a 5xx status code +func (o *V1HostGroupsIDGetBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 host groups Id get bad request response a status code equal to that given +func (o *V1HostGroupsIDGetBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the v1 host groups Id get bad request response +func (o *V1HostGroupsIDGetBadRequest) Code() int { + return 400 +} + +func (o *V1HostGroupsIDGetBadRequest) Error() string { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetBadRequest %+v", 400, o.Payload) +} + +func (o *V1HostGroupsIDGetBadRequest) String() string { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetBadRequest %+v", 400, o.Payload) +} + +func (o *V1HostGroupsIDGetBadRequest) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1HostGroupsIDGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewV1HostGroupsIDGetUnauthorized creates a V1HostGroupsIDGetUnauthorized with default headers values +func NewV1HostGroupsIDGetUnauthorized() *V1HostGroupsIDGetUnauthorized { + return &V1HostGroupsIDGetUnauthorized{} +} + +/* +V1HostGroupsIDGetUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type V1HostGroupsIDGetUnauthorized struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 host groups Id get unauthorized response has a 2xx status code +func (o *V1HostGroupsIDGetUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 host groups Id get unauthorized response has a 3xx status code +func (o *V1HostGroupsIDGetUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 host groups Id get unauthorized response has a 4xx status code +func (o *V1HostGroupsIDGetUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 host groups Id get unauthorized response has a 5xx status code +func (o *V1HostGroupsIDGetUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 host groups Id get unauthorized response a status code equal to that given +func (o *V1HostGroupsIDGetUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the v1 host groups Id get unauthorized response +func (o *V1HostGroupsIDGetUnauthorized) Code() int { + return 401 +} + +func (o *V1HostGroupsIDGetUnauthorized) Error() string { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetUnauthorized %+v", 401, o.Payload) +} + +func (o *V1HostGroupsIDGetUnauthorized) String() string { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetUnauthorized %+v", 401, o.Payload) +} + +func (o *V1HostGroupsIDGetUnauthorized) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1HostGroupsIDGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewV1HostGroupsIDGetForbidden creates a V1HostGroupsIDGetForbidden with default headers values +func NewV1HostGroupsIDGetForbidden() *V1HostGroupsIDGetForbidden { + return &V1HostGroupsIDGetForbidden{} +} + +/* +V1HostGroupsIDGetForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type V1HostGroupsIDGetForbidden struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 host groups Id get forbidden response has a 2xx status code +func (o *V1HostGroupsIDGetForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 host groups Id get forbidden response has a 3xx status code +func (o *V1HostGroupsIDGetForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 host groups Id get forbidden response has a 4xx status code +func (o *V1HostGroupsIDGetForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 host groups Id get forbidden response has a 5xx status code +func (o *V1HostGroupsIDGetForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 host groups Id get forbidden response a status code equal to that given +func (o *V1HostGroupsIDGetForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the v1 host groups Id get forbidden response +func (o *V1HostGroupsIDGetForbidden) Code() int { + return 403 +} + +func (o *V1HostGroupsIDGetForbidden) Error() string { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetForbidden %+v", 403, o.Payload) +} + +func (o *V1HostGroupsIDGetForbidden) String() string { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetForbidden %+v", 403, o.Payload) +} + +func (o *V1HostGroupsIDGetForbidden) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1HostGroupsIDGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewV1HostGroupsIDGetNotFound creates a V1HostGroupsIDGetNotFound with default headers values +func NewV1HostGroupsIDGetNotFound() *V1HostGroupsIDGetNotFound { + return &V1HostGroupsIDGetNotFound{} +} + +/* +V1HostGroupsIDGetNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type V1HostGroupsIDGetNotFound struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 host groups Id get not found response has a 2xx status code +func (o *V1HostGroupsIDGetNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 host groups Id get not found response has a 3xx status code +func (o *V1HostGroupsIDGetNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 host groups Id get not found response has a 4xx status code +func (o *V1HostGroupsIDGetNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 host groups Id get not found response has a 5xx status code +func (o *V1HostGroupsIDGetNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 host groups Id get not found response a status code equal to that given +func (o *V1HostGroupsIDGetNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the v1 host groups Id get not found response +func (o *V1HostGroupsIDGetNotFound) Code() int { + return 404 +} + +func (o *V1HostGroupsIDGetNotFound) Error() string { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetNotFound %+v", 404, o.Payload) +} + +func (o *V1HostGroupsIDGetNotFound) String() string { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetNotFound %+v", 404, o.Payload) +} + +func (o *V1HostGroupsIDGetNotFound) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1HostGroupsIDGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewV1HostGroupsIDGetInternalServerError creates a V1HostGroupsIDGetInternalServerError with default headers values +func NewV1HostGroupsIDGetInternalServerError() *V1HostGroupsIDGetInternalServerError { + return &V1HostGroupsIDGetInternalServerError{} +} + +/* +V1HostGroupsIDGetInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type V1HostGroupsIDGetInternalServerError struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 host groups Id get internal server error response has a 2xx status code +func (o *V1HostGroupsIDGetInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 host groups Id get internal server error response has a 3xx status code +func (o *V1HostGroupsIDGetInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 host groups Id get internal server error response has a 4xx status code +func (o *V1HostGroupsIDGetInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this v1 host groups Id get internal server error response has a 5xx status code +func (o *V1HostGroupsIDGetInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this v1 host groups Id get internal server error response a status code equal to that given +func (o *V1HostGroupsIDGetInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the v1 host groups Id get internal server error response +func (o *V1HostGroupsIDGetInternalServerError) Code() int { + return 500 +} + +func (o *V1HostGroupsIDGetInternalServerError) Error() string { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetInternalServerError %+v", 500, o.Payload) +} + +func (o *V1HostGroupsIDGetInternalServerError) String() string { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetInternalServerError %+v", 500, o.Payload) +} + +func (o *V1HostGroupsIDGetInternalServerError) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1HostGroupsIDGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewV1HostGroupsIDGetGatewayTimeout creates a V1HostGroupsIDGetGatewayTimeout with default headers values +func NewV1HostGroupsIDGetGatewayTimeout() *V1HostGroupsIDGetGatewayTimeout { + return &V1HostGroupsIDGetGatewayTimeout{} +} + +/* +V1HostGroupsIDGetGatewayTimeout describes a response with status code 504, with default header values. + +Gateway Timeout. Request is still processing and taking longer than expected. +*/ +type V1HostGroupsIDGetGatewayTimeout struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 host groups Id get gateway timeout response has a 2xx status code +func (o *V1HostGroupsIDGetGatewayTimeout) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 host groups Id get gateway timeout response has a 3xx status code +func (o *V1HostGroupsIDGetGatewayTimeout) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 host groups Id get gateway timeout response has a 4xx status code +func (o *V1HostGroupsIDGetGatewayTimeout) IsClientError() bool { + return false +} + +// IsServerError returns true when this v1 host groups Id get gateway timeout response has a 5xx status code +func (o *V1HostGroupsIDGetGatewayTimeout) IsServerError() bool { + return true +} + +// IsCode returns true when this v1 host groups Id get gateway timeout response a status code equal to that given +func (o *V1HostGroupsIDGetGatewayTimeout) IsCode(code int) bool { + return code == 504 +} + +// Code gets the status code for the v1 host groups Id get gateway timeout response +func (o *V1HostGroupsIDGetGatewayTimeout) Code() int { + return 504 +} + +func (o *V1HostGroupsIDGetGatewayTimeout) Error() string { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetGatewayTimeout %+v", 504, o.Payload) +} + +func (o *V1HostGroupsIDGetGatewayTimeout) String() string { + return fmt.Sprintf("[GET /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdGetGatewayTimeout %+v", 504, o.Payload) +} + +func (o *V1HostGroupsIDGetGatewayTimeout) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1HostGroupsIDGetGatewayTimeout) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/power/client/host_groups/v1_host_groups_id_put_parameters.go b/power/client/host_groups/v1_host_groups_id_put_parameters.go new file mode 100644 index 00000000..02a106c1 --- /dev/null +++ b/power/client/host_groups/v1_host_groups_id_put_parameters.go @@ -0,0 +1,175 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package host_groups + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// NewV1HostGroupsIDPutParams creates a new V1HostGroupsIDPutParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewV1HostGroupsIDPutParams() *V1HostGroupsIDPutParams { + return &V1HostGroupsIDPutParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewV1HostGroupsIDPutParamsWithTimeout creates a new V1HostGroupsIDPutParams object +// with the ability to set a timeout on a request. +func NewV1HostGroupsIDPutParamsWithTimeout(timeout time.Duration) *V1HostGroupsIDPutParams { + return &V1HostGroupsIDPutParams{ + timeout: timeout, + } +} + +// NewV1HostGroupsIDPutParamsWithContext creates a new V1HostGroupsIDPutParams object +// with the ability to set a context for a request. +func NewV1HostGroupsIDPutParamsWithContext(ctx context.Context) *V1HostGroupsIDPutParams { + return &V1HostGroupsIDPutParams{ + Context: ctx, + } +} + +// NewV1HostGroupsIDPutParamsWithHTTPClient creates a new V1HostGroupsIDPutParams object +// with the ability to set a custom HTTPClient for a request. +func NewV1HostGroupsIDPutParamsWithHTTPClient(client *http.Client) *V1HostGroupsIDPutParams { + return &V1HostGroupsIDPutParams{ + HTTPClient: client, + } +} + +/* +V1HostGroupsIDPutParams contains all the parameters to send to the API endpoint + + for the v1 host groups id put operation. + + Typically these are written to a http.Request. +*/ +type V1HostGroupsIDPutParams struct { + + /* Body. + + Parameters to set the sharing status of the host group + */ + Body *models.HostGroupShareOp + + /* HostGroupID. + + Hostgroup ID + */ + HostGroupID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the v1 host groups id put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *V1HostGroupsIDPutParams) WithDefaults() *V1HostGroupsIDPutParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the v1 host groups id put params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *V1HostGroupsIDPutParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the v1 host groups id put params +func (o *V1HostGroupsIDPutParams) WithTimeout(timeout time.Duration) *V1HostGroupsIDPutParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the v1 host groups id put params +func (o *V1HostGroupsIDPutParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the v1 host groups id put params +func (o *V1HostGroupsIDPutParams) WithContext(ctx context.Context) *V1HostGroupsIDPutParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the v1 host groups id put params +func (o *V1HostGroupsIDPutParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the v1 host groups id put params +func (o *V1HostGroupsIDPutParams) WithHTTPClient(client *http.Client) *V1HostGroupsIDPutParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the v1 host groups id put params +func (o *V1HostGroupsIDPutParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the v1 host groups id put params +func (o *V1HostGroupsIDPutParams) WithBody(body *models.HostGroupShareOp) *V1HostGroupsIDPutParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the v1 host groups id put params +func (o *V1HostGroupsIDPutParams) SetBody(body *models.HostGroupShareOp) { + o.Body = body +} + +// WithHostGroupID adds the hostGroupID to the v1 host groups id put params +func (o *V1HostGroupsIDPutParams) WithHostGroupID(hostGroupID string) *V1HostGroupsIDPutParams { + o.SetHostGroupID(hostGroupID) + return o +} + +// SetHostGroupID adds the hostGroupId to the v1 host groups id put params +func (o *V1HostGroupsIDPutParams) SetHostGroupID(hostGroupID string) { + o.HostGroupID = hostGroupID +} + +// WriteToRequest writes these params to a swagger request +func (o *V1HostGroupsIDPutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // path param host_group_id + if err := r.SetPathParam("host_group_id", o.HostGroupID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/power/client/host_groups/v1_host_groups_id_put_responses.go b/power/client/host_groups/v1_host_groups_id_put_responses.go new file mode 100644 index 00000000..126854de --- /dev/null +++ b/power/client/host_groups/v1_host_groups_id_put_responses.go @@ -0,0 +1,621 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package host_groups + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// V1HostGroupsIDPutReader is a Reader for the V1HostGroupsIDPut structure. +type V1HostGroupsIDPutReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *V1HostGroupsIDPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewV1HostGroupsIDPutOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewV1HostGroupsIDPutBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewV1HostGroupsIDPutUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewV1HostGroupsIDPutForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewV1HostGroupsIDPutNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewV1HostGroupsIDPutConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewV1HostGroupsIDPutInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 504: + result := NewV1HostGroupsIDPutGatewayTimeout() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[PUT /v1/host-groups/{host_group_id}] v1.hostGroups.id.put", response, response.Code()) + } +} + +// NewV1HostGroupsIDPutOK creates a V1HostGroupsIDPutOK with default headers values +func NewV1HostGroupsIDPutOK() *V1HostGroupsIDPutOK { + return &V1HostGroupsIDPutOK{} +} + +/* +V1HostGroupsIDPutOK describes a response with status code 200, with default header values. + +OK +*/ +type V1HostGroupsIDPutOK struct { + Payload *models.HostGroup +} + +// IsSuccess returns true when this v1 host groups Id put o k response has a 2xx status code +func (o *V1HostGroupsIDPutOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this v1 host groups Id put o k response has a 3xx status code +func (o *V1HostGroupsIDPutOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 host groups Id put o k response has a 4xx status code +func (o *V1HostGroupsIDPutOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this v1 host groups Id put o k response has a 5xx status code +func (o *V1HostGroupsIDPutOK) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 host groups Id put o k response a status code equal to that given +func (o *V1HostGroupsIDPutOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the v1 host groups Id put o k response +func (o *V1HostGroupsIDPutOK) Code() int { + return 200 +} + +func (o *V1HostGroupsIDPutOK) Error() string { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutOK %+v", 200, o.Payload) +} + +func (o *V1HostGroupsIDPutOK) String() string { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutOK %+v", 200, o.Payload) +} + +func (o *V1HostGroupsIDPutOK) GetPayload() *models.HostGroup { + return o.Payload +} + +func (o *V1HostGroupsIDPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HostGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewV1HostGroupsIDPutBadRequest creates a V1HostGroupsIDPutBadRequest with default headers values +func NewV1HostGroupsIDPutBadRequest() *V1HostGroupsIDPutBadRequest { + return &V1HostGroupsIDPutBadRequest{} +} + +/* +V1HostGroupsIDPutBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type V1HostGroupsIDPutBadRequest struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 host groups Id put bad request response has a 2xx status code +func (o *V1HostGroupsIDPutBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 host groups Id put bad request response has a 3xx status code +func (o *V1HostGroupsIDPutBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 host groups Id put bad request response has a 4xx status code +func (o *V1HostGroupsIDPutBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 host groups Id put bad request response has a 5xx status code +func (o *V1HostGroupsIDPutBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 host groups Id put bad request response a status code equal to that given +func (o *V1HostGroupsIDPutBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the v1 host groups Id put bad request response +func (o *V1HostGroupsIDPutBadRequest) Code() int { + return 400 +} + +func (o *V1HostGroupsIDPutBadRequest) Error() string { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutBadRequest %+v", 400, o.Payload) +} + +func (o *V1HostGroupsIDPutBadRequest) String() string { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutBadRequest %+v", 400, o.Payload) +} + +func (o *V1HostGroupsIDPutBadRequest) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1HostGroupsIDPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewV1HostGroupsIDPutUnauthorized creates a V1HostGroupsIDPutUnauthorized with default headers values +func NewV1HostGroupsIDPutUnauthorized() *V1HostGroupsIDPutUnauthorized { + return &V1HostGroupsIDPutUnauthorized{} +} + +/* +V1HostGroupsIDPutUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type V1HostGroupsIDPutUnauthorized struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 host groups Id put unauthorized response has a 2xx status code +func (o *V1HostGroupsIDPutUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 host groups Id put unauthorized response has a 3xx status code +func (o *V1HostGroupsIDPutUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 host groups Id put unauthorized response has a 4xx status code +func (o *V1HostGroupsIDPutUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 host groups Id put unauthorized response has a 5xx status code +func (o *V1HostGroupsIDPutUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 host groups Id put unauthorized response a status code equal to that given +func (o *V1HostGroupsIDPutUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the v1 host groups Id put unauthorized response +func (o *V1HostGroupsIDPutUnauthorized) Code() int { + return 401 +} + +func (o *V1HostGroupsIDPutUnauthorized) Error() string { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutUnauthorized %+v", 401, o.Payload) +} + +func (o *V1HostGroupsIDPutUnauthorized) String() string { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutUnauthorized %+v", 401, o.Payload) +} + +func (o *V1HostGroupsIDPutUnauthorized) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1HostGroupsIDPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewV1HostGroupsIDPutForbidden creates a V1HostGroupsIDPutForbidden with default headers values +func NewV1HostGroupsIDPutForbidden() *V1HostGroupsIDPutForbidden { + return &V1HostGroupsIDPutForbidden{} +} + +/* +V1HostGroupsIDPutForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type V1HostGroupsIDPutForbidden struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 host groups Id put forbidden response has a 2xx status code +func (o *V1HostGroupsIDPutForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 host groups Id put forbidden response has a 3xx status code +func (o *V1HostGroupsIDPutForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 host groups Id put forbidden response has a 4xx status code +func (o *V1HostGroupsIDPutForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 host groups Id put forbidden response has a 5xx status code +func (o *V1HostGroupsIDPutForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 host groups Id put forbidden response a status code equal to that given +func (o *V1HostGroupsIDPutForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the v1 host groups Id put forbidden response +func (o *V1HostGroupsIDPutForbidden) Code() int { + return 403 +} + +func (o *V1HostGroupsIDPutForbidden) Error() string { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutForbidden %+v", 403, o.Payload) +} + +func (o *V1HostGroupsIDPutForbidden) String() string { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutForbidden %+v", 403, o.Payload) +} + +func (o *V1HostGroupsIDPutForbidden) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1HostGroupsIDPutForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewV1HostGroupsIDPutNotFound creates a V1HostGroupsIDPutNotFound with default headers values +func NewV1HostGroupsIDPutNotFound() *V1HostGroupsIDPutNotFound { + return &V1HostGroupsIDPutNotFound{} +} + +/* +V1HostGroupsIDPutNotFound describes a response with status code 404, with default header values. + +Not Found +*/ +type V1HostGroupsIDPutNotFound struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 host groups Id put not found response has a 2xx status code +func (o *V1HostGroupsIDPutNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 host groups Id put not found response has a 3xx status code +func (o *V1HostGroupsIDPutNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 host groups Id put not found response has a 4xx status code +func (o *V1HostGroupsIDPutNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 host groups Id put not found response has a 5xx status code +func (o *V1HostGroupsIDPutNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 host groups Id put not found response a status code equal to that given +func (o *V1HostGroupsIDPutNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the v1 host groups Id put not found response +func (o *V1HostGroupsIDPutNotFound) Code() int { + return 404 +} + +func (o *V1HostGroupsIDPutNotFound) Error() string { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutNotFound %+v", 404, o.Payload) +} + +func (o *V1HostGroupsIDPutNotFound) String() string { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutNotFound %+v", 404, o.Payload) +} + +func (o *V1HostGroupsIDPutNotFound) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1HostGroupsIDPutNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewV1HostGroupsIDPutConflict creates a V1HostGroupsIDPutConflict with default headers values +func NewV1HostGroupsIDPutConflict() *V1HostGroupsIDPutConflict { + return &V1HostGroupsIDPutConflict{} +} + +/* +V1HostGroupsIDPutConflict describes a response with status code 409, with default header values. + +Conflict +*/ +type V1HostGroupsIDPutConflict struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 host groups Id put conflict response has a 2xx status code +func (o *V1HostGroupsIDPutConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 host groups Id put conflict response has a 3xx status code +func (o *V1HostGroupsIDPutConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 host groups Id put conflict response has a 4xx status code +func (o *V1HostGroupsIDPutConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 host groups Id put conflict response has a 5xx status code +func (o *V1HostGroupsIDPutConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 host groups Id put conflict response a status code equal to that given +func (o *V1HostGroupsIDPutConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the v1 host groups Id put conflict response +func (o *V1HostGroupsIDPutConflict) Code() int { + return 409 +} + +func (o *V1HostGroupsIDPutConflict) Error() string { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutConflict %+v", 409, o.Payload) +} + +func (o *V1HostGroupsIDPutConflict) String() string { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutConflict %+v", 409, o.Payload) +} + +func (o *V1HostGroupsIDPutConflict) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1HostGroupsIDPutConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewV1HostGroupsIDPutInternalServerError creates a V1HostGroupsIDPutInternalServerError with default headers values +func NewV1HostGroupsIDPutInternalServerError() *V1HostGroupsIDPutInternalServerError { + return &V1HostGroupsIDPutInternalServerError{} +} + +/* +V1HostGroupsIDPutInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type V1HostGroupsIDPutInternalServerError struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 host groups Id put internal server error response has a 2xx status code +func (o *V1HostGroupsIDPutInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 host groups Id put internal server error response has a 3xx status code +func (o *V1HostGroupsIDPutInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 host groups Id put internal server error response has a 4xx status code +func (o *V1HostGroupsIDPutInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this v1 host groups Id put internal server error response has a 5xx status code +func (o *V1HostGroupsIDPutInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this v1 host groups Id put internal server error response a status code equal to that given +func (o *V1HostGroupsIDPutInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the v1 host groups Id put internal server error response +func (o *V1HostGroupsIDPutInternalServerError) Code() int { + return 500 +} + +func (o *V1HostGroupsIDPutInternalServerError) Error() string { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutInternalServerError %+v", 500, o.Payload) +} + +func (o *V1HostGroupsIDPutInternalServerError) String() string { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutInternalServerError %+v", 500, o.Payload) +} + +func (o *V1HostGroupsIDPutInternalServerError) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1HostGroupsIDPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewV1HostGroupsIDPutGatewayTimeout creates a V1HostGroupsIDPutGatewayTimeout with default headers values +func NewV1HostGroupsIDPutGatewayTimeout() *V1HostGroupsIDPutGatewayTimeout { + return &V1HostGroupsIDPutGatewayTimeout{} +} + +/* +V1HostGroupsIDPutGatewayTimeout describes a response with status code 504, with default header values. + +Gateway Timeout. Request is still processing and taking longer than expected. +*/ +type V1HostGroupsIDPutGatewayTimeout struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 host groups Id put gateway timeout response has a 2xx status code +func (o *V1HostGroupsIDPutGatewayTimeout) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 host groups Id put gateway timeout response has a 3xx status code +func (o *V1HostGroupsIDPutGatewayTimeout) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 host groups Id put gateway timeout response has a 4xx status code +func (o *V1HostGroupsIDPutGatewayTimeout) IsClientError() bool { + return false +} + +// IsServerError returns true when this v1 host groups Id put gateway timeout response has a 5xx status code +func (o *V1HostGroupsIDPutGatewayTimeout) IsServerError() bool { + return true +} + +// IsCode returns true when this v1 host groups Id put gateway timeout response a status code equal to that given +func (o *V1HostGroupsIDPutGatewayTimeout) IsCode(code int) bool { + return code == 504 +} + +// Code gets the status code for the v1 host groups Id put gateway timeout response +func (o *V1HostGroupsIDPutGatewayTimeout) Code() int { + return 504 +} + +func (o *V1HostGroupsIDPutGatewayTimeout) Error() string { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutGatewayTimeout %+v", 504, o.Payload) +} + +func (o *V1HostGroupsIDPutGatewayTimeout) String() string { + return fmt.Sprintf("[PUT /v1/host-groups/{host_group_id}][%d] v1HostGroupsIdPutGatewayTimeout %+v", 504, o.Payload) +} + +func (o *V1HostGroupsIDPutGatewayTimeout) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1HostGroupsIDPutGatewayTimeout) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/power/client/host_groups/v1_host_groups_post_parameters.go b/power/client/host_groups/v1_host_groups_post_parameters.go new file mode 100644 index 00000000..f75d2a3a --- /dev/null +++ b/power/client/host_groups/v1_host_groups_post_parameters.go @@ -0,0 +1,153 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package host_groups + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// NewV1HostGroupsPostParams creates a new V1HostGroupsPostParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewV1HostGroupsPostParams() *V1HostGroupsPostParams { + return &V1HostGroupsPostParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewV1HostGroupsPostParamsWithTimeout creates a new V1HostGroupsPostParams object +// with the ability to set a timeout on a request. +func NewV1HostGroupsPostParamsWithTimeout(timeout time.Duration) *V1HostGroupsPostParams { + return &V1HostGroupsPostParams{ + timeout: timeout, + } +} + +// NewV1HostGroupsPostParamsWithContext creates a new V1HostGroupsPostParams object +// with the ability to set a context for a request. +func NewV1HostGroupsPostParamsWithContext(ctx context.Context) *V1HostGroupsPostParams { + return &V1HostGroupsPostParams{ + Context: ctx, + } +} + +// NewV1HostGroupsPostParamsWithHTTPClient creates a new V1HostGroupsPostParams object +// with the ability to set a custom HTTPClient for a request. +func NewV1HostGroupsPostParamsWithHTTPClient(client *http.Client) *V1HostGroupsPostParams { + return &V1HostGroupsPostParams{ + HTTPClient: client, + } +} + +/* +V1HostGroupsPostParams contains all the parameters to send to the API endpoint + + for the v1 host groups post operation. + + Typically these are written to a http.Request. +*/ +type V1HostGroupsPostParams struct { + + /* Body. + + Parameters for the creation of a new host group + */ + Body *models.HostGroupCreate + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the v1 host groups post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *V1HostGroupsPostParams) WithDefaults() *V1HostGroupsPostParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the v1 host groups post params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *V1HostGroupsPostParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the v1 host groups post params +func (o *V1HostGroupsPostParams) WithTimeout(timeout time.Duration) *V1HostGroupsPostParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the v1 host groups post params +func (o *V1HostGroupsPostParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the v1 host groups post params +func (o *V1HostGroupsPostParams) WithContext(ctx context.Context) *V1HostGroupsPostParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the v1 host groups post params +func (o *V1HostGroupsPostParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the v1 host groups post params +func (o *V1HostGroupsPostParams) WithHTTPClient(client *http.Client) *V1HostGroupsPostParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the v1 host groups post params +func (o *V1HostGroupsPostParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the v1 host groups post params +func (o *V1HostGroupsPostParams) WithBody(body *models.HostGroupCreate) *V1HostGroupsPostParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the v1 host groups post params +func (o *V1HostGroupsPostParams) SetBody(body *models.HostGroupCreate) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *V1HostGroupsPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/power/client/host_groups/v1_host_groups_post_responses.go b/power/client/host_groups/v1_host_groups_post_responses.go new file mode 100644 index 00000000..18415773 --- /dev/null +++ b/power/client/host_groups/v1_host_groups_post_responses.go @@ -0,0 +1,621 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package host_groups + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/IBM-Cloud/power-go-client/power/models" +) + +// V1HostGroupsPostReader is a Reader for the V1HostGroupsPost structure. +type V1HostGroupsPostReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *V1HostGroupsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewV1HostGroupsPostCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewV1HostGroupsPostBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewV1HostGroupsPostUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewV1HostGroupsPostForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewV1HostGroupsPostConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewV1HostGroupsPostUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewV1HostGroupsPostInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 504: + result := NewV1HostGroupsPostGatewayTimeout() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /v1/host-groups] v1.hostGroups.post", response, response.Code()) + } +} + +// NewV1HostGroupsPostCreated creates a V1HostGroupsPostCreated with default headers values +func NewV1HostGroupsPostCreated() *V1HostGroupsPostCreated { + return &V1HostGroupsPostCreated{} +} + +/* +V1HostGroupsPostCreated describes a response with status code 201, with default header values. + +Created +*/ +type V1HostGroupsPostCreated struct { + Payload *models.HostGroup +} + +// IsSuccess returns true when this v1 host groups post created response has a 2xx status code +func (o *V1HostGroupsPostCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this v1 host groups post created response has a 3xx status code +func (o *V1HostGroupsPostCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 host groups post created response has a 4xx status code +func (o *V1HostGroupsPostCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this v1 host groups post created response has a 5xx status code +func (o *V1HostGroupsPostCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 host groups post created response a status code equal to that given +func (o *V1HostGroupsPostCreated) IsCode(code int) bool { + return code == 201 +} + +// Code gets the status code for the v1 host groups post created response +func (o *V1HostGroupsPostCreated) Code() int { + return 201 +} + +func (o *V1HostGroupsPostCreated) Error() string { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostCreated %+v", 201, o.Payload) +} + +func (o *V1HostGroupsPostCreated) String() string { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostCreated %+v", 201, o.Payload) +} + +func (o *V1HostGroupsPostCreated) GetPayload() *models.HostGroup { + return o.Payload +} + +func (o *V1HostGroupsPostCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.HostGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewV1HostGroupsPostBadRequest creates a V1HostGroupsPostBadRequest with default headers values +func NewV1HostGroupsPostBadRequest() *V1HostGroupsPostBadRequest { + return &V1HostGroupsPostBadRequest{} +} + +/* +V1HostGroupsPostBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type V1HostGroupsPostBadRequest struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 host groups post bad request response has a 2xx status code +func (o *V1HostGroupsPostBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 host groups post bad request response has a 3xx status code +func (o *V1HostGroupsPostBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 host groups post bad request response has a 4xx status code +func (o *V1HostGroupsPostBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 host groups post bad request response has a 5xx status code +func (o *V1HostGroupsPostBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 host groups post bad request response a status code equal to that given +func (o *V1HostGroupsPostBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the v1 host groups post bad request response +func (o *V1HostGroupsPostBadRequest) Code() int { + return 400 +} + +func (o *V1HostGroupsPostBadRequest) Error() string { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostBadRequest %+v", 400, o.Payload) +} + +func (o *V1HostGroupsPostBadRequest) String() string { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostBadRequest %+v", 400, o.Payload) +} + +func (o *V1HostGroupsPostBadRequest) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1HostGroupsPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewV1HostGroupsPostUnauthorized creates a V1HostGroupsPostUnauthorized with default headers values +func NewV1HostGroupsPostUnauthorized() *V1HostGroupsPostUnauthorized { + return &V1HostGroupsPostUnauthorized{} +} + +/* +V1HostGroupsPostUnauthorized describes a response with status code 401, with default header values. + +Unauthorized +*/ +type V1HostGroupsPostUnauthorized struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 host groups post unauthorized response has a 2xx status code +func (o *V1HostGroupsPostUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 host groups post unauthorized response has a 3xx status code +func (o *V1HostGroupsPostUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 host groups post unauthorized response has a 4xx status code +func (o *V1HostGroupsPostUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 host groups post unauthorized response has a 5xx status code +func (o *V1HostGroupsPostUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 host groups post unauthorized response a status code equal to that given +func (o *V1HostGroupsPostUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the v1 host groups post unauthorized response +func (o *V1HostGroupsPostUnauthorized) Code() int { + return 401 +} + +func (o *V1HostGroupsPostUnauthorized) Error() string { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostUnauthorized %+v", 401, o.Payload) +} + +func (o *V1HostGroupsPostUnauthorized) String() string { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostUnauthorized %+v", 401, o.Payload) +} + +func (o *V1HostGroupsPostUnauthorized) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1HostGroupsPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewV1HostGroupsPostForbidden creates a V1HostGroupsPostForbidden with default headers values +func NewV1HostGroupsPostForbidden() *V1HostGroupsPostForbidden { + return &V1HostGroupsPostForbidden{} +} + +/* +V1HostGroupsPostForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type V1HostGroupsPostForbidden struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 host groups post forbidden response has a 2xx status code +func (o *V1HostGroupsPostForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 host groups post forbidden response has a 3xx status code +func (o *V1HostGroupsPostForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 host groups post forbidden response has a 4xx status code +func (o *V1HostGroupsPostForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 host groups post forbidden response has a 5xx status code +func (o *V1HostGroupsPostForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 host groups post forbidden response a status code equal to that given +func (o *V1HostGroupsPostForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the v1 host groups post forbidden response +func (o *V1HostGroupsPostForbidden) Code() int { + return 403 +} + +func (o *V1HostGroupsPostForbidden) Error() string { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostForbidden %+v", 403, o.Payload) +} + +func (o *V1HostGroupsPostForbidden) String() string { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostForbidden %+v", 403, o.Payload) +} + +func (o *V1HostGroupsPostForbidden) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1HostGroupsPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewV1HostGroupsPostConflict creates a V1HostGroupsPostConflict with default headers values +func NewV1HostGroupsPostConflict() *V1HostGroupsPostConflict { + return &V1HostGroupsPostConflict{} +} + +/* +V1HostGroupsPostConflict describes a response with status code 409, with default header values. + +Conflict +*/ +type V1HostGroupsPostConflict struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 host groups post conflict response has a 2xx status code +func (o *V1HostGroupsPostConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 host groups post conflict response has a 3xx status code +func (o *V1HostGroupsPostConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 host groups post conflict response has a 4xx status code +func (o *V1HostGroupsPostConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 host groups post conflict response has a 5xx status code +func (o *V1HostGroupsPostConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 host groups post conflict response a status code equal to that given +func (o *V1HostGroupsPostConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the v1 host groups post conflict response +func (o *V1HostGroupsPostConflict) Code() int { + return 409 +} + +func (o *V1HostGroupsPostConflict) Error() string { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostConflict %+v", 409, o.Payload) +} + +func (o *V1HostGroupsPostConflict) String() string { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostConflict %+v", 409, o.Payload) +} + +func (o *V1HostGroupsPostConflict) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1HostGroupsPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewV1HostGroupsPostUnprocessableEntity creates a V1HostGroupsPostUnprocessableEntity with default headers values +func NewV1HostGroupsPostUnprocessableEntity() *V1HostGroupsPostUnprocessableEntity { + return &V1HostGroupsPostUnprocessableEntity{} +} + +/* +V1HostGroupsPostUnprocessableEntity describes a response with status code 422, with default header values. + +Unprocessable Entity +*/ +type V1HostGroupsPostUnprocessableEntity struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 host groups post unprocessable entity response has a 2xx status code +func (o *V1HostGroupsPostUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 host groups post unprocessable entity response has a 3xx status code +func (o *V1HostGroupsPostUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 host groups post unprocessable entity response has a 4xx status code +func (o *V1HostGroupsPostUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this v1 host groups post unprocessable entity response has a 5xx status code +func (o *V1HostGroupsPostUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this v1 host groups post unprocessable entity response a status code equal to that given +func (o *V1HostGroupsPostUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the v1 host groups post unprocessable entity response +func (o *V1HostGroupsPostUnprocessableEntity) Code() int { + return 422 +} + +func (o *V1HostGroupsPostUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *V1HostGroupsPostUnprocessableEntity) String() string { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *V1HostGroupsPostUnprocessableEntity) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1HostGroupsPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewV1HostGroupsPostInternalServerError creates a V1HostGroupsPostInternalServerError with default headers values +func NewV1HostGroupsPostInternalServerError() *V1HostGroupsPostInternalServerError { + return &V1HostGroupsPostInternalServerError{} +} + +/* +V1HostGroupsPostInternalServerError describes a response with status code 500, with default header values. + +Internal Server Error +*/ +type V1HostGroupsPostInternalServerError struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 host groups post internal server error response has a 2xx status code +func (o *V1HostGroupsPostInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 host groups post internal server error response has a 3xx status code +func (o *V1HostGroupsPostInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 host groups post internal server error response has a 4xx status code +func (o *V1HostGroupsPostInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this v1 host groups post internal server error response has a 5xx status code +func (o *V1HostGroupsPostInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this v1 host groups post internal server error response a status code equal to that given +func (o *V1HostGroupsPostInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the v1 host groups post internal server error response +func (o *V1HostGroupsPostInternalServerError) Code() int { + return 500 +} + +func (o *V1HostGroupsPostInternalServerError) Error() string { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostInternalServerError %+v", 500, o.Payload) +} + +func (o *V1HostGroupsPostInternalServerError) String() string { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostInternalServerError %+v", 500, o.Payload) +} + +func (o *V1HostGroupsPostInternalServerError) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1HostGroupsPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewV1HostGroupsPostGatewayTimeout creates a V1HostGroupsPostGatewayTimeout with default headers values +func NewV1HostGroupsPostGatewayTimeout() *V1HostGroupsPostGatewayTimeout { + return &V1HostGroupsPostGatewayTimeout{} +} + +/* +V1HostGroupsPostGatewayTimeout describes a response with status code 504, with default header values. + +Gateway Timeout. Request is still processing and taking longer than expected. +*/ +type V1HostGroupsPostGatewayTimeout struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 host groups post gateway timeout response has a 2xx status code +func (o *V1HostGroupsPostGatewayTimeout) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 host groups post gateway timeout response has a 3xx status code +func (o *V1HostGroupsPostGatewayTimeout) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 host groups post gateway timeout response has a 4xx status code +func (o *V1HostGroupsPostGatewayTimeout) IsClientError() bool { + return false +} + +// IsServerError returns true when this v1 host groups post gateway timeout response has a 5xx status code +func (o *V1HostGroupsPostGatewayTimeout) IsServerError() bool { + return true +} + +// IsCode returns true when this v1 host groups post gateway timeout response a status code equal to that given +func (o *V1HostGroupsPostGatewayTimeout) IsCode(code int) bool { + return code == 504 +} + +// Code gets the status code for the v1 host groups post gateway timeout response +func (o *V1HostGroupsPostGatewayTimeout) Code() int { + return 504 +} + +func (o *V1HostGroupsPostGatewayTimeout) Error() string { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostGatewayTimeout %+v", 504, o.Payload) +} + +func (o *V1HostGroupsPostGatewayTimeout) String() string { + return fmt.Sprintf("[POST /v1/host-groups][%d] v1HostGroupsPostGatewayTimeout %+v", 504, o.Payload) +} + +func (o *V1HostGroupsPostGatewayTimeout) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1HostGroupsPostGatewayTimeout) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/power/client/hostgroups/v1_hosts_get_parameters.go b/power/client/host_groups/v1_hosts_get_parameters.go similarity index 99% rename from power/client/hostgroups/v1_hosts_get_parameters.go rename to power/client/host_groups/v1_hosts_get_parameters.go index b2b9e6c7..b4139ea5 100644 --- a/power/client/hostgroups/v1_hosts_get_parameters.go +++ b/power/client/host_groups/v1_hosts_get_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +package host_groups // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command diff --git a/power/client/hostgroups/v1_hosts_get_responses.go b/power/client/host_groups/v1_hosts_get_responses.go similarity index 99% rename from power/client/hostgroups/v1_hosts_get_responses.go rename to power/client/host_groups/v1_hosts_get_responses.go index 80e385ed..ba907c0d 100644 --- a/power/client/hostgroups/v1_hosts_get_responses.go +++ b/power/client/host_groups/v1_hosts_get_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +package host_groups // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command diff --git a/power/client/hostgroups/v1_hosts_id_delete_parameters.go b/power/client/host_groups/v1_hosts_id_delete_parameters.go similarity index 99% rename from power/client/hostgroups/v1_hosts_id_delete_parameters.go rename to power/client/host_groups/v1_hosts_id_delete_parameters.go index e2508c8d..412fe32c 100644 --- a/power/client/hostgroups/v1_hosts_id_delete_parameters.go +++ b/power/client/host_groups/v1_hosts_id_delete_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +package host_groups // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command diff --git a/power/client/hostgroups/v1_hosts_id_delete_responses.go b/power/client/host_groups/v1_hosts_id_delete_responses.go similarity index 99% rename from power/client/hostgroups/v1_hosts_id_delete_responses.go rename to power/client/host_groups/v1_hosts_id_delete_responses.go index e41a8ea2..1681c9fe 100644 --- a/power/client/hostgroups/v1_hosts_id_delete_responses.go +++ b/power/client/host_groups/v1_hosts_id_delete_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +package host_groups // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command diff --git a/power/client/hostgroups/v1_hosts_id_get_parameters.go b/power/client/host_groups/v1_hosts_id_get_parameters.go similarity index 99% rename from power/client/hostgroups/v1_hosts_id_get_parameters.go rename to power/client/host_groups/v1_hosts_id_get_parameters.go index 73c5b368..422c12ff 100644 --- a/power/client/hostgroups/v1_hosts_id_get_parameters.go +++ b/power/client/host_groups/v1_hosts_id_get_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +package host_groups // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command diff --git a/power/client/hostgroups/v1_hosts_id_get_responses.go b/power/client/host_groups/v1_hosts_id_get_responses.go similarity index 99% rename from power/client/hostgroups/v1_hosts_id_get_responses.go rename to power/client/host_groups/v1_hosts_id_get_responses.go index f28f8270..42411024 100644 --- a/power/client/hostgroups/v1_hosts_id_get_responses.go +++ b/power/client/host_groups/v1_hosts_id_get_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +package host_groups // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command diff --git a/power/client/hostgroups/v1_hosts_id_put_parameters.go b/power/client/host_groups/v1_hosts_id_put_parameters.go similarity index 99% rename from power/client/hostgroups/v1_hosts_id_put_parameters.go rename to power/client/host_groups/v1_hosts_id_put_parameters.go index d1186ae9..557c18a4 100644 --- a/power/client/hostgroups/v1_hosts_id_put_parameters.go +++ b/power/client/host_groups/v1_hosts_id_put_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +package host_groups // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command diff --git a/power/client/hostgroups/v1_hosts_id_put_responses.go b/power/client/host_groups/v1_hosts_id_put_responses.go similarity index 99% rename from power/client/hostgroups/v1_hosts_id_put_responses.go rename to power/client/host_groups/v1_hosts_id_put_responses.go index 322ce86b..8723d370 100644 --- a/power/client/hostgroups/v1_hosts_id_put_responses.go +++ b/power/client/host_groups/v1_hosts_id_put_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +package host_groups // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command diff --git a/power/client/hostgroups/v1_hosts_post_parameters.go b/power/client/host_groups/v1_hosts_post_parameters.go similarity index 98% rename from power/client/hostgroups/v1_hosts_post_parameters.go rename to power/client/host_groups/v1_hosts_post_parameters.go index d44a5ff3..21437e7a 100644 --- a/power/client/hostgroups/v1_hosts_post_parameters.go +++ b/power/client/host_groups/v1_hosts_post_parameters.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +package host_groups // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command @@ -65,7 +65,7 @@ type V1HostsPostParams struct { /* Body. - Parameters to add a host to an existing hostgroup + Parameters to add a host to an existing host group */ Body *models.HostCreate diff --git a/power/client/hostgroups/v1_hosts_post_responses.go b/power/client/host_groups/v1_hosts_post_responses.go similarity index 98% rename from power/client/hostgroups/v1_hosts_post_responses.go rename to power/client/host_groups/v1_hosts_post_responses.go index 40dc82e7..2a62bb96 100644 --- a/power/client/hostgroups/v1_hosts_post_responses.go +++ b/power/client/host_groups/v1_hosts_post_responses.go @@ -1,6 +1,6 @@ // Code generated by go-swagger; DO NOT EDIT. -package hostgroups +package host_groups // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command @@ -81,7 +81,7 @@ V1HostsPostCreated describes a response with status code 201, with default heade Created */ type V1HostsPostCreated struct { - Payload *models.Host + Payload models.HostList } // IsSuccess returns true when this v1 hosts post created response has a 2xx status code @@ -122,16 +122,14 @@ func (o *V1HostsPostCreated) String() string { return fmt.Sprintf("[POST /v1/hosts][%d] v1HostsPostCreated %+v", 201, o.Payload) } -func (o *V1HostsPostCreated) GetPayload() *models.Host { +func (o *V1HostsPostCreated) GetPayload() models.HostList { return o.Payload } func (o *V1HostsPostCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.Host) - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { return err } diff --git a/power/client/hostgroups/v1_hostgroups_get_parameters.go b/power/client/hostgroups/v1_hostgroups_get_parameters.go deleted file mode 100644 index e4c9dcc2..00000000 --- a/power/client/hostgroups/v1_hostgroups_get_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package hostgroups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewV1HostgroupsGetParams creates a new V1HostgroupsGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1HostgroupsGetParams() *V1HostgroupsGetParams { - return &V1HostgroupsGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1HostgroupsGetParamsWithTimeout creates a new V1HostgroupsGetParams object -// with the ability to set a timeout on a request. -func NewV1HostgroupsGetParamsWithTimeout(timeout time.Duration) *V1HostgroupsGetParams { - return &V1HostgroupsGetParams{ - timeout: timeout, - } -} - -// NewV1HostgroupsGetParamsWithContext creates a new V1HostgroupsGetParams object -// with the ability to set a context for a request. -func NewV1HostgroupsGetParamsWithContext(ctx context.Context) *V1HostgroupsGetParams { - return &V1HostgroupsGetParams{ - Context: ctx, - } -} - -// NewV1HostgroupsGetParamsWithHTTPClient creates a new V1HostgroupsGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1HostgroupsGetParamsWithHTTPClient(client *http.Client) *V1HostgroupsGetParams { - return &V1HostgroupsGetParams{ - HTTPClient: client, - } -} - -/* -V1HostgroupsGetParams contains all the parameters to send to the API endpoint - - for the v1 hostgroups get operation. - - Typically these are written to a http.Request. -*/ -type V1HostgroupsGetParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 hostgroups get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1HostgroupsGetParams) WithDefaults() *V1HostgroupsGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 hostgroups get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1HostgroupsGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 hostgroups get params -func (o *V1HostgroupsGetParams) WithTimeout(timeout time.Duration) *V1HostgroupsGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 hostgroups get params -func (o *V1HostgroupsGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 hostgroups get params -func (o *V1HostgroupsGetParams) WithContext(ctx context.Context) *V1HostgroupsGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 hostgroups get params -func (o *V1HostgroupsGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 hostgroups get params -func (o *V1HostgroupsGetParams) WithHTTPClient(client *http.Client) *V1HostgroupsGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 hostgroups get params -func (o *V1HostgroupsGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *V1HostgroupsGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/hostgroups/v1_hostgroups_get_responses.go b/power/client/hostgroups/v1_hostgroups_get_responses.go deleted file mode 100644 index 6ee0eeca..00000000 --- a/power/client/hostgroups/v1_hostgroups_get_responses.go +++ /dev/null @@ -1,471 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package hostgroups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1HostgroupsGetReader is a Reader for the V1HostgroupsGet structure. -type V1HostgroupsGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1HostgroupsGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewV1HostgroupsGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewV1HostgroupsGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewV1HostgroupsGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1HostgroupsGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1HostgroupsGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 504: - result := NewV1HostgroupsGetGatewayTimeout() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /v1/hostgroups] v1.hostgroups.get", response, response.Code()) - } -} - -// NewV1HostgroupsGetOK creates a V1HostgroupsGetOK with default headers values -func NewV1HostgroupsGetOK() *V1HostgroupsGetOK { - return &V1HostgroupsGetOK{} -} - -/* -V1HostgroupsGetOK describes a response with status code 200, with default header values. - -OK -*/ -type V1HostgroupsGetOK struct { - Payload models.HostgroupList -} - -// IsSuccess returns true when this v1 hostgroups get o k response has a 2xx status code -func (o *V1HostgroupsGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 hostgroups get o k response has a 3xx status code -func (o *V1HostgroupsGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups get o k response has a 4xx status code -func (o *V1HostgroupsGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups get o k response has a 5xx status code -func (o *V1HostgroupsGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups get o k response a status code equal to that given -func (o *V1HostgroupsGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the v1 hostgroups get o k response -func (o *V1HostgroupsGetOK) Code() int { - return 200 -} - -func (o *V1HostgroupsGetOK) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetOK %+v", 200, o.Payload) -} - -func (o *V1HostgroupsGetOK) String() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetOK %+v", 200, o.Payload) -} - -func (o *V1HostgroupsGetOK) GetPayload() models.HostgroupList { - return o.Payload -} - -func (o *V1HostgroupsGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostgroupsGetBadRequest creates a V1HostgroupsGetBadRequest with default headers values -func NewV1HostgroupsGetBadRequest() *V1HostgroupsGetBadRequest { - return &V1HostgroupsGetBadRequest{} -} - -/* -V1HostgroupsGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type V1HostgroupsGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hostgroups get bad request response has a 2xx status code -func (o *V1HostgroupsGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups get bad request response has a 3xx status code -func (o *V1HostgroupsGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups get bad request response has a 4xx status code -func (o *V1HostgroupsGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups get bad request response has a 5xx status code -func (o *V1HostgroupsGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups get bad request response a status code equal to that given -func (o *V1HostgroupsGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the v1 hostgroups get bad request response -func (o *V1HostgroupsGetBadRequest) Code() int { - return 400 -} - -func (o *V1HostgroupsGetBadRequest) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetBadRequest %+v", 400, o.Payload) -} - -func (o *V1HostgroupsGetBadRequest) String() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetBadRequest %+v", 400, o.Payload) -} - -func (o *V1HostgroupsGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostgroupsGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostgroupsGetUnauthorized creates a V1HostgroupsGetUnauthorized with default headers values -func NewV1HostgroupsGetUnauthorized() *V1HostgroupsGetUnauthorized { - return &V1HostgroupsGetUnauthorized{} -} - -/* -V1HostgroupsGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1HostgroupsGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hostgroups get unauthorized response has a 2xx status code -func (o *V1HostgroupsGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups get unauthorized response has a 3xx status code -func (o *V1HostgroupsGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups get unauthorized response has a 4xx status code -func (o *V1HostgroupsGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups get unauthorized response has a 5xx status code -func (o *V1HostgroupsGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups get unauthorized response a status code equal to that given -func (o *V1HostgroupsGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 hostgroups get unauthorized response -func (o *V1HostgroupsGetUnauthorized) Code() int { - return 401 -} - -func (o *V1HostgroupsGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetUnauthorized %+v", 401, o.Payload) -} - -func (o *V1HostgroupsGetUnauthorized) String() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetUnauthorized %+v", 401, o.Payload) -} - -func (o *V1HostgroupsGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostgroupsGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostgroupsGetForbidden creates a V1HostgroupsGetForbidden with default headers values -func NewV1HostgroupsGetForbidden() *V1HostgroupsGetForbidden { - return &V1HostgroupsGetForbidden{} -} - -/* -V1HostgroupsGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1HostgroupsGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hostgroups get forbidden response has a 2xx status code -func (o *V1HostgroupsGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups get forbidden response has a 3xx status code -func (o *V1HostgroupsGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups get forbidden response has a 4xx status code -func (o *V1HostgroupsGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups get forbidden response has a 5xx status code -func (o *V1HostgroupsGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups get forbidden response a status code equal to that given -func (o *V1HostgroupsGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 hostgroups get forbidden response -func (o *V1HostgroupsGetForbidden) Code() int { - return 403 -} - -func (o *V1HostgroupsGetForbidden) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetForbidden %+v", 403, o.Payload) -} - -func (o *V1HostgroupsGetForbidden) String() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetForbidden %+v", 403, o.Payload) -} - -func (o *V1HostgroupsGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostgroupsGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostgroupsGetInternalServerError creates a V1HostgroupsGetInternalServerError with default headers values -func NewV1HostgroupsGetInternalServerError() *V1HostgroupsGetInternalServerError { - return &V1HostgroupsGetInternalServerError{} -} - -/* -V1HostgroupsGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1HostgroupsGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hostgroups get internal server error response has a 2xx status code -func (o *V1HostgroupsGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups get internal server error response has a 3xx status code -func (o *V1HostgroupsGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups get internal server error response has a 4xx status code -func (o *V1HostgroupsGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups get internal server error response has a 5xx status code -func (o *V1HostgroupsGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 hostgroups get internal server error response a status code equal to that given -func (o *V1HostgroupsGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 hostgroups get internal server error response -func (o *V1HostgroupsGetInternalServerError) Code() int { - return 500 -} - -func (o *V1HostgroupsGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetInternalServerError %+v", 500, o.Payload) -} - -func (o *V1HostgroupsGetInternalServerError) String() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetInternalServerError %+v", 500, o.Payload) -} - -func (o *V1HostgroupsGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostgroupsGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostgroupsGetGatewayTimeout creates a V1HostgroupsGetGatewayTimeout with default headers values -func NewV1HostgroupsGetGatewayTimeout() *V1HostgroupsGetGatewayTimeout { - return &V1HostgroupsGetGatewayTimeout{} -} - -/* -V1HostgroupsGetGatewayTimeout describes a response with status code 504, with default header values. - -Gateway Timeout. Request is still processing and taking longer than expected. -*/ -type V1HostgroupsGetGatewayTimeout struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hostgroups get gateway timeout response has a 2xx status code -func (o *V1HostgroupsGetGatewayTimeout) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups get gateway timeout response has a 3xx status code -func (o *V1HostgroupsGetGatewayTimeout) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups get gateway timeout response has a 4xx status code -func (o *V1HostgroupsGetGatewayTimeout) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups get gateway timeout response has a 5xx status code -func (o *V1HostgroupsGetGatewayTimeout) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 hostgroups get gateway timeout response a status code equal to that given -func (o *V1HostgroupsGetGatewayTimeout) IsCode(code int) bool { - return code == 504 -} - -// Code gets the status code for the v1 hostgroups get gateway timeout response -func (o *V1HostgroupsGetGatewayTimeout) Code() int { - return 504 -} - -func (o *V1HostgroupsGetGatewayTimeout) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetGatewayTimeout %+v", 504, o.Payload) -} - -func (o *V1HostgroupsGetGatewayTimeout) String() string { - return fmt.Sprintf("[GET /v1/hostgroups][%d] v1HostgroupsGetGatewayTimeout %+v", 504, o.Payload) -} - -func (o *V1HostgroupsGetGatewayTimeout) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostgroupsGetGatewayTimeout) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/hostgroups/v1_hostgroups_id_get_parameters.go b/power/client/hostgroups/v1_hostgroups_id_get_parameters.go deleted file mode 100644 index f266f7eb..00000000 --- a/power/client/hostgroups/v1_hostgroups_id_get_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package hostgroups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewV1HostgroupsIDGetParams creates a new V1HostgroupsIDGetParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1HostgroupsIDGetParams() *V1HostgroupsIDGetParams { - return &V1HostgroupsIDGetParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1HostgroupsIDGetParamsWithTimeout creates a new V1HostgroupsIDGetParams object -// with the ability to set a timeout on a request. -func NewV1HostgroupsIDGetParamsWithTimeout(timeout time.Duration) *V1HostgroupsIDGetParams { - return &V1HostgroupsIDGetParams{ - timeout: timeout, - } -} - -// NewV1HostgroupsIDGetParamsWithContext creates a new V1HostgroupsIDGetParams object -// with the ability to set a context for a request. -func NewV1HostgroupsIDGetParamsWithContext(ctx context.Context) *V1HostgroupsIDGetParams { - return &V1HostgroupsIDGetParams{ - Context: ctx, - } -} - -// NewV1HostgroupsIDGetParamsWithHTTPClient creates a new V1HostgroupsIDGetParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1HostgroupsIDGetParamsWithHTTPClient(client *http.Client) *V1HostgroupsIDGetParams { - return &V1HostgroupsIDGetParams{ - HTTPClient: client, - } -} - -/* -V1HostgroupsIDGetParams contains all the parameters to send to the API endpoint - - for the v1 hostgroups id get operation. - - Typically these are written to a http.Request. -*/ -type V1HostgroupsIDGetParams struct { - - /* HostgroupID. - - Hostgroup ID - */ - HostgroupID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 hostgroups id get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1HostgroupsIDGetParams) WithDefaults() *V1HostgroupsIDGetParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 hostgroups id get params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1HostgroupsIDGetParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 hostgroups id get params -func (o *V1HostgroupsIDGetParams) WithTimeout(timeout time.Duration) *V1HostgroupsIDGetParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 hostgroups id get params -func (o *V1HostgroupsIDGetParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 hostgroups id get params -func (o *V1HostgroupsIDGetParams) WithContext(ctx context.Context) *V1HostgroupsIDGetParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 hostgroups id get params -func (o *V1HostgroupsIDGetParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 hostgroups id get params -func (o *V1HostgroupsIDGetParams) WithHTTPClient(client *http.Client) *V1HostgroupsIDGetParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 hostgroups id get params -func (o *V1HostgroupsIDGetParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithHostgroupID adds the hostgroupID to the v1 hostgroups id get params -func (o *V1HostgroupsIDGetParams) WithHostgroupID(hostgroupID string) *V1HostgroupsIDGetParams { - o.SetHostgroupID(hostgroupID) - return o -} - -// SetHostgroupID adds the hostgroupId to the v1 hostgroups id get params -func (o *V1HostgroupsIDGetParams) SetHostgroupID(hostgroupID string) { - o.HostgroupID = hostgroupID -} - -// WriteToRequest writes these params to a swagger request -func (o *V1HostgroupsIDGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param hostgroup_id - if err := r.SetPathParam("hostgroup_id", o.HostgroupID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/hostgroups/v1_hostgroups_id_get_responses.go b/power/client/hostgroups/v1_hostgroups_id_get_responses.go deleted file mode 100644 index d458c4db..00000000 --- a/power/client/hostgroups/v1_hostgroups_id_get_responses.go +++ /dev/null @@ -1,547 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package hostgroups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1HostgroupsIDGetReader is a Reader for the V1HostgroupsIDGet structure. -type V1HostgroupsIDGetReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1HostgroupsIDGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewV1HostgroupsIDGetOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewV1HostgroupsIDGetBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewV1HostgroupsIDGetUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1HostgroupsIDGetForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewV1HostgroupsIDGetNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1HostgroupsIDGetInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 504: - result := NewV1HostgroupsIDGetGatewayTimeout() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /v1/hostgroups/{hostgroup_id}] v1.hostgroups.id.get", response, response.Code()) - } -} - -// NewV1HostgroupsIDGetOK creates a V1HostgroupsIDGetOK with default headers values -func NewV1HostgroupsIDGetOK() *V1HostgroupsIDGetOK { - return &V1HostgroupsIDGetOK{} -} - -/* -V1HostgroupsIDGetOK describes a response with status code 200, with default header values. - -OK -*/ -type V1HostgroupsIDGetOK struct { - Payload *models.Hostgroup -} - -// IsSuccess returns true when this v1 hostgroups Id get o k response has a 2xx status code -func (o *V1HostgroupsIDGetOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 hostgroups Id get o k response has a 3xx status code -func (o *V1HostgroupsIDGetOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id get o k response has a 4xx status code -func (o *V1HostgroupsIDGetOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups Id get o k response has a 5xx status code -func (o *V1HostgroupsIDGetOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups Id get o k response a status code equal to that given -func (o *V1HostgroupsIDGetOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the v1 hostgroups Id get o k response -func (o *V1HostgroupsIDGetOK) Code() int { - return 200 -} - -func (o *V1HostgroupsIDGetOK) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetOK %+v", 200, o.Payload) -} - -func (o *V1HostgroupsIDGetOK) String() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetOK %+v", 200, o.Payload) -} - -func (o *V1HostgroupsIDGetOK) GetPayload() *models.Hostgroup { - return o.Payload -} - -func (o *V1HostgroupsIDGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Hostgroup) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostgroupsIDGetBadRequest creates a V1HostgroupsIDGetBadRequest with default headers values -func NewV1HostgroupsIDGetBadRequest() *V1HostgroupsIDGetBadRequest { - return &V1HostgroupsIDGetBadRequest{} -} - -/* -V1HostgroupsIDGetBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type V1HostgroupsIDGetBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hostgroups Id get bad request response has a 2xx status code -func (o *V1HostgroupsIDGetBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id get bad request response has a 3xx status code -func (o *V1HostgroupsIDGetBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id get bad request response has a 4xx status code -func (o *V1HostgroupsIDGetBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups Id get bad request response has a 5xx status code -func (o *V1HostgroupsIDGetBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups Id get bad request response a status code equal to that given -func (o *V1HostgroupsIDGetBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the v1 hostgroups Id get bad request response -func (o *V1HostgroupsIDGetBadRequest) Code() int { - return 400 -} - -func (o *V1HostgroupsIDGetBadRequest) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetBadRequest %+v", 400, o.Payload) -} - -func (o *V1HostgroupsIDGetBadRequest) String() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetBadRequest %+v", 400, o.Payload) -} - -func (o *V1HostgroupsIDGetBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostgroupsIDGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostgroupsIDGetUnauthorized creates a V1HostgroupsIDGetUnauthorized with default headers values -func NewV1HostgroupsIDGetUnauthorized() *V1HostgroupsIDGetUnauthorized { - return &V1HostgroupsIDGetUnauthorized{} -} - -/* -V1HostgroupsIDGetUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1HostgroupsIDGetUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hostgroups Id get unauthorized response has a 2xx status code -func (o *V1HostgroupsIDGetUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id get unauthorized response has a 3xx status code -func (o *V1HostgroupsIDGetUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id get unauthorized response has a 4xx status code -func (o *V1HostgroupsIDGetUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups Id get unauthorized response has a 5xx status code -func (o *V1HostgroupsIDGetUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups Id get unauthorized response a status code equal to that given -func (o *V1HostgroupsIDGetUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 hostgroups Id get unauthorized response -func (o *V1HostgroupsIDGetUnauthorized) Code() int { - return 401 -} - -func (o *V1HostgroupsIDGetUnauthorized) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetUnauthorized %+v", 401, o.Payload) -} - -func (o *V1HostgroupsIDGetUnauthorized) String() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetUnauthorized %+v", 401, o.Payload) -} - -func (o *V1HostgroupsIDGetUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostgroupsIDGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostgroupsIDGetForbidden creates a V1HostgroupsIDGetForbidden with default headers values -func NewV1HostgroupsIDGetForbidden() *V1HostgroupsIDGetForbidden { - return &V1HostgroupsIDGetForbidden{} -} - -/* -V1HostgroupsIDGetForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1HostgroupsIDGetForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hostgroups Id get forbidden response has a 2xx status code -func (o *V1HostgroupsIDGetForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id get forbidden response has a 3xx status code -func (o *V1HostgroupsIDGetForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id get forbidden response has a 4xx status code -func (o *V1HostgroupsIDGetForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups Id get forbidden response has a 5xx status code -func (o *V1HostgroupsIDGetForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups Id get forbidden response a status code equal to that given -func (o *V1HostgroupsIDGetForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 hostgroups Id get forbidden response -func (o *V1HostgroupsIDGetForbidden) Code() int { - return 403 -} - -func (o *V1HostgroupsIDGetForbidden) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetForbidden %+v", 403, o.Payload) -} - -func (o *V1HostgroupsIDGetForbidden) String() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetForbidden %+v", 403, o.Payload) -} - -func (o *V1HostgroupsIDGetForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostgroupsIDGetForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostgroupsIDGetNotFound creates a V1HostgroupsIDGetNotFound with default headers values -func NewV1HostgroupsIDGetNotFound() *V1HostgroupsIDGetNotFound { - return &V1HostgroupsIDGetNotFound{} -} - -/* -V1HostgroupsIDGetNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type V1HostgroupsIDGetNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hostgroups Id get not found response has a 2xx status code -func (o *V1HostgroupsIDGetNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id get not found response has a 3xx status code -func (o *V1HostgroupsIDGetNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id get not found response has a 4xx status code -func (o *V1HostgroupsIDGetNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups Id get not found response has a 5xx status code -func (o *V1HostgroupsIDGetNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups Id get not found response a status code equal to that given -func (o *V1HostgroupsIDGetNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the v1 hostgroups Id get not found response -func (o *V1HostgroupsIDGetNotFound) Code() int { - return 404 -} - -func (o *V1HostgroupsIDGetNotFound) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetNotFound %+v", 404, o.Payload) -} - -func (o *V1HostgroupsIDGetNotFound) String() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetNotFound %+v", 404, o.Payload) -} - -func (o *V1HostgroupsIDGetNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostgroupsIDGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostgroupsIDGetInternalServerError creates a V1HostgroupsIDGetInternalServerError with default headers values -func NewV1HostgroupsIDGetInternalServerError() *V1HostgroupsIDGetInternalServerError { - return &V1HostgroupsIDGetInternalServerError{} -} - -/* -V1HostgroupsIDGetInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1HostgroupsIDGetInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hostgroups Id get internal server error response has a 2xx status code -func (o *V1HostgroupsIDGetInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id get internal server error response has a 3xx status code -func (o *V1HostgroupsIDGetInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id get internal server error response has a 4xx status code -func (o *V1HostgroupsIDGetInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups Id get internal server error response has a 5xx status code -func (o *V1HostgroupsIDGetInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 hostgroups Id get internal server error response a status code equal to that given -func (o *V1HostgroupsIDGetInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 hostgroups Id get internal server error response -func (o *V1HostgroupsIDGetInternalServerError) Code() int { - return 500 -} - -func (o *V1HostgroupsIDGetInternalServerError) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetInternalServerError %+v", 500, o.Payload) -} - -func (o *V1HostgroupsIDGetInternalServerError) String() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetInternalServerError %+v", 500, o.Payload) -} - -func (o *V1HostgroupsIDGetInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostgroupsIDGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostgroupsIDGetGatewayTimeout creates a V1HostgroupsIDGetGatewayTimeout with default headers values -func NewV1HostgroupsIDGetGatewayTimeout() *V1HostgroupsIDGetGatewayTimeout { - return &V1HostgroupsIDGetGatewayTimeout{} -} - -/* -V1HostgroupsIDGetGatewayTimeout describes a response with status code 504, with default header values. - -Gateway Timeout. Request is still processing and taking longer than expected. -*/ -type V1HostgroupsIDGetGatewayTimeout struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hostgroups Id get gateway timeout response has a 2xx status code -func (o *V1HostgroupsIDGetGatewayTimeout) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id get gateway timeout response has a 3xx status code -func (o *V1HostgroupsIDGetGatewayTimeout) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id get gateway timeout response has a 4xx status code -func (o *V1HostgroupsIDGetGatewayTimeout) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups Id get gateway timeout response has a 5xx status code -func (o *V1HostgroupsIDGetGatewayTimeout) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 hostgroups Id get gateway timeout response a status code equal to that given -func (o *V1HostgroupsIDGetGatewayTimeout) IsCode(code int) bool { - return code == 504 -} - -// Code gets the status code for the v1 hostgroups Id get gateway timeout response -func (o *V1HostgroupsIDGetGatewayTimeout) Code() int { - return 504 -} - -func (o *V1HostgroupsIDGetGatewayTimeout) Error() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetGatewayTimeout %+v", 504, o.Payload) -} - -func (o *V1HostgroupsIDGetGatewayTimeout) String() string { - return fmt.Sprintf("[GET /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdGetGatewayTimeout %+v", 504, o.Payload) -} - -func (o *V1HostgroupsIDGetGatewayTimeout) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostgroupsIDGetGatewayTimeout) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/hostgroups/v1_hostgroups_id_put_parameters.go b/power/client/hostgroups/v1_hostgroups_id_put_parameters.go deleted file mode 100644 index 61e2d566..00000000 --- a/power/client/hostgroups/v1_hostgroups_id_put_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package hostgroups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewV1HostgroupsIDPutParams creates a new V1HostgroupsIDPutParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1HostgroupsIDPutParams() *V1HostgroupsIDPutParams { - return &V1HostgroupsIDPutParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1HostgroupsIDPutParamsWithTimeout creates a new V1HostgroupsIDPutParams object -// with the ability to set a timeout on a request. -func NewV1HostgroupsIDPutParamsWithTimeout(timeout time.Duration) *V1HostgroupsIDPutParams { - return &V1HostgroupsIDPutParams{ - timeout: timeout, - } -} - -// NewV1HostgroupsIDPutParamsWithContext creates a new V1HostgroupsIDPutParams object -// with the ability to set a context for a request. -func NewV1HostgroupsIDPutParamsWithContext(ctx context.Context) *V1HostgroupsIDPutParams { - return &V1HostgroupsIDPutParams{ - Context: ctx, - } -} - -// NewV1HostgroupsIDPutParamsWithHTTPClient creates a new V1HostgroupsIDPutParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1HostgroupsIDPutParamsWithHTTPClient(client *http.Client) *V1HostgroupsIDPutParams { - return &V1HostgroupsIDPutParams{ - HTTPClient: client, - } -} - -/* -V1HostgroupsIDPutParams contains all the parameters to send to the API endpoint - - for the v1 hostgroups id put operation. - - Typically these are written to a http.Request. -*/ -type V1HostgroupsIDPutParams struct { - - /* Body. - - Parameters to set the sharing status of the hostgroup - */ - Body *models.HostgroupShareOp - - /* HostgroupID. - - Hostgroup ID - */ - HostgroupID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 hostgroups id put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1HostgroupsIDPutParams) WithDefaults() *V1HostgroupsIDPutParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 hostgroups id put params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1HostgroupsIDPutParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 hostgroups id put params -func (o *V1HostgroupsIDPutParams) WithTimeout(timeout time.Duration) *V1HostgroupsIDPutParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 hostgroups id put params -func (o *V1HostgroupsIDPutParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 hostgroups id put params -func (o *V1HostgroupsIDPutParams) WithContext(ctx context.Context) *V1HostgroupsIDPutParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 hostgroups id put params -func (o *V1HostgroupsIDPutParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 hostgroups id put params -func (o *V1HostgroupsIDPutParams) WithHTTPClient(client *http.Client) *V1HostgroupsIDPutParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 hostgroups id put params -func (o *V1HostgroupsIDPutParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the v1 hostgroups id put params -func (o *V1HostgroupsIDPutParams) WithBody(body *models.HostgroupShareOp) *V1HostgroupsIDPutParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the v1 hostgroups id put params -func (o *V1HostgroupsIDPutParams) SetBody(body *models.HostgroupShareOp) { - o.Body = body -} - -// WithHostgroupID adds the hostgroupID to the v1 hostgroups id put params -func (o *V1HostgroupsIDPutParams) WithHostgroupID(hostgroupID string) *V1HostgroupsIDPutParams { - o.SetHostgroupID(hostgroupID) - return o -} - -// SetHostgroupID adds the hostgroupId to the v1 hostgroups id put params -func (o *V1HostgroupsIDPutParams) SetHostgroupID(hostgroupID string) { - o.HostgroupID = hostgroupID -} - -// WriteToRequest writes these params to a swagger request -func (o *V1HostgroupsIDPutParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param hostgroup_id - if err := r.SetPathParam("hostgroup_id", o.HostgroupID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/hostgroups/v1_hostgroups_id_put_responses.go b/power/client/hostgroups/v1_hostgroups_id_put_responses.go deleted file mode 100644 index 33b7c6b4..00000000 --- a/power/client/hostgroups/v1_hostgroups_id_put_responses.go +++ /dev/null @@ -1,621 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package hostgroups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1HostgroupsIDPutReader is a Reader for the V1HostgroupsIDPut structure. -type V1HostgroupsIDPutReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1HostgroupsIDPutReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewV1HostgroupsIDPutOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewV1HostgroupsIDPutBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewV1HostgroupsIDPutUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1HostgroupsIDPutForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewV1HostgroupsIDPutNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewV1HostgroupsIDPutConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1HostgroupsIDPutInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 504: - result := NewV1HostgroupsIDPutGatewayTimeout() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PUT /v1/hostgroups/{hostgroup_id}] v1.hostgroups.id.put", response, response.Code()) - } -} - -// NewV1HostgroupsIDPutOK creates a V1HostgroupsIDPutOK with default headers values -func NewV1HostgroupsIDPutOK() *V1HostgroupsIDPutOK { - return &V1HostgroupsIDPutOK{} -} - -/* -V1HostgroupsIDPutOK describes a response with status code 200, with default header values. - -OK -*/ -type V1HostgroupsIDPutOK struct { - Payload *models.Hostgroup -} - -// IsSuccess returns true when this v1 hostgroups Id put o k response has a 2xx status code -func (o *V1HostgroupsIDPutOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 hostgroups Id put o k response has a 3xx status code -func (o *V1HostgroupsIDPutOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id put o k response has a 4xx status code -func (o *V1HostgroupsIDPutOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups Id put o k response has a 5xx status code -func (o *V1HostgroupsIDPutOK) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups Id put o k response a status code equal to that given -func (o *V1HostgroupsIDPutOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the v1 hostgroups Id put o k response -func (o *V1HostgroupsIDPutOK) Code() int { - return 200 -} - -func (o *V1HostgroupsIDPutOK) Error() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutOK %+v", 200, o.Payload) -} - -func (o *V1HostgroupsIDPutOK) String() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutOK %+v", 200, o.Payload) -} - -func (o *V1HostgroupsIDPutOK) GetPayload() *models.Hostgroup { - return o.Payload -} - -func (o *V1HostgroupsIDPutOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Hostgroup) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostgroupsIDPutBadRequest creates a V1HostgroupsIDPutBadRequest with default headers values -func NewV1HostgroupsIDPutBadRequest() *V1HostgroupsIDPutBadRequest { - return &V1HostgroupsIDPutBadRequest{} -} - -/* -V1HostgroupsIDPutBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type V1HostgroupsIDPutBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hostgroups Id put bad request response has a 2xx status code -func (o *V1HostgroupsIDPutBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id put bad request response has a 3xx status code -func (o *V1HostgroupsIDPutBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id put bad request response has a 4xx status code -func (o *V1HostgroupsIDPutBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups Id put bad request response has a 5xx status code -func (o *V1HostgroupsIDPutBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups Id put bad request response a status code equal to that given -func (o *V1HostgroupsIDPutBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the v1 hostgroups Id put bad request response -func (o *V1HostgroupsIDPutBadRequest) Code() int { - return 400 -} - -func (o *V1HostgroupsIDPutBadRequest) Error() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutBadRequest %+v", 400, o.Payload) -} - -func (o *V1HostgroupsIDPutBadRequest) String() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutBadRequest %+v", 400, o.Payload) -} - -func (o *V1HostgroupsIDPutBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostgroupsIDPutBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostgroupsIDPutUnauthorized creates a V1HostgroupsIDPutUnauthorized with default headers values -func NewV1HostgroupsIDPutUnauthorized() *V1HostgroupsIDPutUnauthorized { - return &V1HostgroupsIDPutUnauthorized{} -} - -/* -V1HostgroupsIDPutUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1HostgroupsIDPutUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hostgroups Id put unauthorized response has a 2xx status code -func (o *V1HostgroupsIDPutUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id put unauthorized response has a 3xx status code -func (o *V1HostgroupsIDPutUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id put unauthorized response has a 4xx status code -func (o *V1HostgroupsIDPutUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups Id put unauthorized response has a 5xx status code -func (o *V1HostgroupsIDPutUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups Id put unauthorized response a status code equal to that given -func (o *V1HostgroupsIDPutUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 hostgroups Id put unauthorized response -func (o *V1HostgroupsIDPutUnauthorized) Code() int { - return 401 -} - -func (o *V1HostgroupsIDPutUnauthorized) Error() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutUnauthorized %+v", 401, o.Payload) -} - -func (o *V1HostgroupsIDPutUnauthorized) String() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutUnauthorized %+v", 401, o.Payload) -} - -func (o *V1HostgroupsIDPutUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostgroupsIDPutUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostgroupsIDPutForbidden creates a V1HostgroupsIDPutForbidden with default headers values -func NewV1HostgroupsIDPutForbidden() *V1HostgroupsIDPutForbidden { - return &V1HostgroupsIDPutForbidden{} -} - -/* -V1HostgroupsIDPutForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1HostgroupsIDPutForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hostgroups Id put forbidden response has a 2xx status code -func (o *V1HostgroupsIDPutForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id put forbidden response has a 3xx status code -func (o *V1HostgroupsIDPutForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id put forbidden response has a 4xx status code -func (o *V1HostgroupsIDPutForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups Id put forbidden response has a 5xx status code -func (o *V1HostgroupsIDPutForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups Id put forbidden response a status code equal to that given -func (o *V1HostgroupsIDPutForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 hostgroups Id put forbidden response -func (o *V1HostgroupsIDPutForbidden) Code() int { - return 403 -} - -func (o *V1HostgroupsIDPutForbidden) Error() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutForbidden %+v", 403, o.Payload) -} - -func (o *V1HostgroupsIDPutForbidden) String() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutForbidden %+v", 403, o.Payload) -} - -func (o *V1HostgroupsIDPutForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostgroupsIDPutForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostgroupsIDPutNotFound creates a V1HostgroupsIDPutNotFound with default headers values -func NewV1HostgroupsIDPutNotFound() *V1HostgroupsIDPutNotFound { - return &V1HostgroupsIDPutNotFound{} -} - -/* -V1HostgroupsIDPutNotFound describes a response with status code 404, with default header values. - -Not Found -*/ -type V1HostgroupsIDPutNotFound struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hostgroups Id put not found response has a 2xx status code -func (o *V1HostgroupsIDPutNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id put not found response has a 3xx status code -func (o *V1HostgroupsIDPutNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id put not found response has a 4xx status code -func (o *V1HostgroupsIDPutNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups Id put not found response has a 5xx status code -func (o *V1HostgroupsIDPutNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups Id put not found response a status code equal to that given -func (o *V1HostgroupsIDPutNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the v1 hostgroups Id put not found response -func (o *V1HostgroupsIDPutNotFound) Code() int { - return 404 -} - -func (o *V1HostgroupsIDPutNotFound) Error() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutNotFound %+v", 404, o.Payload) -} - -func (o *V1HostgroupsIDPutNotFound) String() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutNotFound %+v", 404, o.Payload) -} - -func (o *V1HostgroupsIDPutNotFound) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostgroupsIDPutNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostgroupsIDPutConflict creates a V1HostgroupsIDPutConflict with default headers values -func NewV1HostgroupsIDPutConflict() *V1HostgroupsIDPutConflict { - return &V1HostgroupsIDPutConflict{} -} - -/* -V1HostgroupsIDPutConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type V1HostgroupsIDPutConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hostgroups Id put conflict response has a 2xx status code -func (o *V1HostgroupsIDPutConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id put conflict response has a 3xx status code -func (o *V1HostgroupsIDPutConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id put conflict response has a 4xx status code -func (o *V1HostgroupsIDPutConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups Id put conflict response has a 5xx status code -func (o *V1HostgroupsIDPutConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups Id put conflict response a status code equal to that given -func (o *V1HostgroupsIDPutConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the v1 hostgroups Id put conflict response -func (o *V1HostgroupsIDPutConflict) Code() int { - return 409 -} - -func (o *V1HostgroupsIDPutConflict) Error() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutConflict %+v", 409, o.Payload) -} - -func (o *V1HostgroupsIDPutConflict) String() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutConflict %+v", 409, o.Payload) -} - -func (o *V1HostgroupsIDPutConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostgroupsIDPutConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostgroupsIDPutInternalServerError creates a V1HostgroupsIDPutInternalServerError with default headers values -func NewV1HostgroupsIDPutInternalServerError() *V1HostgroupsIDPutInternalServerError { - return &V1HostgroupsIDPutInternalServerError{} -} - -/* -V1HostgroupsIDPutInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1HostgroupsIDPutInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hostgroups Id put internal server error response has a 2xx status code -func (o *V1HostgroupsIDPutInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id put internal server error response has a 3xx status code -func (o *V1HostgroupsIDPutInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id put internal server error response has a 4xx status code -func (o *V1HostgroupsIDPutInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups Id put internal server error response has a 5xx status code -func (o *V1HostgroupsIDPutInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 hostgroups Id put internal server error response a status code equal to that given -func (o *V1HostgroupsIDPutInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 hostgroups Id put internal server error response -func (o *V1HostgroupsIDPutInternalServerError) Code() int { - return 500 -} - -func (o *V1HostgroupsIDPutInternalServerError) Error() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutInternalServerError %+v", 500, o.Payload) -} - -func (o *V1HostgroupsIDPutInternalServerError) String() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutInternalServerError %+v", 500, o.Payload) -} - -func (o *V1HostgroupsIDPutInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostgroupsIDPutInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostgroupsIDPutGatewayTimeout creates a V1HostgroupsIDPutGatewayTimeout with default headers values -func NewV1HostgroupsIDPutGatewayTimeout() *V1HostgroupsIDPutGatewayTimeout { - return &V1HostgroupsIDPutGatewayTimeout{} -} - -/* -V1HostgroupsIDPutGatewayTimeout describes a response with status code 504, with default header values. - -Gateway Timeout. Request is still processing and taking longer than expected. -*/ -type V1HostgroupsIDPutGatewayTimeout struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hostgroups Id put gateway timeout response has a 2xx status code -func (o *V1HostgroupsIDPutGatewayTimeout) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups Id put gateway timeout response has a 3xx status code -func (o *V1HostgroupsIDPutGatewayTimeout) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups Id put gateway timeout response has a 4xx status code -func (o *V1HostgroupsIDPutGatewayTimeout) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups Id put gateway timeout response has a 5xx status code -func (o *V1HostgroupsIDPutGatewayTimeout) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 hostgroups Id put gateway timeout response a status code equal to that given -func (o *V1HostgroupsIDPutGatewayTimeout) IsCode(code int) bool { - return code == 504 -} - -// Code gets the status code for the v1 hostgroups Id put gateway timeout response -func (o *V1HostgroupsIDPutGatewayTimeout) Code() int { - return 504 -} - -func (o *V1HostgroupsIDPutGatewayTimeout) Error() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutGatewayTimeout %+v", 504, o.Payload) -} - -func (o *V1HostgroupsIDPutGatewayTimeout) String() string { - return fmt.Sprintf("[PUT /v1/hostgroups/{hostgroup_id}][%d] v1HostgroupsIdPutGatewayTimeout %+v", 504, o.Payload) -} - -func (o *V1HostgroupsIDPutGatewayTimeout) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostgroupsIDPutGatewayTimeout) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/hostgroups/v1_hostgroups_post_parameters.go b/power/client/hostgroups/v1_hostgroups_post_parameters.go deleted file mode 100644 index 56fe0baa..00000000 --- a/power/client/hostgroups/v1_hostgroups_post_parameters.go +++ /dev/null @@ -1,153 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package hostgroups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// NewV1HostgroupsPostParams creates a new V1HostgroupsPostParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewV1HostgroupsPostParams() *V1HostgroupsPostParams { - return &V1HostgroupsPostParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewV1HostgroupsPostParamsWithTimeout creates a new V1HostgroupsPostParams object -// with the ability to set a timeout on a request. -func NewV1HostgroupsPostParamsWithTimeout(timeout time.Duration) *V1HostgroupsPostParams { - return &V1HostgroupsPostParams{ - timeout: timeout, - } -} - -// NewV1HostgroupsPostParamsWithContext creates a new V1HostgroupsPostParams object -// with the ability to set a context for a request. -func NewV1HostgroupsPostParamsWithContext(ctx context.Context) *V1HostgroupsPostParams { - return &V1HostgroupsPostParams{ - Context: ctx, - } -} - -// NewV1HostgroupsPostParamsWithHTTPClient creates a new V1HostgroupsPostParams object -// with the ability to set a custom HTTPClient for a request. -func NewV1HostgroupsPostParamsWithHTTPClient(client *http.Client) *V1HostgroupsPostParams { - return &V1HostgroupsPostParams{ - HTTPClient: client, - } -} - -/* -V1HostgroupsPostParams contains all the parameters to send to the API endpoint - - for the v1 hostgroups post operation. - - Typically these are written to a http.Request. -*/ -type V1HostgroupsPostParams struct { - - /* Body. - - Parameters for the creation of a new hostgroup - */ - Body *models.HostgroupCreate - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the v1 hostgroups post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1HostgroupsPostParams) WithDefaults() *V1HostgroupsPostParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the v1 hostgroups post params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *V1HostgroupsPostParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the v1 hostgroups post params -func (o *V1HostgroupsPostParams) WithTimeout(timeout time.Duration) *V1HostgroupsPostParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the v1 hostgroups post params -func (o *V1HostgroupsPostParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the v1 hostgroups post params -func (o *V1HostgroupsPostParams) WithContext(ctx context.Context) *V1HostgroupsPostParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the v1 hostgroups post params -func (o *V1HostgroupsPostParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the v1 hostgroups post params -func (o *V1HostgroupsPostParams) WithHTTPClient(client *http.Client) *V1HostgroupsPostParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the v1 hostgroups post params -func (o *V1HostgroupsPostParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the v1 hostgroups post params -func (o *V1HostgroupsPostParams) WithBody(body *models.HostgroupCreate) *V1HostgroupsPostParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the v1 hostgroups post params -func (o *V1HostgroupsPostParams) SetBody(body *models.HostgroupCreate) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *V1HostgroupsPostParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/power/client/hostgroups/v1_hostgroups_post_responses.go b/power/client/hostgroups/v1_hostgroups_post_responses.go deleted file mode 100644 index 81b051bb..00000000 --- a/power/client/hostgroups/v1_hostgroups_post_responses.go +++ /dev/null @@ -1,621 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package hostgroups - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/IBM-Cloud/power-go-client/power/models" -) - -// V1HostgroupsPostReader is a Reader for the V1HostgroupsPost structure. -type V1HostgroupsPostReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *V1HostgroupsPostReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewV1HostgroupsPostCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewV1HostgroupsPostBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewV1HostgroupsPostUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewV1HostgroupsPostForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewV1HostgroupsPostConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewV1HostgroupsPostUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewV1HostgroupsPostInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 504: - result := NewV1HostgroupsPostGatewayTimeout() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /v1/hostgroups] v1.hostgroups.post", response, response.Code()) - } -} - -// NewV1HostgroupsPostCreated creates a V1HostgroupsPostCreated with default headers values -func NewV1HostgroupsPostCreated() *V1HostgroupsPostCreated { - return &V1HostgroupsPostCreated{} -} - -/* -V1HostgroupsPostCreated describes a response with status code 201, with default header values. - -Created -*/ -type V1HostgroupsPostCreated struct { - Payload *models.Hostgroup -} - -// IsSuccess returns true when this v1 hostgroups post created response has a 2xx status code -func (o *V1HostgroupsPostCreated) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this v1 hostgroups post created response has a 3xx status code -func (o *V1HostgroupsPostCreated) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups post created response has a 4xx status code -func (o *V1HostgroupsPostCreated) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups post created response has a 5xx status code -func (o *V1HostgroupsPostCreated) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups post created response a status code equal to that given -func (o *V1HostgroupsPostCreated) IsCode(code int) bool { - return code == 201 -} - -// Code gets the status code for the v1 hostgroups post created response -func (o *V1HostgroupsPostCreated) Code() int { - return 201 -} - -func (o *V1HostgroupsPostCreated) Error() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostCreated %+v", 201, o.Payload) -} - -func (o *V1HostgroupsPostCreated) String() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostCreated %+v", 201, o.Payload) -} - -func (o *V1HostgroupsPostCreated) GetPayload() *models.Hostgroup { - return o.Payload -} - -func (o *V1HostgroupsPostCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Hostgroup) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostgroupsPostBadRequest creates a V1HostgroupsPostBadRequest with default headers values -func NewV1HostgroupsPostBadRequest() *V1HostgroupsPostBadRequest { - return &V1HostgroupsPostBadRequest{} -} - -/* -V1HostgroupsPostBadRequest describes a response with status code 400, with default header values. - -Bad Request -*/ -type V1HostgroupsPostBadRequest struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hostgroups post bad request response has a 2xx status code -func (o *V1HostgroupsPostBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups post bad request response has a 3xx status code -func (o *V1HostgroupsPostBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups post bad request response has a 4xx status code -func (o *V1HostgroupsPostBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups post bad request response has a 5xx status code -func (o *V1HostgroupsPostBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups post bad request response a status code equal to that given -func (o *V1HostgroupsPostBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the v1 hostgroups post bad request response -func (o *V1HostgroupsPostBadRequest) Code() int { - return 400 -} - -func (o *V1HostgroupsPostBadRequest) Error() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostBadRequest %+v", 400, o.Payload) -} - -func (o *V1HostgroupsPostBadRequest) String() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostBadRequest %+v", 400, o.Payload) -} - -func (o *V1HostgroupsPostBadRequest) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostgroupsPostBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostgroupsPostUnauthorized creates a V1HostgroupsPostUnauthorized with default headers values -func NewV1HostgroupsPostUnauthorized() *V1HostgroupsPostUnauthorized { - return &V1HostgroupsPostUnauthorized{} -} - -/* -V1HostgroupsPostUnauthorized describes a response with status code 401, with default header values. - -Unauthorized -*/ -type V1HostgroupsPostUnauthorized struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hostgroups post unauthorized response has a 2xx status code -func (o *V1HostgroupsPostUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups post unauthorized response has a 3xx status code -func (o *V1HostgroupsPostUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups post unauthorized response has a 4xx status code -func (o *V1HostgroupsPostUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups post unauthorized response has a 5xx status code -func (o *V1HostgroupsPostUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups post unauthorized response a status code equal to that given -func (o *V1HostgroupsPostUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the v1 hostgroups post unauthorized response -func (o *V1HostgroupsPostUnauthorized) Code() int { - return 401 -} - -func (o *V1HostgroupsPostUnauthorized) Error() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostUnauthorized %+v", 401, o.Payload) -} - -func (o *V1HostgroupsPostUnauthorized) String() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostUnauthorized %+v", 401, o.Payload) -} - -func (o *V1HostgroupsPostUnauthorized) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostgroupsPostUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostgroupsPostForbidden creates a V1HostgroupsPostForbidden with default headers values -func NewV1HostgroupsPostForbidden() *V1HostgroupsPostForbidden { - return &V1HostgroupsPostForbidden{} -} - -/* -V1HostgroupsPostForbidden describes a response with status code 403, with default header values. - -Forbidden -*/ -type V1HostgroupsPostForbidden struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hostgroups post forbidden response has a 2xx status code -func (o *V1HostgroupsPostForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups post forbidden response has a 3xx status code -func (o *V1HostgroupsPostForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups post forbidden response has a 4xx status code -func (o *V1HostgroupsPostForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups post forbidden response has a 5xx status code -func (o *V1HostgroupsPostForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups post forbidden response a status code equal to that given -func (o *V1HostgroupsPostForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the v1 hostgroups post forbidden response -func (o *V1HostgroupsPostForbidden) Code() int { - return 403 -} - -func (o *V1HostgroupsPostForbidden) Error() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostForbidden %+v", 403, o.Payload) -} - -func (o *V1HostgroupsPostForbidden) String() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostForbidden %+v", 403, o.Payload) -} - -func (o *V1HostgroupsPostForbidden) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostgroupsPostForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostgroupsPostConflict creates a V1HostgroupsPostConflict with default headers values -func NewV1HostgroupsPostConflict() *V1HostgroupsPostConflict { - return &V1HostgroupsPostConflict{} -} - -/* -V1HostgroupsPostConflict describes a response with status code 409, with default header values. - -Conflict -*/ -type V1HostgroupsPostConflict struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hostgroups post conflict response has a 2xx status code -func (o *V1HostgroupsPostConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups post conflict response has a 3xx status code -func (o *V1HostgroupsPostConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups post conflict response has a 4xx status code -func (o *V1HostgroupsPostConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups post conflict response has a 5xx status code -func (o *V1HostgroupsPostConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups post conflict response a status code equal to that given -func (o *V1HostgroupsPostConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the v1 hostgroups post conflict response -func (o *V1HostgroupsPostConflict) Code() int { - return 409 -} - -func (o *V1HostgroupsPostConflict) Error() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostConflict %+v", 409, o.Payload) -} - -func (o *V1HostgroupsPostConflict) String() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostConflict %+v", 409, o.Payload) -} - -func (o *V1HostgroupsPostConflict) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostgroupsPostConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostgroupsPostUnprocessableEntity creates a V1HostgroupsPostUnprocessableEntity with default headers values -func NewV1HostgroupsPostUnprocessableEntity() *V1HostgroupsPostUnprocessableEntity { - return &V1HostgroupsPostUnprocessableEntity{} -} - -/* -V1HostgroupsPostUnprocessableEntity describes a response with status code 422, with default header values. - -Unprocessable Entity -*/ -type V1HostgroupsPostUnprocessableEntity struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hostgroups post unprocessable entity response has a 2xx status code -func (o *V1HostgroupsPostUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups post unprocessable entity response has a 3xx status code -func (o *V1HostgroupsPostUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups post unprocessable entity response has a 4xx status code -func (o *V1HostgroupsPostUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this v1 hostgroups post unprocessable entity response has a 5xx status code -func (o *V1HostgroupsPostUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this v1 hostgroups post unprocessable entity response a status code equal to that given -func (o *V1HostgroupsPostUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the v1 hostgroups post unprocessable entity response -func (o *V1HostgroupsPostUnprocessableEntity) Code() int { - return 422 -} - -func (o *V1HostgroupsPostUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *V1HostgroupsPostUnprocessableEntity) String() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *V1HostgroupsPostUnprocessableEntity) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostgroupsPostUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostgroupsPostInternalServerError creates a V1HostgroupsPostInternalServerError with default headers values -func NewV1HostgroupsPostInternalServerError() *V1HostgroupsPostInternalServerError { - return &V1HostgroupsPostInternalServerError{} -} - -/* -V1HostgroupsPostInternalServerError describes a response with status code 500, with default header values. - -Internal Server Error -*/ -type V1HostgroupsPostInternalServerError struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hostgroups post internal server error response has a 2xx status code -func (o *V1HostgroupsPostInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups post internal server error response has a 3xx status code -func (o *V1HostgroupsPostInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups post internal server error response has a 4xx status code -func (o *V1HostgroupsPostInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups post internal server error response has a 5xx status code -func (o *V1HostgroupsPostInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 hostgroups post internal server error response a status code equal to that given -func (o *V1HostgroupsPostInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the v1 hostgroups post internal server error response -func (o *V1HostgroupsPostInternalServerError) Code() int { - return 500 -} - -func (o *V1HostgroupsPostInternalServerError) Error() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostInternalServerError %+v", 500, o.Payload) -} - -func (o *V1HostgroupsPostInternalServerError) String() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostInternalServerError %+v", 500, o.Payload) -} - -func (o *V1HostgroupsPostInternalServerError) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostgroupsPostInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewV1HostgroupsPostGatewayTimeout creates a V1HostgroupsPostGatewayTimeout with default headers values -func NewV1HostgroupsPostGatewayTimeout() *V1HostgroupsPostGatewayTimeout { - return &V1HostgroupsPostGatewayTimeout{} -} - -/* -V1HostgroupsPostGatewayTimeout describes a response with status code 504, with default header values. - -Gateway Timeout. Request is still processing and taking longer than expected. -*/ -type V1HostgroupsPostGatewayTimeout struct { - Payload *models.Error -} - -// IsSuccess returns true when this v1 hostgroups post gateway timeout response has a 2xx status code -func (o *V1HostgroupsPostGatewayTimeout) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this v1 hostgroups post gateway timeout response has a 3xx status code -func (o *V1HostgroupsPostGatewayTimeout) IsRedirect() bool { - return false -} - -// IsClientError returns true when this v1 hostgroups post gateway timeout response has a 4xx status code -func (o *V1HostgroupsPostGatewayTimeout) IsClientError() bool { - return false -} - -// IsServerError returns true when this v1 hostgroups post gateway timeout response has a 5xx status code -func (o *V1HostgroupsPostGatewayTimeout) IsServerError() bool { - return true -} - -// IsCode returns true when this v1 hostgroups post gateway timeout response a status code equal to that given -func (o *V1HostgroupsPostGatewayTimeout) IsCode(code int) bool { - return code == 504 -} - -// Code gets the status code for the v1 hostgroups post gateway timeout response -func (o *V1HostgroupsPostGatewayTimeout) Code() int { - return 504 -} - -func (o *V1HostgroupsPostGatewayTimeout) Error() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostGatewayTimeout %+v", 504, o.Payload) -} - -func (o *V1HostgroupsPostGatewayTimeout) String() string { - return fmt.Sprintf("[POST /v1/hostgroups][%d] v1HostgroupsPostGatewayTimeout %+v", 504, o.Payload) -} - -func (o *V1HostgroupsPostGatewayTimeout) GetPayload() *models.Error { - return o.Payload -} - -func (o *V1HostgroupsPostGatewayTimeout) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/power/client/p_cloud_volumes/p_cloud_volumes_client.go b/power/client/p_cloud_volumes/p_cloud_volumes_client.go index c662828e..e2819358 100644 --- a/power/client/p_cloud_volumes/p_cloud_volumes_client.go +++ b/power/client/p_cloud_volumes/p_cloud_volumes_client.go @@ -519,7 +519,11 @@ func (a *Client) PcloudPvminstancesVolumesGetall(params *PcloudPvminstancesVolum } /* -PcloudPvminstancesVolumesPost attaches a volume to a p VM instance + PcloudPvminstancesVolumesPost attaches a volume to a p VM instance + + Attach a volume to a PVMInstance. + +>**Note**: In the case of VMRM, the first volume being attached will be converted to a bootable volume. */ func (a *Client) PcloudPvminstancesVolumesPost(params *PcloudPvminstancesVolumesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVolumesPostOK, error) { // TODO: Validate the params before sending @@ -597,7 +601,11 @@ func (a *Client) PcloudPvminstancesVolumesPut(params *PcloudPvminstancesVolumesP } /* -PcloudPvminstancesVolumesSetbootPut sets the p VM instance volume as the boot volume + PcloudPvminstancesVolumesSetbootPut sets the p VM instance volume as the boot volume + + Set the PVMInstance volume as the boot volume. + +>**Note**: If a non-bootable volume is provided, it will be converted to a bootable volume and then attached. */ func (a *Client) PcloudPvminstancesVolumesSetbootPut(params *PcloudPvminstancesVolumesSetbootPutParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudPvminstancesVolumesSetbootPutOK, error) { // TODO: Validate the params before sending @@ -675,7 +683,11 @@ func (a *Client) PcloudV2PvminstancesVolumesDelete(params *PcloudV2PvminstancesV } /* -PcloudV2PvminstancesVolumesPost attaches all volumes to a p VM instance + PcloudV2PvminstancesVolumesPost attaches all volumes to a p VM instance + + Attach all volumes to a PVMInstance. + +>**Note**: In the case of VMRM, if a single volume ID is provided in the 'volumeIDs' field, that volume will be converted to a bootable volume and then attached. */ func (a *Client) PcloudV2PvminstancesVolumesPost(params *PcloudV2PvminstancesVolumesPostParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PcloudV2PvminstancesVolumesPostAccepted, error) { // TODO: Validate the params before sending diff --git a/power/client/power_iaas_api_client.go b/power/client/power_iaas_api_client.go index 2b8c1a8c..fe13576c 100644 --- a/power/client/power_iaas_api_client.go +++ b/power/client/power_iaas_api_client.go @@ -15,7 +15,7 @@ import ( "github.com/IBM-Cloud/power-go-client/power/client/catalog" "github.com/IBM-Cloud/power-go-client/power/client/datacenters" "github.com/IBM-Cloud/power-go-client/power/client/hardware_platforms" - "github.com/IBM-Cloud/power-go-client/power/client/hostgroups" + "github.com/IBM-Cloud/power-go-client/power/client/host_groups" "github.com/IBM-Cloud/power-go-client/power/client/iaas_service_broker" "github.com/IBM-Cloud/power-go-client/power/client/internal_power_v_s_instances" "github.com/IBM-Cloud/power-go-client/power/client/internal_power_v_s_locations" @@ -102,7 +102,7 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *PowerIaasA cli.Catalog = catalog.New(transport, formats) cli.Datacenters = datacenters.New(transport, formats) cli.HardwarePlatforms = hardware_platforms.New(transport, formats) - cli.Hostgroups = hostgroups.New(transport, formats) + cli.HostGroups = host_groups.New(transport, formats) cli.IaasServiceBroker = iaas_service_broker.New(transport, formats) cli.InternalPowervsInstances = internal_power_v_s_instances.New(transport, formats) cli.InternalPowervsLocations = internal_power_v_s_locations.New(transport, formats) @@ -194,7 +194,7 @@ type PowerIaasAPI struct { HardwarePlatforms hardware_platforms.ClientService - Hostgroups hostgroups.ClientService + HostGroups host_groups.ClientService IaasServiceBroker iaas_service_broker.ClientService @@ -281,7 +281,7 @@ func (c *PowerIaasAPI) SetTransport(transport runtime.ClientTransport) { c.Catalog.SetTransport(transport) c.Datacenters.SetTransport(transport) c.HardwarePlatforms.SetTransport(transport) - c.Hostgroups.SetTransport(transport) + c.HostGroups.SetTransport(transport) c.IaasServiceBroker.SetTransport(transport) c.InternalPowervsInstances.SetTransport(transport) c.InternalPowervsLocations.SetTransport(transport) diff --git a/power/models/add_host.go b/power/models/add_host.go index fb06e74e..b0e6358a 100644 --- a/power/models/add_host.go +++ b/power/models/add_host.go @@ -14,7 +14,7 @@ import ( "github.com/go-openapi/validate" ) -// AddHost Host to add to a hostgroup +// AddHost Host to add to a host group // // swagger:model AddHost type AddHost struct { diff --git a/power/models/available_host.go b/power/models/available_host.go index 35b33173..db8b23ba 100644 --- a/power/models/available_host.go +++ b/power/models/available_host.go @@ -19,7 +19,7 @@ import ( type AvailableHost struct { // Resource capacities for that system type and configuration - Capacity *HostAvailableCapacity `json:"capacity,omitempty"` + Capacity *AvailableHostCapacity `json:"capacity,omitempty"` // How many hosts of such type/capacities are available Count int64 `json:"count,omitempty"` diff --git a/power/models/available_host_capacity.go b/power/models/available_host_capacity.go new file mode 100644 index 00000000..1b4ec156 --- /dev/null +++ b/power/models/available_host_capacity.go @@ -0,0 +1,160 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AvailableHostCapacity available host capacity +// +// swagger:model AvailableHostCapacity +type AvailableHostCapacity struct { + + // Core capacity of the host + Cores *AvailableHostResourceCapacity `json:"cores,omitempty"` + + // Memory capacity of the host (in MB) + Memory *AvailableHostResourceCapacity `json:"memory,omitempty"` +} + +// Validate validates this available host capacity +func (m *AvailableHostCapacity) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCores(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMemory(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AvailableHostCapacity) validateCores(formats strfmt.Registry) error { + if swag.IsZero(m.Cores) { // not required + return nil + } + + if m.Cores != nil { + if err := m.Cores.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cores") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cores") + } + return err + } + } + + return nil +} + +func (m *AvailableHostCapacity) validateMemory(formats strfmt.Registry) error { + if swag.IsZero(m.Memory) { // not required + return nil + } + + if m.Memory != nil { + if err := m.Memory.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("memory") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("memory") + } + return err + } + } + + return nil +} + +// ContextValidate validate this available host capacity based on the context it is used +func (m *AvailableHostCapacity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCores(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMemory(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AvailableHostCapacity) contextValidateCores(ctx context.Context, formats strfmt.Registry) error { + + if m.Cores != nil { + + if swag.IsZero(m.Cores) { // not required + return nil + } + + if err := m.Cores.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cores") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cores") + } + return err + } + } + + return nil +} + +func (m *AvailableHostCapacity) contextValidateMemory(ctx context.Context, formats strfmt.Registry) error { + + if m.Memory != nil { + + if swag.IsZero(m.Memory) { // not required + return nil + } + + if err := m.Memory.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("memory") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("memory") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *AvailableHostCapacity) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AvailableHostCapacity) UnmarshalBinary(b []byte) error { + var res AvailableHostCapacity + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/power/models/available_host_resource_capacity.go b/power/models/available_host_resource_capacity.go new file mode 100644 index 00000000..ba0e0591 --- /dev/null +++ b/power/models/available_host_resource_capacity.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AvailableHostResourceCapacity available host resource capacity +// +// swagger:model AvailableHostResourceCapacity +type AvailableHostResourceCapacity struct { + + // available + Available float64 `json:"available,omitempty"` +} + +// Validate validates this available host resource capacity +func (m *AvailableHostResourceCapacity) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this available host resource capacity based on context it is used +func (m *AvailableHostResourceCapacity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *AvailableHostResourceCapacity) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AvailableHostResourceCapacity) UnmarshalBinary(b []byte) error { + var res AvailableHostResourceCapacity + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/power/models/create_cos_image_import_job.go b/power/models/create_cos_image_import_job.go index 12186df3..7511771e 100644 --- a/power/models/create_cos_image_import_job.go +++ b/power/models/create_cos_image_import_job.go @@ -39,6 +39,9 @@ type CreateCosImageImportJob struct { // Required: true ImageName *string `json:"imageName"` + // Import details for SAP images + ImportDetails *ImageImportDetails `json:"importDetails,omitempty"` + // Image OS Type, required if importing a raw image; raw images can only be imported using the command line interface // Enum: [aix ibmi rhel sles] OsType string `json:"osType,omitempty"` @@ -80,6 +83,10 @@ func (m *CreateCosImageImportJob) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateImportDetails(formats); err != nil { + res = append(res, err) + } + if err := m.validateOsType(formats); err != nil { res = append(res, err) } @@ -167,6 +174,25 @@ func (m *CreateCosImageImportJob) validateImageName(formats strfmt.Registry) err return nil } +func (m *CreateCosImageImportJob) validateImportDetails(formats strfmt.Registry) error { + if swag.IsZero(m.ImportDetails) { // not required + return nil + } + + if m.ImportDetails != nil { + if err := m.ImportDetails.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("importDetails") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("importDetails") + } + return err + } + } + + return nil +} + var createCosImageImportJobTypeOsTypePropEnum []interface{} func init() { @@ -247,6 +273,10 @@ func (m *CreateCosImageImportJob) validateStorageAffinity(formats strfmt.Registr func (m *CreateCosImageImportJob) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error + if err := m.contextValidateImportDetails(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateStorageAffinity(ctx, formats); err != nil { res = append(res, err) } @@ -257,6 +287,27 @@ func (m *CreateCosImageImportJob) ContextValidate(ctx context.Context, formats s return nil } +func (m *CreateCosImageImportJob) contextValidateImportDetails(ctx context.Context, formats strfmt.Registry) error { + + if m.ImportDetails != nil { + + if swag.IsZero(m.ImportDetails) { // not required + return nil + } + + if err := m.ImportDetails.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("importDetails") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("importDetails") + } + return err + } + } + + return nil +} + func (m *CreateCosImageImportJob) contextValidateStorageAffinity(ctx context.Context, formats strfmt.Registry) error { if m.StorageAffinity != nil { diff --git a/power/models/host.go b/power/models/host.go index d0ad65f7..51e2d4a4 100644 --- a/power/models/host.go +++ b/power/models/host.go @@ -24,8 +24,8 @@ type Host struct { // Name of the host (chosen by the user) DisplayName string `json:"displayName,omitempty"` - // Link to the owning hostgroup - Hostgroup HostgroupHref `json:"hostgroup,omitempty"` + // Information about the owning host group + HostGroup *HostGroupSummary `json:"hostGroup,omitempty"` // ID of the host ID string `json:"id,omitempty"` @@ -48,7 +48,7 @@ func (m *Host) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateHostgroup(formats); err != nil { + if err := m.validateHostGroup(formats); err != nil { res = append(res, err) } @@ -77,18 +77,20 @@ func (m *Host) validateCapacity(formats strfmt.Registry) error { return nil } -func (m *Host) validateHostgroup(formats strfmt.Registry) error { - if swag.IsZero(m.Hostgroup) { // not required +func (m *Host) validateHostGroup(formats strfmt.Registry) error { + if swag.IsZero(m.HostGroup) { // not required return nil } - if err := m.Hostgroup.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("hostgroup") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("hostgroup") + if m.HostGroup != nil { + if err := m.HostGroup.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("hostGroup") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("hostGroup") + } + return err } - return err } return nil @@ -102,7 +104,7 @@ func (m *Host) ContextValidate(ctx context.Context, formats strfmt.Registry) err res = append(res, err) } - if err := m.contextValidateHostgroup(ctx, formats); err != nil { + if err := m.contextValidateHostGroup(ctx, formats); err != nil { res = append(res, err) } @@ -133,19 +135,22 @@ func (m *Host) contextValidateCapacity(ctx context.Context, formats strfmt.Regis return nil } -func (m *Host) contextValidateHostgroup(ctx context.Context, formats strfmt.Registry) error { +func (m *Host) contextValidateHostGroup(ctx context.Context, formats strfmt.Registry) error { - if swag.IsZero(m.Hostgroup) { // not required - return nil - } + if m.HostGroup != nil { - if err := m.Hostgroup.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("hostgroup") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("hostgroup") + if swag.IsZero(m.HostGroup) { // not required + return nil + } + + if err := m.HostGroup.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("hostGroup") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("hostGroup") + } + return err } - return err } return nil diff --git a/power/models/host_available_capacity.go b/power/models/host_available_capacity.go deleted file mode 100644 index 4099a90f..00000000 --- a/power/models/host_available_capacity.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// HostAvailableCapacity host available capacity -// -// swagger:model HostAvailableCapacity -type HostAvailableCapacity struct { - - // Number of cores available on the host - AvailableCore float64 `json:"availableCore,omitempty"` - - // Memory capacity available on the host (in MB) - AvailableMemory float64 `json:"availableMemory,omitempty"` -} - -// Validate validates this host available capacity -func (m *HostAvailableCapacity) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this host available capacity based on context it is used -func (m *HostAvailableCapacity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *HostAvailableCapacity) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *HostAvailableCapacity) UnmarshalBinary(b []byte) error { - var res HostAvailableCapacity - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/power/models/host_capacity.go b/power/models/host_capacity.go index 1e822fb7..9ded7f72 100644 --- a/power/models/host_capacity.go +++ b/power/models/host_capacity.go @@ -8,6 +8,7 @@ package models import ( "context" + "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) @@ -17,38 +18,126 @@ import ( // swagger:model HostCapacity type HostCapacity struct { - // Number of cores currently available - AvailableCore float64 `json:"availableCore,omitempty"` + // Core capacity of the host + Cores *HostResourceCapacity `json:"cores,omitempty"` - // Amount of memory currently available (in MB) - AvailableMemory float64 `json:"availableMemory,omitempty"` + // Memory capacity of the host (in MB) + Memory *HostResourceCapacity `json:"memory,omitempty"` +} - // Number of cores reserved for system use - ReservedCore float64 `json:"reservedCore,omitempty"` +// Validate validates this host capacity +func (m *HostCapacity) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCores(formats); err != nil { + res = append(res, err) + } - // Amount of memory reserved for system use (in MB) - ReservedMemory float64 `json:"reservedMemory,omitempty"` + if err := m.validateMemory(formats); err != nil { + res = append(res, err) + } - // Total number of cores of the host - TotalCore float64 `json:"totalCore,omitempty"` + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} - // Total amount of memory of the host (in MB) - TotalMemory float64 `json:"totalMemory,omitempty"` +func (m *HostCapacity) validateCores(formats strfmt.Registry) error { + if swag.IsZero(m.Cores) { // not required + return nil + } - // Number of cores in use on the host - UsedCore float64 `json:"usedCore,omitempty"` + if m.Cores != nil { + if err := m.Cores.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cores") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cores") + } + return err + } + } - // Amount of memory used on the host (in MB) - UsedMemory float64 `json:"usedMemory,omitempty"` + return nil } -// Validate validates this host capacity -func (m *HostCapacity) Validate(formats strfmt.Registry) error { +func (m *HostCapacity) validateMemory(formats strfmt.Registry) error { + if swag.IsZero(m.Memory) { // not required + return nil + } + + if m.Memory != nil { + if err := m.Memory.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("memory") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("memory") + } + return err + } + } + return nil } -// ContextValidate validates this host capacity based on context it is used +// ContextValidate validate this host capacity based on the context it is used func (m *HostCapacity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCores(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMemory(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *HostCapacity) contextValidateCores(ctx context.Context, formats strfmt.Registry) error { + + if m.Cores != nil { + + if swag.IsZero(m.Cores) { // not required + return nil + } + + if err := m.Cores.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cores") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("cores") + } + return err + } + } + + return nil +} + +func (m *HostCapacity) contextValidateMemory(ctx context.Context, formats strfmt.Registry) error { + + if m.Memory != nil { + + if swag.IsZero(m.Memory) { // not required + return nil + } + + if err := m.Memory.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("memory") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("memory") + } + return err + } + } + return nil } diff --git a/power/models/host_create.go b/power/models/host_create.go index 0e7d68ee..8c256de8 100644 --- a/power/models/host_create.go +++ b/power/models/host_create.go @@ -7,6 +7,7 @@ package models import ( "context" + "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" @@ -14,29 +15,29 @@ import ( "github.com/go-openapi/validate" ) -// HostCreate Parameters to add a host to an existing hostgroup +// HostCreate Parameters to add a host to an existing host group // // swagger:model HostCreate type HostCreate struct { - // Host to be added + // ID of the host group to which the host should be added // Required: true - Host *AddHost `json:"host"` + HostGroupID *string `json:"hostGroupID"` - // ID of the hostgroup to which the host should be added + // Hosts to be added // Required: true - HostgroupID *string `json:"hostgroupID"` + Hosts []*AddHost `json:"hosts"` } // Validate validates this host create func (m *HostCreate) Validate(formats strfmt.Registry) error { var res []error - if err := m.validateHost(formats); err != nil { + if err := m.validateHostGroupID(formats); err != nil { res = append(res, err) } - if err := m.validateHostgroupID(formats); err != nil { + if err := m.validateHosts(formats); err != nil { res = append(res, err) } @@ -46,32 +47,39 @@ func (m *HostCreate) Validate(formats strfmt.Registry) error { return nil } -func (m *HostCreate) validateHost(formats strfmt.Registry) error { +func (m *HostCreate) validateHostGroupID(formats strfmt.Registry) error { - if err := validate.Required("host", "body", m.Host); err != nil { + if err := validate.Required("hostGroupID", "body", m.HostGroupID); err != nil { return err } - if m.Host != nil { - if err := m.Host.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("host") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("host") - } - return err - } - } - return nil } -func (m *HostCreate) validateHostgroupID(formats strfmt.Registry) error { +func (m *HostCreate) validateHosts(formats strfmt.Registry) error { - if err := validate.Required("hostgroupID", "body", m.HostgroupID); err != nil { + if err := validate.Required("hosts", "body", m.Hosts); err != nil { return err } + for i := 0; i < len(m.Hosts); i++ { + if swag.IsZero(m.Hosts[i]) { // not required + continue + } + + if m.Hosts[i] != nil { + if err := m.Hosts[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("hosts" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("hosts" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + return nil } @@ -79,7 +87,7 @@ func (m *HostCreate) validateHostgroupID(formats strfmt.Registry) error { func (m *HostCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error - if err := m.contextValidateHost(ctx, formats); err != nil { + if err := m.contextValidateHosts(ctx, formats); err != nil { res = append(res, err) } @@ -89,18 +97,26 @@ func (m *HostCreate) ContextValidate(ctx context.Context, formats strfmt.Registr return nil } -func (m *HostCreate) contextValidateHost(ctx context.Context, formats strfmt.Registry) error { +func (m *HostCreate) contextValidateHosts(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Hosts); i++ { - if m.Host != nil { + if m.Hosts[i] != nil { - if err := m.Host.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("host") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("host") + if swag.IsZero(m.Hosts[i]) { // not required + return nil + } + + if err := m.Hosts[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("hosts" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("hosts" + "." + strconv.Itoa(i)) + } + return err } - return err } + } return nil diff --git a/power/models/hostgroup.go b/power/models/host_group.go similarity index 74% rename from power/models/hostgroup.go rename to power/models/host_group.go index 7ca1c07c..91c21cd7 100644 --- a/power/models/hostgroup.go +++ b/power/models/host_group.go @@ -15,33 +15,33 @@ import ( "github.com/go-openapi/validate" ) -// Hostgroup Description of a hostgroup +// HostGroup Description of a host group // -// swagger:model Hostgroup -type Hostgroup struct { +// swagger:model HostGroup +type HostGroup struct { - // Date/Time of hostgroup creation + // Date/Time of host group creation // Format: date-time CreationDate strfmt.DateTime `json:"creationDate,omitempty"` // List of hosts Hosts []HostHref `json:"hosts"` - // Hostgroup ID + // Host group ID ID string `json:"id,omitempty"` - // Name of the hostgroup + // Name of the host group Name string `json:"name,omitempty"` - // Name of the workspace owning the hostgroup + // Name of the workspace owning the host group Primary string `json:"primary,omitempty"` - // Names of workspaces the hostgroup has been shared with + // Names of workspaces the host group has been shared with Secondaries []string `json:"secondaries"` } -// Validate validates this hostgroup -func (m *Hostgroup) Validate(formats strfmt.Registry) error { +// Validate validates this host group +func (m *HostGroup) Validate(formats strfmt.Registry) error { var res []error if err := m.validateCreationDate(formats); err != nil { @@ -58,7 +58,7 @@ func (m *Hostgroup) Validate(formats strfmt.Registry) error { return nil } -func (m *Hostgroup) validateCreationDate(formats strfmt.Registry) error { +func (m *HostGroup) validateCreationDate(formats strfmt.Registry) error { if swag.IsZero(m.CreationDate) { // not required return nil } @@ -70,7 +70,7 @@ func (m *Hostgroup) validateCreationDate(formats strfmt.Registry) error { return nil } -func (m *Hostgroup) validateHosts(formats strfmt.Registry) error { +func (m *HostGroup) validateHosts(formats strfmt.Registry) error { if swag.IsZero(m.Hosts) { // not required return nil } @@ -91,8 +91,8 @@ func (m *Hostgroup) validateHosts(formats strfmt.Registry) error { return nil } -// ContextValidate validate this hostgroup based on the context it is used -func (m *Hostgroup) ContextValidate(ctx context.Context, formats strfmt.Registry) error { +// ContextValidate validate this host group based on the context it is used +func (m *HostGroup) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error if err := m.contextValidateHosts(ctx, formats); err != nil { @@ -105,7 +105,7 @@ func (m *Hostgroup) ContextValidate(ctx context.Context, formats strfmt.Registry return nil } -func (m *Hostgroup) contextValidateHosts(ctx context.Context, formats strfmt.Registry) error { +func (m *HostGroup) contextValidateHosts(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Hosts); i++ { @@ -128,7 +128,7 @@ func (m *Hostgroup) contextValidateHosts(ctx context.Context, formats strfmt.Reg } // MarshalBinary interface implementation -func (m *Hostgroup) MarshalBinary() ([]byte, error) { +func (m *HostGroup) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -136,8 +136,8 @@ func (m *Hostgroup) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *Hostgroup) UnmarshalBinary(b []byte) error { - var res Hostgroup +func (m *HostGroup) UnmarshalBinary(b []byte) error { + var res HostGroup if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/power/models/hostgroup_create.go b/power/models/host_group_create.go similarity index 78% rename from power/models/hostgroup_create.go rename to power/models/host_group_create.go index b2c8b2cd..ddd5fc9f 100644 --- a/power/models/hostgroup_create.go +++ b/power/models/host_group_create.go @@ -15,25 +15,25 @@ import ( "github.com/go-openapi/validate" ) -// HostgroupCreate Parameters for the creation of a new hostgroup +// HostGroupCreate Parameters for the creation of a new host group // -// swagger:model HostgroupCreate -type HostgroupCreate struct { +// swagger:model HostGroupCreate +type HostGroupCreate struct { - // List of hosts to add to the group + // List of hosts to add to the host group // Required: true Hosts []*AddHost `json:"hosts"` - // Name of the hostgroup to create + // Name of the host group to create // Required: true Name *string `json:"name"` - // List of workspace names to share the hostgroup with (optional) + // List of workspace names to share the host group with (optional) Secondaries []*Secondary `json:"secondaries"` } -// Validate validates this hostgroup create -func (m *HostgroupCreate) Validate(formats strfmt.Registry) error { +// Validate validates this host group create +func (m *HostGroupCreate) Validate(formats strfmt.Registry) error { var res []error if err := m.validateHosts(formats); err != nil { @@ -54,7 +54,7 @@ func (m *HostgroupCreate) Validate(formats strfmt.Registry) error { return nil } -func (m *HostgroupCreate) validateHosts(formats strfmt.Registry) error { +func (m *HostGroupCreate) validateHosts(formats strfmt.Registry) error { if err := validate.Required("hosts", "body", m.Hosts); err != nil { return err @@ -81,7 +81,7 @@ func (m *HostgroupCreate) validateHosts(formats strfmt.Registry) error { return nil } -func (m *HostgroupCreate) validateName(formats strfmt.Registry) error { +func (m *HostGroupCreate) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { return err @@ -90,7 +90,7 @@ func (m *HostgroupCreate) validateName(formats strfmt.Registry) error { return nil } -func (m *HostgroupCreate) validateSecondaries(formats strfmt.Registry) error { +func (m *HostGroupCreate) validateSecondaries(formats strfmt.Registry) error { if swag.IsZero(m.Secondaries) { // not required return nil } @@ -116,8 +116,8 @@ func (m *HostgroupCreate) validateSecondaries(formats strfmt.Registry) error { return nil } -// ContextValidate validate this hostgroup create based on the context it is used -func (m *HostgroupCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { +// ContextValidate validate this host group create based on the context it is used +func (m *HostGroupCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error if err := m.contextValidateHosts(ctx, formats); err != nil { @@ -134,7 +134,7 @@ func (m *HostgroupCreate) ContextValidate(ctx context.Context, formats strfmt.Re return nil } -func (m *HostgroupCreate) contextValidateHosts(ctx context.Context, formats strfmt.Registry) error { +func (m *HostGroupCreate) contextValidateHosts(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Hosts); i++ { @@ -159,7 +159,7 @@ func (m *HostgroupCreate) contextValidateHosts(ctx context.Context, formats strf return nil } -func (m *HostgroupCreate) contextValidateSecondaries(ctx context.Context, formats strfmt.Registry) error { +func (m *HostGroupCreate) contextValidateSecondaries(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Secondaries); i++ { @@ -185,7 +185,7 @@ func (m *HostgroupCreate) contextValidateSecondaries(ctx context.Context, format } // MarshalBinary interface implementation -func (m *HostgroupCreate) MarshalBinary() ([]byte, error) { +func (m *HostGroupCreate) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -193,8 +193,8 @@ func (m *HostgroupCreate) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *HostgroupCreate) UnmarshalBinary(b []byte) error { - var res HostgroupCreate +func (m *HostGroupCreate) UnmarshalBinary(b []byte) error { + var res HostGroupCreate if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/power/models/hostgroup_list.go b/power/models/host_group_list.go similarity index 79% rename from power/models/hostgroup_list.go rename to power/models/host_group_list.go index bdcc2bb3..617cb02d 100644 --- a/power/models/hostgroup_list.go +++ b/power/models/host_group_list.go @@ -14,13 +14,13 @@ import ( "github.com/go-openapi/swag" ) -// HostgroupList hostgroup list +// HostGroupList host group list // -// swagger:model HostgroupList -type HostgroupList []*Hostgroup +// swagger:model HostGroupList +type HostGroupList []*HostGroup -// Validate validates this hostgroup list -func (m HostgroupList) Validate(formats strfmt.Registry) error { +// Validate validates this host group list +func (m HostGroupList) Validate(formats strfmt.Registry) error { var res []error for i := 0; i < len(m); i++ { @@ -47,8 +47,8 @@ func (m HostgroupList) Validate(formats strfmt.Registry) error { return nil } -// ContextValidate validate this hostgroup list based on the context it is used -func (m HostgroupList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { +// ContextValidate validate this host group list based on the context it is used +func (m HostGroupList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error for i := 0; i < len(m); i++ { diff --git a/power/models/hostgroup_share_op.go b/power/models/host_group_share_op.go similarity index 72% rename from power/models/hostgroup_share_op.go rename to power/models/host_group_share_op.go index ebd3fd75..fe1f2c99 100644 --- a/power/models/hostgroup_share_op.go +++ b/power/models/host_group_share_op.go @@ -14,20 +14,20 @@ import ( "github.com/go-openapi/swag" ) -// HostgroupShareOp Operation updating the sharing status (mutually exclusive) +// HostGroupShareOp Operation updating the sharing status (mutually exclusive) // -// swagger:model HostgroupShareOp -type HostgroupShareOp struct { +// swagger:model HostGroupShareOp +type HostGroupShareOp struct { - // List of workspace names to share the hostgroup with + // List of workspace names to share the host group with Add []*Secondary `json:"add"` - // A workspace name to stop sharing the hostgroup with + // A workspace name to stop sharing the host group with Remove string `json:"remove,omitempty"` } -// Validate validates this hostgroup share op -func (m *HostgroupShareOp) Validate(formats strfmt.Registry) error { +// Validate validates this host group share op +func (m *HostGroupShareOp) Validate(formats strfmt.Registry) error { var res []error if err := m.validateAdd(formats); err != nil { @@ -40,7 +40,7 @@ func (m *HostgroupShareOp) Validate(formats strfmt.Registry) error { return nil } -func (m *HostgroupShareOp) validateAdd(formats strfmt.Registry) error { +func (m *HostGroupShareOp) validateAdd(formats strfmt.Registry) error { if swag.IsZero(m.Add) { // not required return nil } @@ -66,8 +66,8 @@ func (m *HostgroupShareOp) validateAdd(formats strfmt.Registry) error { return nil } -// ContextValidate validate this hostgroup share op based on the context it is used -func (m *HostgroupShareOp) ContextValidate(ctx context.Context, formats strfmt.Registry) error { +// ContextValidate validate this host group share op based on the context it is used +func (m *HostGroupShareOp) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error if err := m.contextValidateAdd(ctx, formats); err != nil { @@ -80,7 +80,7 @@ func (m *HostgroupShareOp) ContextValidate(ctx context.Context, formats strfmt.R return nil } -func (m *HostgroupShareOp) contextValidateAdd(ctx context.Context, formats strfmt.Registry) error { +func (m *HostGroupShareOp) contextValidateAdd(ctx context.Context, formats strfmt.Registry) error { for i := 0; i < len(m.Add); i++ { @@ -106,7 +106,7 @@ func (m *HostgroupShareOp) contextValidateAdd(ctx context.Context, formats strfm } // MarshalBinary interface implementation -func (m *HostgroupShareOp) MarshalBinary() ([]byte, error) { +func (m *HostGroupShareOp) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -114,8 +114,8 @@ func (m *HostgroupShareOp) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *HostgroupShareOp) UnmarshalBinary(b []byte) error { - var res HostgroupShareOp +func (m *HostGroupShareOp) UnmarshalBinary(b []byte) error { + var res HostGroupShareOp if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/power/models/host_group_summary.go b/power/models/host_group_summary.go new file mode 100644 index 00000000..f4c345ed --- /dev/null +++ b/power/models/host_group_summary.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HostGroupSummary host group summary +// +// swagger:model HostGroupSummary +type HostGroupSummary struct { + + // Whether the host group is a primary or secondary host group + Access string `json:"access,omitempty"` + + // Link to the host group resource + Href string `json:"href,omitempty"` + + // Name of the host group + Name string `json:"name,omitempty"` +} + +// Validate validates this host group summary +func (m *HostGroupSummary) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this host group summary based on context it is used +func (m *HostGroupSummary) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HostGroupSummary) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HostGroupSummary) UnmarshalBinary(b []byte) error { + var res HostGroupSummary + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/power/models/host_resource_capacity.go b/power/models/host_resource_capacity.go new file mode 100644 index 00000000..4814c505 --- /dev/null +++ b/power/models/host_resource_capacity.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// HostResourceCapacity host resource capacity +// +// swagger:model HostResourceCapacity +type HostResourceCapacity struct { + + // available + Available float64 `json:"available,omitempty"` + + // reserved + Reserved float64 `json:"reserved,omitempty"` + + // total + Total float64 `json:"total,omitempty"` + + // used + Used float64 `json:"used,omitempty"` +} + +// Validate validates this host resource capacity +func (m *HostResourceCapacity) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this host resource capacity based on context it is used +func (m *HostResourceCapacity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HostResourceCapacity) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HostResourceCapacity) UnmarshalBinary(b []byte) error { + var res HostResourceCapacity + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/power/models/hostgroup_href.go b/power/models/hostgroup_href.go deleted file mode 100644 index 2733f00f..00000000 --- a/power/models/hostgroup_href.go +++ /dev/null @@ -1,27 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" -) - -// HostgroupHref Link to hostgroup resource -// -// swagger:model HostgroupHref -type HostgroupHref string - -// Validate validates this hostgroup href -func (m HostgroupHref) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this hostgroup href based on context it is used -func (m HostgroupHref) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/power/models/image_import_details.go b/power/models/image_import_details.go new file mode 100644 index 00000000..59560a09 --- /dev/null +++ b/power/models/image_import_details.go @@ -0,0 +1,205 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ImageImportDetails image import details +// +// swagger:model ImageImportDetails +type ImageImportDetails struct { + + // Origin of the license of the product + // Required: true + // Enum: [byol] + LicenseType *string `json:"licenseType"` + + // Product within the image + // Required: true + // Enum: [Hana Netweaver] + Product *string `json:"product"` + + // Vendor supporting the product + // Required: true + // Enum: [SAP] + Vendor *string `json:"vendor"` +} + +// Validate validates this image import details +func (m *ImageImportDetails) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLicenseType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateProduct(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVendor(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var imageImportDetailsTypeLicenseTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["byol"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + imageImportDetailsTypeLicenseTypePropEnum = append(imageImportDetailsTypeLicenseTypePropEnum, v) + } +} + +const ( + + // ImageImportDetailsLicenseTypeByol captures enum value "byol" + ImageImportDetailsLicenseTypeByol string = "byol" +) + +// prop value enum +func (m *ImageImportDetails) validateLicenseTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, imageImportDetailsTypeLicenseTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *ImageImportDetails) validateLicenseType(formats strfmt.Registry) error { + + if err := validate.Required("licenseType", "body", m.LicenseType); err != nil { + return err + } + + // value enum + if err := m.validateLicenseTypeEnum("licenseType", "body", *m.LicenseType); err != nil { + return err + } + + return nil +} + +var imageImportDetailsTypeProductPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["Hana","Netweaver"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + imageImportDetailsTypeProductPropEnum = append(imageImportDetailsTypeProductPropEnum, v) + } +} + +const ( + + // ImageImportDetailsProductHana captures enum value "Hana" + ImageImportDetailsProductHana string = "Hana" + + // ImageImportDetailsProductNetweaver captures enum value "Netweaver" + ImageImportDetailsProductNetweaver string = "Netweaver" +) + +// prop value enum +func (m *ImageImportDetails) validateProductEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, imageImportDetailsTypeProductPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *ImageImportDetails) validateProduct(formats strfmt.Registry) error { + + if err := validate.Required("product", "body", m.Product); err != nil { + return err + } + + // value enum + if err := m.validateProductEnum("product", "body", *m.Product); err != nil { + return err + } + + return nil +} + +var imageImportDetailsTypeVendorPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["SAP"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + imageImportDetailsTypeVendorPropEnum = append(imageImportDetailsTypeVendorPropEnum, v) + } +} + +const ( + + // ImageImportDetailsVendorSAP captures enum value "SAP" + ImageImportDetailsVendorSAP string = "SAP" +) + +// prop value enum +func (m *ImageImportDetails) validateVendorEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, imageImportDetailsTypeVendorPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *ImageImportDetails) validateVendor(formats strfmt.Registry) error { + + if err := validate.Required("vendor", "body", m.Vendor); err != nil { + return err + } + + // value enum + if err := m.validateVendorEnum("vendor", "body", *m.Vendor); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this image import details based on context it is used +func (m *ImageImportDetails) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ImageImportDetails) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ImageImportDetails) UnmarshalBinary(b []byte) error { + var res ImageImportDetails + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/power/models/p_vm_instance_create.go b/power/models/p_vm_instance_create.go index 013a094c..5023f322 100644 --- a/power/models/p_vm_instance_create.go +++ b/power/models/p_vm_instance_create.go @@ -21,7 +21,7 @@ import ( // swagger:model PVMInstanceCreate type PVMInstanceCreate struct { - // The name of the host or hostgroup where to deploy the VM + // The name of the host or host group where to deploy the VM DeployTarget string `json:"deployTarget,omitempty"` // The custom deployment type @@ -106,7 +106,7 @@ type PVMInstanceCreate struct { // System type used to host the instance SysType string `json:"sysType,omitempty"` - // Cloud init user defined data + // Cloud init user defined data; For FLS, only cloud-config instance-data is supported and data must not be compressed or exceed 63K UserData string `json:"userData,omitempty"` // The pvm instance virtual CPU information diff --git a/power/models/s_a_p_create.go b/power/models/s_a_p_create.go index e16ee442..632bc758 100644 --- a/power/models/s_a_p_create.go +++ b/power/models/s_a_p_create.go @@ -63,7 +63,7 @@ type SAPCreate struct { // System type used to host the instance. Only e880, e980, e1080 are supported SysType string `json:"sysType,omitempty"` - // Cloud init user defined data + // Cloud init user defined data; For FLS, only cloud-config instance-data is supported and data must not be compressed or exceed 63K UserData string `json:"userData,omitempty"` // List of Volume IDs to attach to the pvm-instance on creation diff --git a/power/models/s_a_p_profile.go b/power/models/s_a_p_profile.go index 73096fa6..6333b489 100644 --- a/power/models/s_a_p_profile.go +++ b/power/models/s_a_p_profile.go @@ -36,6 +36,9 @@ type SAPProfile struct { // Required: true ProfileID *string `json:"profileID"` + // List of supported systems + SupportedSystems []string `json:"supportedSystems"` + // Type of profile // Required: true // Enum: [balanced compute memory non-production ultra-memory] diff --git a/power/models/secondary.go b/power/models/secondary.go index 11c37f88..63bca7d5 100644 --- a/power/models/secondary.go +++ b/power/models/secondary.go @@ -14,15 +14,15 @@ import ( "github.com/go-openapi/validate" ) -// Secondary Information to create a secondary hostgroup +// Secondary Information to create a secondary host group // // swagger:model Secondary type Secondary struct { - // Name of the hostgroup to create in the secondary workspace + // Name of the host group to create in the secondary workspace Name string `json:"name,omitempty"` - // Name of the workspace to share the hostgroup with + // Name of the workspace to share the host group with // Required: true Workspace *string `json:"workspace"` } diff --git a/power/models/volumes_clone_async_request.go b/power/models/volumes_clone_async_request.go index 7c4628c2..1b0993a1 100644 --- a/power/models/volumes_clone_async_request.go +++ b/power/models/volumes_clone_async_request.go @@ -26,6 +26,7 @@ type VolumesCloneAsyncRequest struct { // Example volume names using name="volume-abcdef" // single volume clone will be named "clone-volume-abcdef-83081" // multi volume clone will be named "clone-volume-abcdef-73721-1", "clone-volume-abcdef-73721-2", ... + // For multiple volume clone, the provided name will be truncated to the first 20 characters. // // Required: true Name *string `json:"name"` diff --git a/power/models/volumes_clone_execute.go b/power/models/volumes_clone_execute.go index 1d880001..b470cb78 100644 --- a/power/models/volumes_clone_execute.go +++ b/power/models/volumes_clone_execute.go @@ -26,6 +26,7 @@ type VolumesCloneExecute struct { // Example volume names using name="volume-abcdef" // single volume clone will be named "clone-volume-abcdef-83081" // multi volume clone will be named "clone-volume-abcdef-73721-1", "clone-volume-abcdef-73721-2", ... + // For multiple volume clone, the provided name will be truncated to the first 20 characters. // // Required: true Name *string `json:"name"` diff --git a/power/models/volumes_clone_request.go b/power/models/volumes_clone_request.go index 7ed5f8c5..cb238678 100644 --- a/power/models/volumes_clone_request.go +++ b/power/models/volumes_clone_request.go @@ -25,6 +25,7 @@ type VolumesCloneRequest struct { // Example volume names using displayName="volume-abcdef" // single volume clone will be named "clone-volume-abcdef" // multi volume clone will be named "clone-volume-abcdef-1", "clone-volume-abcdef-2", ... + // For multiple volume clone, the provided name will be truncated to the first 20 characters. // // Required: true DisplayName *string `json:"displayName"`