cloud/azure/compute/models/virtual_machine_scale_set_identity.go
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 (
"encoding/json"
strfmt "github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/errors"
"github.com/go-openapi/validate"
)
// VirtualMachineScaleSetIdentity Identity for the virtual machine scale set.
// swagger:model VirtualMachineScaleSetIdentity
type VirtualMachineScaleSetIdentity struct {
// The principal id of virtual machine scale set identity.
// Read Only: true
PrincipalID string `json:"principalId,omitempty"`
// The tenant id associated with the virtual machine scale set.
// Read Only: true
TenantID string `json:"tenantId,omitempty"`
// The type of identity used for the virtual machine scale set. Currently, the only supported type is 'SystemAssigned', which implicitly creates an identity.
Type string `json:"type,omitempty"`
}
// Validate validates this virtual machine scale set identity
func (m *VirtualMachineScaleSetIdentity) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateType(formats); err != nil {
// prop
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
var virtualMachineScaleSetIdentityTypeTypePropEnum []interface{}
func init() {
var res []string
if err := json.Unmarshal([]byte(`["SystemAssigned"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
virtualMachineScaleSetIdentityTypeTypePropEnum = append(virtualMachineScaleSetIdentityTypeTypePropEnum, v)
}
}
const (
// VirtualMachineScaleSetIdentityTypeSystemAssigned captures enum value "SystemAssigned"
VirtualMachineScaleSetIdentityTypeSystemAssigned string = "SystemAssigned"
)
// prop value enum
func (m *VirtualMachineScaleSetIdentity) validateTypeEnum(path, location string, value string) error {
if err := validate.Enum(path, location, value, virtualMachineScaleSetIdentityTypeTypePropEnum); err != nil {
return err
}
return nil
}
func (m *VirtualMachineScaleSetIdentity) validateType(formats strfmt.Registry) error {
if swag.IsZero(m.Type) { // not required
return nil
}
// value enum
if err := m.validateTypeEnum("type", "body", m.Type); err != nil {
return err
}
return nil
}