From 2a05a1eac4ddc8f784df8caabe55db898d48bd03 Mon Sep 17 00:00:00 2001 From: powervs-ibm Date: Mon, 26 Feb 2024 11:47:50 +0000 Subject: [PATCH] Generated Swagger client from service-broker commit 45fa0692a89deb1e1c0f0e3ad997fad969037f00 --- ...powervs_locations_tag_delete_parameters.go | 8 +-- ...1_powervs_locations_tag_post_parameters.go | 8 +-- ...v1_powervs_locations_tag_post_responses.go | 16 +---- power/models/network.go | 10 +-- power/models/network_create.go | 17 ----- power/models/network_reference.go | 10 +-- power/models/network_update.go | 18 ----- power/models/p_vm_instance_create.go | 8 +-- power/models/satellite_registration.go | 18 ++++- power/models/satellite_tag.go | 71 +++++++++++++++++++ 10 files changed, 111 insertions(+), 73 deletions(-) create mode 100644 power/models/satellite_tag.go diff --git a/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_tag_delete_parameters.go b/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_tag_delete_parameters.go index d1eea31c..f3f1f0d6 100644 --- a/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_tag_delete_parameters.go +++ b/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_tag_delete_parameters.go @@ -65,9 +65,9 @@ type InternalV1PowervsLocationsTagDeleteParams struct { /* Body. - Parameters for activating a satellite location + Parameters for tagging a satellite location */ - Body *models.SatelliteRegistration + Body *models.SatelliteTag timeout time.Duration Context context.Context @@ -123,13 +123,13 @@ func (o *InternalV1PowervsLocationsTagDeleteParams) SetHTTPClient(client *http.C } // WithBody adds the body to the internal v1 powervs locations tag delete params -func (o *InternalV1PowervsLocationsTagDeleteParams) WithBody(body *models.SatelliteRegistration) *InternalV1PowervsLocationsTagDeleteParams { +func (o *InternalV1PowervsLocationsTagDeleteParams) WithBody(body *models.SatelliteTag) *InternalV1PowervsLocationsTagDeleteParams { o.SetBody(body) return o } // SetBody adds the body to the internal v1 powervs locations tag delete params -func (o *InternalV1PowervsLocationsTagDeleteParams) SetBody(body *models.SatelliteRegistration) { +func (o *InternalV1PowervsLocationsTagDeleteParams) SetBody(body *models.SatelliteTag) { o.Body = body } diff --git a/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_tag_post_parameters.go b/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_tag_post_parameters.go index c03ba2dd..e1930f9c 100644 --- a/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_tag_post_parameters.go +++ b/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_tag_post_parameters.go @@ -65,9 +65,9 @@ type InternalV1PowervsLocationsTagPostParams struct { /* Body. - Parameters for activating a satellite location + Parameters for tagging a satellite location */ - Body *models.SatelliteRegistration + Body *models.SatelliteTag timeout time.Duration Context context.Context @@ -123,13 +123,13 @@ func (o *InternalV1PowervsLocationsTagPostParams) SetHTTPClient(client *http.Cli } // WithBody adds the body to the internal v1 powervs locations tag post params -func (o *InternalV1PowervsLocationsTagPostParams) WithBody(body *models.SatelliteRegistration) *InternalV1PowervsLocationsTagPostParams { +func (o *InternalV1PowervsLocationsTagPostParams) WithBody(body *models.SatelliteTag) *InternalV1PowervsLocationsTagPostParams { o.SetBody(body) return o } // SetBody adds the body to the internal v1 powervs locations tag post params -func (o *InternalV1PowervsLocationsTagPostParams) SetBody(body *models.SatelliteRegistration) { +func (o *InternalV1PowervsLocationsTagPostParams) SetBody(body *models.SatelliteTag) { o.Body = body } diff --git a/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_tag_post_responses.go b/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_tag_post_responses.go index 60dd308e..938e531a 100644 --- a/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_tag_post_responses.go +++ b/power/client/internal_power_v_s_locations/internal_v1_powervs_locations_tag_post_responses.go @@ -69,7 +69,6 @@ InternalV1PowervsLocationsTagPostOK describes a response with status code 200, w OK */ type InternalV1PowervsLocationsTagPostOK struct { - Payload *models.SatelliteOrder } // IsSuccess returns true when this internal v1 powervs locations tag post o k response has a 2xx status code @@ -103,26 +102,15 @@ func (o *InternalV1PowervsLocationsTagPostOK) Code() int { } func (o *InternalV1PowervsLocationsTagPostOK) Error() string { - return fmt.Sprintf("[POST /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagPostOK %+v", 200, o.Payload) + return fmt.Sprintf("[POST /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagPostOK ", 200) } func (o *InternalV1PowervsLocationsTagPostOK) String() string { - return fmt.Sprintf("[POST /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagPostOK %+v", 200, o.Payload) -} - -func (o *InternalV1PowervsLocationsTagPostOK) GetPayload() *models.SatelliteOrder { - return o.Payload + return fmt.Sprintf("[POST /internal/v1/powervs/locations/tag][%d] internalV1PowervsLocationsTagPostOK ", 200) } func (o *InternalV1PowervsLocationsTagPostOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.SatelliteOrder) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - return nil } diff --git a/power/models/network.go b/power/models/network.go index 458eed54..512aa941 100644 --- a/power/models/network.go +++ b/power/models/network.go @@ -49,13 +49,13 @@ type Network struct { // Required: true IPAddressRanges []*IPAddressRange `json:"ipAddressRanges"` - // Enable MTU Jumbo Network (for multi-zone locations only) + // (deprecated - replaced by mtu) Enable MTU Jumbo Network (for multi-zone locations only) Jumbo bool `json:"jumbo,omitempty"` - // Maximum transmission unit (for satellite locations only) + // Maximum transmission unit // Maximum: 9000 // Minimum: 1450 - Mtu int64 `json:"mtu,omitempty"` + Mtu *int64 `json:"mtu,omitempty"` // Network Name // Required: true @@ -249,11 +249,11 @@ func (m *Network) validateMtu(formats strfmt.Registry) error { return nil } - if err := validate.MinimumInt("mtu", "body", m.Mtu, 1450, false); err != nil { + if err := validate.MinimumInt("mtu", "body", *m.Mtu, 1450, false); err != nil { return err } - if err := validate.MaximumInt("mtu", "body", m.Mtu, 9000, false); err != nil { + if err := validate.MaximumInt("mtu", "body", *m.Mtu, 9000, false); err != nil { return err } diff --git a/power/models/network_create.go b/power/models/network_create.go index 2d64fbd8..f320776e 100644 --- a/power/models/network_create.go +++ b/power/models/network_create.go @@ -46,7 +46,6 @@ type NetworkCreate struct { Mtu *int64 `json:"mtu,omitempty"` // Network Name - // Max Length: 255 Name string `json:"name,omitempty"` // Type of Network - 'vlan' (private network) 'pub-vlan' (public network) 'dhcp-vlan' (for satellite locations only) @@ -71,10 +70,6 @@ func (m *NetworkCreate) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - if err := m.validateType(formats); err != nil { res = append(res, err) } @@ -144,18 +139,6 @@ func (m *NetworkCreate) validateMtu(formats strfmt.Registry) error { return nil } -func (m *NetworkCreate) validateName(formats strfmt.Registry) error { - if swag.IsZero(m.Name) { // not required - return nil - } - - if err := validate.MaxLength("name", "body", m.Name, 255); err != nil { - return err - } - - return nil -} - var networkCreateTypeTypePropEnum []interface{} func init() { diff --git a/power/models/network_reference.go b/power/models/network_reference.go index ff36c5b6..40563314 100644 --- a/power/models/network_reference.go +++ b/power/models/network_reference.go @@ -30,13 +30,13 @@ type NetworkReference struct { // Required: true Href *string `json:"href"` - // Enable MTU Jumbo Network (for multi-zone locations only) + // (deprecated - replaced by mtu) Enable MTU Jumbo Network (for multi-zone locations only) Jumbo bool `json:"jumbo,omitempty"` - // Maximum transmission unit (for satellite locations only) + // Maximum transmission unit // Maximum: 9000 // Minimum: 1450 - Mtu int64 `json:"mtu,omitempty"` + Mtu *int64 `json:"mtu,omitempty"` // Network Name // Required: true @@ -125,11 +125,11 @@ func (m *NetworkReference) validateMtu(formats strfmt.Registry) error { return nil } - if err := validate.MinimumInt("mtu", "body", m.Mtu, 1450, false); err != nil { + if err := validate.MinimumInt("mtu", "body", *m.Mtu, 1450, false); err != nil { return err } - if err := validate.MaximumInt("mtu", "body", m.Mtu, 9000, false); err != nil { + if err := validate.MaximumInt("mtu", "body", *m.Mtu, 9000, false); err != nil { return err } diff --git a/power/models/network_update.go b/power/models/network_update.go index 642b474b..b8924c7f 100644 --- a/power/models/network_update.go +++ b/power/models/network_update.go @@ -12,7 +12,6 @@ import ( "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" - "github.com/go-openapi/validate" ) // NetworkUpdate network update @@ -30,7 +29,6 @@ type NetworkUpdate struct { IPAddressRanges []*IPAddressRange `json:"ipAddressRanges"` // Replaces the current Network Name - // Max Length: 255 Name *string `json:"name,omitempty"` } @@ -42,10 +40,6 @@ func (m *NetworkUpdate) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -78,18 +72,6 @@ func (m *NetworkUpdate) validateIPAddressRanges(formats strfmt.Registry) error { return nil } -func (m *NetworkUpdate) validateName(formats strfmt.Registry) error { - if swag.IsZero(m.Name) { // not required - return nil - } - - if err := validate.MaxLength("name", "body", *m.Name, 255); err != nil { - return err - } - - return nil -} - // ContextValidate validate this network update based on the context it is used func (m *NetworkUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error diff --git a/power/models/p_vm_instance_create.go b/power/models/p_vm_instance_create.go index 01358861..013a094c 100644 --- a/power/models/p_vm_instance_create.go +++ b/power/models/p_vm_instance_create.go @@ -94,7 +94,7 @@ type PVMInstanceCreate struct { StorageConnection string `json:"storageConnection,omitempty"` // The storage connection type - // Enum: [vSCSI maxVolumeAttachement] + // Enum: [vSCSI maxVolumeSupport] StorageConnectionV2 string `json:"storageConnectionV2,omitempty"` // Storage Pool for server deployment; if provided then storageAffinity will be ignored; Only valid when you deploy one of the IBM supplied stock images. Storage pool for a custom image (an imported image or an image that is created from a PVMInstance capture) defaults to the storage pool the image was created in @@ -475,7 +475,7 @@ var pVmInstanceCreateTypeStorageConnectionV2PropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["vSCSI","maxVolumeAttachement"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["vSCSI","maxVolumeSupport"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -488,8 +488,8 @@ const ( // PVMInstanceCreateStorageConnectionV2VSCSI captures enum value "vSCSI" PVMInstanceCreateStorageConnectionV2VSCSI string = "vSCSI" - // PVMInstanceCreateStorageConnectionV2MaxVolumeAttachement captures enum value "maxVolumeAttachement" - PVMInstanceCreateStorageConnectionV2MaxVolumeAttachement string = "maxVolumeAttachement" + // PVMInstanceCreateStorageConnectionV2MaxVolumeSupport captures enum value "maxVolumeSupport" + PVMInstanceCreateStorageConnectionV2MaxVolumeSupport string = "maxVolumeSupport" ) // prop value enum diff --git a/power/models/satellite_registration.go b/power/models/satellite_registration.go index d9fc0fe0..2835f9ec 100644 --- a/power/models/satellite_registration.go +++ b/power/models/satellite_registration.go @@ -19,11 +19,12 @@ import ( // swagger:model SatelliteRegistration type SatelliteRegistration struct { - // Requested Number of Days to Delay Order Activation + // Requested Number of Days to Delay Order Activation. Defaults to 1. DaysToDelay int64 `json:"daysToDelay,omitempty"` // Billing ID for Power Private Cloud Satellite Subscription - OrderID string `json:"orderID,omitempty"` + // Required: true + OrderID *string `json:"orderID"` // CRN of satellite to register // Required: true @@ -34,6 +35,10 @@ type SatelliteRegistration struct { func (m *SatelliteRegistration) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateOrderID(formats); err != nil { + res = append(res, err) + } + if err := m.validateSatelliteID(formats); err != nil { res = append(res, err) } @@ -44,6 +49,15 @@ func (m *SatelliteRegistration) Validate(formats strfmt.Registry) error { return nil } +func (m *SatelliteRegistration) validateOrderID(formats strfmt.Registry) error { + + if err := validate.Required("orderID", "body", m.OrderID); err != nil { + return err + } + + return nil +} + func (m *SatelliteRegistration) validateSatelliteID(formats strfmt.Registry) error { if err := validate.Required("satelliteID", "body", m.SatelliteID); err != nil { diff --git a/power/models/satellite_tag.go b/power/models/satellite_tag.go new file mode 100644 index 00000000..354e9220 --- /dev/null +++ b/power/models/satellite_tag.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// SatelliteTag satellite tag +// +// swagger:model SatelliteTag +type SatelliteTag struct { + + // CRN of satellite to perform tag operation + // Required: true + SatelliteID *string `json:"satelliteID"` +} + +// Validate validates this satellite tag +func (m *SatelliteTag) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSatelliteID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SatelliteTag) validateSatelliteID(formats strfmt.Registry) error { + + if err := validate.Required("satelliteID", "body", m.SatelliteID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this satellite tag based on context it is used +func (m *SatelliteTag) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *SatelliteTag) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SatelliteTag) UnmarshalBinary(b []byte) error { + var res SatelliteTag + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +}