cloud/azure/compute/models/o_s_profile.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 (
strfmt "github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/errors"
)
// OSProfile Describes an OS profile.
// swagger:model OSProfile
type OSProfile struct {
// Specifies the password of the administrator account.
AdminPassword string `json:"adminPassword,omitempty"`
// Specifies the name of the administrator account.
AdminUsername string `json:"adminUsername,omitempty"`
// Specifies the host OS name of the virtual machine.
ComputerName string `json:"computerName,omitempty"`
// Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that is saved as a file on the Virtual Machine. The maximum length of the binary array is 65535 bytes
CustomData string `json:"customData,omitempty"`
// The Linux configuration of the OS profile.
LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"`
// The list of certificates for addition to the VM.
Secrets []*VaultSecretGroup `json:"secrets"`
// The Windows configuration of the OS profile.
WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"`
}
// Validate validates this o s profile
func (m *OSProfile) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateLinuxConfiguration(formats); err != nil {
// prop
res = append(res, err)
}
if err := m.validateSecrets(formats); err != nil {
// prop
res = append(res, err)
}
if err := m.validateWindowsConfiguration(formats); err != nil {
// prop
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *OSProfile) validateLinuxConfiguration(formats strfmt.Registry) error {
if swag.IsZero(m.LinuxConfiguration) { // not required
return nil
}
if m.LinuxConfiguration != nil {
if err := m.LinuxConfiguration.Validate(formats); err != nil {
return err
}
}
return nil
}
func (m *OSProfile) validateSecrets(formats strfmt.Registry) error {
if swag.IsZero(m.Secrets) { // not required
return nil
}
for i := 0; i < len(m.Secrets); i++ {
if swag.IsZero(m.Secrets[i]) { // not required
continue
}
if m.Secrets[i] != nil {
if err := m.Secrets[i].Validate(formats); err != nil {
return err
}
}
}
return nil
}
func (m *OSProfile) validateWindowsConfiguration(formats strfmt.Registry) error {
if swag.IsZero(m.WindowsConfiguration) { // not required
return nil
}
if m.WindowsConfiguration != nil {
if err := m.WindowsConfiguration.Validate(formats); err != nil {
return err
}
}
return nil
}