diff --git a/power/models/datacenters.go b/power/models/datacenters.go index a9aba024..9fd22e8f 100644 --- a/power/models/datacenters.go +++ b/power/models/datacenters.go @@ -22,14 +22,14 @@ type Datacenters struct { // Power Systems Virtual Server available Datacenters // Required: true - Datacenter []*Datacenter `json:"datacenter"` + Datacenters []*Datacenter `json:"datacenters"` } // Validate validates this datacenters func (m *Datacenters) Validate(formats strfmt.Registry) error { var res []error - if err := m.validateDatacenter(formats); err != nil { + if err := m.validateDatacenters(formats); err != nil { res = append(res, err) } @@ -39,23 +39,23 @@ func (m *Datacenters) Validate(formats strfmt.Registry) error { return nil } -func (m *Datacenters) validateDatacenter(formats strfmt.Registry) error { +func (m *Datacenters) validateDatacenters(formats strfmt.Registry) error { - if err := validate.Required("datacenter", "body", m.Datacenter); err != nil { + if err := validate.Required("datacenters", "body", m.Datacenters); err != nil { return err } - for i := 0; i < len(m.Datacenter); i++ { - if swag.IsZero(m.Datacenter[i]) { // not required + for i := 0; i < len(m.Datacenters); i++ { + if swag.IsZero(m.Datacenters[i]) { // not required continue } - if m.Datacenter[i] != nil { - if err := m.Datacenter[i].Validate(formats); err != nil { + if m.Datacenters[i] != nil { + if err := m.Datacenters[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("datacenter" + "." + strconv.Itoa(i)) + return ve.ValidateName("datacenters" + "." + strconv.Itoa(i)) } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("datacenter" + "." + strconv.Itoa(i)) + return ce.ValidateName("datacenters" + "." + strconv.Itoa(i)) } return err } @@ -70,7 +70,7 @@ func (m *Datacenters) validateDatacenter(formats strfmt.Registry) error { func (m *Datacenters) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error - if err := m.contextValidateDatacenter(ctx, formats); err != nil { + if err := m.contextValidateDatacenters(ctx, formats); err != nil { res = append(res, err) } @@ -80,21 +80,21 @@ func (m *Datacenters) ContextValidate(ctx context.Context, formats strfmt.Regist return nil } -func (m *Datacenters) contextValidateDatacenter(ctx context.Context, formats strfmt.Registry) error { +func (m *Datacenters) contextValidateDatacenters(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(m.Datacenter); i++ { + for i := 0; i < len(m.Datacenters); i++ { - if m.Datacenter[i] != nil { + if m.Datacenters[i] != nil { - if swag.IsZero(m.Datacenter[i]) { // not required + if swag.IsZero(m.Datacenters[i]) { // not required return nil } - if err := m.Datacenter[i].ContextValidate(ctx, formats); err != nil { + if err := m.Datacenters[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("datacenter" + "." + strconv.Itoa(i)) + return ve.ValidateName("datacenters" + "." + strconv.Itoa(i)) } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("datacenter" + "." + strconv.Itoa(i)) + return ce.ValidateName("datacenters" + "." + strconv.Itoa(i)) } return err } diff --git a/power/models/p_vm_instance_create.go b/power/models/p_vm_instance_create.go index c439514a..5404989b 100644 --- a/power/models/p_vm_instance_create.go +++ b/power/models/p_vm_instance_create.go @@ -21,9 +21,6 @@ import ( // swagger:model PVMInstanceCreate type PVMInstanceCreate struct { - // Indicates if cloudInit should be configured or not - ConfigureCloudInit *bool `json:"configureCloudInit,omitempty"` - // The custom deployment type DeploymentType string `json:"deploymentType,omitempty"` @@ -50,10 +47,6 @@ type PVMInstanceCreate struct { // The pvm instance networks information Networks []*PVMInstanceAddNetwork `json:"networks"` - // The type of OS. iamgeID and osType are mutually exclusive. If OStype is provided then VM will be created without any volume and user later can attach primary boot volume. - // Enum: [aix ibmi rhel sles] - OsType string `json:"osType,omitempty"` - // pin policy PinPolicy PinPolicy `json:"pinPolicy,omitempty"` @@ -132,10 +125,6 @@ func (m *PVMInstanceCreate) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateOsType(formats); err != nil { - res = append(res, err) - } - if err := m.validatePinPolicy(formats); err != nil { res = append(res, err) } @@ -226,54 +215,6 @@ func (m *PVMInstanceCreate) validateNetworks(formats strfmt.Registry) error { return nil } -var pVmInstanceCreateTypeOsTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["aix","ibmi","rhel","sles"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - pVmInstanceCreateTypeOsTypePropEnum = append(pVmInstanceCreateTypeOsTypePropEnum, v) - } -} - -const ( - - // PVMInstanceCreateOsTypeAix captures enum value "aix" - PVMInstanceCreateOsTypeAix string = "aix" - - // PVMInstanceCreateOsTypeIbmi captures enum value "ibmi" - PVMInstanceCreateOsTypeIbmi string = "ibmi" - - // PVMInstanceCreateOsTypeRhel captures enum value "rhel" - PVMInstanceCreateOsTypeRhel string = "rhel" - - // PVMInstanceCreateOsTypeSles captures enum value "sles" - PVMInstanceCreateOsTypeSles string = "sles" -) - -// prop value enum -func (m *PVMInstanceCreate) validateOsTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, pVmInstanceCreateTypeOsTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *PVMInstanceCreate) validateOsType(formats strfmt.Registry) error { - if swag.IsZero(m.OsType) { // not required - return nil - } - - // value enum - if err := m.validateOsTypeEnum("osType", "body", m.OsType); err != nil { - return err - } - - return nil -} - func (m *PVMInstanceCreate) validatePinPolicy(formats strfmt.Registry) error { if swag.IsZero(m.PinPolicy) { // not required return nil diff --git a/power/models/workspace.go b/power/models/workspace.go index eefac672..62902f51 100644 --- a/power/models/workspace.go +++ b/power/models/workspace.go @@ -42,7 +42,7 @@ type Workspace struct { // The Workspace status // Required: true - // Enum: [ACTIVE FAILED] + // Enum: [Active Failed Provisioning] Status *string `json:"status"` // The Workspace type @@ -160,7 +160,7 @@ var workspaceTypeStatusPropEnum []interface{} func init() { var res []string - if err := json.Unmarshal([]byte(`["ACTIVE","FAILED"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["Active","Failed","Provisioning"]`), &res); err != nil { panic(err) } for _, v := range res { @@ -170,11 +170,14 @@ func init() { const ( - // WorkspaceStatusACTIVE captures enum value "ACTIVE" - WorkspaceStatusACTIVE string = "ACTIVE" + // WorkspaceStatusActive captures enum value "Active" + WorkspaceStatusActive string = "Active" - // WorkspaceStatusFAILED captures enum value "FAILED" - WorkspaceStatusFAILED string = "FAILED" + // WorkspaceStatusFailed captures enum value "Failed" + WorkspaceStatusFailed string = "Failed" + + // WorkspaceStatusProvisioning captures enum value "Provisioning" + WorkspaceStatusProvisioning string = "Provisioning" ) // prop value enum diff --git a/power/models/workspace_location.go b/power/models/workspace_location.go index 0a81b980..f74be70b 100644 --- a/power/models/workspace_location.go +++ b/power/models/workspace_location.go @@ -24,12 +24,10 @@ type WorkspaceLocation struct { Region *string `json:"region"` // The Workspace location region type - // Required: true - Type *string `json:"type"` + Type string `json:"type,omitempty"` // The Workspace location region url - // Required: true - URL *string `json:"url"` + URL string `json:"url,omitempty"` } // Validate validates this workspace location @@ -40,14 +38,6 @@ func (m *WorkspaceLocation) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateURL(formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -63,24 +53,6 @@ func (m *WorkspaceLocation) validateRegion(formats strfmt.Registry) error { return nil } -func (m *WorkspaceLocation) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - return nil -} - -func (m *WorkspaceLocation) validateURL(formats strfmt.Registry) error { - - if err := validate.Required("url", "body", m.URL); err != nil { - return err - } - - return nil -} - // ContextValidate validates this workspace location based on context it is used func (m *WorkspaceLocation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil diff --git a/power/models/workspaces.go b/power/models/workspaces.go index 41ede8d5..ef05e062 100644 --- a/power/models/workspaces.go +++ b/power/models/workspaces.go @@ -22,14 +22,14 @@ type Workspaces struct { // The list of available workspaces // Required: true - Workspace []*Workspace `json:"workspace"` + Workspaces []*Workspace `json:"workspaces"` } // Validate validates this workspaces func (m *Workspaces) Validate(formats strfmt.Registry) error { var res []error - if err := m.validateWorkspace(formats); err != nil { + if err := m.validateWorkspaces(formats); err != nil { res = append(res, err) } @@ -39,23 +39,23 @@ func (m *Workspaces) Validate(formats strfmt.Registry) error { return nil } -func (m *Workspaces) validateWorkspace(formats strfmt.Registry) error { +func (m *Workspaces) validateWorkspaces(formats strfmt.Registry) error { - if err := validate.Required("workspace", "body", m.Workspace); err != nil { + if err := validate.Required("workspaces", "body", m.Workspaces); err != nil { return err } - for i := 0; i < len(m.Workspace); i++ { - if swag.IsZero(m.Workspace[i]) { // not required + for i := 0; i < len(m.Workspaces); i++ { + if swag.IsZero(m.Workspaces[i]) { // not required continue } - if m.Workspace[i] != nil { - if err := m.Workspace[i].Validate(formats); err != nil { + if m.Workspaces[i] != nil { + if err := m.Workspaces[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("workspace" + "." + strconv.Itoa(i)) + return ve.ValidateName("workspaces" + "." + strconv.Itoa(i)) } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("workspace" + "." + strconv.Itoa(i)) + return ce.ValidateName("workspaces" + "." + strconv.Itoa(i)) } return err } @@ -70,7 +70,7 @@ func (m *Workspaces) validateWorkspace(formats strfmt.Registry) error { func (m *Workspaces) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error - if err := m.contextValidateWorkspace(ctx, formats); err != nil { + if err := m.contextValidateWorkspaces(ctx, formats); err != nil { res = append(res, err) } @@ -80,21 +80,21 @@ func (m *Workspaces) ContextValidate(ctx context.Context, formats strfmt.Registr return nil } -func (m *Workspaces) contextValidateWorkspace(ctx context.Context, formats strfmt.Registry) error { +func (m *Workspaces) contextValidateWorkspaces(ctx context.Context, formats strfmt.Registry) error { - for i := 0; i < len(m.Workspace); i++ { + for i := 0; i < len(m.Workspaces); i++ { - if m.Workspace[i] != nil { + if m.Workspaces[i] != nil { - if swag.IsZero(m.Workspace[i]) { // not required + if swag.IsZero(m.Workspaces[i]) { // not required return nil } - if err := m.Workspace[i].ContextValidate(ctx, formats); err != nil { + if err := m.Workspaces[i].ContextValidate(ctx, formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("workspace" + "." + strconv.Itoa(i)) + return ve.ValidateName("workspaces" + "." + strconv.Itoa(i)) } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("workspace" + "." + strconv.Itoa(i)) + return ce.ValidateName("workspaces" + "." + strconv.Itoa(i)) } return err }