// Code generated by azure-service-operator-codegen. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package arm

import (
	"github.com/Azure/azure-service-operator/v2/pkg/genruntime"
	"k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
)

type VirtualMachinesExtension_Spec struct {
	// Location: Resource location
	Location *string `json:"location,omitempty"`
	Name     string  `json:"name,omitempty"`

	// Properties: Describes the properties of a Virtual Machine Extension.
	Properties *VirtualMachineExtensionProperties `json:"properties,omitempty"`

	// Tags: Resource tags
	Tags map[string]string `json:"tags,omitempty"`
}

var _ genruntime.ARMResourceSpec = &VirtualMachinesExtension_Spec{}

// GetAPIVersion returns the ARM API version of the resource. This is always "2020-12-01"
func (extension VirtualMachinesExtension_Spec) GetAPIVersion() string {
	return "2020-12-01"
}

// GetName returns the Name of the resource
func (extension *VirtualMachinesExtension_Spec) GetName() string {
	return extension.Name
}

// GetType returns the ARM Type of the resource. This is always "Microsoft.Compute/virtualMachines/extensions"
func (extension *VirtualMachinesExtension_Spec) GetType() string {
	return "Microsoft.Compute/virtualMachines/extensions"
}

// Describes the properties of a Virtual Machine Extension.
type VirtualMachineExtensionProperties struct {
	// AutoUpgradeMinorVersion: Indicates whether the extension should use a newer minor version if one is available at
	// deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this
	// property set to true.
	AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"`

	// EnableAutomaticUpgrade: Indicates whether the extension should be automatically upgraded by the platform if there is a
	// newer version of the extension available.
	EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"`

	// ForceUpdateTag: How the extension handler should be forced to update even if the extension configuration has not changed.
	ForceUpdateTag *string `json:"forceUpdateTag,omitempty"`

	// InstanceView: The virtual machine extension instance view.
	InstanceView *VirtualMachineExtensionInstanceView `json:"instanceView,omitempty"`

	// ProtectedSettings: The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected
	// settings at all.
	ProtectedSettings map[string]string `json:"protectedSettings,omitempty"`

	// Publisher: The name of the extension handler publisher.
	Publisher *string `json:"publisher,omitempty"`

	// Settings: Json formatted public settings for the extension.
	Settings map[string]v1.JSON `json:"settings,omitempty"`

	// Type: Specifies the type of the extension; an example is "CustomScriptExtension".
	Type *string `json:"type,omitempty"`

	// TypeHandlerVersion: Specifies the version of the script handler.
	TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"`
}

// The instance view of a virtual machine extension.
type VirtualMachineExtensionInstanceView struct {
	// Name: The virtual machine extension name.
	Name *string `json:"name,omitempty"`

	// Statuses: The resource status information.
	Statuses []InstanceViewStatus `json:"statuses,omitempty"`

	// Substatuses: The resource status information.
	Substatuses []InstanceViewStatus `json:"substatuses,omitempty"`

	// Type: Specifies the type of the extension; an example is "CustomScriptExtension".
	Type *string `json:"type,omitempty"`

	// TypeHandlerVersion: Specifies the version of the script handler.
	TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"`
}

// Instance view status.
type InstanceViewStatus struct {
	// Code: The status code.
	Code *string `json:"code,omitempty"`

	// DisplayStatus: The short localizable label for the status.
	DisplayStatus *string `json:"displayStatus,omitempty"`

	// Level: The level code.
	Level *InstanceViewStatus_Level `json:"level,omitempty"`

	// Message: The detailed status message, including for alerts and error messages.
	Message *string `json:"message,omitempty"`

	// Time: The time of the status.
	Time *string `json:"time,omitempty"`
}

// +kubebuilder:validation:Enum={"Error","Info","Warning"}
type InstanceViewStatus_Level string

const (
	InstanceViewStatus_Level_Error   = InstanceViewStatus_Level("Error")
	InstanceViewStatus_Level_Info    = InstanceViewStatus_Level("Info")
	InstanceViewStatus_Level_Warning = InstanceViewStatus_Level("Warning")
)

// Mapping from string to InstanceViewStatus_Level
var instanceViewStatus_Level_Values = map[string]InstanceViewStatus_Level{
	"error":   InstanceViewStatus_Level_Error,
	"info":    InstanceViewStatus_Level_Info,
	"warning": InstanceViewStatus_Level_Warning,
}
