From 4d9e461c86da0a1853cbea96fde831ebd7c1d023 Mon Sep 17 00:00:00 2001 From: Matthew Date: Mon, 1 Jul 2024 16:38:47 -0700 Subject: [PATCH 1/6] New Resource: azurerm_restore_point_collection --- internal/services/compute/client/client.go | 9 + internal/services/compute/registration.go | 1 + .../restore_point_collection_resource.go | 211 +++ .../restore_point_collection_resource_test.go | 169 ++ .../restorepointcollections/README.md | 125 ++ .../restorepointcollections/client.go | 26 + .../restorepointcollections/constants.go | 1481 +++++++++++++++++ .../id_restorepointcollection.go | 130 ++ .../method_createorupdate.go | 59 + .../restorepointcollections/method_delete.go | 71 + .../restorepointcollections/method_get.go | 83 + .../restorepointcollections/method_list.go | 106 ++ .../restorepointcollections/method_listall.go | 106 ++ .../restorepointcollections/method_update.go | 58 + .../model_additionalunattendcontent.go | 11 + .../model_apientityreference.go | 8 + .../model_bootdiagnostics.go | 9 + .../model_diagnosticsprofile.go | 8 + .../model_diskencryptionsettings.go | 10 + .../model_diskrestorepointattributes.go | 10 + .../model_diskrestorepointinstanceview.go | 9 + ...model_diskrestorepointreplicationstatus.go | 9 + .../model_encryptionidentity.go | 8 + .../model_hardwareprofile.go | 9 + .../model_instanceviewstatus.go | 30 + .../model_keyvaultkeyreference.go | 9 + .../model_keyvaultsecretreference.go | 9 + .../model_linuxconfiguration.go | 12 + .../model_linuxpatchsettings.go | 10 + ...vmguestpatchautomaticbyplatformsettings.go | 9 + .../model_manageddiskparameters.go | 11 + .../model_osprofile.go | 16 + .../model_patchsettings.go | 11 + .../model_proxyagentsettings.go | 10 + .../model_restorepoint.go | 11 + .../model_restorepointcollection.go | 13 + .../model_restorepointcollectionproperties.go | 11 + ..._restorepointcollectionsourceproperties.go | 9 + .../model_restorepointcollectionupdate.go | 9 + .../model_restorepointencryption.go | 9 + .../model_restorepointinstanceview.go | 9 + .../model_restorepointproperties.go | 32 + .../model_restorepointsourcemetadata.go | 17 + .../model_restorepointsourcevmdatadisk.go | 14 + .../model_restorepointsourcevmosdisk.go | 15 + ...odel_restorepointsourcevmstorageprofile.go | 10 + .../model_securityprofile.go | 12 + .../model_sshconfiguration.go | 8 + .../model_sshpublickey.go | 9 + .../model_subresource.go | 8 + .../model_uefisettings.go | 9 + .../model_vaultcertificate.go | 9 + .../model_vaultsecretgroup.go | 9 + .../model_vmdisksecurityprofile.go | 9 + .../model_vmsizeproperties.go | 9 + .../model_windowsconfiguration.go | 14 + ...vmguestpatchautomaticbyplatformsettings.go | 9 + .../model_winrmconfiguration.go | 8 + .../model_winrmlistener.go | 9 + .../restorepointcollections/predicates.go | 32 + .../restorepointcollections/version.go | 12 + vendor/modules.txt | 1 + .../r/restore_point_collection.html.markdown | 122 ++ 63 files changed, 3301 insertions(+) create mode 100644 internal/services/compute/restore_point_collection_resource.go create mode 100644 internal/services/compute/restore_point_collection_resource_test.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/id_restorepointcollection.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/method_createorupdate.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/method_delete.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/method_get.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/method_list.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/method_listall.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/method_update.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_additionalunattendcontent.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_apientityreference.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_bootdiagnostics.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_diagnosticsprofile.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_diskencryptionsettings.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_diskrestorepointattributes.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_diskrestorepointinstanceview.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_diskrestorepointreplicationstatus.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_encryptionidentity.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_hardwareprofile.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_instanceviewstatus.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_keyvaultkeyreference.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_keyvaultsecretreference.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_linuxconfiguration.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_linuxpatchsettings.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_linuxvmguestpatchautomaticbyplatformsettings.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_manageddiskparameters.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_osprofile.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_patchsettings.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_proxyagentsettings.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepoint.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepointcollection.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepointcollectionproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepointcollectionsourceproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepointcollectionupdate.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepointencryption.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepointinstanceview.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepointproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepointsourcemetadata.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepointsourcevmdatadisk.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepointsourcevmosdisk.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepointsourcevmstorageprofile.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_securityprofile.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_sshconfiguration.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_sshpublickey.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_subresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_uefisettings.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_vaultcertificate.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_vaultsecretgroup.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_vmdisksecurityprofile.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_vmsizeproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_windowsconfiguration.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_windowsvmguestpatchautomaticbyplatformsettings.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_winrmconfiguration.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_winrmlistener.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/predicates.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/version.go create mode 100644 website/docs/r/restore_point_collection.html.markdown diff --git a/internal/services/compute/client/client.go b/internal/services/compute/client/client.go index e2f5cb5c7c55..7698c7dbb6a4 100644 --- a/internal/services/compute/client/client.go +++ b/internal/services/compute/client/client.go @@ -29,6 +29,7 @@ import ( "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/availabilitysets" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/dedicatedhostgroups" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/dedicatedhosts" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/sshpublickeys" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/virtualmachineextensions" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/virtualmachineimages" @@ -61,6 +62,7 @@ type Client struct { ImagesClient *images.ImagesClient MarketplaceAgreementsClient *agreements.AgreementsClient ProximityPlacementGroupsClient *proximityplacementgroups.ProximityPlacementGroupsClient + RestorePointCollectionsClient *restorepointcollections.RestorePointCollectionsClient SkusClient *skus.SkusClient SSHPublicKeysClient *sshpublickeys.SshPublicKeysClient SnapshotsClient *snapshots.SnapshotsClient @@ -177,6 +179,12 @@ func NewClient(o *common.ClientOptions) (*Client, error) { } o.Configure(proximityPlacementGroupsClient.Client, o.Authorizers.ResourceManager) + restorePointCollectionsClient, err := restorepointcollections.NewRestorePointCollectionsClientWithBaseURI(o.Environment.ResourceManager) + if err != nil { + return nil, fmt.Errorf("building RestorePointCollections client: %+v", err) + } + o.Configure(restorePointCollectionsClient.Client, o.Authorizers.ResourceManager) + skusClient, err := skus.NewSkusClientWithBaseURI(o.Environment.ResourceManager) if err != nil { return nil, fmt.Errorf("building Skus client: %+v", err) @@ -261,6 +269,7 @@ func NewClient(o *common.ClientOptions) (*Client, error) { ImagesClient: imagesClient, MarketplaceAgreementsClient: marketplaceAgreementsClient, ProximityPlacementGroupsClient: proximityPlacementGroupsClient, + RestorePointCollectionsClient: restorePointCollectionsClient, SkusClient: skusClient, SSHPublicKeysClient: sshPublicKeysClient, SnapshotsClient: snapshotsClient, diff --git a/internal/services/compute/registration.go b/internal/services/compute/registration.go index 2cfdf8b72570..7b593ab49697 100644 --- a/internal/services/compute/registration.go +++ b/internal/services/compute/registration.go @@ -92,6 +92,7 @@ func (r Registration) Resources() []sdk.Resource { VirtualMachineRunCommandResource{}, GalleryApplicationResource{}, GalleryApplicationVersionResource{}, + RestorePointCollectionResource{}, VirtualMachineGalleryApplicationAssignmentResource{}, } } diff --git a/internal/services/compute/restore_point_collection_resource.go b/internal/services/compute/restore_point_collection_resource.go new file mode 100644 index 000000000000..c722fafeccd5 --- /dev/null +++ b/internal/services/compute/restore_point_collection_resource.go @@ -0,0 +1,211 @@ +package compute + +import ( + "context" + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/pointer" + "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" + "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections" + "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" +) + +type RestorePointCollectionResource struct{} + +var _ sdk.ResourceWithUpdate = RestorePointCollectionResource{} + +func (r RestorePointCollectionResource) ModelObject() interface{} { + return &RestorePointCollectionResourceModel{} +} + +type RestorePointCollectionResourceModel struct { + Name string `tfschema:"name"` + ResourceGroup string `tfschema:"resource_group_name"` + Location string `tfschema:"location"` + SourceVirtualMachineId string `tfschema:"source_virtual_machine_id"` + Tags map[string]interface{} `tfschema:"tags"` +} + +func (r RestorePointCollectionResource) IDValidationFunc() pluginsdk.SchemaValidateFunc { + return restorepointcollections.ValidateRestorePointCollectionID +} + +func (r RestorePointCollectionResource) ResourceType() string { + return "azurerm_restore_point_collection" +} + +func (r RestorePointCollectionResource) Arguments() map[string]*pluginsdk.Schema { + return map[string]*pluginsdk.Schema{ + "name": { + ForceNew: true, + Required: true, + Type: pluginsdk.TypeString, + }, + + "resource_group_name": commonschema.ResourceGroupName(), + + "location": commonschema.Location(), + + "source_virtual_machine_id": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: commonids.ValidateVirtualMachineID, + }, + + "tags": commonschema.Tags(), + } +} + +func (r RestorePointCollectionResource) Attributes() map[string]*pluginsdk.Schema { + return map[string]*pluginsdk.Schema{} +} + +func (r RestorePointCollectionResource) Create() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 30 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + client := metadata.Client.Compute.RestorePointCollectionsClient + subscriptionId := metadata.Client.Account.SubscriptionId + + var config RestorePointCollectionResourceModel + if err := metadata.Decode(&config); err != nil { + return fmt.Errorf("decoding: %+v", err) + } + + id := restorepointcollections.NewRestorePointCollectionID(subscriptionId, config.ResourceGroup, config.Name) + + existing, err := client.Get(ctx, id, restorepointcollections.DefaultGetOperationOptions()) + if err != nil { + if !response.WasNotFound(existing.HttpResponse) { + return fmt.Errorf("checking for the presence of an existing %s: %+v", id, err) + } + } + if !response.WasNotFound(existing.HttpResponse) { + return metadata.ResourceRequiresImport(r.ResourceType(), id) + } + + parameters := restorepointcollections.RestorePointCollection{ + Location: config.Location, + Properties: &restorepointcollections.RestorePointCollectionProperties{ + Source: &restorepointcollections.RestorePointCollectionSourceProperties{ + Id: pointer.To(config.SourceVirtualMachineId), + }, + }, + Tags: tags.Expand(config.Tags), + } + + if _, err = client.CreateOrUpdate(ctx, id, parameters); err != nil { + return fmt.Errorf("creating %s: %+v", id, err) + } + + metadata.SetID(id) + return nil + }, + } +} + +func (r RestorePointCollectionResource) Read() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 5 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + client := metadata.Client.Compute.RestorePointCollectionsClient + + schema := RestorePointCollectionResourceModel{} + + id, err := restorepointcollections.ParseRestorePointCollectionID(metadata.ResourceData.Id()) + if err != nil { + return err + } + + resp, err := client.Get(ctx, *id, restorepointcollections.DefaultGetOperationOptions()) + if err != nil { + if response.WasNotFound(resp.HttpResponse) { + return metadata.MarkAsGone(*id) + } + return fmt.Errorf("retrieving %s: %+v", *id, err) + } + + if model := resp.Model; model != nil { + schema.Name = id.RestorePointCollectionName + schema.ResourceGroup = id.ResourceGroupName + + if props := model.Properties; props != nil { + if source := props.Source; source != nil { + schema.SourceVirtualMachineId = pointer.From(source.Id) + schema.Location = pointer.From(source.Location) + } + } + + schema.Tags = tags.Flatten(model.Tags) + } + + return metadata.Encode(&schema) + }, + } +} + +func (r RestorePointCollectionResource) Update() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 30 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + client := metadata.Client.Compute.RestorePointCollectionsClient + + id, err := restorepointcollections.ParseRestorePointCollectionID(metadata.ResourceData.Id()) + if err != nil { + return err + } + + existing, err := client.Get(ctx, *id, restorepointcollections.DefaultGetOperationOptions()) + if err != nil { + return fmt.Errorf("checking for presence of existing %s: %+v", id, err) + } + + if existing.Model == nil { + return fmt.Errorf("retrieving %s: `model` was nil", id) + } + + payload := *existing.Model + + var config RestorePointCollectionResourceModel + if err := metadata.Decode(&config); err != nil { + return fmt.Errorf("decoding: %+v", err) + } + + if metadata.ResourceData.HasChange("tags") { + payload.Tags = tags.Expand(config.Tags) + } + + if _, err = client.CreateOrUpdate(ctx, *id, payload); err != nil { + return fmt.Errorf("updating %s: %+v", *id, err) + } + + return nil + }, + } +} + +func (r RestorePointCollectionResource) Delete() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 30 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + client := metadata.Client.Compute.RestorePointCollectionsClient + + id, err := restorepointcollections.ParseRestorePointCollectionID(metadata.ResourceData.Id()) + if err != nil { + return err + } + + if err := client.DeleteThenPoll(ctx, *id); err != nil { + return fmt.Errorf("deleting %s: %+v", *id, err) + } + + return nil + }, + } +} diff --git a/internal/services/compute/restore_point_collection_resource_test.go b/internal/services/compute/restore_point_collection_resource_test.go new file mode 100644 index 000000000000..7ee55f31240b --- /dev/null +++ b/internal/services/compute/restore_point_collection_resource_test.go @@ -0,0 +1,169 @@ +package compute_test + +import ( + "context" + "fmt" + "testing" + + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections" + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" + "github.com/hashicorp/terraform-provider-azurerm/internal/clients" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" + "github.com/hashicorp/terraform-provider-azurerm/utils" +) + +type RestorePointCollectionResource struct{} + +func TestAccRestorePointCollection_basic(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_restore_point_collection", "test") + r := RestorePointCollectionResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + }) +} + +func TestAccRestorePointCollection_update(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_restore_point_collection", "test") + r := RestorePointCollectionResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + { + Config: r.update(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + }) +} + +func (r RestorePointCollectionResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { + id, err := restorepointcollections.ParseRestorePointCollectionID(state.ID) + if err != nil { + return nil, err + } + + resp, err := clients.Compute.RestorePointCollectionsClient.Get(ctx, *id, restorepointcollections.DefaultGetOperationOptions()) + if err != nil { + return nil, fmt.Errorf("reading %s: %+v", *id, err) + } + + return utils.Bool(resp.Model != nil), nil +} + +func (r RestorePointCollectionResource) basic(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} +%[1]s +resource "azurerm_restore_point_collection" "test" { + name = "acctestRPC-%[2]s" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_linux_virtual_machine.test.location + source_virtual_machine_id = azurerm_linux_virtual_machine.test.id + + tags = { + foo = "bar" + } +} +`, r.template(data), data.RandomString) +} + +func (r RestorePointCollectionResource) update(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} +%[1]s +resource "azurerm_restore_point_collection" "test" { + name = "acctestRPC-%[2]s" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_linux_virtual_machine.test.location + source_virtual_machine_id = azurerm_linux_virtual_machine.test.id + + tags = { + bar = "foo" + } +} +`, r.template(data), data.RandomString) +} + +func (r RestorePointCollectionResource) template(data acceptance.TestData) string { + return fmt.Sprintf(` +resource "azurerm_resource_group" "test" { + name = "acctestRG-Compute-%[1]d" + location = "%[2]s" +} + + +resource "azurerm_virtual_network" "test" { + name = "acctestnw-%[1]d" + address_space = ["10.0.0.0/16"] + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name +} + +resource "azurerm_subnet" "test" { + name = "internal-%[1]d" + resource_group_name = azurerm_resource_group.test.name + virtual_network_name = azurerm_virtual_network.test.name + address_prefixes = ["10.0.0.0/24"] +} + +resource "azurerm_network_interface" "test" { + name = "acctestnic-%[1]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + ip_configuration { + name = "internal" + subnet_id = azurerm_subnet.test.id + private_ip_address_allocation = "Dynamic" + } +} + +resource "azurerm_linux_virtual_machine" "test" { + name = "acctestVM-%[1]d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + size = "Standard_F2" + admin_username = "adminuser" + admin_password = "P@$$w0rd1234!" + network_interface_ids = [ + azurerm_network_interface.test.id, + ] + + admin_ssh_key { + username = "adminuser" + public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+wWK73dCr+jgQOAxNsHAnNNNMEMWOHYEccp6wJm2gotpr9katuF/ZAdou5AaW1C61slRkHRkpRRX9FA9CYBiitZgvCCz+3nWNN7l/Up54Zps/pHWGZLHNJZRYyAB6j5yVLMVHIHriY49d/GZTZVNB8GoJv9Gakwc/fuEZYYl4YDFiGMBP///TzlI4jhiJzjKnEvqPFki5p2ZRJqcbCiF4pJrxUQR/RXqVFQdbRLZgYfJ8xGB878RENq3yQ39d8dVOkq4edbkzwcUmwwwkYVPIoDGsYLaRHnG+To7FvMeyO7xDVQkMKzopTQV8AuKpyvpqu0a9pWOMaiCyDytO7GGN you@me.com" + } + + os_disk { + caching = "ReadWrite" + storage_account_type = "Standard_LRS" + } + + source_image_reference { + publisher = "Canonical" + offer = "0001-com-ubuntu-server-jammy" + sku = "22_04-lts" + version = "latest" + } +} +`, data.RandomInteger, data.Locations.Primary) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/README.md new file mode 100644 index 000000000000..27964ff3e62d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/README.md @@ -0,0 +1,125 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections` Documentation + +The `restorepointcollections` SDK allows for interaction with the Azure Resource Manager Service `compute` (API Version `2024-03-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" +import "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections" +``` + + +### Client Initialization + +```go +client := restorepointcollections.NewRestorePointCollectionsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `RestorePointCollectionsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := restorepointcollections.NewRestorePointCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "restorePointCollectionValue") + +payload := restorepointcollections.RestorePointCollection{ + // ... +} + + +read, err := client.CreateOrUpdate(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `RestorePointCollectionsClient.Delete` + +```go +ctx := context.TODO() +id := restorepointcollections.NewRestorePointCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "restorePointCollectionValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `RestorePointCollectionsClient.Get` + +```go +ctx := context.TODO() +id := restorepointcollections.NewRestorePointCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "restorePointCollectionValue") + +read, err := client.Get(ctx, id, restorepointcollections.DefaultGetOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `RestorePointCollectionsClient.List` + +```go +ctx := context.TODO() +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// alternatively `client.List(ctx, id)` can be used to do batched pagination +items, err := client.ListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `RestorePointCollectionsClient.ListAll` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination +items, err := client.ListAllComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `RestorePointCollectionsClient.Update` + +```go +ctx := context.TODO() +id := restorepointcollections.NewRestorePointCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "restorePointCollectionValue") + +payload := restorepointcollections.RestorePointCollectionUpdate{ + // ... +} + + +read, err := client.Update(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/client.go new file mode 100644 index 000000000000..816bae4a3462 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/client.go @@ -0,0 +1,26 @@ +package restorepointcollections + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RestorePointCollectionsClient struct { + Client *resourcemanager.Client +} + +func NewRestorePointCollectionsClientWithBaseURI(sdkApi sdkEnv.Api) (*RestorePointCollectionsClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "restorepointcollections", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating RestorePointCollectionsClient: %+v", err) + } + + return &RestorePointCollectionsClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/constants.go new file mode 100644 index 000000000000..23bd8196d651 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/constants.go @@ -0,0 +1,1481 @@ +package restorepointcollections + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CachingTypes string + +const ( + CachingTypesNone CachingTypes = "None" + CachingTypesReadOnly CachingTypes = "ReadOnly" + CachingTypesReadWrite CachingTypes = "ReadWrite" +) + +func PossibleValuesForCachingTypes() []string { + return []string{ + string(CachingTypesNone), + string(CachingTypesReadOnly), + string(CachingTypesReadWrite), + } +} + +func (s *CachingTypes) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCachingTypes(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseCachingTypes(input string) (*CachingTypes, error) { + vals := map[string]CachingTypes{ + "none": CachingTypesNone, + "readonly": CachingTypesReadOnly, + "readwrite": CachingTypesReadWrite, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CachingTypes(input) + return &out, nil +} + +type ComponentNames string + +const ( + ComponentNamesMicrosoftNegativeWindowsNegativeShellNegativeSetup ComponentNames = "Microsoft-Windows-Shell-Setup" +) + +func PossibleValuesForComponentNames() []string { + return []string{ + string(ComponentNamesMicrosoftNegativeWindowsNegativeShellNegativeSetup), + } +} + +func (s *ComponentNames) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseComponentNames(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseComponentNames(input string) (*ComponentNames, error) { + vals := map[string]ComponentNames{ + "microsoft-windows-shell-setup": ComponentNamesMicrosoftNegativeWindowsNegativeShellNegativeSetup, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ComponentNames(input) + return &out, nil +} + +type ConsistencyModeTypes string + +const ( + ConsistencyModeTypesApplicationConsistent ConsistencyModeTypes = "ApplicationConsistent" + ConsistencyModeTypesCrashConsistent ConsistencyModeTypes = "CrashConsistent" + ConsistencyModeTypesFileSystemConsistent ConsistencyModeTypes = "FileSystemConsistent" +) + +func PossibleValuesForConsistencyModeTypes() []string { + return []string{ + string(ConsistencyModeTypesApplicationConsistent), + string(ConsistencyModeTypesCrashConsistent), + string(ConsistencyModeTypesFileSystemConsistent), + } +} + +func (s *ConsistencyModeTypes) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseConsistencyModeTypes(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseConsistencyModeTypes(input string) (*ConsistencyModeTypes, error) { + vals := map[string]ConsistencyModeTypes{ + "applicationconsistent": ConsistencyModeTypesApplicationConsistent, + "crashconsistent": ConsistencyModeTypesCrashConsistent, + "filesystemconsistent": ConsistencyModeTypesFileSystemConsistent, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ConsistencyModeTypes(input) + return &out, nil +} + +type DiskControllerTypes string + +const ( + DiskControllerTypesNVMe DiskControllerTypes = "NVMe" + DiskControllerTypesSCSI DiskControllerTypes = "SCSI" +) + +func PossibleValuesForDiskControllerTypes() []string { + return []string{ + string(DiskControllerTypesNVMe), + string(DiskControllerTypesSCSI), + } +} + +func (s *DiskControllerTypes) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDiskControllerTypes(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDiskControllerTypes(input string) (*DiskControllerTypes, error) { + vals := map[string]DiskControllerTypes{ + "nvme": DiskControllerTypesNVMe, + "scsi": DiskControllerTypesSCSI, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DiskControllerTypes(input) + return &out, nil +} + +type HyperVGenerationTypes string + +const ( + HyperVGenerationTypesVOne HyperVGenerationTypes = "V1" + HyperVGenerationTypesVTwo HyperVGenerationTypes = "V2" +) + +func PossibleValuesForHyperVGenerationTypes() []string { + return []string{ + string(HyperVGenerationTypesVOne), + string(HyperVGenerationTypesVTwo), + } +} + +func (s *HyperVGenerationTypes) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseHyperVGenerationTypes(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseHyperVGenerationTypes(input string) (*HyperVGenerationTypes, error) { + vals := map[string]HyperVGenerationTypes{ + "v1": HyperVGenerationTypesVOne, + "v2": HyperVGenerationTypesVTwo, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := HyperVGenerationTypes(input) + return &out, nil +} + +type LinuxPatchAssessmentMode string + +const ( + LinuxPatchAssessmentModeAutomaticByPlatform LinuxPatchAssessmentMode = "AutomaticByPlatform" + LinuxPatchAssessmentModeImageDefault LinuxPatchAssessmentMode = "ImageDefault" +) + +func PossibleValuesForLinuxPatchAssessmentMode() []string { + return []string{ + string(LinuxPatchAssessmentModeAutomaticByPlatform), + string(LinuxPatchAssessmentModeImageDefault), + } +} + +func (s *LinuxPatchAssessmentMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLinuxPatchAssessmentMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLinuxPatchAssessmentMode(input string) (*LinuxPatchAssessmentMode, error) { + vals := map[string]LinuxPatchAssessmentMode{ + "automaticbyplatform": LinuxPatchAssessmentModeAutomaticByPlatform, + "imagedefault": LinuxPatchAssessmentModeImageDefault, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LinuxPatchAssessmentMode(input) + return &out, nil +} + +type LinuxVMGuestPatchAutomaticByPlatformRebootSetting string + +const ( + LinuxVMGuestPatchAutomaticByPlatformRebootSettingAlways LinuxVMGuestPatchAutomaticByPlatformRebootSetting = "Always" + LinuxVMGuestPatchAutomaticByPlatformRebootSettingIfRequired LinuxVMGuestPatchAutomaticByPlatformRebootSetting = "IfRequired" + LinuxVMGuestPatchAutomaticByPlatformRebootSettingNever LinuxVMGuestPatchAutomaticByPlatformRebootSetting = "Never" + LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown LinuxVMGuestPatchAutomaticByPlatformRebootSetting = "Unknown" +) + +func PossibleValuesForLinuxVMGuestPatchAutomaticByPlatformRebootSetting() []string { + return []string{ + string(LinuxVMGuestPatchAutomaticByPlatformRebootSettingAlways), + string(LinuxVMGuestPatchAutomaticByPlatformRebootSettingIfRequired), + string(LinuxVMGuestPatchAutomaticByPlatformRebootSettingNever), + string(LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown), + } +} + +func (s *LinuxVMGuestPatchAutomaticByPlatformRebootSetting) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLinuxVMGuestPatchAutomaticByPlatformRebootSetting(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLinuxVMGuestPatchAutomaticByPlatformRebootSetting(input string) (*LinuxVMGuestPatchAutomaticByPlatformRebootSetting, error) { + vals := map[string]LinuxVMGuestPatchAutomaticByPlatformRebootSetting{ + "always": LinuxVMGuestPatchAutomaticByPlatformRebootSettingAlways, + "ifrequired": LinuxVMGuestPatchAutomaticByPlatformRebootSettingIfRequired, + "never": LinuxVMGuestPatchAutomaticByPlatformRebootSettingNever, + "unknown": LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LinuxVMGuestPatchAutomaticByPlatformRebootSetting(input) + return &out, nil +} + +type LinuxVMGuestPatchMode string + +const ( + LinuxVMGuestPatchModeAutomaticByPlatform LinuxVMGuestPatchMode = "AutomaticByPlatform" + LinuxVMGuestPatchModeImageDefault LinuxVMGuestPatchMode = "ImageDefault" +) + +func PossibleValuesForLinuxVMGuestPatchMode() []string { + return []string{ + string(LinuxVMGuestPatchModeAutomaticByPlatform), + string(LinuxVMGuestPatchModeImageDefault), + } +} + +func (s *LinuxVMGuestPatchMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLinuxVMGuestPatchMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLinuxVMGuestPatchMode(input string) (*LinuxVMGuestPatchMode, error) { + vals := map[string]LinuxVMGuestPatchMode{ + "automaticbyplatform": LinuxVMGuestPatchModeAutomaticByPlatform, + "imagedefault": LinuxVMGuestPatchModeImageDefault, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LinuxVMGuestPatchMode(input) + return &out, nil +} + +type Mode string + +const ( + ModeAudit Mode = "Audit" + ModeEnforce Mode = "Enforce" +) + +func PossibleValuesForMode() []string { + return []string{ + string(ModeAudit), + string(ModeEnforce), + } +} + +func (s *Mode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMode(input string) (*Mode, error) { + vals := map[string]Mode{ + "audit": ModeAudit, + "enforce": ModeEnforce, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := Mode(input) + return &out, nil +} + +type OperatingSystemType string + +const ( + OperatingSystemTypeLinux OperatingSystemType = "Linux" + OperatingSystemTypeWindows OperatingSystemType = "Windows" +) + +func PossibleValuesForOperatingSystemType() []string { + return []string{ + string(OperatingSystemTypeLinux), + string(OperatingSystemTypeWindows), + } +} + +func (s *OperatingSystemType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseOperatingSystemType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseOperatingSystemType(input string) (*OperatingSystemType, error) { + vals := map[string]OperatingSystemType{ + "linux": OperatingSystemTypeLinux, + "windows": OperatingSystemTypeWindows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OperatingSystemType(input) + return &out, nil +} + +type PassNames string + +const ( + PassNamesOobeSystem PassNames = "OobeSystem" +) + +func PossibleValuesForPassNames() []string { + return []string{ + string(PassNamesOobeSystem), + } +} + +func (s *PassNames) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePassNames(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePassNames(input string) (*PassNames, error) { + vals := map[string]PassNames{ + "oobesystem": PassNamesOobeSystem, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PassNames(input) + return &out, nil +} + +type ProtocolTypes string + +const ( + ProtocolTypesHTTP ProtocolTypes = "Http" + ProtocolTypesHTTPS ProtocolTypes = "Https" +) + +func PossibleValuesForProtocolTypes() []string { + return []string{ + string(ProtocolTypesHTTP), + string(ProtocolTypesHTTPS), + } +} + +func (s *ProtocolTypes) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProtocolTypes(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProtocolTypes(input string) (*ProtocolTypes, error) { + vals := map[string]ProtocolTypes{ + "http": ProtocolTypesHTTP, + "https": ProtocolTypesHTTPS, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProtocolTypes(input) + return &out, nil +} + +type RestorePointCollectionExpandOptions string + +const ( + RestorePointCollectionExpandOptionsRestorePoints RestorePointCollectionExpandOptions = "restorePoints" +) + +func PossibleValuesForRestorePointCollectionExpandOptions() []string { + return []string{ + string(RestorePointCollectionExpandOptionsRestorePoints), + } +} + +func (s *RestorePointCollectionExpandOptions) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRestorePointCollectionExpandOptions(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRestorePointCollectionExpandOptions(input string) (*RestorePointCollectionExpandOptions, error) { + vals := map[string]RestorePointCollectionExpandOptions{ + "restorepoints": RestorePointCollectionExpandOptionsRestorePoints, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RestorePointCollectionExpandOptions(input) + return &out, nil +} + +type RestorePointEncryptionType string + +const ( + RestorePointEncryptionTypeEncryptionAtRestWithCustomerKey RestorePointEncryptionType = "EncryptionAtRestWithCustomerKey" + RestorePointEncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys RestorePointEncryptionType = "EncryptionAtRestWithPlatformAndCustomerKeys" + RestorePointEncryptionTypeEncryptionAtRestWithPlatformKey RestorePointEncryptionType = "EncryptionAtRestWithPlatformKey" +) + +func PossibleValuesForRestorePointEncryptionType() []string { + return []string{ + string(RestorePointEncryptionTypeEncryptionAtRestWithCustomerKey), + string(RestorePointEncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys), + string(RestorePointEncryptionTypeEncryptionAtRestWithPlatformKey), + } +} + +func (s *RestorePointEncryptionType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRestorePointEncryptionType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRestorePointEncryptionType(input string) (*RestorePointEncryptionType, error) { + vals := map[string]RestorePointEncryptionType{ + "encryptionatrestwithcustomerkey": RestorePointEncryptionTypeEncryptionAtRestWithCustomerKey, + "encryptionatrestwithplatformandcustomerkeys": RestorePointEncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys, + "encryptionatrestwithplatformkey": RestorePointEncryptionTypeEncryptionAtRestWithPlatformKey, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RestorePointEncryptionType(input) + return &out, nil +} + +type SecurityEncryptionTypes string + +const ( + SecurityEncryptionTypesDiskWithVMGuestState SecurityEncryptionTypes = "DiskWithVMGuestState" + SecurityEncryptionTypesNonPersistedTPM SecurityEncryptionTypes = "NonPersistedTPM" + SecurityEncryptionTypesVMGuestStateOnly SecurityEncryptionTypes = "VMGuestStateOnly" +) + +func PossibleValuesForSecurityEncryptionTypes() []string { + return []string{ + string(SecurityEncryptionTypesDiskWithVMGuestState), + string(SecurityEncryptionTypesNonPersistedTPM), + string(SecurityEncryptionTypesVMGuestStateOnly), + } +} + +func (s *SecurityEncryptionTypes) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityEncryptionTypes(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityEncryptionTypes(input string) (*SecurityEncryptionTypes, error) { + vals := map[string]SecurityEncryptionTypes{ + "diskwithvmgueststate": SecurityEncryptionTypesDiskWithVMGuestState, + "nonpersistedtpm": SecurityEncryptionTypesNonPersistedTPM, + "vmgueststateonly": SecurityEncryptionTypesVMGuestStateOnly, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityEncryptionTypes(input) + return &out, nil +} + +type SecurityTypes string + +const ( + SecurityTypesConfidentialVM SecurityTypes = "ConfidentialVM" + SecurityTypesTrustedLaunch SecurityTypes = "TrustedLaunch" +) + +func PossibleValuesForSecurityTypes() []string { + return []string{ + string(SecurityTypesConfidentialVM), + string(SecurityTypesTrustedLaunch), + } +} + +func (s *SecurityTypes) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityTypes(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityTypes(input string) (*SecurityTypes, error) { + vals := map[string]SecurityTypes{ + "confidentialvm": SecurityTypesConfidentialVM, + "trustedlaunch": SecurityTypesTrustedLaunch, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityTypes(input) + return &out, nil +} + +type SettingNames string + +const ( + SettingNamesAutoLogon SettingNames = "AutoLogon" + SettingNamesFirstLogonCommands SettingNames = "FirstLogonCommands" +) + +func PossibleValuesForSettingNames() []string { + return []string{ + string(SettingNamesAutoLogon), + string(SettingNamesFirstLogonCommands), + } +} + +func (s *SettingNames) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSettingNames(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSettingNames(input string) (*SettingNames, error) { + vals := map[string]SettingNames{ + "autologon": SettingNamesAutoLogon, + "firstlogoncommands": SettingNamesFirstLogonCommands, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SettingNames(input) + return &out, nil +} + +type StatusLevelTypes string + +const ( + StatusLevelTypesError StatusLevelTypes = "Error" + StatusLevelTypesInfo StatusLevelTypes = "Info" + StatusLevelTypesWarning StatusLevelTypes = "Warning" +) + +func PossibleValuesForStatusLevelTypes() []string { + return []string{ + string(StatusLevelTypesError), + string(StatusLevelTypesInfo), + string(StatusLevelTypesWarning), + } +} + +func (s *StatusLevelTypes) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseStatusLevelTypes(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseStatusLevelTypes(input string) (*StatusLevelTypes, error) { + vals := map[string]StatusLevelTypes{ + "error": StatusLevelTypesError, + "info": StatusLevelTypesInfo, + "warning": StatusLevelTypesWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := StatusLevelTypes(input) + return &out, nil +} + +type StorageAccountTypes string + +const ( + StorageAccountTypesPremiumLRS StorageAccountTypes = "Premium_LRS" + StorageAccountTypesPremiumVTwoLRS StorageAccountTypes = "PremiumV2_LRS" + StorageAccountTypesPremiumZRS StorageAccountTypes = "Premium_ZRS" + StorageAccountTypesStandardLRS StorageAccountTypes = "Standard_LRS" + StorageAccountTypesStandardSSDLRS StorageAccountTypes = "StandardSSD_LRS" + StorageAccountTypesStandardSSDZRS StorageAccountTypes = "StandardSSD_ZRS" + StorageAccountTypesUltraSSDLRS StorageAccountTypes = "UltraSSD_LRS" +) + +func PossibleValuesForStorageAccountTypes() []string { + return []string{ + string(StorageAccountTypesPremiumLRS), + string(StorageAccountTypesPremiumVTwoLRS), + string(StorageAccountTypesPremiumZRS), + string(StorageAccountTypesStandardLRS), + string(StorageAccountTypesStandardSSDLRS), + string(StorageAccountTypesStandardSSDZRS), + string(StorageAccountTypesUltraSSDLRS), + } +} + +func (s *StorageAccountTypes) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseStorageAccountTypes(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseStorageAccountTypes(input string) (*StorageAccountTypes, error) { + vals := map[string]StorageAccountTypes{ + "premium_lrs": StorageAccountTypesPremiumLRS, + "premiumv2_lrs": StorageAccountTypesPremiumVTwoLRS, + "premium_zrs": StorageAccountTypesPremiumZRS, + "standard_lrs": StorageAccountTypesStandardLRS, + "standardssd_lrs": StorageAccountTypesStandardSSDLRS, + "standardssd_zrs": StorageAccountTypesStandardSSDZRS, + "ultrassd_lrs": StorageAccountTypesUltraSSDLRS, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := StorageAccountTypes(input) + return &out, nil +} + +type VirtualMachineSizeTypes string + +const ( + VirtualMachineSizeTypesBasicAFour VirtualMachineSizeTypes = "Basic_A4" + VirtualMachineSizeTypesBasicAOne VirtualMachineSizeTypes = "Basic_A1" + VirtualMachineSizeTypesBasicAThree VirtualMachineSizeTypes = "Basic_A3" + VirtualMachineSizeTypesBasicATwo VirtualMachineSizeTypes = "Basic_A2" + VirtualMachineSizeTypesBasicAZero VirtualMachineSizeTypes = "Basic_A0" + VirtualMachineSizeTypesStandardAEight VirtualMachineSizeTypes = "Standard_A8" + VirtualMachineSizeTypesStandardAEightVTwo VirtualMachineSizeTypes = "Standard_A8_v2" + VirtualMachineSizeTypesStandardAEightmVTwo VirtualMachineSizeTypes = "Standard_A8m_v2" + VirtualMachineSizeTypesStandardAFive VirtualMachineSizeTypes = "Standard_A5" + VirtualMachineSizeTypesStandardAFour VirtualMachineSizeTypes = "Standard_A4" + VirtualMachineSizeTypesStandardAFourVTwo VirtualMachineSizeTypes = "Standard_A4_v2" + VirtualMachineSizeTypesStandardAFourmVTwo VirtualMachineSizeTypes = "Standard_A4m_v2" + VirtualMachineSizeTypesStandardANine VirtualMachineSizeTypes = "Standard_A9" + VirtualMachineSizeTypesStandardAOne VirtualMachineSizeTypes = "Standard_A1" + VirtualMachineSizeTypesStandardAOneOne VirtualMachineSizeTypes = "Standard_A11" + VirtualMachineSizeTypesStandardAOneVTwo VirtualMachineSizeTypes = "Standard_A1_v2" + VirtualMachineSizeTypesStandardAOneZero VirtualMachineSizeTypes = "Standard_A10" + VirtualMachineSizeTypesStandardASeven VirtualMachineSizeTypes = "Standard_A7" + VirtualMachineSizeTypesStandardASix VirtualMachineSizeTypes = "Standard_A6" + VirtualMachineSizeTypesStandardAThree VirtualMachineSizeTypes = "Standard_A3" + VirtualMachineSizeTypesStandardATwo VirtualMachineSizeTypes = "Standard_A2" + VirtualMachineSizeTypesStandardATwoVTwo VirtualMachineSizeTypes = "Standard_A2_v2" + VirtualMachineSizeTypesStandardATwomVTwo VirtualMachineSizeTypes = "Standard_A2m_v2" + VirtualMachineSizeTypesStandardAZero VirtualMachineSizeTypes = "Standard_A0" + VirtualMachineSizeTypesStandardBEightms VirtualMachineSizeTypes = "Standard_B8ms" + VirtualMachineSizeTypesStandardBFourms VirtualMachineSizeTypes = "Standard_B4ms" + VirtualMachineSizeTypesStandardBOnems VirtualMachineSizeTypes = "Standard_B1ms" + VirtualMachineSizeTypesStandardBOnes VirtualMachineSizeTypes = "Standard_B1s" + VirtualMachineSizeTypesStandardBTwoms VirtualMachineSizeTypes = "Standard_B2ms" + VirtualMachineSizeTypesStandardBTwos VirtualMachineSizeTypes = "Standard_B2s" + VirtualMachineSizeTypesStandardDEightVThree VirtualMachineSizeTypes = "Standard_D8_v3" + VirtualMachineSizeTypesStandardDEightsVThree VirtualMachineSizeTypes = "Standard_D8s_v3" + VirtualMachineSizeTypesStandardDFiveVTwo VirtualMachineSizeTypes = "Standard_D5_v2" + VirtualMachineSizeTypesStandardDFour VirtualMachineSizeTypes = "Standard_D4" + VirtualMachineSizeTypesStandardDFourVThree VirtualMachineSizeTypes = "Standard_D4_v3" + VirtualMachineSizeTypesStandardDFourVTwo VirtualMachineSizeTypes = "Standard_D4_v2" + VirtualMachineSizeTypesStandardDFoursVThree VirtualMachineSizeTypes = "Standard_D4s_v3" + VirtualMachineSizeTypesStandardDOne VirtualMachineSizeTypes = "Standard_D1" + VirtualMachineSizeTypesStandardDOneFiveVTwo VirtualMachineSizeTypes = "Standard_D15_v2" + VirtualMachineSizeTypesStandardDOneFour VirtualMachineSizeTypes = "Standard_D14" + VirtualMachineSizeTypesStandardDOneFourVTwo VirtualMachineSizeTypes = "Standard_D14_v2" + VirtualMachineSizeTypesStandardDOneOne VirtualMachineSizeTypes = "Standard_D11" + VirtualMachineSizeTypesStandardDOneOneVTwo VirtualMachineSizeTypes = "Standard_D11_v2" + VirtualMachineSizeTypesStandardDOneSixVThree VirtualMachineSizeTypes = "Standard_D16_v3" + VirtualMachineSizeTypesStandardDOneSixsVThree VirtualMachineSizeTypes = "Standard_D16s_v3" + VirtualMachineSizeTypesStandardDOneThree VirtualMachineSizeTypes = "Standard_D13" + VirtualMachineSizeTypesStandardDOneThreeVTwo VirtualMachineSizeTypes = "Standard_D13_v2" + VirtualMachineSizeTypesStandardDOneTwo VirtualMachineSizeTypes = "Standard_D12" + VirtualMachineSizeTypesStandardDOneTwoVTwo VirtualMachineSizeTypes = "Standard_D12_v2" + VirtualMachineSizeTypesStandardDOneVTwo VirtualMachineSizeTypes = "Standard_D1_v2" + VirtualMachineSizeTypesStandardDSFiveVTwo VirtualMachineSizeTypes = "Standard_DS5_v2" + VirtualMachineSizeTypesStandardDSFour VirtualMachineSizeTypes = "Standard_DS4" + VirtualMachineSizeTypesStandardDSFourVTwo VirtualMachineSizeTypes = "Standard_DS4_v2" + VirtualMachineSizeTypesStandardDSOne VirtualMachineSizeTypes = "Standard_DS1" + VirtualMachineSizeTypesStandardDSOneFiveVTwo VirtualMachineSizeTypes = "Standard_DS15_v2" + VirtualMachineSizeTypesStandardDSOneFour VirtualMachineSizeTypes = "Standard_DS14" + VirtualMachineSizeTypesStandardDSOneFourNegativeEightVTwo VirtualMachineSizeTypes = "Standard_DS14-8_v2" + VirtualMachineSizeTypesStandardDSOneFourNegativeFourVTwo VirtualMachineSizeTypes = "Standard_DS14-4_v2" + VirtualMachineSizeTypesStandardDSOneFourVTwo VirtualMachineSizeTypes = "Standard_DS14_v2" + VirtualMachineSizeTypesStandardDSOneOne VirtualMachineSizeTypes = "Standard_DS11" + VirtualMachineSizeTypesStandardDSOneOneVTwo VirtualMachineSizeTypes = "Standard_DS11_v2" + VirtualMachineSizeTypesStandardDSOneThree VirtualMachineSizeTypes = "Standard_DS13" + VirtualMachineSizeTypesStandardDSOneThreeNegativeFourVTwo VirtualMachineSizeTypes = "Standard_DS13-4_v2" + VirtualMachineSizeTypesStandardDSOneThreeNegativeTwoVTwo VirtualMachineSizeTypes = "Standard_DS13-2_v2" + VirtualMachineSizeTypesStandardDSOneThreeVTwo VirtualMachineSizeTypes = "Standard_DS13_v2" + VirtualMachineSizeTypesStandardDSOneTwo VirtualMachineSizeTypes = "Standard_DS12" + VirtualMachineSizeTypesStandardDSOneTwoVTwo VirtualMachineSizeTypes = "Standard_DS12_v2" + VirtualMachineSizeTypesStandardDSOneVTwo VirtualMachineSizeTypes = "Standard_DS1_v2" + VirtualMachineSizeTypesStandardDSThree VirtualMachineSizeTypes = "Standard_DS3" + VirtualMachineSizeTypesStandardDSThreeVTwo VirtualMachineSizeTypes = "Standard_DS3_v2" + VirtualMachineSizeTypesStandardDSTwo VirtualMachineSizeTypes = "Standard_DS2" + VirtualMachineSizeTypesStandardDSTwoVTwo VirtualMachineSizeTypes = "Standard_DS2_v2" + VirtualMachineSizeTypesStandardDSixFourVThree VirtualMachineSizeTypes = "Standard_D64_v3" + VirtualMachineSizeTypesStandardDSixFoursVThree VirtualMachineSizeTypes = "Standard_D64s_v3" + VirtualMachineSizeTypesStandardDThree VirtualMachineSizeTypes = "Standard_D3" + VirtualMachineSizeTypesStandardDThreeTwoVThree VirtualMachineSizeTypes = "Standard_D32_v3" + VirtualMachineSizeTypesStandardDThreeTwosVThree VirtualMachineSizeTypes = "Standard_D32s_v3" + VirtualMachineSizeTypesStandardDThreeVTwo VirtualMachineSizeTypes = "Standard_D3_v2" + VirtualMachineSizeTypesStandardDTwo VirtualMachineSizeTypes = "Standard_D2" + VirtualMachineSizeTypesStandardDTwoVThree VirtualMachineSizeTypes = "Standard_D2_v3" + VirtualMachineSizeTypesStandardDTwoVTwo VirtualMachineSizeTypes = "Standard_D2_v2" + VirtualMachineSizeTypesStandardDTwosVThree VirtualMachineSizeTypes = "Standard_D2s_v3" + VirtualMachineSizeTypesStandardEEightVThree VirtualMachineSizeTypes = "Standard_E8_v3" + VirtualMachineSizeTypesStandardEEightsVThree VirtualMachineSizeTypes = "Standard_E8s_v3" + VirtualMachineSizeTypesStandardEFourVThree VirtualMachineSizeTypes = "Standard_E4_v3" + VirtualMachineSizeTypesStandardEFoursVThree VirtualMachineSizeTypes = "Standard_E4s_v3" + VirtualMachineSizeTypesStandardEOneSixVThree VirtualMachineSizeTypes = "Standard_E16_v3" + VirtualMachineSizeTypesStandardEOneSixsVThree VirtualMachineSizeTypes = "Standard_E16s_v3" + VirtualMachineSizeTypesStandardESixFourNegativeOneSixsVThree VirtualMachineSizeTypes = "Standard_E64-16s_v3" + VirtualMachineSizeTypesStandardESixFourNegativeThreeTwosVThree VirtualMachineSizeTypes = "Standard_E64-32s_v3" + VirtualMachineSizeTypesStandardESixFourVThree VirtualMachineSizeTypes = "Standard_E64_v3" + VirtualMachineSizeTypesStandardESixFoursVThree VirtualMachineSizeTypes = "Standard_E64s_v3" + VirtualMachineSizeTypesStandardEThreeTwoNegativeEightsVThree VirtualMachineSizeTypes = "Standard_E32-8s_v3" + VirtualMachineSizeTypesStandardEThreeTwoNegativeOneSixVThree VirtualMachineSizeTypes = "Standard_E32-16_v3" + VirtualMachineSizeTypesStandardEThreeTwoVThree VirtualMachineSizeTypes = "Standard_E32_v3" + VirtualMachineSizeTypesStandardEThreeTwosVThree VirtualMachineSizeTypes = "Standard_E32s_v3" + VirtualMachineSizeTypesStandardETwoVThree VirtualMachineSizeTypes = "Standard_E2_v3" + VirtualMachineSizeTypesStandardETwosVThree VirtualMachineSizeTypes = "Standard_E2s_v3" + VirtualMachineSizeTypesStandardFEight VirtualMachineSizeTypes = "Standard_F8" + VirtualMachineSizeTypesStandardFEights VirtualMachineSizeTypes = "Standard_F8s" + VirtualMachineSizeTypesStandardFEightsVTwo VirtualMachineSizeTypes = "Standard_F8s_v2" + VirtualMachineSizeTypesStandardFFour VirtualMachineSizeTypes = "Standard_F4" + VirtualMachineSizeTypesStandardFFours VirtualMachineSizeTypes = "Standard_F4s" + VirtualMachineSizeTypesStandardFFoursVTwo VirtualMachineSizeTypes = "Standard_F4s_v2" + VirtualMachineSizeTypesStandardFOne VirtualMachineSizeTypes = "Standard_F1" + VirtualMachineSizeTypesStandardFOneSix VirtualMachineSizeTypes = "Standard_F16" + VirtualMachineSizeTypesStandardFOneSixs VirtualMachineSizeTypes = "Standard_F16s" + VirtualMachineSizeTypesStandardFOneSixsVTwo VirtualMachineSizeTypes = "Standard_F16s_v2" + VirtualMachineSizeTypesStandardFOnes VirtualMachineSizeTypes = "Standard_F1s" + VirtualMachineSizeTypesStandardFSevenTwosVTwo VirtualMachineSizeTypes = "Standard_F72s_v2" + VirtualMachineSizeTypesStandardFSixFoursVTwo VirtualMachineSizeTypes = "Standard_F64s_v2" + VirtualMachineSizeTypesStandardFThreeTwosVTwo VirtualMachineSizeTypes = "Standard_F32s_v2" + VirtualMachineSizeTypesStandardFTwo VirtualMachineSizeTypes = "Standard_F2" + VirtualMachineSizeTypesStandardFTwos VirtualMachineSizeTypes = "Standard_F2s" + VirtualMachineSizeTypesStandardFTwosVTwo VirtualMachineSizeTypes = "Standard_F2s_v2" + VirtualMachineSizeTypesStandardGFive VirtualMachineSizeTypes = "Standard_G5" + VirtualMachineSizeTypesStandardGFour VirtualMachineSizeTypes = "Standard_G4" + VirtualMachineSizeTypesStandardGOne VirtualMachineSizeTypes = "Standard_G1" + VirtualMachineSizeTypesStandardGSFive VirtualMachineSizeTypes = "Standard_GS5" + VirtualMachineSizeTypesStandardGSFiveNegativeEight VirtualMachineSizeTypes = "Standard_GS5-8" + VirtualMachineSizeTypesStandardGSFiveNegativeOneSix VirtualMachineSizeTypes = "Standard_GS5-16" + VirtualMachineSizeTypesStandardGSFour VirtualMachineSizeTypes = "Standard_GS4" + VirtualMachineSizeTypesStandardGSFourNegativeEight VirtualMachineSizeTypes = "Standard_GS4-8" + VirtualMachineSizeTypesStandardGSFourNegativeFour VirtualMachineSizeTypes = "Standard_GS4-4" + VirtualMachineSizeTypesStandardGSOne VirtualMachineSizeTypes = "Standard_GS1" + VirtualMachineSizeTypesStandardGSThree VirtualMachineSizeTypes = "Standard_GS3" + VirtualMachineSizeTypesStandardGSTwo VirtualMachineSizeTypes = "Standard_GS2" + VirtualMachineSizeTypesStandardGThree VirtualMachineSizeTypes = "Standard_G3" + VirtualMachineSizeTypesStandardGTwo VirtualMachineSizeTypes = "Standard_G2" + VirtualMachineSizeTypesStandardHEight VirtualMachineSizeTypes = "Standard_H8" + VirtualMachineSizeTypesStandardHEightm VirtualMachineSizeTypes = "Standard_H8m" + VirtualMachineSizeTypesStandardHOneSix VirtualMachineSizeTypes = "Standard_H16" + VirtualMachineSizeTypesStandardHOneSixm VirtualMachineSizeTypes = "Standard_H16m" + VirtualMachineSizeTypesStandardHOneSixmr VirtualMachineSizeTypes = "Standard_H16mr" + VirtualMachineSizeTypesStandardHOneSixr VirtualMachineSizeTypes = "Standard_H16r" + VirtualMachineSizeTypesStandardLEights VirtualMachineSizeTypes = "Standard_L8s" + VirtualMachineSizeTypesStandardLFours VirtualMachineSizeTypes = "Standard_L4s" + VirtualMachineSizeTypesStandardLOneSixs VirtualMachineSizeTypes = "Standard_L16s" + VirtualMachineSizeTypesStandardLThreeTwos VirtualMachineSizeTypes = "Standard_L32s" + VirtualMachineSizeTypesStandardMOneTwoEightNegativeSixFourms VirtualMachineSizeTypes = "Standard_M128-64ms" + VirtualMachineSizeTypesStandardMOneTwoEightNegativeThreeTwoms VirtualMachineSizeTypes = "Standard_M128-32ms" + VirtualMachineSizeTypesStandardMOneTwoEightms VirtualMachineSizeTypes = "Standard_M128ms" + VirtualMachineSizeTypesStandardMOneTwoEights VirtualMachineSizeTypes = "Standard_M128s" + VirtualMachineSizeTypesStandardMSixFourNegativeOneSixms VirtualMachineSizeTypes = "Standard_M64-16ms" + VirtualMachineSizeTypesStandardMSixFourNegativeThreeTwoms VirtualMachineSizeTypes = "Standard_M64-32ms" + VirtualMachineSizeTypesStandardMSixFourms VirtualMachineSizeTypes = "Standard_M64ms" + VirtualMachineSizeTypesStandardMSixFours VirtualMachineSizeTypes = "Standard_M64s" + VirtualMachineSizeTypesStandardNCOneTwo VirtualMachineSizeTypes = "Standard_NC12" + VirtualMachineSizeTypesStandardNCOneTwosVThree VirtualMachineSizeTypes = "Standard_NC12s_v3" + VirtualMachineSizeTypesStandardNCOneTwosVTwo VirtualMachineSizeTypes = "Standard_NC12s_v2" + VirtualMachineSizeTypesStandardNCSix VirtualMachineSizeTypes = "Standard_NC6" + VirtualMachineSizeTypesStandardNCSixsVThree VirtualMachineSizeTypes = "Standard_NC6s_v3" + VirtualMachineSizeTypesStandardNCSixsVTwo VirtualMachineSizeTypes = "Standard_NC6s_v2" + VirtualMachineSizeTypesStandardNCTwoFour VirtualMachineSizeTypes = "Standard_NC24" + VirtualMachineSizeTypesStandardNCTwoFourr VirtualMachineSizeTypes = "Standard_NC24r" + VirtualMachineSizeTypesStandardNCTwoFourrsVThree VirtualMachineSizeTypes = "Standard_NC24rs_v3" + VirtualMachineSizeTypesStandardNCTwoFourrsVTwo VirtualMachineSizeTypes = "Standard_NC24rs_v2" + VirtualMachineSizeTypesStandardNCTwoFoursVThree VirtualMachineSizeTypes = "Standard_NC24s_v3" + VirtualMachineSizeTypesStandardNCTwoFoursVTwo VirtualMachineSizeTypes = "Standard_NC24s_v2" + VirtualMachineSizeTypesStandardNDOneTwos VirtualMachineSizeTypes = "Standard_ND12s" + VirtualMachineSizeTypesStandardNDSixs VirtualMachineSizeTypes = "Standard_ND6s" + VirtualMachineSizeTypesStandardNDTwoFourrs VirtualMachineSizeTypes = "Standard_ND24rs" + VirtualMachineSizeTypesStandardNDTwoFours VirtualMachineSizeTypes = "Standard_ND24s" + VirtualMachineSizeTypesStandardNVOneTwo VirtualMachineSizeTypes = "Standard_NV12" + VirtualMachineSizeTypesStandardNVSix VirtualMachineSizeTypes = "Standard_NV6" + VirtualMachineSizeTypesStandardNVTwoFour VirtualMachineSizeTypes = "Standard_NV24" +) + +func PossibleValuesForVirtualMachineSizeTypes() []string { + return []string{ + string(VirtualMachineSizeTypesBasicAFour), + string(VirtualMachineSizeTypesBasicAOne), + string(VirtualMachineSizeTypesBasicAThree), + string(VirtualMachineSizeTypesBasicATwo), + string(VirtualMachineSizeTypesBasicAZero), + string(VirtualMachineSizeTypesStandardAEight), + string(VirtualMachineSizeTypesStandardAEightVTwo), + string(VirtualMachineSizeTypesStandardAEightmVTwo), + string(VirtualMachineSizeTypesStandardAFive), + string(VirtualMachineSizeTypesStandardAFour), + string(VirtualMachineSizeTypesStandardAFourVTwo), + string(VirtualMachineSizeTypesStandardAFourmVTwo), + string(VirtualMachineSizeTypesStandardANine), + string(VirtualMachineSizeTypesStandardAOne), + string(VirtualMachineSizeTypesStandardAOneOne), + string(VirtualMachineSizeTypesStandardAOneVTwo), + string(VirtualMachineSizeTypesStandardAOneZero), + string(VirtualMachineSizeTypesStandardASeven), + string(VirtualMachineSizeTypesStandardASix), + string(VirtualMachineSizeTypesStandardAThree), + string(VirtualMachineSizeTypesStandardATwo), + string(VirtualMachineSizeTypesStandardATwoVTwo), + string(VirtualMachineSizeTypesStandardATwomVTwo), + string(VirtualMachineSizeTypesStandardAZero), + string(VirtualMachineSizeTypesStandardBEightms), + string(VirtualMachineSizeTypesStandardBFourms), + string(VirtualMachineSizeTypesStandardBOnems), + string(VirtualMachineSizeTypesStandardBOnes), + string(VirtualMachineSizeTypesStandardBTwoms), + string(VirtualMachineSizeTypesStandardBTwos), + string(VirtualMachineSizeTypesStandardDEightVThree), + string(VirtualMachineSizeTypesStandardDEightsVThree), + string(VirtualMachineSizeTypesStandardDFiveVTwo), + string(VirtualMachineSizeTypesStandardDFour), + string(VirtualMachineSizeTypesStandardDFourVThree), + string(VirtualMachineSizeTypesStandardDFourVTwo), + string(VirtualMachineSizeTypesStandardDFoursVThree), + string(VirtualMachineSizeTypesStandardDOne), + string(VirtualMachineSizeTypesStandardDOneFiveVTwo), + string(VirtualMachineSizeTypesStandardDOneFour), + string(VirtualMachineSizeTypesStandardDOneFourVTwo), + string(VirtualMachineSizeTypesStandardDOneOne), + string(VirtualMachineSizeTypesStandardDOneOneVTwo), + string(VirtualMachineSizeTypesStandardDOneSixVThree), + string(VirtualMachineSizeTypesStandardDOneSixsVThree), + string(VirtualMachineSizeTypesStandardDOneThree), + string(VirtualMachineSizeTypesStandardDOneThreeVTwo), + string(VirtualMachineSizeTypesStandardDOneTwo), + string(VirtualMachineSizeTypesStandardDOneTwoVTwo), + string(VirtualMachineSizeTypesStandardDOneVTwo), + string(VirtualMachineSizeTypesStandardDSFiveVTwo), + string(VirtualMachineSizeTypesStandardDSFour), + string(VirtualMachineSizeTypesStandardDSFourVTwo), + string(VirtualMachineSizeTypesStandardDSOne), + string(VirtualMachineSizeTypesStandardDSOneFiveVTwo), + string(VirtualMachineSizeTypesStandardDSOneFour), + string(VirtualMachineSizeTypesStandardDSOneFourNegativeEightVTwo), + string(VirtualMachineSizeTypesStandardDSOneFourNegativeFourVTwo), + string(VirtualMachineSizeTypesStandardDSOneFourVTwo), + string(VirtualMachineSizeTypesStandardDSOneOne), + string(VirtualMachineSizeTypesStandardDSOneOneVTwo), + string(VirtualMachineSizeTypesStandardDSOneThree), + string(VirtualMachineSizeTypesStandardDSOneThreeNegativeFourVTwo), + string(VirtualMachineSizeTypesStandardDSOneThreeNegativeTwoVTwo), + string(VirtualMachineSizeTypesStandardDSOneThreeVTwo), + string(VirtualMachineSizeTypesStandardDSOneTwo), + string(VirtualMachineSizeTypesStandardDSOneTwoVTwo), + string(VirtualMachineSizeTypesStandardDSOneVTwo), + string(VirtualMachineSizeTypesStandardDSThree), + string(VirtualMachineSizeTypesStandardDSThreeVTwo), + string(VirtualMachineSizeTypesStandardDSTwo), + string(VirtualMachineSizeTypesStandardDSTwoVTwo), + string(VirtualMachineSizeTypesStandardDSixFourVThree), + string(VirtualMachineSizeTypesStandardDSixFoursVThree), + string(VirtualMachineSizeTypesStandardDThree), + string(VirtualMachineSizeTypesStandardDThreeTwoVThree), + string(VirtualMachineSizeTypesStandardDThreeTwosVThree), + string(VirtualMachineSizeTypesStandardDThreeVTwo), + string(VirtualMachineSizeTypesStandardDTwo), + string(VirtualMachineSizeTypesStandardDTwoVThree), + string(VirtualMachineSizeTypesStandardDTwoVTwo), + string(VirtualMachineSizeTypesStandardDTwosVThree), + string(VirtualMachineSizeTypesStandardEEightVThree), + string(VirtualMachineSizeTypesStandardEEightsVThree), + string(VirtualMachineSizeTypesStandardEFourVThree), + string(VirtualMachineSizeTypesStandardEFoursVThree), + string(VirtualMachineSizeTypesStandardEOneSixVThree), + string(VirtualMachineSizeTypesStandardEOneSixsVThree), + string(VirtualMachineSizeTypesStandardESixFourNegativeOneSixsVThree), + string(VirtualMachineSizeTypesStandardESixFourNegativeThreeTwosVThree), + string(VirtualMachineSizeTypesStandardESixFourVThree), + string(VirtualMachineSizeTypesStandardESixFoursVThree), + string(VirtualMachineSizeTypesStandardEThreeTwoNegativeEightsVThree), + string(VirtualMachineSizeTypesStandardEThreeTwoNegativeOneSixVThree), + string(VirtualMachineSizeTypesStandardEThreeTwoVThree), + string(VirtualMachineSizeTypesStandardEThreeTwosVThree), + string(VirtualMachineSizeTypesStandardETwoVThree), + string(VirtualMachineSizeTypesStandardETwosVThree), + string(VirtualMachineSizeTypesStandardFEight), + string(VirtualMachineSizeTypesStandardFEights), + string(VirtualMachineSizeTypesStandardFEightsVTwo), + string(VirtualMachineSizeTypesStandardFFour), + string(VirtualMachineSizeTypesStandardFFours), + string(VirtualMachineSizeTypesStandardFFoursVTwo), + string(VirtualMachineSizeTypesStandardFOne), + string(VirtualMachineSizeTypesStandardFOneSix), + string(VirtualMachineSizeTypesStandardFOneSixs), + string(VirtualMachineSizeTypesStandardFOneSixsVTwo), + string(VirtualMachineSizeTypesStandardFOnes), + string(VirtualMachineSizeTypesStandardFSevenTwosVTwo), + string(VirtualMachineSizeTypesStandardFSixFoursVTwo), + string(VirtualMachineSizeTypesStandardFThreeTwosVTwo), + string(VirtualMachineSizeTypesStandardFTwo), + string(VirtualMachineSizeTypesStandardFTwos), + string(VirtualMachineSizeTypesStandardFTwosVTwo), + string(VirtualMachineSizeTypesStandardGFive), + string(VirtualMachineSizeTypesStandardGFour), + string(VirtualMachineSizeTypesStandardGOne), + string(VirtualMachineSizeTypesStandardGSFive), + string(VirtualMachineSizeTypesStandardGSFiveNegativeEight), + string(VirtualMachineSizeTypesStandardGSFiveNegativeOneSix), + string(VirtualMachineSizeTypesStandardGSFour), + string(VirtualMachineSizeTypesStandardGSFourNegativeEight), + string(VirtualMachineSizeTypesStandardGSFourNegativeFour), + string(VirtualMachineSizeTypesStandardGSOne), + string(VirtualMachineSizeTypesStandardGSThree), + string(VirtualMachineSizeTypesStandardGSTwo), + string(VirtualMachineSizeTypesStandardGThree), + string(VirtualMachineSizeTypesStandardGTwo), + string(VirtualMachineSizeTypesStandardHEight), + string(VirtualMachineSizeTypesStandardHEightm), + string(VirtualMachineSizeTypesStandardHOneSix), + string(VirtualMachineSizeTypesStandardHOneSixm), + string(VirtualMachineSizeTypesStandardHOneSixmr), + string(VirtualMachineSizeTypesStandardHOneSixr), + string(VirtualMachineSizeTypesStandardLEights), + string(VirtualMachineSizeTypesStandardLFours), + string(VirtualMachineSizeTypesStandardLOneSixs), + string(VirtualMachineSizeTypesStandardLThreeTwos), + string(VirtualMachineSizeTypesStandardMOneTwoEightNegativeSixFourms), + string(VirtualMachineSizeTypesStandardMOneTwoEightNegativeThreeTwoms), + string(VirtualMachineSizeTypesStandardMOneTwoEightms), + string(VirtualMachineSizeTypesStandardMOneTwoEights), + string(VirtualMachineSizeTypesStandardMSixFourNegativeOneSixms), + string(VirtualMachineSizeTypesStandardMSixFourNegativeThreeTwoms), + string(VirtualMachineSizeTypesStandardMSixFourms), + string(VirtualMachineSizeTypesStandardMSixFours), + string(VirtualMachineSizeTypesStandardNCOneTwo), + string(VirtualMachineSizeTypesStandardNCOneTwosVThree), + string(VirtualMachineSizeTypesStandardNCOneTwosVTwo), + string(VirtualMachineSizeTypesStandardNCSix), + string(VirtualMachineSizeTypesStandardNCSixsVThree), + string(VirtualMachineSizeTypesStandardNCSixsVTwo), + string(VirtualMachineSizeTypesStandardNCTwoFour), + string(VirtualMachineSizeTypesStandardNCTwoFourr), + string(VirtualMachineSizeTypesStandardNCTwoFourrsVThree), + string(VirtualMachineSizeTypesStandardNCTwoFourrsVTwo), + string(VirtualMachineSizeTypesStandardNCTwoFoursVThree), + string(VirtualMachineSizeTypesStandardNCTwoFoursVTwo), + string(VirtualMachineSizeTypesStandardNDOneTwos), + string(VirtualMachineSizeTypesStandardNDSixs), + string(VirtualMachineSizeTypesStandardNDTwoFourrs), + string(VirtualMachineSizeTypesStandardNDTwoFours), + string(VirtualMachineSizeTypesStandardNVOneTwo), + string(VirtualMachineSizeTypesStandardNVSix), + string(VirtualMachineSizeTypesStandardNVTwoFour), + } +} + +func (s *VirtualMachineSizeTypes) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualMachineSizeTypes(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualMachineSizeTypes(input string) (*VirtualMachineSizeTypes, error) { + vals := map[string]VirtualMachineSizeTypes{ + "basic_a4": VirtualMachineSizeTypesBasicAFour, + "basic_a1": VirtualMachineSizeTypesBasicAOne, + "basic_a3": VirtualMachineSizeTypesBasicAThree, + "basic_a2": VirtualMachineSizeTypesBasicATwo, + "basic_a0": VirtualMachineSizeTypesBasicAZero, + "standard_a8": VirtualMachineSizeTypesStandardAEight, + "standard_a8_v2": VirtualMachineSizeTypesStandardAEightVTwo, + "standard_a8m_v2": VirtualMachineSizeTypesStandardAEightmVTwo, + "standard_a5": VirtualMachineSizeTypesStandardAFive, + "standard_a4": VirtualMachineSizeTypesStandardAFour, + "standard_a4_v2": VirtualMachineSizeTypesStandardAFourVTwo, + "standard_a4m_v2": VirtualMachineSizeTypesStandardAFourmVTwo, + "standard_a9": VirtualMachineSizeTypesStandardANine, + "standard_a1": VirtualMachineSizeTypesStandardAOne, + "standard_a11": VirtualMachineSizeTypesStandardAOneOne, + "standard_a1_v2": VirtualMachineSizeTypesStandardAOneVTwo, + "standard_a10": VirtualMachineSizeTypesStandardAOneZero, + "standard_a7": VirtualMachineSizeTypesStandardASeven, + "standard_a6": VirtualMachineSizeTypesStandardASix, + "standard_a3": VirtualMachineSizeTypesStandardAThree, + "standard_a2": VirtualMachineSizeTypesStandardATwo, + "standard_a2_v2": VirtualMachineSizeTypesStandardATwoVTwo, + "standard_a2m_v2": VirtualMachineSizeTypesStandardATwomVTwo, + "standard_a0": VirtualMachineSizeTypesStandardAZero, + "standard_b8ms": VirtualMachineSizeTypesStandardBEightms, + "standard_b4ms": VirtualMachineSizeTypesStandardBFourms, + "standard_b1ms": VirtualMachineSizeTypesStandardBOnems, + "standard_b1s": VirtualMachineSizeTypesStandardBOnes, + "standard_b2ms": VirtualMachineSizeTypesStandardBTwoms, + "standard_b2s": VirtualMachineSizeTypesStandardBTwos, + "standard_d8_v3": VirtualMachineSizeTypesStandardDEightVThree, + "standard_d8s_v3": VirtualMachineSizeTypesStandardDEightsVThree, + "standard_d5_v2": VirtualMachineSizeTypesStandardDFiveVTwo, + "standard_d4": VirtualMachineSizeTypesStandardDFour, + "standard_d4_v3": VirtualMachineSizeTypesStandardDFourVThree, + "standard_d4_v2": VirtualMachineSizeTypesStandardDFourVTwo, + "standard_d4s_v3": VirtualMachineSizeTypesStandardDFoursVThree, + "standard_d1": VirtualMachineSizeTypesStandardDOne, + "standard_d15_v2": VirtualMachineSizeTypesStandardDOneFiveVTwo, + "standard_d14": VirtualMachineSizeTypesStandardDOneFour, + "standard_d14_v2": VirtualMachineSizeTypesStandardDOneFourVTwo, + "standard_d11": VirtualMachineSizeTypesStandardDOneOne, + "standard_d11_v2": VirtualMachineSizeTypesStandardDOneOneVTwo, + "standard_d16_v3": VirtualMachineSizeTypesStandardDOneSixVThree, + "standard_d16s_v3": VirtualMachineSizeTypesStandardDOneSixsVThree, + "standard_d13": VirtualMachineSizeTypesStandardDOneThree, + "standard_d13_v2": VirtualMachineSizeTypesStandardDOneThreeVTwo, + "standard_d12": VirtualMachineSizeTypesStandardDOneTwo, + "standard_d12_v2": VirtualMachineSizeTypesStandardDOneTwoVTwo, + "standard_d1_v2": VirtualMachineSizeTypesStandardDOneVTwo, + "standard_ds5_v2": VirtualMachineSizeTypesStandardDSFiveVTwo, + "standard_ds4": VirtualMachineSizeTypesStandardDSFour, + "standard_ds4_v2": VirtualMachineSizeTypesStandardDSFourVTwo, + "standard_ds1": VirtualMachineSizeTypesStandardDSOne, + "standard_ds15_v2": VirtualMachineSizeTypesStandardDSOneFiveVTwo, + "standard_ds14": VirtualMachineSizeTypesStandardDSOneFour, + "standard_ds14-8_v2": VirtualMachineSizeTypesStandardDSOneFourNegativeEightVTwo, + "standard_ds14-4_v2": VirtualMachineSizeTypesStandardDSOneFourNegativeFourVTwo, + "standard_ds14_v2": VirtualMachineSizeTypesStandardDSOneFourVTwo, + "standard_ds11": VirtualMachineSizeTypesStandardDSOneOne, + "standard_ds11_v2": VirtualMachineSizeTypesStandardDSOneOneVTwo, + "standard_ds13": VirtualMachineSizeTypesStandardDSOneThree, + "standard_ds13-4_v2": VirtualMachineSizeTypesStandardDSOneThreeNegativeFourVTwo, + "standard_ds13-2_v2": VirtualMachineSizeTypesStandardDSOneThreeNegativeTwoVTwo, + "standard_ds13_v2": VirtualMachineSizeTypesStandardDSOneThreeVTwo, + "standard_ds12": VirtualMachineSizeTypesStandardDSOneTwo, + "standard_ds12_v2": VirtualMachineSizeTypesStandardDSOneTwoVTwo, + "standard_ds1_v2": VirtualMachineSizeTypesStandardDSOneVTwo, + "standard_ds3": VirtualMachineSizeTypesStandardDSThree, + "standard_ds3_v2": VirtualMachineSizeTypesStandardDSThreeVTwo, + "standard_ds2": VirtualMachineSizeTypesStandardDSTwo, + "standard_ds2_v2": VirtualMachineSizeTypesStandardDSTwoVTwo, + "standard_d64_v3": VirtualMachineSizeTypesStandardDSixFourVThree, + "standard_d64s_v3": VirtualMachineSizeTypesStandardDSixFoursVThree, + "standard_d3": VirtualMachineSizeTypesStandardDThree, + "standard_d32_v3": VirtualMachineSizeTypesStandardDThreeTwoVThree, + "standard_d32s_v3": VirtualMachineSizeTypesStandardDThreeTwosVThree, + "standard_d3_v2": VirtualMachineSizeTypesStandardDThreeVTwo, + "standard_d2": VirtualMachineSizeTypesStandardDTwo, + "standard_d2_v3": VirtualMachineSizeTypesStandardDTwoVThree, + "standard_d2_v2": VirtualMachineSizeTypesStandardDTwoVTwo, + "standard_d2s_v3": VirtualMachineSizeTypesStandardDTwosVThree, + "standard_e8_v3": VirtualMachineSizeTypesStandardEEightVThree, + "standard_e8s_v3": VirtualMachineSizeTypesStandardEEightsVThree, + "standard_e4_v3": VirtualMachineSizeTypesStandardEFourVThree, + "standard_e4s_v3": VirtualMachineSizeTypesStandardEFoursVThree, + "standard_e16_v3": VirtualMachineSizeTypesStandardEOneSixVThree, + "standard_e16s_v3": VirtualMachineSizeTypesStandardEOneSixsVThree, + "standard_e64-16s_v3": VirtualMachineSizeTypesStandardESixFourNegativeOneSixsVThree, + "standard_e64-32s_v3": VirtualMachineSizeTypesStandardESixFourNegativeThreeTwosVThree, + "standard_e64_v3": VirtualMachineSizeTypesStandardESixFourVThree, + "standard_e64s_v3": VirtualMachineSizeTypesStandardESixFoursVThree, + "standard_e32-8s_v3": VirtualMachineSizeTypesStandardEThreeTwoNegativeEightsVThree, + "standard_e32-16_v3": VirtualMachineSizeTypesStandardEThreeTwoNegativeOneSixVThree, + "standard_e32_v3": VirtualMachineSizeTypesStandardEThreeTwoVThree, + "standard_e32s_v3": VirtualMachineSizeTypesStandardEThreeTwosVThree, + "standard_e2_v3": VirtualMachineSizeTypesStandardETwoVThree, + "standard_e2s_v3": VirtualMachineSizeTypesStandardETwosVThree, + "standard_f8": VirtualMachineSizeTypesStandardFEight, + "standard_f8s": VirtualMachineSizeTypesStandardFEights, + "standard_f8s_v2": VirtualMachineSizeTypesStandardFEightsVTwo, + "standard_f4": VirtualMachineSizeTypesStandardFFour, + "standard_f4s": VirtualMachineSizeTypesStandardFFours, + "standard_f4s_v2": VirtualMachineSizeTypesStandardFFoursVTwo, + "standard_f1": VirtualMachineSizeTypesStandardFOne, + "standard_f16": VirtualMachineSizeTypesStandardFOneSix, + "standard_f16s": VirtualMachineSizeTypesStandardFOneSixs, + "standard_f16s_v2": VirtualMachineSizeTypesStandardFOneSixsVTwo, + "standard_f1s": VirtualMachineSizeTypesStandardFOnes, + "standard_f72s_v2": VirtualMachineSizeTypesStandardFSevenTwosVTwo, + "standard_f64s_v2": VirtualMachineSizeTypesStandardFSixFoursVTwo, + "standard_f32s_v2": VirtualMachineSizeTypesStandardFThreeTwosVTwo, + "standard_f2": VirtualMachineSizeTypesStandardFTwo, + "standard_f2s": VirtualMachineSizeTypesStandardFTwos, + "standard_f2s_v2": VirtualMachineSizeTypesStandardFTwosVTwo, + "standard_g5": VirtualMachineSizeTypesStandardGFive, + "standard_g4": VirtualMachineSizeTypesStandardGFour, + "standard_g1": VirtualMachineSizeTypesStandardGOne, + "standard_gs5": VirtualMachineSizeTypesStandardGSFive, + "standard_gs5-8": VirtualMachineSizeTypesStandardGSFiveNegativeEight, + "standard_gs5-16": VirtualMachineSizeTypesStandardGSFiveNegativeOneSix, + "standard_gs4": VirtualMachineSizeTypesStandardGSFour, + "standard_gs4-8": VirtualMachineSizeTypesStandardGSFourNegativeEight, + "standard_gs4-4": VirtualMachineSizeTypesStandardGSFourNegativeFour, + "standard_gs1": VirtualMachineSizeTypesStandardGSOne, + "standard_gs3": VirtualMachineSizeTypesStandardGSThree, + "standard_gs2": VirtualMachineSizeTypesStandardGSTwo, + "standard_g3": VirtualMachineSizeTypesStandardGThree, + "standard_g2": VirtualMachineSizeTypesStandardGTwo, + "standard_h8": VirtualMachineSizeTypesStandardHEight, + "standard_h8m": VirtualMachineSizeTypesStandardHEightm, + "standard_h16": VirtualMachineSizeTypesStandardHOneSix, + "standard_h16m": VirtualMachineSizeTypesStandardHOneSixm, + "standard_h16mr": VirtualMachineSizeTypesStandardHOneSixmr, + "standard_h16r": VirtualMachineSizeTypesStandardHOneSixr, + "standard_l8s": VirtualMachineSizeTypesStandardLEights, + "standard_l4s": VirtualMachineSizeTypesStandardLFours, + "standard_l16s": VirtualMachineSizeTypesStandardLOneSixs, + "standard_l32s": VirtualMachineSizeTypesStandardLThreeTwos, + "standard_m128-64ms": VirtualMachineSizeTypesStandardMOneTwoEightNegativeSixFourms, + "standard_m128-32ms": VirtualMachineSizeTypesStandardMOneTwoEightNegativeThreeTwoms, + "standard_m128ms": VirtualMachineSizeTypesStandardMOneTwoEightms, + "standard_m128s": VirtualMachineSizeTypesStandardMOneTwoEights, + "standard_m64-16ms": VirtualMachineSizeTypesStandardMSixFourNegativeOneSixms, + "standard_m64-32ms": VirtualMachineSizeTypesStandardMSixFourNegativeThreeTwoms, + "standard_m64ms": VirtualMachineSizeTypesStandardMSixFourms, + "standard_m64s": VirtualMachineSizeTypesStandardMSixFours, + "standard_nc12": VirtualMachineSizeTypesStandardNCOneTwo, + "standard_nc12s_v3": VirtualMachineSizeTypesStandardNCOneTwosVThree, + "standard_nc12s_v2": VirtualMachineSizeTypesStandardNCOneTwosVTwo, + "standard_nc6": VirtualMachineSizeTypesStandardNCSix, + "standard_nc6s_v3": VirtualMachineSizeTypesStandardNCSixsVThree, + "standard_nc6s_v2": VirtualMachineSizeTypesStandardNCSixsVTwo, + "standard_nc24": VirtualMachineSizeTypesStandardNCTwoFour, + "standard_nc24r": VirtualMachineSizeTypesStandardNCTwoFourr, + "standard_nc24rs_v3": VirtualMachineSizeTypesStandardNCTwoFourrsVThree, + "standard_nc24rs_v2": VirtualMachineSizeTypesStandardNCTwoFourrsVTwo, + "standard_nc24s_v3": VirtualMachineSizeTypesStandardNCTwoFoursVThree, + "standard_nc24s_v2": VirtualMachineSizeTypesStandardNCTwoFoursVTwo, + "standard_nd12s": VirtualMachineSizeTypesStandardNDOneTwos, + "standard_nd6s": VirtualMachineSizeTypesStandardNDSixs, + "standard_nd24rs": VirtualMachineSizeTypesStandardNDTwoFourrs, + "standard_nd24s": VirtualMachineSizeTypesStandardNDTwoFours, + "standard_nv12": VirtualMachineSizeTypesStandardNVOneTwo, + "standard_nv6": VirtualMachineSizeTypesStandardNVSix, + "standard_nv24": VirtualMachineSizeTypesStandardNVTwoFour, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualMachineSizeTypes(input) + return &out, nil +} + +type WindowsPatchAssessmentMode string + +const ( + WindowsPatchAssessmentModeAutomaticByPlatform WindowsPatchAssessmentMode = "AutomaticByPlatform" + WindowsPatchAssessmentModeImageDefault WindowsPatchAssessmentMode = "ImageDefault" +) + +func PossibleValuesForWindowsPatchAssessmentMode() []string { + return []string{ + string(WindowsPatchAssessmentModeAutomaticByPlatform), + string(WindowsPatchAssessmentModeImageDefault), + } +} + +func (s *WindowsPatchAssessmentMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseWindowsPatchAssessmentMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseWindowsPatchAssessmentMode(input string) (*WindowsPatchAssessmentMode, error) { + vals := map[string]WindowsPatchAssessmentMode{ + "automaticbyplatform": WindowsPatchAssessmentModeAutomaticByPlatform, + "imagedefault": WindowsPatchAssessmentModeImageDefault, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := WindowsPatchAssessmentMode(input) + return &out, nil +} + +type WindowsVMGuestPatchAutomaticByPlatformRebootSetting string + +const ( + WindowsVMGuestPatchAutomaticByPlatformRebootSettingAlways WindowsVMGuestPatchAutomaticByPlatformRebootSetting = "Always" + WindowsVMGuestPatchAutomaticByPlatformRebootSettingIfRequired WindowsVMGuestPatchAutomaticByPlatformRebootSetting = "IfRequired" + WindowsVMGuestPatchAutomaticByPlatformRebootSettingNever WindowsVMGuestPatchAutomaticByPlatformRebootSetting = "Never" + WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown WindowsVMGuestPatchAutomaticByPlatformRebootSetting = "Unknown" +) + +func PossibleValuesForWindowsVMGuestPatchAutomaticByPlatformRebootSetting() []string { + return []string{ + string(WindowsVMGuestPatchAutomaticByPlatformRebootSettingAlways), + string(WindowsVMGuestPatchAutomaticByPlatformRebootSettingIfRequired), + string(WindowsVMGuestPatchAutomaticByPlatformRebootSettingNever), + string(WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown), + } +} + +func (s *WindowsVMGuestPatchAutomaticByPlatformRebootSetting) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseWindowsVMGuestPatchAutomaticByPlatformRebootSetting(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseWindowsVMGuestPatchAutomaticByPlatformRebootSetting(input string) (*WindowsVMGuestPatchAutomaticByPlatformRebootSetting, error) { + vals := map[string]WindowsVMGuestPatchAutomaticByPlatformRebootSetting{ + "always": WindowsVMGuestPatchAutomaticByPlatformRebootSettingAlways, + "ifrequired": WindowsVMGuestPatchAutomaticByPlatformRebootSettingIfRequired, + "never": WindowsVMGuestPatchAutomaticByPlatformRebootSettingNever, + "unknown": WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := WindowsVMGuestPatchAutomaticByPlatformRebootSetting(input) + return &out, nil +} + +type WindowsVMGuestPatchMode string + +const ( + WindowsVMGuestPatchModeAutomaticByOS WindowsVMGuestPatchMode = "AutomaticByOS" + WindowsVMGuestPatchModeAutomaticByPlatform WindowsVMGuestPatchMode = "AutomaticByPlatform" + WindowsVMGuestPatchModeManual WindowsVMGuestPatchMode = "Manual" +) + +func PossibleValuesForWindowsVMGuestPatchMode() []string { + return []string{ + string(WindowsVMGuestPatchModeAutomaticByOS), + string(WindowsVMGuestPatchModeAutomaticByPlatform), + string(WindowsVMGuestPatchModeManual), + } +} + +func (s *WindowsVMGuestPatchMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseWindowsVMGuestPatchMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseWindowsVMGuestPatchMode(input string) (*WindowsVMGuestPatchMode, error) { + vals := map[string]WindowsVMGuestPatchMode{ + "automaticbyos": WindowsVMGuestPatchModeAutomaticByOS, + "automaticbyplatform": WindowsVMGuestPatchModeAutomaticByPlatform, + "manual": WindowsVMGuestPatchModeManual, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := WindowsVMGuestPatchMode(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/id_restorepointcollection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/id_restorepointcollection.go new file mode 100644 index 000000000000..5ae5a2198296 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/id_restorepointcollection.go @@ -0,0 +1,130 @@ +package restorepointcollections + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +func init() { + recaser.RegisterResourceId(&RestorePointCollectionId{}) +} + +var _ resourceids.ResourceId = &RestorePointCollectionId{} + +// RestorePointCollectionId is a struct representing the Resource ID for a Restore Point Collection +type RestorePointCollectionId struct { + SubscriptionId string + ResourceGroupName string + RestorePointCollectionName string +} + +// NewRestorePointCollectionID returns a new RestorePointCollectionId struct +func NewRestorePointCollectionID(subscriptionId string, resourceGroupName string, restorePointCollectionName string) RestorePointCollectionId { + return RestorePointCollectionId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + RestorePointCollectionName: restorePointCollectionName, + } +} + +// ParseRestorePointCollectionID parses 'input' into a RestorePointCollectionId +func ParseRestorePointCollectionID(input string) (*RestorePointCollectionId, error) { + parser := resourceids.NewParserFromResourceIdType(&RestorePointCollectionId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := RestorePointCollectionId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseRestorePointCollectionIDInsensitively parses 'input' case-insensitively into a RestorePointCollectionId +// note: this method should only be used for API response data and not user input +func ParseRestorePointCollectionIDInsensitively(input string) (*RestorePointCollectionId, error) { + parser := resourceids.NewParserFromResourceIdType(&RestorePointCollectionId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := RestorePointCollectionId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *RestorePointCollectionId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) + } + + if id.RestorePointCollectionName, ok = input.Parsed["restorePointCollectionName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "restorePointCollectionName", input) + } + + return nil +} + +// ValidateRestorePointCollectionID checks that 'input' can be parsed as a Restore Point Collection ID +func ValidateRestorePointCollectionID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseRestorePointCollectionID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Restore Point Collection ID +func (id RestorePointCollectionId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/restorePointCollections/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RestorePointCollectionName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Restore Point Collection ID +func (id RestorePointCollectionId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), + resourceids.StaticSegment("staticRestorePointCollections", "restorePointCollections", "restorePointCollections"), + resourceids.UserSpecifiedSegment("restorePointCollectionName", "restorePointCollectionValue"), + } +} + +// String returns a human-readable description of this Restore Point Collection ID +func (id RestorePointCollectionId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Restore Point Collection Name: %q", id.RestorePointCollectionName), + } + return fmt.Sprintf("Restore Point Collection (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/method_createorupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/method_createorupdate.go new file mode 100644 index 000000000000..6837427e5be1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/method_createorupdate.go @@ -0,0 +1,59 @@ +package restorepointcollections + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *RestorePointCollection +} + +// CreateOrUpdate ... +func (c RestorePointCollectionsClient) CreateOrUpdate(ctx context.Context, id RestorePointCollectionId, input RestorePointCollection) (result CreateOrUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model RestorePointCollection + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/method_delete.go new file mode 100644 index 000000000000..3aefb2adc43f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/method_delete.go @@ -0,0 +1,71 @@ +package restorepointcollections + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Delete ... +func (c RestorePointCollectionsClient) Delete(ctx context.Context, id RestorePointCollectionId) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + http.StatusOK, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// DeleteThenPoll performs Delete then polls until it's completed +func (c RestorePointCollectionsClient) DeleteThenPoll(ctx context.Context, id RestorePointCollectionId) error { + result, err := c.Delete(ctx, id) + if err != nil { + return fmt.Errorf("performing Delete: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Delete: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/method_get.go new file mode 100644 index 000000000000..875f286c7fa8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/method_get.go @@ -0,0 +1,83 @@ +package restorepointcollections + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *RestorePointCollection +} + +type GetOperationOptions struct { + Expand *RestorePointCollectionExpandOptions +} + +func DefaultGetOperationOptions() GetOperationOptions { + return GetOperationOptions{} +} + +func (o GetOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + + return &out +} + +func (o GetOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o GetOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + if o.Expand != nil { + out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) + } + return &out +} + +// Get ... +func (c RestorePointCollectionsClient) Get(ctx context.Context, id RestorePointCollectionId, options GetOperationOptions) (result GetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + OptionsObject: options, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model RestorePointCollection + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/method_list.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/method_list.go new file mode 100644 index 000000000000..ab48c4768888 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/method_list.go @@ -0,0 +1,106 @@ +package restorepointcollections + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]RestorePointCollection +} + +type ListCompleteResult struct { + LatestHttpResponse *http.Response + Items []RestorePointCollection +} + +type ListCustomPager struct { + NextLink *odata.Link `json:"nextLink"` +} + +func (p *ListCustomPager) NextPageLink() *odata.Link { + defer func() { + p.NextLink = nil + }() + + return p.NextLink +} + +// List ... +func (c RestorePointCollectionsClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Pager: &ListCustomPager{}, + Path: fmt.Sprintf("%s/providers/Microsoft.Compute/restorePointCollections", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]RestorePointCollection `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListComplete retrieves all the results into a single object +func (c RestorePointCollectionsClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { + return c.ListCompleteMatchingPredicate(ctx, id, RestorePointCollectionOperationPredicate{}) +} + +// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c RestorePointCollectionsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate RestorePointCollectionOperationPredicate) (result ListCompleteResult, err error) { + items := make([]RestorePointCollection, 0) + + resp, err := c.List(ctx, id) + if err != nil { + result.LatestHttpResponse = resp.HttpResponse + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/method_listall.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/method_listall.go new file mode 100644 index 000000000000..a254de391708 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/method_listall.go @@ -0,0 +1,106 @@ +package restorepointcollections + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListAllOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]RestorePointCollection +} + +type ListAllCompleteResult struct { + LatestHttpResponse *http.Response + Items []RestorePointCollection +} + +type ListAllCustomPager struct { + NextLink *odata.Link `json:"nextLink"` +} + +func (p *ListAllCustomPager) NextPageLink() *odata.Link { + defer func() { + p.NextLink = nil + }() + + return p.NextLink +} + +// ListAll ... +func (c RestorePointCollectionsClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Pager: &ListAllCustomPager{}, + Path: fmt.Sprintf("%s/providers/Microsoft.Compute/restorePointCollections", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]RestorePointCollection `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListAllComplete retrieves all the results into a single object +func (c RestorePointCollectionsClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId) (ListAllCompleteResult, error) { + return c.ListAllCompleteMatchingPredicate(ctx, id, RestorePointCollectionOperationPredicate{}) +} + +// ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c RestorePointCollectionsClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate RestorePointCollectionOperationPredicate) (result ListAllCompleteResult, err error) { + items := make([]RestorePointCollection, 0) + + resp, err := c.ListAll(ctx, id) + if err != nil { + result.LatestHttpResponse = resp.HttpResponse + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListAllCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/method_update.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/method_update.go new file mode 100644 index 000000000000..209e763e72dd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/method_update.go @@ -0,0 +1,58 @@ +package restorepointcollections + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpdateOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *RestorePointCollection +} + +// Update ... +func (c RestorePointCollectionsClient) Update(ctx context.Context, id RestorePointCollectionId, input RestorePointCollectionUpdate) (result UpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPatch, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model RestorePointCollection + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_additionalunattendcontent.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_additionalunattendcontent.go new file mode 100644 index 000000000000..a60a8371ab29 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_additionalunattendcontent.go @@ -0,0 +1,11 @@ +package restorepointcollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AdditionalUnattendContent struct { + ComponentName *ComponentNames `json:"componentName,omitempty"` + Content *string `json:"content,omitempty"` + PassName *PassNames `json:"passName,omitempty"` + SettingName *SettingNames `json:"settingName,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_apientityreference.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_apientityreference.go new file mode 100644 index 000000000000..727d790c6565 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_apientityreference.go @@ -0,0 +1,8 @@ +package restorepointcollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ApiEntityReference struct { + Id *string `json:"id,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_bootdiagnostics.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_bootdiagnostics.go new file mode 100644 index 000000000000..f7688478a5f6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_bootdiagnostics.go @@ -0,0 +1,9 @@ +package restorepointcollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BootDiagnostics struct { + Enabled *bool `json:"enabled,omitempty"` + StorageUri *string `json:"storageUri,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_diagnosticsprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_diagnosticsprofile.go new file mode 100644 index 000000000000..0fe48b89ceda --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_diagnosticsprofile.go @@ -0,0 +1,8 @@ +package restorepointcollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DiagnosticsProfile struct { + BootDiagnostics *BootDiagnostics `json:"bootDiagnostics,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_diskencryptionsettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_diskencryptionsettings.go new file mode 100644 index 000000000000..0d821506598e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_diskencryptionsettings.go @@ -0,0 +1,10 @@ +package restorepointcollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DiskEncryptionSettings struct { + DiskEncryptionKey *KeyVaultSecretReference `json:"diskEncryptionKey,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + KeyEncryptionKey *KeyVaultKeyReference `json:"keyEncryptionKey,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_diskrestorepointattributes.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_diskrestorepointattributes.go new file mode 100644 index 000000000000..43124c8f0612 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_diskrestorepointattributes.go @@ -0,0 +1,10 @@ +package restorepointcollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DiskRestorePointAttributes struct { + Encryption *RestorePointEncryption `json:"encryption,omitempty"` + Id *string `json:"id,omitempty"` + SourceDiskRestorePoint *ApiEntityReference `json:"sourceDiskRestorePoint,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_diskrestorepointinstanceview.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_diskrestorepointinstanceview.go new file mode 100644 index 000000000000..210aa74b8236 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_diskrestorepointinstanceview.go @@ -0,0 +1,9 @@ +package restorepointcollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DiskRestorePointInstanceView struct { + Id *string `json:"id,omitempty"` + ReplicationStatus *DiskRestorePointReplicationStatus `json:"replicationStatus,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_diskrestorepointreplicationstatus.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_diskrestorepointreplicationstatus.go new file mode 100644 index 000000000000..a9b1c99fc376 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_diskrestorepointreplicationstatus.go @@ -0,0 +1,9 @@ +package restorepointcollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DiskRestorePointReplicationStatus struct { + CompletionPercent *int64 `json:"completionPercent,omitempty"` + Status *InstanceViewStatus `json:"status,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_encryptionidentity.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_encryptionidentity.go new file mode 100644 index 000000000000..ff6228b54ee9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_encryptionidentity.go @@ -0,0 +1,8 @@ +package restorepointcollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type EncryptionIdentity struct { + UserAssignedIdentityResourceId *string `json:"userAssignedIdentityResourceId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_hardwareprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_hardwareprofile.go new file mode 100644 index 000000000000..2d11fed2803e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_hardwareprofile.go @@ -0,0 +1,9 @@ +package restorepointcollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HardwareProfile struct { + VMSize *VirtualMachineSizeTypes `json:"vmSize,omitempty"` + VMSizeProperties *VMSizeProperties `json:"vmSizeProperties,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_instanceviewstatus.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_instanceviewstatus.go new file mode 100644 index 000000000000..c72457c65f6e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_instanceviewstatus.go @@ -0,0 +1,30 @@ +package restorepointcollections + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type InstanceViewStatus struct { + Code *string `json:"code,omitempty"` + DisplayStatus *string `json:"displayStatus,omitempty"` + Level *StatusLevelTypes `json:"level,omitempty"` + Message *string `json:"message,omitempty"` + Time *string `json:"time,omitempty"` +} + +func (o *InstanceViewStatus) GetTimeAsTime() (*time.Time, error) { + if o.Time == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Time, "2006-01-02T15:04:05Z07:00") +} + +func (o *InstanceViewStatus) SetTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Time = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_keyvaultkeyreference.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_keyvaultkeyreference.go new file mode 100644 index 000000000000..a58940dc6011 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_keyvaultkeyreference.go @@ -0,0 +1,9 @@ +package restorepointcollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type KeyVaultKeyReference struct { + KeyUrl string `json:"keyUrl"` + SourceVault SubResource `json:"sourceVault"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_keyvaultsecretreference.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_keyvaultsecretreference.go new file mode 100644 index 000000000000..9cdda52320c9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_keyvaultsecretreference.go @@ -0,0 +1,9 @@ +package restorepointcollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type KeyVaultSecretReference struct { + SecretUrl string `json:"secretUrl"` + SourceVault SubResource `json:"sourceVault"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_linuxconfiguration.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_linuxconfiguration.go new file mode 100644 index 000000000000..331ab8adf5f1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_linuxconfiguration.go @@ -0,0 +1,12 @@ +package restorepointcollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type LinuxConfiguration struct { + DisablePasswordAuthentication *bool `json:"disablePasswordAuthentication,omitempty"` + EnableVMAgentPlatformUpdates *bool `json:"enableVMAgentPlatformUpdates,omitempty"` + PatchSettings *LinuxPatchSettings `json:"patchSettings,omitempty"` + ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` + Ssh *SshConfiguration `json:"ssh,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_linuxpatchsettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_linuxpatchsettings.go new file mode 100644 index 000000000000..1911d1f34cbd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_linuxpatchsettings.go @@ -0,0 +1,10 @@ +package restorepointcollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type LinuxPatchSettings struct { + AssessmentMode *LinuxPatchAssessmentMode `json:"assessmentMode,omitempty"` + AutomaticByPlatformSettings *LinuxVMGuestPatchAutomaticByPlatformSettings `json:"automaticByPlatformSettings,omitempty"` + PatchMode *LinuxVMGuestPatchMode `json:"patchMode,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_linuxvmguestpatchautomaticbyplatformsettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_linuxvmguestpatchautomaticbyplatformsettings.go new file mode 100644 index 000000000000..ee79a6f51554 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_linuxvmguestpatchautomaticbyplatformsettings.go @@ -0,0 +1,9 @@ +package restorepointcollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type LinuxVMGuestPatchAutomaticByPlatformSettings struct { + BypassPlatformSafetyChecksOnUserSchedule *bool `json:"bypassPlatformSafetyChecksOnUserSchedule,omitempty"` + RebootSetting *LinuxVMGuestPatchAutomaticByPlatformRebootSetting `json:"rebootSetting,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_manageddiskparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_manageddiskparameters.go new file mode 100644 index 000000000000..c5ceac9dcb8b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_manageddiskparameters.go @@ -0,0 +1,11 @@ +package restorepointcollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedDiskParameters struct { + DiskEncryptionSet *SubResource `json:"diskEncryptionSet,omitempty"` + Id *string `json:"id,omitempty"` + SecurityProfile *VMDiskSecurityProfile `json:"securityProfile,omitempty"` + StorageAccountType *StorageAccountTypes `json:"storageAccountType,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_osprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_osprofile.go new file mode 100644 index 000000000000..2a8765dd51fa --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_osprofile.go @@ -0,0 +1,16 @@ +package restorepointcollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type OSProfile struct { + AdminPassword *string `json:"adminPassword,omitempty"` + AdminUsername *string `json:"adminUsername,omitempty"` + AllowExtensionOperations *bool `json:"allowExtensionOperations,omitempty"` + ComputerName *string `json:"computerName,omitempty"` + CustomData *string `json:"customData,omitempty"` + LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` + RequireGuestProvisionSignal *bool `json:"requireGuestProvisionSignal,omitempty"` + Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` + WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_patchsettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_patchsettings.go new file mode 100644 index 000000000000..dccbe861dcc6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_patchsettings.go @@ -0,0 +1,11 @@ +package restorepointcollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PatchSettings struct { + AssessmentMode *WindowsPatchAssessmentMode `json:"assessmentMode,omitempty"` + AutomaticByPlatformSettings *WindowsVMGuestPatchAutomaticByPlatformSettings `json:"automaticByPlatformSettings,omitempty"` + EnableHotpatching *bool `json:"enableHotpatching,omitempty"` + PatchMode *WindowsVMGuestPatchMode `json:"patchMode,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_proxyagentsettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_proxyagentsettings.go new file mode 100644 index 000000000000..533c54531ee6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_proxyagentsettings.go @@ -0,0 +1,10 @@ +package restorepointcollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ProxyAgentSettings struct { + Enabled *bool `json:"enabled,omitempty"` + KeyIncarnationId *int64 `json:"keyIncarnationId,omitempty"` + Mode *Mode `json:"mode,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepoint.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepoint.go new file mode 100644 index 000000000000..4d1f4152a438 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepoint.go @@ -0,0 +1,11 @@ +package restorepointcollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RestorePoint struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *RestorePointProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepointcollection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepointcollection.go new file mode 100644 index 000000000000..cb0993cc4eec --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepointcollection.go @@ -0,0 +1,13 @@ +package restorepointcollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RestorePointCollection struct { + Id *string `json:"id,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties *RestorePointCollectionProperties `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepointcollectionproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepointcollectionproperties.go new file mode 100644 index 000000000000..9d6edb62a228 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepointcollectionproperties.go @@ -0,0 +1,11 @@ +package restorepointcollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RestorePointCollectionProperties struct { + ProvisioningState *string `json:"provisioningState,omitempty"` + RestorePointCollectionId *string `json:"restorePointCollectionId,omitempty"` + RestorePoints *[]RestorePoint `json:"restorePoints,omitempty"` + Source *RestorePointCollectionSourceProperties `json:"source,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepointcollectionsourceproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepointcollectionsourceproperties.go new file mode 100644 index 000000000000..0fce692d38bd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepointcollectionsourceproperties.go @@ -0,0 +1,9 @@ +package restorepointcollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RestorePointCollectionSourceProperties struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepointcollectionupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepointcollectionupdate.go new file mode 100644 index 000000000000..e97da7d44a86 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepointcollectionupdate.go @@ -0,0 +1,9 @@ +package restorepointcollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RestorePointCollectionUpdate struct { + Properties *RestorePointCollectionProperties `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepointencryption.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepointencryption.go new file mode 100644 index 000000000000..ac434a738861 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepointencryption.go @@ -0,0 +1,9 @@ +package restorepointcollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RestorePointEncryption struct { + DiskEncryptionSet *SubResource `json:"diskEncryptionSet,omitempty"` + Type *RestorePointEncryptionType `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepointinstanceview.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepointinstanceview.go new file mode 100644 index 000000000000..50af16f9dd0d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepointinstanceview.go @@ -0,0 +1,9 @@ +package restorepointcollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RestorePointInstanceView struct { + DiskRestorePoints *[]DiskRestorePointInstanceView `json:"diskRestorePoints,omitempty"` + Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepointproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepointproperties.go new file mode 100644 index 000000000000..083437b0943f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepointproperties.go @@ -0,0 +1,32 @@ +package restorepointcollections + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RestorePointProperties struct { + ConsistencyMode *ConsistencyModeTypes `json:"consistencyMode,omitempty"` + ExcludeDisks *[]ApiEntityReference `json:"excludeDisks,omitempty"` + InstanceView *RestorePointInstanceView `json:"instanceView,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + SourceMetadata *RestorePointSourceMetadata `json:"sourceMetadata,omitempty"` + SourceRestorePoint *ApiEntityReference `json:"sourceRestorePoint,omitempty"` + TimeCreated *string `json:"timeCreated,omitempty"` +} + +func (o *RestorePointProperties) GetTimeCreatedAsTime() (*time.Time, error) { + if o.TimeCreated == nil { + return nil, nil + } + return dates.ParseAsFormat(o.TimeCreated, "2006-01-02T15:04:05Z07:00") +} + +func (o *RestorePointProperties) SetTimeCreatedAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.TimeCreated = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepointsourcemetadata.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepointsourcemetadata.go new file mode 100644 index 000000000000..154a3e68682b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepointsourcemetadata.go @@ -0,0 +1,17 @@ +package restorepointcollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RestorePointSourceMetadata struct { + DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` + HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` + HyperVGeneration *HyperVGenerationTypes `json:"hyperVGeneration,omitempty"` + LicenseType *string `json:"licenseType,omitempty"` + Location *string `json:"location,omitempty"` + OsProfile *OSProfile `json:"osProfile,omitempty"` + SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` + StorageProfile *RestorePointSourceVMStorageProfile `json:"storageProfile,omitempty"` + UserData *string `json:"userData,omitempty"` + VMId *string `json:"vmId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepointsourcevmdatadisk.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepointsourcevmdatadisk.go new file mode 100644 index 000000000000..587b86f3ae19 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepointsourcevmdatadisk.go @@ -0,0 +1,14 @@ +package restorepointcollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RestorePointSourceVMDataDisk struct { + Caching *CachingTypes `json:"caching,omitempty"` + DiskRestorePoint *DiskRestorePointAttributes `json:"diskRestorePoint,omitempty"` + DiskSizeGB *int64 `json:"diskSizeGB,omitempty"` + Lun *int64 `json:"lun,omitempty"` + ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` + Name *string `json:"name,omitempty"` + WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepointsourcevmosdisk.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepointsourcevmosdisk.go new file mode 100644 index 000000000000..e75634d6f6f7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepointsourcevmosdisk.go @@ -0,0 +1,15 @@ +package restorepointcollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RestorePointSourceVMOSDisk struct { + Caching *CachingTypes `json:"caching,omitempty"` + DiskRestorePoint *DiskRestorePointAttributes `json:"diskRestorePoint,omitempty"` + DiskSizeGB *int64 `json:"diskSizeGB,omitempty"` + EncryptionSettings *DiskEncryptionSettings `json:"encryptionSettings,omitempty"` + ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` + Name *string `json:"name,omitempty"` + OsType *OperatingSystemType `json:"osType,omitempty"` + WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepointsourcevmstorageprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepointsourcevmstorageprofile.go new file mode 100644 index 000000000000..101439cc548e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_restorepointsourcevmstorageprofile.go @@ -0,0 +1,10 @@ +package restorepointcollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RestorePointSourceVMStorageProfile struct { + DataDisks *[]RestorePointSourceVMDataDisk `json:"dataDisks,omitempty"` + DiskControllerType *DiskControllerTypes `json:"diskControllerType,omitempty"` + OsDisk *RestorePointSourceVMOSDisk `json:"osDisk,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_securityprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_securityprofile.go new file mode 100644 index 000000000000..32d20891ded5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_securityprofile.go @@ -0,0 +1,12 @@ +package restorepointcollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityProfile struct { + EncryptionAtHost *bool `json:"encryptionAtHost,omitempty"` + EncryptionIdentity *EncryptionIdentity `json:"encryptionIdentity,omitempty"` + ProxyAgentSettings *ProxyAgentSettings `json:"proxyAgentSettings,omitempty"` + SecurityType *SecurityTypes `json:"securityType,omitempty"` + UefiSettings *UefiSettings `json:"uefiSettings,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_sshconfiguration.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_sshconfiguration.go new file mode 100644 index 000000000000..78c9da8533f5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_sshconfiguration.go @@ -0,0 +1,8 @@ +package restorepointcollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SshConfiguration struct { + PublicKeys *[]SshPublicKey `json:"publicKeys,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_sshpublickey.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_sshpublickey.go new file mode 100644 index 000000000000..e29505369190 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_sshpublickey.go @@ -0,0 +1,9 @@ +package restorepointcollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SshPublicKey struct { + KeyData *string `json:"keyData,omitempty"` + Path *string `json:"path,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_subresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_subresource.go new file mode 100644 index 000000000000..bd10eea4e510 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_subresource.go @@ -0,0 +1,8 @@ +package restorepointcollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubResource struct { + Id *string `json:"id,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_uefisettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_uefisettings.go new file mode 100644 index 000000000000..12510ee841de --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_uefisettings.go @@ -0,0 +1,9 @@ +package restorepointcollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UefiSettings struct { + SecureBootEnabled *bool `json:"secureBootEnabled,omitempty"` + VTpmEnabled *bool `json:"vTpmEnabled,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_vaultcertificate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_vaultcertificate.go new file mode 100644 index 000000000000..1e6b6948da01 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_vaultcertificate.go @@ -0,0 +1,9 @@ +package restorepointcollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VaultCertificate struct { + CertificateStore *string `json:"certificateStore,omitempty"` + CertificateUrl *string `json:"certificateUrl,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_vaultsecretgroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_vaultsecretgroup.go new file mode 100644 index 000000000000..039fc20fb7e6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_vaultsecretgroup.go @@ -0,0 +1,9 @@ +package restorepointcollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VaultSecretGroup struct { + SourceVault *SubResource `json:"sourceVault,omitempty"` + VaultCertificates *[]VaultCertificate `json:"vaultCertificates,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_vmdisksecurityprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_vmdisksecurityprofile.go new file mode 100644 index 000000000000..af2b07bc05c5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_vmdisksecurityprofile.go @@ -0,0 +1,9 @@ +package restorepointcollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VMDiskSecurityProfile struct { + DiskEncryptionSet *SubResource `json:"diskEncryptionSet,omitempty"` + SecurityEncryptionType *SecurityEncryptionTypes `json:"securityEncryptionType,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_vmsizeproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_vmsizeproperties.go new file mode 100644 index 000000000000..9bd6823b54ef --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_vmsizeproperties.go @@ -0,0 +1,9 @@ +package restorepointcollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VMSizeProperties struct { + VCPUsAvailable *int64 `json:"vCPUsAvailable,omitempty"` + VCPUsPerCore *int64 `json:"vCPUsPerCore,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_windowsconfiguration.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_windowsconfiguration.go new file mode 100644 index 000000000000..1408c9770a1f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_windowsconfiguration.go @@ -0,0 +1,14 @@ +package restorepointcollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WindowsConfiguration struct { + AdditionalUnattendContent *[]AdditionalUnattendContent `json:"additionalUnattendContent,omitempty"` + EnableAutomaticUpdates *bool `json:"enableAutomaticUpdates,omitempty"` + EnableVMAgentPlatformUpdates *bool `json:"enableVMAgentPlatformUpdates,omitempty"` + PatchSettings *PatchSettings `json:"patchSettings,omitempty"` + ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` + TimeZone *string `json:"timeZone,omitempty"` + WinRM *WinRMConfiguration `json:"winRM,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_windowsvmguestpatchautomaticbyplatformsettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_windowsvmguestpatchautomaticbyplatformsettings.go new file mode 100644 index 000000000000..a2b5f7d65b60 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_windowsvmguestpatchautomaticbyplatformsettings.go @@ -0,0 +1,9 @@ +package restorepointcollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WindowsVMGuestPatchAutomaticByPlatformSettings struct { + BypassPlatformSafetyChecksOnUserSchedule *bool `json:"bypassPlatformSafetyChecksOnUserSchedule,omitempty"` + RebootSetting *WindowsVMGuestPatchAutomaticByPlatformRebootSetting `json:"rebootSetting,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_winrmconfiguration.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_winrmconfiguration.go new file mode 100644 index 000000000000..d89758ef38f9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_winrmconfiguration.go @@ -0,0 +1,8 @@ +package restorepointcollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WinRMConfiguration struct { + Listeners *[]WinRMListener `json:"listeners,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_winrmlistener.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_winrmlistener.go new file mode 100644 index 000000000000..48cee24a28f0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/model_winrmlistener.go @@ -0,0 +1,9 @@ +package restorepointcollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WinRMListener struct { + CertificateUrl *string `json:"certificateUrl,omitempty"` + Protocol *ProtocolTypes `json:"protocol,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/predicates.go new file mode 100644 index 000000000000..6f4eb007a65e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/predicates.go @@ -0,0 +1,32 @@ +package restorepointcollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RestorePointCollectionOperationPredicate struct { + Id *string + Location *string + Name *string + Type *string +} + +func (p RestorePointCollectionOperationPredicate) Matches(input RestorePointCollection) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Location != nil && *p.Location != input.Location { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/version.go new file mode 100644 index 000000000000..681e25f32a75 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections/version.go @@ -0,0 +1,12 @@ +package restorepointcollections + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2024-03-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/restorepointcollections/%s", defaultApiVersion) +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 4761b5ecabfb..7b5d86361c9d 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -344,6 +344,7 @@ github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/availabilitysets github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/dedicatedhostgroups github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/dedicatedhosts +github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/sshpublickeys github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/virtualmachineextensions github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/virtualmachineimages diff --git a/website/docs/r/restore_point_collection.html.markdown b/website/docs/r/restore_point_collection.html.markdown new file mode 100644 index 000000000000..7ab1749761e0 --- /dev/null +++ b/website/docs/r/restore_point_collection.html.markdown @@ -0,0 +1,122 @@ +--- +subcategory: "Compute" +layout: "azurerm" +page_title: "Azure Resource Manager: azurerm_restore_point_collection" +description: |- + Manages a Restore Point Collection +--- + +# azurerm_restore_point_collection + +Manages a Restore Point Collection. + +## Example Usage + +```hcl +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "example" { + name = "example-resources" + location = "West Europe" +} + +resource "azurerm_virtual_network" "example" { + name = "example-network" + address_space = ["10.0.0.0/16"] + location = azurerm_resource_group.example.location + resource_group_name = azurerm_resource_group.example.name +} + +resource "azurerm_subnet" "example" { + name = "internal" + resource_group_name = azurerm_resource_group.example.name + virtual_network_name = azurerm_virtual_network.example.name + address_prefixes = ["10.0.2.0/24"] +} + +resource "azurerm_network_interface" "example" { + name = "example-nic" + location = azurerm_resource_group.example.location + resource_group_name = azurerm_resource_group.example.name + + ip_configuration { + name = "internal" + subnet_id = azurerm_subnet.example.id + private_ip_address_allocation = "Dynamic" + } +} + +resource "azurerm_linux_virtual_machine" "example" { + name = "example-machine" + resource_group_name = azurerm_resource_group.example.name + location = azurerm_resource_group.example.location + size = "Standard_F2" + admin_username = "adminuser" + network_interface_ids = [ + azurerm_network_interface.example.id, + ] + + admin_ssh_key { + username = "adminuser" + public_key = file("~/.ssh/id_rsa.pub") + } + + os_disk { + caching = "ReadWrite" + storage_account_type = "Standard_LRS" + } + + source_image_reference { + publisher = "Canonical" + offer = "0001-com-ubuntu-server-jammy" + sku = "22_04-lts" + version = "latest" + } +} + +resource "azurerm_restore_point_collection" "test" { + name = "example-collection" + resource_group_name = azurerm_resource_group.example.name + location = azurerm_linux_virtual_machine.example.location + source_virtual_machine_id = azurerm_linux_virtual_machine.example.id +} +``` + +## Argument Reference + +The following arguments are supported: + +* `name` - (Required) Specifies the name of the Restore Point Collection. Changing this forces a new resource to be created. + +* `location` - (Required) The Azure location where the Restore Point Collection should exist. Changing this forces a new resource to be created. + +* `resource_group_name` - (Required) The name of the Resource Group in which the Restore Point Collection should exist. Changing this forces a new resource to be created. + +* `source_virtual_machine_id` - (Required) The ID of the virtual machine that will be associated with this Restore Point Collection. Changing this forces a new resource to be created. + +* `tags` - (Optional) A mapping of tags which should be assigned to this Restore Point Collection. + +## Attributes Reference + +In addition to the Arguments listed above - the following Attributes are exported: + +* `id` - The ID of the Restore Point Collection. + +## Timeouts + +The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: + +* `create` - (Defaults to 45 minutes) Used when creating the Restore Point Collection. +* `update` - (Defaults to 45 minutes) Used when updating the Restore Point Collection. +* `delete` - (Defaults to 45 minutes) Used when deleting the Restore Point Collection. +* `read` - (Defaults to 5 minutes) Used when retrieving the Restore Point Collection. + +## Import + +Restore Point Collections can be imported using the `resource id`, e.g. + +```shell +terraform import azurerm_restore_point_collection.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Compute/restorePointCollections/collection1 +``` From 2376ae963c0013aa321af8a1a7051cfe6b8735cd Mon Sep 17 00:00:00 2001 From: Matthew Date: Tue, 2 Jul 2024 15:50:57 -0700 Subject: [PATCH 2/6] New Resource: azurerm_restore_point --- internal/services/compute/client/client.go | 9 + internal/services/compute/registration.go | 1 + .../compute/restore_point_resource.go | 197 +++ .../compute/restore_point_resource_test.go | 176 ++ .../2024-03-01/restorepoints/README.md | 65 + .../2024-03-01/restorepoints/client.go | 26 + .../2024-03-01/restorepoints/constants.go | 1481 +++++++++++++++++ .../restorepoints/id_restorepoint.go | 139 ++ .../2024-03-01/restorepoints/method_create.go | 74 + .../2024-03-01/restorepoints/method_delete.go | 71 + .../2024-03-01/restorepoints/method_get.go | 83 + .../model_additionalunattendcontent.go | 11 + .../restorepoints/model_apientityreference.go | 8 + .../restorepoints/model_bootdiagnostics.go | 9 + .../restorepoints/model_diagnosticsprofile.go | 8 + .../model_diskencryptionsettings.go | 10 + .../model_diskrestorepointattributes.go | 10 + .../model_diskrestorepointinstanceview.go | 9 + ...model_diskrestorepointreplicationstatus.go | 9 + .../restorepoints/model_encryptionidentity.go | 8 + .../restorepoints/model_hardwareprofile.go | 9 + .../restorepoints/model_instanceviewstatus.go | 30 + .../model_keyvaultkeyreference.go | 9 + .../model_keyvaultsecretreference.go | 9 + .../restorepoints/model_linuxconfiguration.go | 12 + .../restorepoints/model_linuxpatchsettings.go | 10 + ...vmguestpatchautomaticbyplatformsettings.go | 9 + .../model_manageddiskparameters.go | 11 + .../restorepoints/model_osprofile.go | 16 + .../restorepoints/model_patchsettings.go | 11 + .../restorepoints/model_proxyagentsettings.go | 10 + .../restorepoints/model_restorepoint.go | 11 + .../model_restorepointencryption.go | 9 + .../model_restorepointinstanceview.go | 9 + .../model_restorepointproperties.go | 32 + .../model_restorepointsourcemetadata.go | 17 + .../model_restorepointsourcevmdatadisk.go | 14 + .../model_restorepointsourcevmosdisk.go | 15 + ...odel_restorepointsourcevmstorageprofile.go | 10 + .../restorepoints/model_securityprofile.go | 12 + .../restorepoints/model_sshconfiguration.go | 8 + .../restorepoints/model_sshpublickey.go | 9 + .../restorepoints/model_subresource.go | 8 + .../restorepoints/model_uefisettings.go | 9 + .../restorepoints/model_vaultcertificate.go | 9 + .../restorepoints/model_vaultsecretgroup.go | 9 + .../model_vmdisksecurityprofile.go | 9 + .../restorepoints/model_vmsizeproperties.go | 9 + .../model_windowsconfiguration.go | 14 + ...vmguestpatchautomaticbyplatformsettings.go | 9 + .../restorepoints/model_winrmconfiguration.go | 8 + .../restorepoints/model_winrmlistener.go | 9 + .../2024-03-01/restorepoints/version.go | 12 + vendor/modules.txt | 1 + website/docs/r/restore_point.html.markdown | 125 ++ 55 files changed, 2917 insertions(+) create mode 100644 internal/services/compute/restore_point_resource.go create mode 100644 internal/services/compute/restore_point_resource_test.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/id_restorepoint.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/method_create.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/method_delete.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/method_get.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_additionalunattendcontent.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_apientityreference.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_bootdiagnostics.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_diagnosticsprofile.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_diskencryptionsettings.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_diskrestorepointattributes.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_diskrestorepointinstanceview.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_diskrestorepointreplicationstatus.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_encryptionidentity.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_hardwareprofile.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_instanceviewstatus.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_keyvaultkeyreference.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_keyvaultsecretreference.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_linuxconfiguration.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_linuxpatchsettings.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_linuxvmguestpatchautomaticbyplatformsettings.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_manageddiskparameters.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_osprofile.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_patchsettings.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_proxyagentsettings.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_restorepoint.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_restorepointencryption.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_restorepointinstanceview.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_restorepointproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_restorepointsourcemetadata.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_restorepointsourcevmdatadisk.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_restorepointsourcevmosdisk.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_restorepointsourcevmstorageprofile.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_securityprofile.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_sshconfiguration.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_sshpublickey.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_subresource.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_uefisettings.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_vaultcertificate.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_vaultsecretgroup.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_vmdisksecurityprofile.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_vmsizeproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_windowsconfiguration.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_windowsvmguestpatchautomaticbyplatformsettings.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_winrmconfiguration.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_winrmlistener.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/version.go create mode 100644 website/docs/r/restore_point.html.markdown diff --git a/internal/services/compute/client/client.go b/internal/services/compute/client/client.go index 7698c7dbb6a4..8c3d9b51514f 100644 --- a/internal/services/compute/client/client.go +++ b/internal/services/compute/client/client.go @@ -30,6 +30,7 @@ import ( "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/dedicatedhostgroups" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/dedicatedhosts" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/sshpublickeys" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/virtualmachineextensions" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/virtualmachineimages" @@ -63,6 +64,7 @@ type Client struct { MarketplaceAgreementsClient *agreements.AgreementsClient ProximityPlacementGroupsClient *proximityplacementgroups.ProximityPlacementGroupsClient RestorePointCollectionsClient *restorepointcollections.RestorePointCollectionsClient + RestorePointsClient *restorepoints.RestorePointsClient SkusClient *skus.SkusClient SSHPublicKeysClient *sshpublickeys.SshPublicKeysClient SnapshotsClient *snapshots.SnapshotsClient @@ -185,6 +187,12 @@ func NewClient(o *common.ClientOptions) (*Client, error) { } o.Configure(restorePointCollectionsClient.Client, o.Authorizers.ResourceManager) + restorePointsClient, err := restorepoints.NewRestorePointsClientWithBaseURI(o.Environment.ResourceManager) + if err != nil { + return nil, fmt.Errorf("building RestorePoints client: %+v", err) + } + o.Configure(restorePointsClient.Client, o.Authorizers.ResourceManager) + skusClient, err := skus.NewSkusClientWithBaseURI(o.Environment.ResourceManager) if err != nil { return nil, fmt.Errorf("building Skus client: %+v", err) @@ -270,6 +278,7 @@ func NewClient(o *common.ClientOptions) (*Client, error) { MarketplaceAgreementsClient: marketplaceAgreementsClient, ProximityPlacementGroupsClient: proximityPlacementGroupsClient, RestorePointCollectionsClient: restorePointCollectionsClient, + RestorePointsClient: restorePointsClient, SkusClient: skusClient, SSHPublicKeysClient: sshPublicKeysClient, SnapshotsClient: snapshotsClient, diff --git a/internal/services/compute/registration.go b/internal/services/compute/registration.go index 7b593ab49697..2f62ac2c8e49 100644 --- a/internal/services/compute/registration.go +++ b/internal/services/compute/registration.go @@ -93,6 +93,7 @@ func (r Registration) Resources() []sdk.Resource { GalleryApplicationResource{}, GalleryApplicationVersionResource{}, RestorePointCollectionResource{}, + RestorePointResource{}, VirtualMachineGalleryApplicationAssignmentResource{}, } } diff --git a/internal/services/compute/restore_point_resource.go b/internal/services/compute/restore_point_resource.go new file mode 100644 index 000000000000..f6aca1ae8d6d --- /dev/null +++ b/internal/services/compute/restore_point_resource.go @@ -0,0 +1,197 @@ +package compute + +import ( + "context" + "fmt" + "strings" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/pointer" + "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints" + "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" +) + +type RestorePointResource struct{} + +var _ sdk.Resource = RestorePointResource{} + +func (r RestorePointResource) ModelObject() interface{} { + return &RestorePointResourceModel{} +} + +type RestorePointResourceModel struct { + Name string `tfschema:"name"` + RestorePointCollectionId string `tfschema:"restore_point_collection_id"` + CrashConsistencyModeEnabled bool `tfschema:"crash_consistency_mode_enabled"` + ExcludedDisks []string `tfschema:"excluded_disks"` +} + +func (r RestorePointResource) IDValidationFunc() pluginsdk.SchemaValidateFunc { + return restorepoints.ValidateRestorePointID +} + +func (r RestorePointResource) ResourceType() string { + return "azurerm_restore_point" +} + +func (r RestorePointResource) Arguments() map[string]*pluginsdk.Schema { + return map[string]*pluginsdk.Schema{ + "name": { + ForceNew: true, + Required: true, + Type: pluginsdk.TypeString, + }, + + "restore_point_collection_id": { + ForceNew: true, + Required: true, + Type: pluginsdk.TypeString, + ValidateFunc: restorepointcollections.ValidateRestorePointCollectionID, + }, + + "crash_consistency_mode_enabled": { + ForceNew: true, + Optional: true, + Type: pluginsdk.TypeBool, + Default: false, + }, + + "excluded_disks": { + ForceNew: true, + Optional: true, + Type: pluginsdk.TypeSet, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeString, + ValidateFunc: commonids.ValidateManagedDiskID, + }, + }, + } +} + +func (r RestorePointResource) Attributes() map[string]*pluginsdk.Schema { + return map[string]*pluginsdk.Schema{} +} + +func (r RestorePointResource) Create() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 30 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + client := metadata.Client.Compute.RestorePointsClient + + var config RestorePointResourceModel + if err := metadata.Decode(&config); err != nil { + return fmt.Errorf("decoding: %+v", err) + } + + collectionId, err := restorepointcollections.ParseRestorePointCollectionID(config.RestorePointCollectionId) + if err != nil { + return err + } + + id := restorepoints.NewRestorePointID(collectionId.SubscriptionId, collectionId.ResourceGroupName, collectionId.RestorePointCollectionName, config.Name) + + existing, err := client.Get(ctx, id, restorepoints.DefaultGetOperationOptions()) + if err != nil { + if !response.WasNotFound(existing.HttpResponse) { + return fmt.Errorf("checking for the presence of an existing %s: %+v", id, err) + } + } + if !response.WasNotFound(existing.HttpResponse) { + return metadata.ResourceRequiresImport(r.ResourceType(), id) + } + + parameters := restorepoints.RestorePoint{ + Properties: &restorepoints.RestorePointProperties{}, + } + + if config.CrashConsistencyModeEnabled { + parameters.Properties.ConsistencyMode = pointer.To(restorepoints.ConsistencyModeTypesCrashConsistent) + } + + if len(config.ExcludedDisks) > 0 { + excludedDisks := make([]restorepoints.ApiEntityReference, 0) + for _, diskId := range config.ExcludedDisks { + excludedDisks = append(excludedDisks, restorepoints.ApiEntityReference{ + Id: pointer.To(diskId), + }) + } + + parameters.Properties.ExcludeDisks = pointer.To(excludedDisks) + } + + if err = client.CreateThenPoll(ctx, id, parameters); err != nil { + return fmt.Errorf("creating %s: %+v", id, err) + } + + metadata.SetID(id) + return nil + }, + } +} + +func (r RestorePointResource) Read() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 5 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + client := metadata.Client.Compute.RestorePointsClient + + schema := RestorePointResourceModel{} + + id, err := restorepoints.ParseRestorePointID(metadata.ResourceData.Id()) + if err != nil { + return err + } + + resp, err := client.Get(ctx, *id, restorepoints.DefaultGetOperationOptions()) + if err != nil { + if response.WasNotFound(resp.HttpResponse) { + return metadata.MarkAsGone(*id) + } + return fmt.Errorf("retrieving %s: %+v", *id, err) + } + + if model := resp.Model; model != nil { + schema.Name = id.RestorePointName + schema.RestorePointCollectionId = restorepointcollections.NewRestorePointCollectionID(id.SubscriptionId, id.ResourceGroupName, id.RestorePointCollectionName).ID() + + if props := model.Properties; props != nil { + schema.CrashConsistencyModeEnabled = strings.EqualFold(string(pointer.From(props.ConsistencyMode)), string(restorepoints.ConsistencyModeTypesCrashConsistent)) + + excludedDisksConfig := make([]string, 0) + if excludedDisks := props.ExcludeDisks; excludedDisks != nil { + for _, excludedDisk := range *excludedDisks { + excludedDisksConfig = append(excludedDisksConfig, pointer.From(excludedDisk.Id)) + } + } + schema.ExcludedDisks = excludedDisksConfig + } + } + + return metadata.Encode(&schema) + }, + } +} + +func (r RestorePointResource) Delete() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 30 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + client := metadata.Client.Compute.RestorePointsClient + + id, err := restorepoints.ParseRestorePointID(metadata.ResourceData.Id()) + if err != nil { + return err + } + + if err := client.DeleteThenPoll(ctx, *id); err != nil { + return fmt.Errorf("deleting %s: %+v", *id, err) + } + + return nil + }, + } +} diff --git a/internal/services/compute/restore_point_resource_test.go b/internal/services/compute/restore_point_resource_test.go new file mode 100644 index 000000000000..3e0a3a3ab764 --- /dev/null +++ b/internal/services/compute/restore_point_resource_test.go @@ -0,0 +1,176 @@ +package compute_test + +import ( + "context" + "fmt" + "testing" + + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints" + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" + "github.com/hashicorp/terraform-provider-azurerm/internal/clients" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" + "github.com/hashicorp/terraform-provider-azurerm/utils" +) + +type RestorePointResource struct{} + +func TestAccRestorePoint_basic(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_restore_point", "test") + r := RestorePointResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + }) +} + +func TestAccRestorePoint_excludedDisks(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_restore_point", "test") + r := RestorePointResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + }) +} + +func (r RestorePointResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { + id, err := restorepoints.ParseRestorePointID(state.ID) + if err != nil { + return nil, err + } + + resp, err := clients.Compute.RestorePointsClient.Get(ctx, *id, restorepoints.DefaultGetOperationOptions()) + if err != nil { + return nil, fmt.Errorf("reading %s: %+v", *id, err) + } + + return utils.Bool(resp.Model != nil), nil +} + +func (r RestorePointResource) basic(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +%[1]s + +resource "azurerm_restore_point" "test" { + name = "acctestRP-%[2]s" + restore_point_collection_id = azurerm_restore_point_collection.test.id +} +`, r.template(data), data.RandomString) +} + +func (r RestorePointResource) excludedDisks(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +%[1]s + +resource "azurerm_managed_disk" "test" { + name = "acctest%[2]s" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + storage_account_type = "Standard_LRS" + create_option = "Empty" + disk_size_gb = 10 +} + +resource "azurerm_virtual_machine_data_disk_attachment" "test" { + managed_disk_id = azurerm_managed_disk.test.id + virtual_machine_id = azurerm_linux_virtual_machine.test.id + lun = "11" + caching = "ReadWrite" +} + +resource "azurerm_restore_point" "test" { + name = "acctestRP-%[2]s" + restore_point_collection_id = azurerm_restore_point_collection.test.id +} +`, r.template(data), data.RandomString) +} + +func (r RestorePointResource) template(data acceptance.TestData) string { + return fmt.Sprintf(` +resource "azurerm_resource_group" "test" { + name = "acctestRG-Compute-%[1]d" + location = "%[2]s" +} + +resource "azurerm_virtual_network" "test" { + name = "acctestnw-%[1]d" + address_space = ["10.0.0.0/16"] + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name +} + +resource "azurerm_subnet" "test" { + name = "internal-%[1]d" + resource_group_name = azurerm_resource_group.test.name + virtual_network_name = azurerm_virtual_network.test.name + address_prefixes = ["10.0.0.0/24"] +} + +resource "azurerm_network_interface" "test" { + name = "acctestnic-%[1]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + ip_configuration { + name = "internal" + subnet_id = azurerm_subnet.test.id + private_ip_address_allocation = "Dynamic" + } +} + +resource "azurerm_linux_virtual_machine" "test" { + name = "acctestVM-%[1]d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + size = "Standard_F2" + admin_username = "adminuser" + admin_password = "P@$$w0rd1234!" + network_interface_ids = [ + azurerm_network_interface.test.id, + ] + admin_ssh_key { + username = "adminuser" + public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+wWK73dCr+jgQOAxNsHAnNNNMEMWOHYEccp6wJm2gotpr9katuF/ZAdou5AaW1C61slRkHRkpRRX9FA9CYBiitZgvCCz+3nWNN7l/Up54Zps/pHWGZLHNJZRYyAB6j5yVLMVHIHriY49d/GZTZVNB8GoJv9Gakwc/fuEZYYl4YDFiGMBP///TzlI4jhiJzjKnEvqPFki5p2ZRJqcbCiF4pJrxUQR/RXqVFQdbRLZgYfJ8xGB878RENq3yQ39d8dVOkq4edbkzwcUmwwwkYVPIoDGsYLaRHnG+To7FvMeyO7xDVQkMKzopTQV8AuKpyvpqu0a9pWOMaiCyDytO7GGN you@me.com" + } + os_disk { + caching = "ReadWrite" + storage_account_type = "Standard_LRS" + } + source_image_reference { + publisher = "Canonical" + offer = "0001-com-ubuntu-server-jammy" + sku = "22_04-lts" + version = "latest" + } +} + +resource "azurerm_restore_point_collection" "test" { + name = "acctestRPC-%[1]d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_linux_virtual_machine.test.location + source_virtual_machine_id = azurerm_linux_virtual_machine.test.id + tags = { + foo = "bar" + } +} +`, data.RandomInteger, data.Locations.Primary) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/README.md new file mode 100644 index 000000000000..90438c912df1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/README.md @@ -0,0 +1,65 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints` Documentation + +The `restorepoints` SDK allows for interaction with the Azure Resource Manager Service `compute` (API Version `2024-03-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints" +``` + + +### Client Initialization + +```go +client := restorepoints.NewRestorePointsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `RestorePointsClient.Create` + +```go +ctx := context.TODO() +id := restorepoints.NewRestorePointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "restorePointCollectionValue", "restorePointValue") + +payload := restorepoints.RestorePoint{ + // ... +} + + +if err := client.CreateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `RestorePointsClient.Delete` + +```go +ctx := context.TODO() +id := restorepoints.NewRestorePointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "restorePointCollectionValue", "restorePointValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `RestorePointsClient.Get` + +```go +ctx := context.TODO() +id := restorepoints.NewRestorePointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "restorePointCollectionValue", "restorePointValue") + +read, err := client.Get(ctx, id, restorepoints.DefaultGetOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/client.go new file mode 100644 index 000000000000..d655ff0350dd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/client.go @@ -0,0 +1,26 @@ +package restorepoints + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RestorePointsClient struct { + Client *resourcemanager.Client +} + +func NewRestorePointsClientWithBaseURI(sdkApi sdkEnv.Api) (*RestorePointsClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "restorepoints", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating RestorePointsClient: %+v", err) + } + + return &RestorePointsClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/constants.go new file mode 100644 index 000000000000..38c134185d9c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/constants.go @@ -0,0 +1,1481 @@ +package restorepoints + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CachingTypes string + +const ( + CachingTypesNone CachingTypes = "None" + CachingTypesReadOnly CachingTypes = "ReadOnly" + CachingTypesReadWrite CachingTypes = "ReadWrite" +) + +func PossibleValuesForCachingTypes() []string { + return []string{ + string(CachingTypesNone), + string(CachingTypesReadOnly), + string(CachingTypesReadWrite), + } +} + +func (s *CachingTypes) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCachingTypes(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseCachingTypes(input string) (*CachingTypes, error) { + vals := map[string]CachingTypes{ + "none": CachingTypesNone, + "readonly": CachingTypesReadOnly, + "readwrite": CachingTypesReadWrite, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CachingTypes(input) + return &out, nil +} + +type ComponentNames string + +const ( + ComponentNamesMicrosoftNegativeWindowsNegativeShellNegativeSetup ComponentNames = "Microsoft-Windows-Shell-Setup" +) + +func PossibleValuesForComponentNames() []string { + return []string{ + string(ComponentNamesMicrosoftNegativeWindowsNegativeShellNegativeSetup), + } +} + +func (s *ComponentNames) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseComponentNames(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseComponentNames(input string) (*ComponentNames, error) { + vals := map[string]ComponentNames{ + "microsoft-windows-shell-setup": ComponentNamesMicrosoftNegativeWindowsNegativeShellNegativeSetup, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ComponentNames(input) + return &out, nil +} + +type ConsistencyModeTypes string + +const ( + ConsistencyModeTypesApplicationConsistent ConsistencyModeTypes = "ApplicationConsistent" + ConsistencyModeTypesCrashConsistent ConsistencyModeTypes = "CrashConsistent" + ConsistencyModeTypesFileSystemConsistent ConsistencyModeTypes = "FileSystemConsistent" +) + +func PossibleValuesForConsistencyModeTypes() []string { + return []string{ + string(ConsistencyModeTypesApplicationConsistent), + string(ConsistencyModeTypesCrashConsistent), + string(ConsistencyModeTypesFileSystemConsistent), + } +} + +func (s *ConsistencyModeTypes) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseConsistencyModeTypes(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseConsistencyModeTypes(input string) (*ConsistencyModeTypes, error) { + vals := map[string]ConsistencyModeTypes{ + "applicationconsistent": ConsistencyModeTypesApplicationConsistent, + "crashconsistent": ConsistencyModeTypesCrashConsistent, + "filesystemconsistent": ConsistencyModeTypesFileSystemConsistent, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ConsistencyModeTypes(input) + return &out, nil +} + +type DiskControllerTypes string + +const ( + DiskControllerTypesNVMe DiskControllerTypes = "NVMe" + DiskControllerTypesSCSI DiskControllerTypes = "SCSI" +) + +func PossibleValuesForDiskControllerTypes() []string { + return []string{ + string(DiskControllerTypesNVMe), + string(DiskControllerTypesSCSI), + } +} + +func (s *DiskControllerTypes) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDiskControllerTypes(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDiskControllerTypes(input string) (*DiskControllerTypes, error) { + vals := map[string]DiskControllerTypes{ + "nvme": DiskControllerTypesNVMe, + "scsi": DiskControllerTypesSCSI, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DiskControllerTypes(input) + return &out, nil +} + +type HyperVGenerationTypes string + +const ( + HyperVGenerationTypesVOne HyperVGenerationTypes = "V1" + HyperVGenerationTypesVTwo HyperVGenerationTypes = "V2" +) + +func PossibleValuesForHyperVGenerationTypes() []string { + return []string{ + string(HyperVGenerationTypesVOne), + string(HyperVGenerationTypesVTwo), + } +} + +func (s *HyperVGenerationTypes) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseHyperVGenerationTypes(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseHyperVGenerationTypes(input string) (*HyperVGenerationTypes, error) { + vals := map[string]HyperVGenerationTypes{ + "v1": HyperVGenerationTypesVOne, + "v2": HyperVGenerationTypesVTwo, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := HyperVGenerationTypes(input) + return &out, nil +} + +type LinuxPatchAssessmentMode string + +const ( + LinuxPatchAssessmentModeAutomaticByPlatform LinuxPatchAssessmentMode = "AutomaticByPlatform" + LinuxPatchAssessmentModeImageDefault LinuxPatchAssessmentMode = "ImageDefault" +) + +func PossibleValuesForLinuxPatchAssessmentMode() []string { + return []string{ + string(LinuxPatchAssessmentModeAutomaticByPlatform), + string(LinuxPatchAssessmentModeImageDefault), + } +} + +func (s *LinuxPatchAssessmentMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLinuxPatchAssessmentMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLinuxPatchAssessmentMode(input string) (*LinuxPatchAssessmentMode, error) { + vals := map[string]LinuxPatchAssessmentMode{ + "automaticbyplatform": LinuxPatchAssessmentModeAutomaticByPlatform, + "imagedefault": LinuxPatchAssessmentModeImageDefault, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LinuxPatchAssessmentMode(input) + return &out, nil +} + +type LinuxVMGuestPatchAutomaticByPlatformRebootSetting string + +const ( + LinuxVMGuestPatchAutomaticByPlatformRebootSettingAlways LinuxVMGuestPatchAutomaticByPlatformRebootSetting = "Always" + LinuxVMGuestPatchAutomaticByPlatformRebootSettingIfRequired LinuxVMGuestPatchAutomaticByPlatformRebootSetting = "IfRequired" + LinuxVMGuestPatchAutomaticByPlatformRebootSettingNever LinuxVMGuestPatchAutomaticByPlatformRebootSetting = "Never" + LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown LinuxVMGuestPatchAutomaticByPlatformRebootSetting = "Unknown" +) + +func PossibleValuesForLinuxVMGuestPatchAutomaticByPlatformRebootSetting() []string { + return []string{ + string(LinuxVMGuestPatchAutomaticByPlatformRebootSettingAlways), + string(LinuxVMGuestPatchAutomaticByPlatformRebootSettingIfRequired), + string(LinuxVMGuestPatchAutomaticByPlatformRebootSettingNever), + string(LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown), + } +} + +func (s *LinuxVMGuestPatchAutomaticByPlatformRebootSetting) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLinuxVMGuestPatchAutomaticByPlatformRebootSetting(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLinuxVMGuestPatchAutomaticByPlatformRebootSetting(input string) (*LinuxVMGuestPatchAutomaticByPlatformRebootSetting, error) { + vals := map[string]LinuxVMGuestPatchAutomaticByPlatformRebootSetting{ + "always": LinuxVMGuestPatchAutomaticByPlatformRebootSettingAlways, + "ifrequired": LinuxVMGuestPatchAutomaticByPlatformRebootSettingIfRequired, + "never": LinuxVMGuestPatchAutomaticByPlatformRebootSettingNever, + "unknown": LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LinuxVMGuestPatchAutomaticByPlatformRebootSetting(input) + return &out, nil +} + +type LinuxVMGuestPatchMode string + +const ( + LinuxVMGuestPatchModeAutomaticByPlatform LinuxVMGuestPatchMode = "AutomaticByPlatform" + LinuxVMGuestPatchModeImageDefault LinuxVMGuestPatchMode = "ImageDefault" +) + +func PossibleValuesForLinuxVMGuestPatchMode() []string { + return []string{ + string(LinuxVMGuestPatchModeAutomaticByPlatform), + string(LinuxVMGuestPatchModeImageDefault), + } +} + +func (s *LinuxVMGuestPatchMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLinuxVMGuestPatchMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLinuxVMGuestPatchMode(input string) (*LinuxVMGuestPatchMode, error) { + vals := map[string]LinuxVMGuestPatchMode{ + "automaticbyplatform": LinuxVMGuestPatchModeAutomaticByPlatform, + "imagedefault": LinuxVMGuestPatchModeImageDefault, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LinuxVMGuestPatchMode(input) + return &out, nil +} + +type Mode string + +const ( + ModeAudit Mode = "Audit" + ModeEnforce Mode = "Enforce" +) + +func PossibleValuesForMode() []string { + return []string{ + string(ModeAudit), + string(ModeEnforce), + } +} + +func (s *Mode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMode(input string) (*Mode, error) { + vals := map[string]Mode{ + "audit": ModeAudit, + "enforce": ModeEnforce, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := Mode(input) + return &out, nil +} + +type OperatingSystemType string + +const ( + OperatingSystemTypeLinux OperatingSystemType = "Linux" + OperatingSystemTypeWindows OperatingSystemType = "Windows" +) + +func PossibleValuesForOperatingSystemType() []string { + return []string{ + string(OperatingSystemTypeLinux), + string(OperatingSystemTypeWindows), + } +} + +func (s *OperatingSystemType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseOperatingSystemType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseOperatingSystemType(input string) (*OperatingSystemType, error) { + vals := map[string]OperatingSystemType{ + "linux": OperatingSystemTypeLinux, + "windows": OperatingSystemTypeWindows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OperatingSystemType(input) + return &out, nil +} + +type PassNames string + +const ( + PassNamesOobeSystem PassNames = "OobeSystem" +) + +func PossibleValuesForPassNames() []string { + return []string{ + string(PassNamesOobeSystem), + } +} + +func (s *PassNames) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePassNames(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePassNames(input string) (*PassNames, error) { + vals := map[string]PassNames{ + "oobesystem": PassNamesOobeSystem, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PassNames(input) + return &out, nil +} + +type ProtocolTypes string + +const ( + ProtocolTypesHTTP ProtocolTypes = "Http" + ProtocolTypesHTTPS ProtocolTypes = "Https" +) + +func PossibleValuesForProtocolTypes() []string { + return []string{ + string(ProtocolTypesHTTP), + string(ProtocolTypesHTTPS), + } +} + +func (s *ProtocolTypes) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProtocolTypes(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProtocolTypes(input string) (*ProtocolTypes, error) { + vals := map[string]ProtocolTypes{ + "http": ProtocolTypesHTTP, + "https": ProtocolTypesHTTPS, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProtocolTypes(input) + return &out, nil +} + +type RestorePointEncryptionType string + +const ( + RestorePointEncryptionTypeEncryptionAtRestWithCustomerKey RestorePointEncryptionType = "EncryptionAtRestWithCustomerKey" + RestorePointEncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys RestorePointEncryptionType = "EncryptionAtRestWithPlatformAndCustomerKeys" + RestorePointEncryptionTypeEncryptionAtRestWithPlatformKey RestorePointEncryptionType = "EncryptionAtRestWithPlatformKey" +) + +func PossibleValuesForRestorePointEncryptionType() []string { + return []string{ + string(RestorePointEncryptionTypeEncryptionAtRestWithCustomerKey), + string(RestorePointEncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys), + string(RestorePointEncryptionTypeEncryptionAtRestWithPlatformKey), + } +} + +func (s *RestorePointEncryptionType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRestorePointEncryptionType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRestorePointEncryptionType(input string) (*RestorePointEncryptionType, error) { + vals := map[string]RestorePointEncryptionType{ + "encryptionatrestwithcustomerkey": RestorePointEncryptionTypeEncryptionAtRestWithCustomerKey, + "encryptionatrestwithplatformandcustomerkeys": RestorePointEncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys, + "encryptionatrestwithplatformkey": RestorePointEncryptionTypeEncryptionAtRestWithPlatformKey, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RestorePointEncryptionType(input) + return &out, nil +} + +type RestorePointExpandOptions string + +const ( + RestorePointExpandOptionsInstanceView RestorePointExpandOptions = "instanceView" +) + +func PossibleValuesForRestorePointExpandOptions() []string { + return []string{ + string(RestorePointExpandOptionsInstanceView), + } +} + +func (s *RestorePointExpandOptions) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRestorePointExpandOptions(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRestorePointExpandOptions(input string) (*RestorePointExpandOptions, error) { + vals := map[string]RestorePointExpandOptions{ + "instanceview": RestorePointExpandOptionsInstanceView, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RestorePointExpandOptions(input) + return &out, nil +} + +type SecurityEncryptionTypes string + +const ( + SecurityEncryptionTypesDiskWithVMGuestState SecurityEncryptionTypes = "DiskWithVMGuestState" + SecurityEncryptionTypesNonPersistedTPM SecurityEncryptionTypes = "NonPersistedTPM" + SecurityEncryptionTypesVMGuestStateOnly SecurityEncryptionTypes = "VMGuestStateOnly" +) + +func PossibleValuesForSecurityEncryptionTypes() []string { + return []string{ + string(SecurityEncryptionTypesDiskWithVMGuestState), + string(SecurityEncryptionTypesNonPersistedTPM), + string(SecurityEncryptionTypesVMGuestStateOnly), + } +} + +func (s *SecurityEncryptionTypes) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityEncryptionTypes(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityEncryptionTypes(input string) (*SecurityEncryptionTypes, error) { + vals := map[string]SecurityEncryptionTypes{ + "diskwithvmgueststate": SecurityEncryptionTypesDiskWithVMGuestState, + "nonpersistedtpm": SecurityEncryptionTypesNonPersistedTPM, + "vmgueststateonly": SecurityEncryptionTypesVMGuestStateOnly, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityEncryptionTypes(input) + return &out, nil +} + +type SecurityTypes string + +const ( + SecurityTypesConfidentialVM SecurityTypes = "ConfidentialVM" + SecurityTypesTrustedLaunch SecurityTypes = "TrustedLaunch" +) + +func PossibleValuesForSecurityTypes() []string { + return []string{ + string(SecurityTypesConfidentialVM), + string(SecurityTypesTrustedLaunch), + } +} + +func (s *SecurityTypes) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityTypes(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityTypes(input string) (*SecurityTypes, error) { + vals := map[string]SecurityTypes{ + "confidentialvm": SecurityTypesConfidentialVM, + "trustedlaunch": SecurityTypesTrustedLaunch, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityTypes(input) + return &out, nil +} + +type SettingNames string + +const ( + SettingNamesAutoLogon SettingNames = "AutoLogon" + SettingNamesFirstLogonCommands SettingNames = "FirstLogonCommands" +) + +func PossibleValuesForSettingNames() []string { + return []string{ + string(SettingNamesAutoLogon), + string(SettingNamesFirstLogonCommands), + } +} + +func (s *SettingNames) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSettingNames(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSettingNames(input string) (*SettingNames, error) { + vals := map[string]SettingNames{ + "autologon": SettingNamesAutoLogon, + "firstlogoncommands": SettingNamesFirstLogonCommands, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SettingNames(input) + return &out, nil +} + +type StatusLevelTypes string + +const ( + StatusLevelTypesError StatusLevelTypes = "Error" + StatusLevelTypesInfo StatusLevelTypes = "Info" + StatusLevelTypesWarning StatusLevelTypes = "Warning" +) + +func PossibleValuesForStatusLevelTypes() []string { + return []string{ + string(StatusLevelTypesError), + string(StatusLevelTypesInfo), + string(StatusLevelTypesWarning), + } +} + +func (s *StatusLevelTypes) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseStatusLevelTypes(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseStatusLevelTypes(input string) (*StatusLevelTypes, error) { + vals := map[string]StatusLevelTypes{ + "error": StatusLevelTypesError, + "info": StatusLevelTypesInfo, + "warning": StatusLevelTypesWarning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := StatusLevelTypes(input) + return &out, nil +} + +type StorageAccountTypes string + +const ( + StorageAccountTypesPremiumLRS StorageAccountTypes = "Premium_LRS" + StorageAccountTypesPremiumVTwoLRS StorageAccountTypes = "PremiumV2_LRS" + StorageAccountTypesPremiumZRS StorageAccountTypes = "Premium_ZRS" + StorageAccountTypesStandardLRS StorageAccountTypes = "Standard_LRS" + StorageAccountTypesStandardSSDLRS StorageAccountTypes = "StandardSSD_LRS" + StorageAccountTypesStandardSSDZRS StorageAccountTypes = "StandardSSD_ZRS" + StorageAccountTypesUltraSSDLRS StorageAccountTypes = "UltraSSD_LRS" +) + +func PossibleValuesForStorageAccountTypes() []string { + return []string{ + string(StorageAccountTypesPremiumLRS), + string(StorageAccountTypesPremiumVTwoLRS), + string(StorageAccountTypesPremiumZRS), + string(StorageAccountTypesStandardLRS), + string(StorageAccountTypesStandardSSDLRS), + string(StorageAccountTypesStandardSSDZRS), + string(StorageAccountTypesUltraSSDLRS), + } +} + +func (s *StorageAccountTypes) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseStorageAccountTypes(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseStorageAccountTypes(input string) (*StorageAccountTypes, error) { + vals := map[string]StorageAccountTypes{ + "premium_lrs": StorageAccountTypesPremiumLRS, + "premiumv2_lrs": StorageAccountTypesPremiumVTwoLRS, + "premium_zrs": StorageAccountTypesPremiumZRS, + "standard_lrs": StorageAccountTypesStandardLRS, + "standardssd_lrs": StorageAccountTypesStandardSSDLRS, + "standardssd_zrs": StorageAccountTypesStandardSSDZRS, + "ultrassd_lrs": StorageAccountTypesUltraSSDLRS, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := StorageAccountTypes(input) + return &out, nil +} + +type VirtualMachineSizeTypes string + +const ( + VirtualMachineSizeTypesBasicAFour VirtualMachineSizeTypes = "Basic_A4" + VirtualMachineSizeTypesBasicAOne VirtualMachineSizeTypes = "Basic_A1" + VirtualMachineSizeTypesBasicAThree VirtualMachineSizeTypes = "Basic_A3" + VirtualMachineSizeTypesBasicATwo VirtualMachineSizeTypes = "Basic_A2" + VirtualMachineSizeTypesBasicAZero VirtualMachineSizeTypes = "Basic_A0" + VirtualMachineSizeTypesStandardAEight VirtualMachineSizeTypes = "Standard_A8" + VirtualMachineSizeTypesStandardAEightVTwo VirtualMachineSizeTypes = "Standard_A8_v2" + VirtualMachineSizeTypesStandardAEightmVTwo VirtualMachineSizeTypes = "Standard_A8m_v2" + VirtualMachineSizeTypesStandardAFive VirtualMachineSizeTypes = "Standard_A5" + VirtualMachineSizeTypesStandardAFour VirtualMachineSizeTypes = "Standard_A4" + VirtualMachineSizeTypesStandardAFourVTwo VirtualMachineSizeTypes = "Standard_A4_v2" + VirtualMachineSizeTypesStandardAFourmVTwo VirtualMachineSizeTypes = "Standard_A4m_v2" + VirtualMachineSizeTypesStandardANine VirtualMachineSizeTypes = "Standard_A9" + VirtualMachineSizeTypesStandardAOne VirtualMachineSizeTypes = "Standard_A1" + VirtualMachineSizeTypesStandardAOneOne VirtualMachineSizeTypes = "Standard_A11" + VirtualMachineSizeTypesStandardAOneVTwo VirtualMachineSizeTypes = "Standard_A1_v2" + VirtualMachineSizeTypesStandardAOneZero VirtualMachineSizeTypes = "Standard_A10" + VirtualMachineSizeTypesStandardASeven VirtualMachineSizeTypes = "Standard_A7" + VirtualMachineSizeTypesStandardASix VirtualMachineSizeTypes = "Standard_A6" + VirtualMachineSizeTypesStandardAThree VirtualMachineSizeTypes = "Standard_A3" + VirtualMachineSizeTypesStandardATwo VirtualMachineSizeTypes = "Standard_A2" + VirtualMachineSizeTypesStandardATwoVTwo VirtualMachineSizeTypes = "Standard_A2_v2" + VirtualMachineSizeTypesStandardATwomVTwo VirtualMachineSizeTypes = "Standard_A2m_v2" + VirtualMachineSizeTypesStandardAZero VirtualMachineSizeTypes = "Standard_A0" + VirtualMachineSizeTypesStandardBEightms VirtualMachineSizeTypes = "Standard_B8ms" + VirtualMachineSizeTypesStandardBFourms VirtualMachineSizeTypes = "Standard_B4ms" + VirtualMachineSizeTypesStandardBOnems VirtualMachineSizeTypes = "Standard_B1ms" + VirtualMachineSizeTypesStandardBOnes VirtualMachineSizeTypes = "Standard_B1s" + VirtualMachineSizeTypesStandardBTwoms VirtualMachineSizeTypes = "Standard_B2ms" + VirtualMachineSizeTypesStandardBTwos VirtualMachineSizeTypes = "Standard_B2s" + VirtualMachineSizeTypesStandardDEightVThree VirtualMachineSizeTypes = "Standard_D8_v3" + VirtualMachineSizeTypesStandardDEightsVThree VirtualMachineSizeTypes = "Standard_D8s_v3" + VirtualMachineSizeTypesStandardDFiveVTwo VirtualMachineSizeTypes = "Standard_D5_v2" + VirtualMachineSizeTypesStandardDFour VirtualMachineSizeTypes = "Standard_D4" + VirtualMachineSizeTypesStandardDFourVThree VirtualMachineSizeTypes = "Standard_D4_v3" + VirtualMachineSizeTypesStandardDFourVTwo VirtualMachineSizeTypes = "Standard_D4_v2" + VirtualMachineSizeTypesStandardDFoursVThree VirtualMachineSizeTypes = "Standard_D4s_v3" + VirtualMachineSizeTypesStandardDOne VirtualMachineSizeTypes = "Standard_D1" + VirtualMachineSizeTypesStandardDOneFiveVTwo VirtualMachineSizeTypes = "Standard_D15_v2" + VirtualMachineSizeTypesStandardDOneFour VirtualMachineSizeTypes = "Standard_D14" + VirtualMachineSizeTypesStandardDOneFourVTwo VirtualMachineSizeTypes = "Standard_D14_v2" + VirtualMachineSizeTypesStandardDOneOne VirtualMachineSizeTypes = "Standard_D11" + VirtualMachineSizeTypesStandardDOneOneVTwo VirtualMachineSizeTypes = "Standard_D11_v2" + VirtualMachineSizeTypesStandardDOneSixVThree VirtualMachineSizeTypes = "Standard_D16_v3" + VirtualMachineSizeTypesStandardDOneSixsVThree VirtualMachineSizeTypes = "Standard_D16s_v3" + VirtualMachineSizeTypesStandardDOneThree VirtualMachineSizeTypes = "Standard_D13" + VirtualMachineSizeTypesStandardDOneThreeVTwo VirtualMachineSizeTypes = "Standard_D13_v2" + VirtualMachineSizeTypesStandardDOneTwo VirtualMachineSizeTypes = "Standard_D12" + VirtualMachineSizeTypesStandardDOneTwoVTwo VirtualMachineSizeTypes = "Standard_D12_v2" + VirtualMachineSizeTypesStandardDOneVTwo VirtualMachineSizeTypes = "Standard_D1_v2" + VirtualMachineSizeTypesStandardDSFiveVTwo VirtualMachineSizeTypes = "Standard_DS5_v2" + VirtualMachineSizeTypesStandardDSFour VirtualMachineSizeTypes = "Standard_DS4" + VirtualMachineSizeTypesStandardDSFourVTwo VirtualMachineSizeTypes = "Standard_DS4_v2" + VirtualMachineSizeTypesStandardDSOne VirtualMachineSizeTypes = "Standard_DS1" + VirtualMachineSizeTypesStandardDSOneFiveVTwo VirtualMachineSizeTypes = "Standard_DS15_v2" + VirtualMachineSizeTypesStandardDSOneFour VirtualMachineSizeTypes = "Standard_DS14" + VirtualMachineSizeTypesStandardDSOneFourNegativeEightVTwo VirtualMachineSizeTypes = "Standard_DS14-8_v2" + VirtualMachineSizeTypesStandardDSOneFourNegativeFourVTwo VirtualMachineSizeTypes = "Standard_DS14-4_v2" + VirtualMachineSizeTypesStandardDSOneFourVTwo VirtualMachineSizeTypes = "Standard_DS14_v2" + VirtualMachineSizeTypesStandardDSOneOne VirtualMachineSizeTypes = "Standard_DS11" + VirtualMachineSizeTypesStandardDSOneOneVTwo VirtualMachineSizeTypes = "Standard_DS11_v2" + VirtualMachineSizeTypesStandardDSOneThree VirtualMachineSizeTypes = "Standard_DS13" + VirtualMachineSizeTypesStandardDSOneThreeNegativeFourVTwo VirtualMachineSizeTypes = "Standard_DS13-4_v2" + VirtualMachineSizeTypesStandardDSOneThreeNegativeTwoVTwo VirtualMachineSizeTypes = "Standard_DS13-2_v2" + VirtualMachineSizeTypesStandardDSOneThreeVTwo VirtualMachineSizeTypes = "Standard_DS13_v2" + VirtualMachineSizeTypesStandardDSOneTwo VirtualMachineSizeTypes = "Standard_DS12" + VirtualMachineSizeTypesStandardDSOneTwoVTwo VirtualMachineSizeTypes = "Standard_DS12_v2" + VirtualMachineSizeTypesStandardDSOneVTwo VirtualMachineSizeTypes = "Standard_DS1_v2" + VirtualMachineSizeTypesStandardDSThree VirtualMachineSizeTypes = "Standard_DS3" + VirtualMachineSizeTypesStandardDSThreeVTwo VirtualMachineSizeTypes = "Standard_DS3_v2" + VirtualMachineSizeTypesStandardDSTwo VirtualMachineSizeTypes = "Standard_DS2" + VirtualMachineSizeTypesStandardDSTwoVTwo VirtualMachineSizeTypes = "Standard_DS2_v2" + VirtualMachineSizeTypesStandardDSixFourVThree VirtualMachineSizeTypes = "Standard_D64_v3" + VirtualMachineSizeTypesStandardDSixFoursVThree VirtualMachineSizeTypes = "Standard_D64s_v3" + VirtualMachineSizeTypesStandardDThree VirtualMachineSizeTypes = "Standard_D3" + VirtualMachineSizeTypesStandardDThreeTwoVThree VirtualMachineSizeTypes = "Standard_D32_v3" + VirtualMachineSizeTypesStandardDThreeTwosVThree VirtualMachineSizeTypes = "Standard_D32s_v3" + VirtualMachineSizeTypesStandardDThreeVTwo VirtualMachineSizeTypes = "Standard_D3_v2" + VirtualMachineSizeTypesStandardDTwo VirtualMachineSizeTypes = "Standard_D2" + VirtualMachineSizeTypesStandardDTwoVThree VirtualMachineSizeTypes = "Standard_D2_v3" + VirtualMachineSizeTypesStandardDTwoVTwo VirtualMachineSizeTypes = "Standard_D2_v2" + VirtualMachineSizeTypesStandardDTwosVThree VirtualMachineSizeTypes = "Standard_D2s_v3" + VirtualMachineSizeTypesStandardEEightVThree VirtualMachineSizeTypes = "Standard_E8_v3" + VirtualMachineSizeTypesStandardEEightsVThree VirtualMachineSizeTypes = "Standard_E8s_v3" + VirtualMachineSizeTypesStandardEFourVThree VirtualMachineSizeTypes = "Standard_E4_v3" + VirtualMachineSizeTypesStandardEFoursVThree VirtualMachineSizeTypes = "Standard_E4s_v3" + VirtualMachineSizeTypesStandardEOneSixVThree VirtualMachineSizeTypes = "Standard_E16_v3" + VirtualMachineSizeTypesStandardEOneSixsVThree VirtualMachineSizeTypes = "Standard_E16s_v3" + VirtualMachineSizeTypesStandardESixFourNegativeOneSixsVThree VirtualMachineSizeTypes = "Standard_E64-16s_v3" + VirtualMachineSizeTypesStandardESixFourNegativeThreeTwosVThree VirtualMachineSizeTypes = "Standard_E64-32s_v3" + VirtualMachineSizeTypesStandardESixFourVThree VirtualMachineSizeTypes = "Standard_E64_v3" + VirtualMachineSizeTypesStandardESixFoursVThree VirtualMachineSizeTypes = "Standard_E64s_v3" + VirtualMachineSizeTypesStandardEThreeTwoNegativeEightsVThree VirtualMachineSizeTypes = "Standard_E32-8s_v3" + VirtualMachineSizeTypesStandardEThreeTwoNegativeOneSixVThree VirtualMachineSizeTypes = "Standard_E32-16_v3" + VirtualMachineSizeTypesStandardEThreeTwoVThree VirtualMachineSizeTypes = "Standard_E32_v3" + VirtualMachineSizeTypesStandardEThreeTwosVThree VirtualMachineSizeTypes = "Standard_E32s_v3" + VirtualMachineSizeTypesStandardETwoVThree VirtualMachineSizeTypes = "Standard_E2_v3" + VirtualMachineSizeTypesStandardETwosVThree VirtualMachineSizeTypes = "Standard_E2s_v3" + VirtualMachineSizeTypesStandardFEight VirtualMachineSizeTypes = "Standard_F8" + VirtualMachineSizeTypesStandardFEights VirtualMachineSizeTypes = "Standard_F8s" + VirtualMachineSizeTypesStandardFEightsVTwo VirtualMachineSizeTypes = "Standard_F8s_v2" + VirtualMachineSizeTypesStandardFFour VirtualMachineSizeTypes = "Standard_F4" + VirtualMachineSizeTypesStandardFFours VirtualMachineSizeTypes = "Standard_F4s" + VirtualMachineSizeTypesStandardFFoursVTwo VirtualMachineSizeTypes = "Standard_F4s_v2" + VirtualMachineSizeTypesStandardFOne VirtualMachineSizeTypes = "Standard_F1" + VirtualMachineSizeTypesStandardFOneSix VirtualMachineSizeTypes = "Standard_F16" + VirtualMachineSizeTypesStandardFOneSixs VirtualMachineSizeTypes = "Standard_F16s" + VirtualMachineSizeTypesStandardFOneSixsVTwo VirtualMachineSizeTypes = "Standard_F16s_v2" + VirtualMachineSizeTypesStandardFOnes VirtualMachineSizeTypes = "Standard_F1s" + VirtualMachineSizeTypesStandardFSevenTwosVTwo VirtualMachineSizeTypes = "Standard_F72s_v2" + VirtualMachineSizeTypesStandardFSixFoursVTwo VirtualMachineSizeTypes = "Standard_F64s_v2" + VirtualMachineSizeTypesStandardFThreeTwosVTwo VirtualMachineSizeTypes = "Standard_F32s_v2" + VirtualMachineSizeTypesStandardFTwo VirtualMachineSizeTypes = "Standard_F2" + VirtualMachineSizeTypesStandardFTwos VirtualMachineSizeTypes = "Standard_F2s" + VirtualMachineSizeTypesStandardFTwosVTwo VirtualMachineSizeTypes = "Standard_F2s_v2" + VirtualMachineSizeTypesStandardGFive VirtualMachineSizeTypes = "Standard_G5" + VirtualMachineSizeTypesStandardGFour VirtualMachineSizeTypes = "Standard_G4" + VirtualMachineSizeTypesStandardGOne VirtualMachineSizeTypes = "Standard_G1" + VirtualMachineSizeTypesStandardGSFive VirtualMachineSizeTypes = "Standard_GS5" + VirtualMachineSizeTypesStandardGSFiveNegativeEight VirtualMachineSizeTypes = "Standard_GS5-8" + VirtualMachineSizeTypesStandardGSFiveNegativeOneSix VirtualMachineSizeTypes = "Standard_GS5-16" + VirtualMachineSizeTypesStandardGSFour VirtualMachineSizeTypes = "Standard_GS4" + VirtualMachineSizeTypesStandardGSFourNegativeEight VirtualMachineSizeTypes = "Standard_GS4-8" + VirtualMachineSizeTypesStandardGSFourNegativeFour VirtualMachineSizeTypes = "Standard_GS4-4" + VirtualMachineSizeTypesStandardGSOne VirtualMachineSizeTypes = "Standard_GS1" + VirtualMachineSizeTypesStandardGSThree VirtualMachineSizeTypes = "Standard_GS3" + VirtualMachineSizeTypesStandardGSTwo VirtualMachineSizeTypes = "Standard_GS2" + VirtualMachineSizeTypesStandardGThree VirtualMachineSizeTypes = "Standard_G3" + VirtualMachineSizeTypesStandardGTwo VirtualMachineSizeTypes = "Standard_G2" + VirtualMachineSizeTypesStandardHEight VirtualMachineSizeTypes = "Standard_H8" + VirtualMachineSizeTypesStandardHEightm VirtualMachineSizeTypes = "Standard_H8m" + VirtualMachineSizeTypesStandardHOneSix VirtualMachineSizeTypes = "Standard_H16" + VirtualMachineSizeTypesStandardHOneSixm VirtualMachineSizeTypes = "Standard_H16m" + VirtualMachineSizeTypesStandardHOneSixmr VirtualMachineSizeTypes = "Standard_H16mr" + VirtualMachineSizeTypesStandardHOneSixr VirtualMachineSizeTypes = "Standard_H16r" + VirtualMachineSizeTypesStandardLEights VirtualMachineSizeTypes = "Standard_L8s" + VirtualMachineSizeTypesStandardLFours VirtualMachineSizeTypes = "Standard_L4s" + VirtualMachineSizeTypesStandardLOneSixs VirtualMachineSizeTypes = "Standard_L16s" + VirtualMachineSizeTypesStandardLThreeTwos VirtualMachineSizeTypes = "Standard_L32s" + VirtualMachineSizeTypesStandardMOneTwoEightNegativeSixFourms VirtualMachineSizeTypes = "Standard_M128-64ms" + VirtualMachineSizeTypesStandardMOneTwoEightNegativeThreeTwoms VirtualMachineSizeTypes = "Standard_M128-32ms" + VirtualMachineSizeTypesStandardMOneTwoEightms VirtualMachineSizeTypes = "Standard_M128ms" + VirtualMachineSizeTypesStandardMOneTwoEights VirtualMachineSizeTypes = "Standard_M128s" + VirtualMachineSizeTypesStandardMSixFourNegativeOneSixms VirtualMachineSizeTypes = "Standard_M64-16ms" + VirtualMachineSizeTypesStandardMSixFourNegativeThreeTwoms VirtualMachineSizeTypes = "Standard_M64-32ms" + VirtualMachineSizeTypesStandardMSixFourms VirtualMachineSizeTypes = "Standard_M64ms" + VirtualMachineSizeTypesStandardMSixFours VirtualMachineSizeTypes = "Standard_M64s" + VirtualMachineSizeTypesStandardNCOneTwo VirtualMachineSizeTypes = "Standard_NC12" + VirtualMachineSizeTypesStandardNCOneTwosVThree VirtualMachineSizeTypes = "Standard_NC12s_v3" + VirtualMachineSizeTypesStandardNCOneTwosVTwo VirtualMachineSizeTypes = "Standard_NC12s_v2" + VirtualMachineSizeTypesStandardNCSix VirtualMachineSizeTypes = "Standard_NC6" + VirtualMachineSizeTypesStandardNCSixsVThree VirtualMachineSizeTypes = "Standard_NC6s_v3" + VirtualMachineSizeTypesStandardNCSixsVTwo VirtualMachineSizeTypes = "Standard_NC6s_v2" + VirtualMachineSizeTypesStandardNCTwoFour VirtualMachineSizeTypes = "Standard_NC24" + VirtualMachineSizeTypesStandardNCTwoFourr VirtualMachineSizeTypes = "Standard_NC24r" + VirtualMachineSizeTypesStandardNCTwoFourrsVThree VirtualMachineSizeTypes = "Standard_NC24rs_v3" + VirtualMachineSizeTypesStandardNCTwoFourrsVTwo VirtualMachineSizeTypes = "Standard_NC24rs_v2" + VirtualMachineSizeTypesStandardNCTwoFoursVThree VirtualMachineSizeTypes = "Standard_NC24s_v3" + VirtualMachineSizeTypesStandardNCTwoFoursVTwo VirtualMachineSizeTypes = "Standard_NC24s_v2" + VirtualMachineSizeTypesStandardNDOneTwos VirtualMachineSizeTypes = "Standard_ND12s" + VirtualMachineSizeTypesStandardNDSixs VirtualMachineSizeTypes = "Standard_ND6s" + VirtualMachineSizeTypesStandardNDTwoFourrs VirtualMachineSizeTypes = "Standard_ND24rs" + VirtualMachineSizeTypesStandardNDTwoFours VirtualMachineSizeTypes = "Standard_ND24s" + VirtualMachineSizeTypesStandardNVOneTwo VirtualMachineSizeTypes = "Standard_NV12" + VirtualMachineSizeTypesStandardNVSix VirtualMachineSizeTypes = "Standard_NV6" + VirtualMachineSizeTypesStandardNVTwoFour VirtualMachineSizeTypes = "Standard_NV24" +) + +func PossibleValuesForVirtualMachineSizeTypes() []string { + return []string{ + string(VirtualMachineSizeTypesBasicAFour), + string(VirtualMachineSizeTypesBasicAOne), + string(VirtualMachineSizeTypesBasicAThree), + string(VirtualMachineSizeTypesBasicATwo), + string(VirtualMachineSizeTypesBasicAZero), + string(VirtualMachineSizeTypesStandardAEight), + string(VirtualMachineSizeTypesStandardAEightVTwo), + string(VirtualMachineSizeTypesStandardAEightmVTwo), + string(VirtualMachineSizeTypesStandardAFive), + string(VirtualMachineSizeTypesStandardAFour), + string(VirtualMachineSizeTypesStandardAFourVTwo), + string(VirtualMachineSizeTypesStandardAFourmVTwo), + string(VirtualMachineSizeTypesStandardANine), + string(VirtualMachineSizeTypesStandardAOne), + string(VirtualMachineSizeTypesStandardAOneOne), + string(VirtualMachineSizeTypesStandardAOneVTwo), + string(VirtualMachineSizeTypesStandardAOneZero), + string(VirtualMachineSizeTypesStandardASeven), + string(VirtualMachineSizeTypesStandardASix), + string(VirtualMachineSizeTypesStandardAThree), + string(VirtualMachineSizeTypesStandardATwo), + string(VirtualMachineSizeTypesStandardATwoVTwo), + string(VirtualMachineSizeTypesStandardATwomVTwo), + string(VirtualMachineSizeTypesStandardAZero), + string(VirtualMachineSizeTypesStandardBEightms), + string(VirtualMachineSizeTypesStandardBFourms), + string(VirtualMachineSizeTypesStandardBOnems), + string(VirtualMachineSizeTypesStandardBOnes), + string(VirtualMachineSizeTypesStandardBTwoms), + string(VirtualMachineSizeTypesStandardBTwos), + string(VirtualMachineSizeTypesStandardDEightVThree), + string(VirtualMachineSizeTypesStandardDEightsVThree), + string(VirtualMachineSizeTypesStandardDFiveVTwo), + string(VirtualMachineSizeTypesStandardDFour), + string(VirtualMachineSizeTypesStandardDFourVThree), + string(VirtualMachineSizeTypesStandardDFourVTwo), + string(VirtualMachineSizeTypesStandardDFoursVThree), + string(VirtualMachineSizeTypesStandardDOne), + string(VirtualMachineSizeTypesStandardDOneFiveVTwo), + string(VirtualMachineSizeTypesStandardDOneFour), + string(VirtualMachineSizeTypesStandardDOneFourVTwo), + string(VirtualMachineSizeTypesStandardDOneOne), + string(VirtualMachineSizeTypesStandardDOneOneVTwo), + string(VirtualMachineSizeTypesStandardDOneSixVThree), + string(VirtualMachineSizeTypesStandardDOneSixsVThree), + string(VirtualMachineSizeTypesStandardDOneThree), + string(VirtualMachineSizeTypesStandardDOneThreeVTwo), + string(VirtualMachineSizeTypesStandardDOneTwo), + string(VirtualMachineSizeTypesStandardDOneTwoVTwo), + string(VirtualMachineSizeTypesStandardDOneVTwo), + string(VirtualMachineSizeTypesStandardDSFiveVTwo), + string(VirtualMachineSizeTypesStandardDSFour), + string(VirtualMachineSizeTypesStandardDSFourVTwo), + string(VirtualMachineSizeTypesStandardDSOne), + string(VirtualMachineSizeTypesStandardDSOneFiveVTwo), + string(VirtualMachineSizeTypesStandardDSOneFour), + string(VirtualMachineSizeTypesStandardDSOneFourNegativeEightVTwo), + string(VirtualMachineSizeTypesStandardDSOneFourNegativeFourVTwo), + string(VirtualMachineSizeTypesStandardDSOneFourVTwo), + string(VirtualMachineSizeTypesStandardDSOneOne), + string(VirtualMachineSizeTypesStandardDSOneOneVTwo), + string(VirtualMachineSizeTypesStandardDSOneThree), + string(VirtualMachineSizeTypesStandardDSOneThreeNegativeFourVTwo), + string(VirtualMachineSizeTypesStandardDSOneThreeNegativeTwoVTwo), + string(VirtualMachineSizeTypesStandardDSOneThreeVTwo), + string(VirtualMachineSizeTypesStandardDSOneTwo), + string(VirtualMachineSizeTypesStandardDSOneTwoVTwo), + string(VirtualMachineSizeTypesStandardDSOneVTwo), + string(VirtualMachineSizeTypesStandardDSThree), + string(VirtualMachineSizeTypesStandardDSThreeVTwo), + string(VirtualMachineSizeTypesStandardDSTwo), + string(VirtualMachineSizeTypesStandardDSTwoVTwo), + string(VirtualMachineSizeTypesStandardDSixFourVThree), + string(VirtualMachineSizeTypesStandardDSixFoursVThree), + string(VirtualMachineSizeTypesStandardDThree), + string(VirtualMachineSizeTypesStandardDThreeTwoVThree), + string(VirtualMachineSizeTypesStandardDThreeTwosVThree), + string(VirtualMachineSizeTypesStandardDThreeVTwo), + string(VirtualMachineSizeTypesStandardDTwo), + string(VirtualMachineSizeTypesStandardDTwoVThree), + string(VirtualMachineSizeTypesStandardDTwoVTwo), + string(VirtualMachineSizeTypesStandardDTwosVThree), + string(VirtualMachineSizeTypesStandardEEightVThree), + string(VirtualMachineSizeTypesStandardEEightsVThree), + string(VirtualMachineSizeTypesStandardEFourVThree), + string(VirtualMachineSizeTypesStandardEFoursVThree), + string(VirtualMachineSizeTypesStandardEOneSixVThree), + string(VirtualMachineSizeTypesStandardEOneSixsVThree), + string(VirtualMachineSizeTypesStandardESixFourNegativeOneSixsVThree), + string(VirtualMachineSizeTypesStandardESixFourNegativeThreeTwosVThree), + string(VirtualMachineSizeTypesStandardESixFourVThree), + string(VirtualMachineSizeTypesStandardESixFoursVThree), + string(VirtualMachineSizeTypesStandardEThreeTwoNegativeEightsVThree), + string(VirtualMachineSizeTypesStandardEThreeTwoNegativeOneSixVThree), + string(VirtualMachineSizeTypesStandardEThreeTwoVThree), + string(VirtualMachineSizeTypesStandardEThreeTwosVThree), + string(VirtualMachineSizeTypesStandardETwoVThree), + string(VirtualMachineSizeTypesStandardETwosVThree), + string(VirtualMachineSizeTypesStandardFEight), + string(VirtualMachineSizeTypesStandardFEights), + string(VirtualMachineSizeTypesStandardFEightsVTwo), + string(VirtualMachineSizeTypesStandardFFour), + string(VirtualMachineSizeTypesStandardFFours), + string(VirtualMachineSizeTypesStandardFFoursVTwo), + string(VirtualMachineSizeTypesStandardFOne), + string(VirtualMachineSizeTypesStandardFOneSix), + string(VirtualMachineSizeTypesStandardFOneSixs), + string(VirtualMachineSizeTypesStandardFOneSixsVTwo), + string(VirtualMachineSizeTypesStandardFOnes), + string(VirtualMachineSizeTypesStandardFSevenTwosVTwo), + string(VirtualMachineSizeTypesStandardFSixFoursVTwo), + string(VirtualMachineSizeTypesStandardFThreeTwosVTwo), + string(VirtualMachineSizeTypesStandardFTwo), + string(VirtualMachineSizeTypesStandardFTwos), + string(VirtualMachineSizeTypesStandardFTwosVTwo), + string(VirtualMachineSizeTypesStandardGFive), + string(VirtualMachineSizeTypesStandardGFour), + string(VirtualMachineSizeTypesStandardGOne), + string(VirtualMachineSizeTypesStandardGSFive), + string(VirtualMachineSizeTypesStandardGSFiveNegativeEight), + string(VirtualMachineSizeTypesStandardGSFiveNegativeOneSix), + string(VirtualMachineSizeTypesStandardGSFour), + string(VirtualMachineSizeTypesStandardGSFourNegativeEight), + string(VirtualMachineSizeTypesStandardGSFourNegativeFour), + string(VirtualMachineSizeTypesStandardGSOne), + string(VirtualMachineSizeTypesStandardGSThree), + string(VirtualMachineSizeTypesStandardGSTwo), + string(VirtualMachineSizeTypesStandardGThree), + string(VirtualMachineSizeTypesStandardGTwo), + string(VirtualMachineSizeTypesStandardHEight), + string(VirtualMachineSizeTypesStandardHEightm), + string(VirtualMachineSizeTypesStandardHOneSix), + string(VirtualMachineSizeTypesStandardHOneSixm), + string(VirtualMachineSizeTypesStandardHOneSixmr), + string(VirtualMachineSizeTypesStandardHOneSixr), + string(VirtualMachineSizeTypesStandardLEights), + string(VirtualMachineSizeTypesStandardLFours), + string(VirtualMachineSizeTypesStandardLOneSixs), + string(VirtualMachineSizeTypesStandardLThreeTwos), + string(VirtualMachineSizeTypesStandardMOneTwoEightNegativeSixFourms), + string(VirtualMachineSizeTypesStandardMOneTwoEightNegativeThreeTwoms), + string(VirtualMachineSizeTypesStandardMOneTwoEightms), + string(VirtualMachineSizeTypesStandardMOneTwoEights), + string(VirtualMachineSizeTypesStandardMSixFourNegativeOneSixms), + string(VirtualMachineSizeTypesStandardMSixFourNegativeThreeTwoms), + string(VirtualMachineSizeTypesStandardMSixFourms), + string(VirtualMachineSizeTypesStandardMSixFours), + string(VirtualMachineSizeTypesStandardNCOneTwo), + string(VirtualMachineSizeTypesStandardNCOneTwosVThree), + string(VirtualMachineSizeTypesStandardNCOneTwosVTwo), + string(VirtualMachineSizeTypesStandardNCSix), + string(VirtualMachineSizeTypesStandardNCSixsVThree), + string(VirtualMachineSizeTypesStandardNCSixsVTwo), + string(VirtualMachineSizeTypesStandardNCTwoFour), + string(VirtualMachineSizeTypesStandardNCTwoFourr), + string(VirtualMachineSizeTypesStandardNCTwoFourrsVThree), + string(VirtualMachineSizeTypesStandardNCTwoFourrsVTwo), + string(VirtualMachineSizeTypesStandardNCTwoFoursVThree), + string(VirtualMachineSizeTypesStandardNCTwoFoursVTwo), + string(VirtualMachineSizeTypesStandardNDOneTwos), + string(VirtualMachineSizeTypesStandardNDSixs), + string(VirtualMachineSizeTypesStandardNDTwoFourrs), + string(VirtualMachineSizeTypesStandardNDTwoFours), + string(VirtualMachineSizeTypesStandardNVOneTwo), + string(VirtualMachineSizeTypesStandardNVSix), + string(VirtualMachineSizeTypesStandardNVTwoFour), + } +} + +func (s *VirtualMachineSizeTypes) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualMachineSizeTypes(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualMachineSizeTypes(input string) (*VirtualMachineSizeTypes, error) { + vals := map[string]VirtualMachineSizeTypes{ + "basic_a4": VirtualMachineSizeTypesBasicAFour, + "basic_a1": VirtualMachineSizeTypesBasicAOne, + "basic_a3": VirtualMachineSizeTypesBasicAThree, + "basic_a2": VirtualMachineSizeTypesBasicATwo, + "basic_a0": VirtualMachineSizeTypesBasicAZero, + "standard_a8": VirtualMachineSizeTypesStandardAEight, + "standard_a8_v2": VirtualMachineSizeTypesStandardAEightVTwo, + "standard_a8m_v2": VirtualMachineSizeTypesStandardAEightmVTwo, + "standard_a5": VirtualMachineSizeTypesStandardAFive, + "standard_a4": VirtualMachineSizeTypesStandardAFour, + "standard_a4_v2": VirtualMachineSizeTypesStandardAFourVTwo, + "standard_a4m_v2": VirtualMachineSizeTypesStandardAFourmVTwo, + "standard_a9": VirtualMachineSizeTypesStandardANine, + "standard_a1": VirtualMachineSizeTypesStandardAOne, + "standard_a11": VirtualMachineSizeTypesStandardAOneOne, + "standard_a1_v2": VirtualMachineSizeTypesStandardAOneVTwo, + "standard_a10": VirtualMachineSizeTypesStandardAOneZero, + "standard_a7": VirtualMachineSizeTypesStandardASeven, + "standard_a6": VirtualMachineSizeTypesStandardASix, + "standard_a3": VirtualMachineSizeTypesStandardAThree, + "standard_a2": VirtualMachineSizeTypesStandardATwo, + "standard_a2_v2": VirtualMachineSizeTypesStandardATwoVTwo, + "standard_a2m_v2": VirtualMachineSizeTypesStandardATwomVTwo, + "standard_a0": VirtualMachineSizeTypesStandardAZero, + "standard_b8ms": VirtualMachineSizeTypesStandardBEightms, + "standard_b4ms": VirtualMachineSizeTypesStandardBFourms, + "standard_b1ms": VirtualMachineSizeTypesStandardBOnems, + "standard_b1s": VirtualMachineSizeTypesStandardBOnes, + "standard_b2ms": VirtualMachineSizeTypesStandardBTwoms, + "standard_b2s": VirtualMachineSizeTypesStandardBTwos, + "standard_d8_v3": VirtualMachineSizeTypesStandardDEightVThree, + "standard_d8s_v3": VirtualMachineSizeTypesStandardDEightsVThree, + "standard_d5_v2": VirtualMachineSizeTypesStandardDFiveVTwo, + "standard_d4": VirtualMachineSizeTypesStandardDFour, + "standard_d4_v3": VirtualMachineSizeTypesStandardDFourVThree, + "standard_d4_v2": VirtualMachineSizeTypesStandardDFourVTwo, + "standard_d4s_v3": VirtualMachineSizeTypesStandardDFoursVThree, + "standard_d1": VirtualMachineSizeTypesStandardDOne, + "standard_d15_v2": VirtualMachineSizeTypesStandardDOneFiveVTwo, + "standard_d14": VirtualMachineSizeTypesStandardDOneFour, + "standard_d14_v2": VirtualMachineSizeTypesStandardDOneFourVTwo, + "standard_d11": VirtualMachineSizeTypesStandardDOneOne, + "standard_d11_v2": VirtualMachineSizeTypesStandardDOneOneVTwo, + "standard_d16_v3": VirtualMachineSizeTypesStandardDOneSixVThree, + "standard_d16s_v3": VirtualMachineSizeTypesStandardDOneSixsVThree, + "standard_d13": VirtualMachineSizeTypesStandardDOneThree, + "standard_d13_v2": VirtualMachineSizeTypesStandardDOneThreeVTwo, + "standard_d12": VirtualMachineSizeTypesStandardDOneTwo, + "standard_d12_v2": VirtualMachineSizeTypesStandardDOneTwoVTwo, + "standard_d1_v2": VirtualMachineSizeTypesStandardDOneVTwo, + "standard_ds5_v2": VirtualMachineSizeTypesStandardDSFiveVTwo, + "standard_ds4": VirtualMachineSizeTypesStandardDSFour, + "standard_ds4_v2": VirtualMachineSizeTypesStandardDSFourVTwo, + "standard_ds1": VirtualMachineSizeTypesStandardDSOne, + "standard_ds15_v2": VirtualMachineSizeTypesStandardDSOneFiveVTwo, + "standard_ds14": VirtualMachineSizeTypesStandardDSOneFour, + "standard_ds14-8_v2": VirtualMachineSizeTypesStandardDSOneFourNegativeEightVTwo, + "standard_ds14-4_v2": VirtualMachineSizeTypesStandardDSOneFourNegativeFourVTwo, + "standard_ds14_v2": VirtualMachineSizeTypesStandardDSOneFourVTwo, + "standard_ds11": VirtualMachineSizeTypesStandardDSOneOne, + "standard_ds11_v2": VirtualMachineSizeTypesStandardDSOneOneVTwo, + "standard_ds13": VirtualMachineSizeTypesStandardDSOneThree, + "standard_ds13-4_v2": VirtualMachineSizeTypesStandardDSOneThreeNegativeFourVTwo, + "standard_ds13-2_v2": VirtualMachineSizeTypesStandardDSOneThreeNegativeTwoVTwo, + "standard_ds13_v2": VirtualMachineSizeTypesStandardDSOneThreeVTwo, + "standard_ds12": VirtualMachineSizeTypesStandardDSOneTwo, + "standard_ds12_v2": VirtualMachineSizeTypesStandardDSOneTwoVTwo, + "standard_ds1_v2": VirtualMachineSizeTypesStandardDSOneVTwo, + "standard_ds3": VirtualMachineSizeTypesStandardDSThree, + "standard_ds3_v2": VirtualMachineSizeTypesStandardDSThreeVTwo, + "standard_ds2": VirtualMachineSizeTypesStandardDSTwo, + "standard_ds2_v2": VirtualMachineSizeTypesStandardDSTwoVTwo, + "standard_d64_v3": VirtualMachineSizeTypesStandardDSixFourVThree, + "standard_d64s_v3": VirtualMachineSizeTypesStandardDSixFoursVThree, + "standard_d3": VirtualMachineSizeTypesStandardDThree, + "standard_d32_v3": VirtualMachineSizeTypesStandardDThreeTwoVThree, + "standard_d32s_v3": VirtualMachineSizeTypesStandardDThreeTwosVThree, + "standard_d3_v2": VirtualMachineSizeTypesStandardDThreeVTwo, + "standard_d2": VirtualMachineSizeTypesStandardDTwo, + "standard_d2_v3": VirtualMachineSizeTypesStandardDTwoVThree, + "standard_d2_v2": VirtualMachineSizeTypesStandardDTwoVTwo, + "standard_d2s_v3": VirtualMachineSizeTypesStandardDTwosVThree, + "standard_e8_v3": VirtualMachineSizeTypesStandardEEightVThree, + "standard_e8s_v3": VirtualMachineSizeTypesStandardEEightsVThree, + "standard_e4_v3": VirtualMachineSizeTypesStandardEFourVThree, + "standard_e4s_v3": VirtualMachineSizeTypesStandardEFoursVThree, + "standard_e16_v3": VirtualMachineSizeTypesStandardEOneSixVThree, + "standard_e16s_v3": VirtualMachineSizeTypesStandardEOneSixsVThree, + "standard_e64-16s_v3": VirtualMachineSizeTypesStandardESixFourNegativeOneSixsVThree, + "standard_e64-32s_v3": VirtualMachineSizeTypesStandardESixFourNegativeThreeTwosVThree, + "standard_e64_v3": VirtualMachineSizeTypesStandardESixFourVThree, + "standard_e64s_v3": VirtualMachineSizeTypesStandardESixFoursVThree, + "standard_e32-8s_v3": VirtualMachineSizeTypesStandardEThreeTwoNegativeEightsVThree, + "standard_e32-16_v3": VirtualMachineSizeTypesStandardEThreeTwoNegativeOneSixVThree, + "standard_e32_v3": VirtualMachineSizeTypesStandardEThreeTwoVThree, + "standard_e32s_v3": VirtualMachineSizeTypesStandardEThreeTwosVThree, + "standard_e2_v3": VirtualMachineSizeTypesStandardETwoVThree, + "standard_e2s_v3": VirtualMachineSizeTypesStandardETwosVThree, + "standard_f8": VirtualMachineSizeTypesStandardFEight, + "standard_f8s": VirtualMachineSizeTypesStandardFEights, + "standard_f8s_v2": VirtualMachineSizeTypesStandardFEightsVTwo, + "standard_f4": VirtualMachineSizeTypesStandardFFour, + "standard_f4s": VirtualMachineSizeTypesStandardFFours, + "standard_f4s_v2": VirtualMachineSizeTypesStandardFFoursVTwo, + "standard_f1": VirtualMachineSizeTypesStandardFOne, + "standard_f16": VirtualMachineSizeTypesStandardFOneSix, + "standard_f16s": VirtualMachineSizeTypesStandardFOneSixs, + "standard_f16s_v2": VirtualMachineSizeTypesStandardFOneSixsVTwo, + "standard_f1s": VirtualMachineSizeTypesStandardFOnes, + "standard_f72s_v2": VirtualMachineSizeTypesStandardFSevenTwosVTwo, + "standard_f64s_v2": VirtualMachineSizeTypesStandardFSixFoursVTwo, + "standard_f32s_v2": VirtualMachineSizeTypesStandardFThreeTwosVTwo, + "standard_f2": VirtualMachineSizeTypesStandardFTwo, + "standard_f2s": VirtualMachineSizeTypesStandardFTwos, + "standard_f2s_v2": VirtualMachineSizeTypesStandardFTwosVTwo, + "standard_g5": VirtualMachineSizeTypesStandardGFive, + "standard_g4": VirtualMachineSizeTypesStandardGFour, + "standard_g1": VirtualMachineSizeTypesStandardGOne, + "standard_gs5": VirtualMachineSizeTypesStandardGSFive, + "standard_gs5-8": VirtualMachineSizeTypesStandardGSFiveNegativeEight, + "standard_gs5-16": VirtualMachineSizeTypesStandardGSFiveNegativeOneSix, + "standard_gs4": VirtualMachineSizeTypesStandardGSFour, + "standard_gs4-8": VirtualMachineSizeTypesStandardGSFourNegativeEight, + "standard_gs4-4": VirtualMachineSizeTypesStandardGSFourNegativeFour, + "standard_gs1": VirtualMachineSizeTypesStandardGSOne, + "standard_gs3": VirtualMachineSizeTypesStandardGSThree, + "standard_gs2": VirtualMachineSizeTypesStandardGSTwo, + "standard_g3": VirtualMachineSizeTypesStandardGThree, + "standard_g2": VirtualMachineSizeTypesStandardGTwo, + "standard_h8": VirtualMachineSizeTypesStandardHEight, + "standard_h8m": VirtualMachineSizeTypesStandardHEightm, + "standard_h16": VirtualMachineSizeTypesStandardHOneSix, + "standard_h16m": VirtualMachineSizeTypesStandardHOneSixm, + "standard_h16mr": VirtualMachineSizeTypesStandardHOneSixmr, + "standard_h16r": VirtualMachineSizeTypesStandardHOneSixr, + "standard_l8s": VirtualMachineSizeTypesStandardLEights, + "standard_l4s": VirtualMachineSizeTypesStandardLFours, + "standard_l16s": VirtualMachineSizeTypesStandardLOneSixs, + "standard_l32s": VirtualMachineSizeTypesStandardLThreeTwos, + "standard_m128-64ms": VirtualMachineSizeTypesStandardMOneTwoEightNegativeSixFourms, + "standard_m128-32ms": VirtualMachineSizeTypesStandardMOneTwoEightNegativeThreeTwoms, + "standard_m128ms": VirtualMachineSizeTypesStandardMOneTwoEightms, + "standard_m128s": VirtualMachineSizeTypesStandardMOneTwoEights, + "standard_m64-16ms": VirtualMachineSizeTypesStandardMSixFourNegativeOneSixms, + "standard_m64-32ms": VirtualMachineSizeTypesStandardMSixFourNegativeThreeTwoms, + "standard_m64ms": VirtualMachineSizeTypesStandardMSixFourms, + "standard_m64s": VirtualMachineSizeTypesStandardMSixFours, + "standard_nc12": VirtualMachineSizeTypesStandardNCOneTwo, + "standard_nc12s_v3": VirtualMachineSizeTypesStandardNCOneTwosVThree, + "standard_nc12s_v2": VirtualMachineSizeTypesStandardNCOneTwosVTwo, + "standard_nc6": VirtualMachineSizeTypesStandardNCSix, + "standard_nc6s_v3": VirtualMachineSizeTypesStandardNCSixsVThree, + "standard_nc6s_v2": VirtualMachineSizeTypesStandardNCSixsVTwo, + "standard_nc24": VirtualMachineSizeTypesStandardNCTwoFour, + "standard_nc24r": VirtualMachineSizeTypesStandardNCTwoFourr, + "standard_nc24rs_v3": VirtualMachineSizeTypesStandardNCTwoFourrsVThree, + "standard_nc24rs_v2": VirtualMachineSizeTypesStandardNCTwoFourrsVTwo, + "standard_nc24s_v3": VirtualMachineSizeTypesStandardNCTwoFoursVThree, + "standard_nc24s_v2": VirtualMachineSizeTypesStandardNCTwoFoursVTwo, + "standard_nd12s": VirtualMachineSizeTypesStandardNDOneTwos, + "standard_nd6s": VirtualMachineSizeTypesStandardNDSixs, + "standard_nd24rs": VirtualMachineSizeTypesStandardNDTwoFourrs, + "standard_nd24s": VirtualMachineSizeTypesStandardNDTwoFours, + "standard_nv12": VirtualMachineSizeTypesStandardNVOneTwo, + "standard_nv6": VirtualMachineSizeTypesStandardNVSix, + "standard_nv24": VirtualMachineSizeTypesStandardNVTwoFour, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualMachineSizeTypes(input) + return &out, nil +} + +type WindowsPatchAssessmentMode string + +const ( + WindowsPatchAssessmentModeAutomaticByPlatform WindowsPatchAssessmentMode = "AutomaticByPlatform" + WindowsPatchAssessmentModeImageDefault WindowsPatchAssessmentMode = "ImageDefault" +) + +func PossibleValuesForWindowsPatchAssessmentMode() []string { + return []string{ + string(WindowsPatchAssessmentModeAutomaticByPlatform), + string(WindowsPatchAssessmentModeImageDefault), + } +} + +func (s *WindowsPatchAssessmentMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseWindowsPatchAssessmentMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseWindowsPatchAssessmentMode(input string) (*WindowsPatchAssessmentMode, error) { + vals := map[string]WindowsPatchAssessmentMode{ + "automaticbyplatform": WindowsPatchAssessmentModeAutomaticByPlatform, + "imagedefault": WindowsPatchAssessmentModeImageDefault, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := WindowsPatchAssessmentMode(input) + return &out, nil +} + +type WindowsVMGuestPatchAutomaticByPlatformRebootSetting string + +const ( + WindowsVMGuestPatchAutomaticByPlatformRebootSettingAlways WindowsVMGuestPatchAutomaticByPlatformRebootSetting = "Always" + WindowsVMGuestPatchAutomaticByPlatformRebootSettingIfRequired WindowsVMGuestPatchAutomaticByPlatformRebootSetting = "IfRequired" + WindowsVMGuestPatchAutomaticByPlatformRebootSettingNever WindowsVMGuestPatchAutomaticByPlatformRebootSetting = "Never" + WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown WindowsVMGuestPatchAutomaticByPlatformRebootSetting = "Unknown" +) + +func PossibleValuesForWindowsVMGuestPatchAutomaticByPlatformRebootSetting() []string { + return []string{ + string(WindowsVMGuestPatchAutomaticByPlatformRebootSettingAlways), + string(WindowsVMGuestPatchAutomaticByPlatformRebootSettingIfRequired), + string(WindowsVMGuestPatchAutomaticByPlatformRebootSettingNever), + string(WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown), + } +} + +func (s *WindowsVMGuestPatchAutomaticByPlatformRebootSetting) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseWindowsVMGuestPatchAutomaticByPlatformRebootSetting(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseWindowsVMGuestPatchAutomaticByPlatformRebootSetting(input string) (*WindowsVMGuestPatchAutomaticByPlatformRebootSetting, error) { + vals := map[string]WindowsVMGuestPatchAutomaticByPlatformRebootSetting{ + "always": WindowsVMGuestPatchAutomaticByPlatformRebootSettingAlways, + "ifrequired": WindowsVMGuestPatchAutomaticByPlatformRebootSettingIfRequired, + "never": WindowsVMGuestPatchAutomaticByPlatformRebootSettingNever, + "unknown": WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := WindowsVMGuestPatchAutomaticByPlatformRebootSetting(input) + return &out, nil +} + +type WindowsVMGuestPatchMode string + +const ( + WindowsVMGuestPatchModeAutomaticByOS WindowsVMGuestPatchMode = "AutomaticByOS" + WindowsVMGuestPatchModeAutomaticByPlatform WindowsVMGuestPatchMode = "AutomaticByPlatform" + WindowsVMGuestPatchModeManual WindowsVMGuestPatchMode = "Manual" +) + +func PossibleValuesForWindowsVMGuestPatchMode() []string { + return []string{ + string(WindowsVMGuestPatchModeAutomaticByOS), + string(WindowsVMGuestPatchModeAutomaticByPlatform), + string(WindowsVMGuestPatchModeManual), + } +} + +func (s *WindowsVMGuestPatchMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseWindowsVMGuestPatchMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseWindowsVMGuestPatchMode(input string) (*WindowsVMGuestPatchMode, error) { + vals := map[string]WindowsVMGuestPatchMode{ + "automaticbyos": WindowsVMGuestPatchModeAutomaticByOS, + "automaticbyplatform": WindowsVMGuestPatchModeAutomaticByPlatform, + "manual": WindowsVMGuestPatchModeManual, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := WindowsVMGuestPatchMode(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/id_restorepoint.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/id_restorepoint.go new file mode 100644 index 000000000000..5ffe0e1d42b2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/id_restorepoint.go @@ -0,0 +1,139 @@ +package restorepoints + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +func init() { + recaser.RegisterResourceId(&RestorePointId{}) +} + +var _ resourceids.ResourceId = &RestorePointId{} + +// RestorePointId is a struct representing the Resource ID for a Restore Point +type RestorePointId struct { + SubscriptionId string + ResourceGroupName string + RestorePointCollectionName string + RestorePointName string +} + +// NewRestorePointID returns a new RestorePointId struct +func NewRestorePointID(subscriptionId string, resourceGroupName string, restorePointCollectionName string, restorePointName string) RestorePointId { + return RestorePointId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + RestorePointCollectionName: restorePointCollectionName, + RestorePointName: restorePointName, + } +} + +// ParseRestorePointID parses 'input' into a RestorePointId +func ParseRestorePointID(input string) (*RestorePointId, error) { + parser := resourceids.NewParserFromResourceIdType(&RestorePointId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := RestorePointId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseRestorePointIDInsensitively parses 'input' case-insensitively into a RestorePointId +// note: this method should only be used for API response data and not user input +func ParseRestorePointIDInsensitively(input string) (*RestorePointId, error) { + parser := resourceids.NewParserFromResourceIdType(&RestorePointId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := RestorePointId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *RestorePointId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) + } + + if id.RestorePointCollectionName, ok = input.Parsed["restorePointCollectionName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "restorePointCollectionName", input) + } + + if id.RestorePointName, ok = input.Parsed["restorePointName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "restorePointName", input) + } + + return nil +} + +// ValidateRestorePointID checks that 'input' can be parsed as a Restore Point ID +func ValidateRestorePointID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseRestorePointID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Restore Point ID +func (id RestorePointId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/restorePointCollections/%s/restorePoints/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RestorePointCollectionName, id.RestorePointName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Restore Point ID +func (id RestorePointId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), + resourceids.StaticSegment("staticRestorePointCollections", "restorePointCollections", "restorePointCollections"), + resourceids.UserSpecifiedSegment("restorePointCollectionName", "restorePointCollectionValue"), + resourceids.StaticSegment("staticRestorePoints", "restorePoints", "restorePoints"), + resourceids.UserSpecifiedSegment("restorePointName", "restorePointValue"), + } +} + +// String returns a human-readable description of this Restore Point ID +func (id RestorePointId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Restore Point Collection Name: %q", id.RestorePointCollectionName), + fmt.Sprintf("Restore Point Name: %q", id.RestorePointName), + } + return fmt.Sprintf("Restore Point (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/method_create.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/method_create.go new file mode 100644 index 000000000000..25a29454e02b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/method_create.go @@ -0,0 +1,74 @@ +package restorepoints + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *RestorePoint +} + +// Create ... +func (c RestorePointsClient) Create(ctx context.Context, id RestorePointId, input RestorePoint) (result CreateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateThenPoll performs Create then polls until it's completed +func (c RestorePointsClient) CreateThenPoll(ctx context.Context, id RestorePointId, input RestorePoint) error { + result, err := c.Create(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Create: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Create: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/method_delete.go new file mode 100644 index 000000000000..6830e37f87dd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/method_delete.go @@ -0,0 +1,71 @@ +package restorepoints + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Delete ... +func (c RestorePointsClient) Delete(ctx context.Context, id RestorePointId) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + http.StatusOK, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// DeleteThenPoll performs Delete then polls until it's completed +func (c RestorePointsClient) DeleteThenPoll(ctx context.Context, id RestorePointId) error { + result, err := c.Delete(ctx, id) + if err != nil { + return fmt.Errorf("performing Delete: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Delete: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/method_get.go new file mode 100644 index 000000000000..1fb0a01b3f89 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/method_get.go @@ -0,0 +1,83 @@ +package restorepoints + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *RestorePoint +} + +type GetOperationOptions struct { + Expand *RestorePointExpandOptions +} + +func DefaultGetOperationOptions() GetOperationOptions { + return GetOperationOptions{} +} + +func (o GetOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + + return &out +} + +func (o GetOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o GetOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + if o.Expand != nil { + out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) + } + return &out +} + +// Get ... +func (c RestorePointsClient) Get(ctx context.Context, id RestorePointId, options GetOperationOptions) (result GetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + OptionsObject: options, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model RestorePoint + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_additionalunattendcontent.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_additionalunattendcontent.go new file mode 100644 index 000000000000..efe1fa7be9d9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_additionalunattendcontent.go @@ -0,0 +1,11 @@ +package restorepoints + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AdditionalUnattendContent struct { + ComponentName *ComponentNames `json:"componentName,omitempty"` + Content *string `json:"content,omitempty"` + PassName *PassNames `json:"passName,omitempty"` + SettingName *SettingNames `json:"settingName,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_apientityreference.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_apientityreference.go new file mode 100644 index 000000000000..babd48c96f38 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_apientityreference.go @@ -0,0 +1,8 @@ +package restorepoints + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ApiEntityReference struct { + Id *string `json:"id,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_bootdiagnostics.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_bootdiagnostics.go new file mode 100644 index 000000000000..2504b8f2cd9e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_bootdiagnostics.go @@ -0,0 +1,9 @@ +package restorepoints + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BootDiagnostics struct { + Enabled *bool `json:"enabled,omitempty"` + StorageUri *string `json:"storageUri,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_diagnosticsprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_diagnosticsprofile.go new file mode 100644 index 000000000000..7da951f723e7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_diagnosticsprofile.go @@ -0,0 +1,8 @@ +package restorepoints + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DiagnosticsProfile struct { + BootDiagnostics *BootDiagnostics `json:"bootDiagnostics,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_diskencryptionsettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_diskencryptionsettings.go new file mode 100644 index 000000000000..5fbbed536778 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_diskencryptionsettings.go @@ -0,0 +1,10 @@ +package restorepoints + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DiskEncryptionSettings struct { + DiskEncryptionKey *KeyVaultSecretReference `json:"diskEncryptionKey,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + KeyEncryptionKey *KeyVaultKeyReference `json:"keyEncryptionKey,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_diskrestorepointattributes.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_diskrestorepointattributes.go new file mode 100644 index 000000000000..22984929525b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_diskrestorepointattributes.go @@ -0,0 +1,10 @@ +package restorepoints + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DiskRestorePointAttributes struct { + Encryption *RestorePointEncryption `json:"encryption,omitempty"` + Id *string `json:"id,omitempty"` + SourceDiskRestorePoint *ApiEntityReference `json:"sourceDiskRestorePoint,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_diskrestorepointinstanceview.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_diskrestorepointinstanceview.go new file mode 100644 index 000000000000..a37f8c7ad708 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_diskrestorepointinstanceview.go @@ -0,0 +1,9 @@ +package restorepoints + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DiskRestorePointInstanceView struct { + Id *string `json:"id,omitempty"` + ReplicationStatus *DiskRestorePointReplicationStatus `json:"replicationStatus,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_diskrestorepointreplicationstatus.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_diskrestorepointreplicationstatus.go new file mode 100644 index 000000000000..40951229dac5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_diskrestorepointreplicationstatus.go @@ -0,0 +1,9 @@ +package restorepoints + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DiskRestorePointReplicationStatus struct { + CompletionPercent *int64 `json:"completionPercent,omitempty"` + Status *InstanceViewStatus `json:"status,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_encryptionidentity.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_encryptionidentity.go new file mode 100644 index 000000000000..3d64c837abc8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_encryptionidentity.go @@ -0,0 +1,8 @@ +package restorepoints + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type EncryptionIdentity struct { + UserAssignedIdentityResourceId *string `json:"userAssignedIdentityResourceId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_hardwareprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_hardwareprofile.go new file mode 100644 index 000000000000..6284b4bfbea5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_hardwareprofile.go @@ -0,0 +1,9 @@ +package restorepoints + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HardwareProfile struct { + VMSize *VirtualMachineSizeTypes `json:"vmSize,omitempty"` + VMSizeProperties *VMSizeProperties `json:"vmSizeProperties,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_instanceviewstatus.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_instanceviewstatus.go new file mode 100644 index 000000000000..bb4210653e0d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_instanceviewstatus.go @@ -0,0 +1,30 @@ +package restorepoints + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type InstanceViewStatus struct { + Code *string `json:"code,omitempty"` + DisplayStatus *string `json:"displayStatus,omitempty"` + Level *StatusLevelTypes `json:"level,omitempty"` + Message *string `json:"message,omitempty"` + Time *string `json:"time,omitempty"` +} + +func (o *InstanceViewStatus) GetTimeAsTime() (*time.Time, error) { + if o.Time == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Time, "2006-01-02T15:04:05Z07:00") +} + +func (o *InstanceViewStatus) SetTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Time = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_keyvaultkeyreference.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_keyvaultkeyreference.go new file mode 100644 index 000000000000..f91f103e1719 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_keyvaultkeyreference.go @@ -0,0 +1,9 @@ +package restorepoints + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type KeyVaultKeyReference struct { + KeyUrl string `json:"keyUrl"` + SourceVault SubResource `json:"sourceVault"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_keyvaultsecretreference.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_keyvaultsecretreference.go new file mode 100644 index 000000000000..4482fc4dbcb6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_keyvaultsecretreference.go @@ -0,0 +1,9 @@ +package restorepoints + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type KeyVaultSecretReference struct { + SecretUrl string `json:"secretUrl"` + SourceVault SubResource `json:"sourceVault"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_linuxconfiguration.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_linuxconfiguration.go new file mode 100644 index 000000000000..c61f1ead4b83 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_linuxconfiguration.go @@ -0,0 +1,12 @@ +package restorepoints + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type LinuxConfiguration struct { + DisablePasswordAuthentication *bool `json:"disablePasswordAuthentication,omitempty"` + EnableVMAgentPlatformUpdates *bool `json:"enableVMAgentPlatformUpdates,omitempty"` + PatchSettings *LinuxPatchSettings `json:"patchSettings,omitempty"` + ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` + Ssh *SshConfiguration `json:"ssh,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_linuxpatchsettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_linuxpatchsettings.go new file mode 100644 index 000000000000..4363078db3ac --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_linuxpatchsettings.go @@ -0,0 +1,10 @@ +package restorepoints + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type LinuxPatchSettings struct { + AssessmentMode *LinuxPatchAssessmentMode `json:"assessmentMode,omitempty"` + AutomaticByPlatformSettings *LinuxVMGuestPatchAutomaticByPlatformSettings `json:"automaticByPlatformSettings,omitempty"` + PatchMode *LinuxVMGuestPatchMode `json:"patchMode,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_linuxvmguestpatchautomaticbyplatformsettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_linuxvmguestpatchautomaticbyplatformsettings.go new file mode 100644 index 000000000000..3ed5d0d1c14c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_linuxvmguestpatchautomaticbyplatformsettings.go @@ -0,0 +1,9 @@ +package restorepoints + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type LinuxVMGuestPatchAutomaticByPlatformSettings struct { + BypassPlatformSafetyChecksOnUserSchedule *bool `json:"bypassPlatformSafetyChecksOnUserSchedule,omitempty"` + RebootSetting *LinuxVMGuestPatchAutomaticByPlatformRebootSetting `json:"rebootSetting,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_manageddiskparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_manageddiskparameters.go new file mode 100644 index 000000000000..c60383cf6649 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_manageddiskparameters.go @@ -0,0 +1,11 @@ +package restorepoints + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedDiskParameters struct { + DiskEncryptionSet *SubResource `json:"diskEncryptionSet,omitempty"` + Id *string `json:"id,omitempty"` + SecurityProfile *VMDiskSecurityProfile `json:"securityProfile,omitempty"` + StorageAccountType *StorageAccountTypes `json:"storageAccountType,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_osprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_osprofile.go new file mode 100644 index 000000000000..0bb7cb7670b9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_osprofile.go @@ -0,0 +1,16 @@ +package restorepoints + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type OSProfile struct { + AdminPassword *string `json:"adminPassword,omitempty"` + AdminUsername *string `json:"adminUsername,omitempty"` + AllowExtensionOperations *bool `json:"allowExtensionOperations,omitempty"` + ComputerName *string `json:"computerName,omitempty"` + CustomData *string `json:"customData,omitempty"` + LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` + RequireGuestProvisionSignal *bool `json:"requireGuestProvisionSignal,omitempty"` + Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` + WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_patchsettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_patchsettings.go new file mode 100644 index 000000000000..3e237d16e78c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_patchsettings.go @@ -0,0 +1,11 @@ +package restorepoints + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PatchSettings struct { + AssessmentMode *WindowsPatchAssessmentMode `json:"assessmentMode,omitempty"` + AutomaticByPlatformSettings *WindowsVMGuestPatchAutomaticByPlatformSettings `json:"automaticByPlatformSettings,omitempty"` + EnableHotpatching *bool `json:"enableHotpatching,omitempty"` + PatchMode *WindowsVMGuestPatchMode `json:"patchMode,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_proxyagentsettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_proxyagentsettings.go new file mode 100644 index 000000000000..e1beb2f4fa71 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_proxyagentsettings.go @@ -0,0 +1,10 @@ +package restorepoints + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ProxyAgentSettings struct { + Enabled *bool `json:"enabled,omitempty"` + KeyIncarnationId *int64 `json:"keyIncarnationId,omitempty"` + Mode *Mode `json:"mode,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_restorepoint.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_restorepoint.go new file mode 100644 index 000000000000..e63d204278a8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_restorepoint.go @@ -0,0 +1,11 @@ +package restorepoints + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RestorePoint struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *RestorePointProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_restorepointencryption.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_restorepointencryption.go new file mode 100644 index 000000000000..7c39e4aeb509 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_restorepointencryption.go @@ -0,0 +1,9 @@ +package restorepoints + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RestorePointEncryption struct { + DiskEncryptionSet *SubResource `json:"diskEncryptionSet,omitempty"` + Type *RestorePointEncryptionType `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_restorepointinstanceview.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_restorepointinstanceview.go new file mode 100644 index 000000000000..d91bef8b2c77 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_restorepointinstanceview.go @@ -0,0 +1,9 @@ +package restorepoints + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RestorePointInstanceView struct { + DiskRestorePoints *[]DiskRestorePointInstanceView `json:"diskRestorePoints,omitempty"` + Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_restorepointproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_restorepointproperties.go new file mode 100644 index 000000000000..f6dd4208a648 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_restorepointproperties.go @@ -0,0 +1,32 @@ +package restorepoints + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RestorePointProperties struct { + ConsistencyMode *ConsistencyModeTypes `json:"consistencyMode,omitempty"` + ExcludeDisks *[]ApiEntityReference `json:"excludeDisks,omitempty"` + InstanceView *RestorePointInstanceView `json:"instanceView,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + SourceMetadata *RestorePointSourceMetadata `json:"sourceMetadata,omitempty"` + SourceRestorePoint *ApiEntityReference `json:"sourceRestorePoint,omitempty"` + TimeCreated *string `json:"timeCreated,omitempty"` +} + +func (o *RestorePointProperties) GetTimeCreatedAsTime() (*time.Time, error) { + if o.TimeCreated == nil { + return nil, nil + } + return dates.ParseAsFormat(o.TimeCreated, "2006-01-02T15:04:05Z07:00") +} + +func (o *RestorePointProperties) SetTimeCreatedAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.TimeCreated = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_restorepointsourcemetadata.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_restorepointsourcemetadata.go new file mode 100644 index 000000000000..4a71d34dcb16 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_restorepointsourcemetadata.go @@ -0,0 +1,17 @@ +package restorepoints + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RestorePointSourceMetadata struct { + DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` + HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` + HyperVGeneration *HyperVGenerationTypes `json:"hyperVGeneration,omitempty"` + LicenseType *string `json:"licenseType,omitempty"` + Location *string `json:"location,omitempty"` + OsProfile *OSProfile `json:"osProfile,omitempty"` + SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` + StorageProfile *RestorePointSourceVMStorageProfile `json:"storageProfile,omitempty"` + UserData *string `json:"userData,omitempty"` + VMId *string `json:"vmId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_restorepointsourcevmdatadisk.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_restorepointsourcevmdatadisk.go new file mode 100644 index 000000000000..846b38eea304 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_restorepointsourcevmdatadisk.go @@ -0,0 +1,14 @@ +package restorepoints + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RestorePointSourceVMDataDisk struct { + Caching *CachingTypes `json:"caching,omitempty"` + DiskRestorePoint *DiskRestorePointAttributes `json:"diskRestorePoint,omitempty"` + DiskSizeGB *int64 `json:"diskSizeGB,omitempty"` + Lun *int64 `json:"lun,omitempty"` + ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` + Name *string `json:"name,omitempty"` + WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_restorepointsourcevmosdisk.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_restorepointsourcevmosdisk.go new file mode 100644 index 000000000000..f61bf9ba4f5d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_restorepointsourcevmosdisk.go @@ -0,0 +1,15 @@ +package restorepoints + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RestorePointSourceVMOSDisk struct { + Caching *CachingTypes `json:"caching,omitempty"` + DiskRestorePoint *DiskRestorePointAttributes `json:"diskRestorePoint,omitempty"` + DiskSizeGB *int64 `json:"diskSizeGB,omitempty"` + EncryptionSettings *DiskEncryptionSettings `json:"encryptionSettings,omitempty"` + ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` + Name *string `json:"name,omitempty"` + OsType *OperatingSystemType `json:"osType,omitempty"` + WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_restorepointsourcevmstorageprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_restorepointsourcevmstorageprofile.go new file mode 100644 index 000000000000..6122c5ab170e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_restorepointsourcevmstorageprofile.go @@ -0,0 +1,10 @@ +package restorepoints + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RestorePointSourceVMStorageProfile struct { + DataDisks *[]RestorePointSourceVMDataDisk `json:"dataDisks,omitempty"` + DiskControllerType *DiskControllerTypes `json:"diskControllerType,omitempty"` + OsDisk *RestorePointSourceVMOSDisk `json:"osDisk,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_securityprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_securityprofile.go new file mode 100644 index 000000000000..944bde890388 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_securityprofile.go @@ -0,0 +1,12 @@ +package restorepoints + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityProfile struct { + EncryptionAtHost *bool `json:"encryptionAtHost,omitempty"` + EncryptionIdentity *EncryptionIdentity `json:"encryptionIdentity,omitempty"` + ProxyAgentSettings *ProxyAgentSettings `json:"proxyAgentSettings,omitempty"` + SecurityType *SecurityTypes `json:"securityType,omitempty"` + UefiSettings *UefiSettings `json:"uefiSettings,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_sshconfiguration.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_sshconfiguration.go new file mode 100644 index 000000000000..af61ff07f8fe --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_sshconfiguration.go @@ -0,0 +1,8 @@ +package restorepoints + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SshConfiguration struct { + PublicKeys *[]SshPublicKey `json:"publicKeys,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_sshpublickey.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_sshpublickey.go new file mode 100644 index 000000000000..3f9651d567ce --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_sshpublickey.go @@ -0,0 +1,9 @@ +package restorepoints + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SshPublicKey struct { + KeyData *string `json:"keyData,omitempty"` + Path *string `json:"path,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_subresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_subresource.go new file mode 100644 index 000000000000..a2e5c085ec2c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_subresource.go @@ -0,0 +1,8 @@ +package restorepoints + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubResource struct { + Id *string `json:"id,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_uefisettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_uefisettings.go new file mode 100644 index 000000000000..9878e8a1f4b7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_uefisettings.go @@ -0,0 +1,9 @@ +package restorepoints + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UefiSettings struct { + SecureBootEnabled *bool `json:"secureBootEnabled,omitempty"` + VTpmEnabled *bool `json:"vTpmEnabled,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_vaultcertificate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_vaultcertificate.go new file mode 100644 index 000000000000..077c7b0db1dc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_vaultcertificate.go @@ -0,0 +1,9 @@ +package restorepoints + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VaultCertificate struct { + CertificateStore *string `json:"certificateStore,omitempty"` + CertificateUrl *string `json:"certificateUrl,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_vaultsecretgroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_vaultsecretgroup.go new file mode 100644 index 000000000000..04d2ed6ef067 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_vaultsecretgroup.go @@ -0,0 +1,9 @@ +package restorepoints + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VaultSecretGroup struct { + SourceVault *SubResource `json:"sourceVault,omitempty"` + VaultCertificates *[]VaultCertificate `json:"vaultCertificates,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_vmdisksecurityprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_vmdisksecurityprofile.go new file mode 100644 index 000000000000..bdf4f1b0785e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_vmdisksecurityprofile.go @@ -0,0 +1,9 @@ +package restorepoints + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VMDiskSecurityProfile struct { + DiskEncryptionSet *SubResource `json:"diskEncryptionSet,omitempty"` + SecurityEncryptionType *SecurityEncryptionTypes `json:"securityEncryptionType,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_vmsizeproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_vmsizeproperties.go new file mode 100644 index 000000000000..5e877d0f4d5d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_vmsizeproperties.go @@ -0,0 +1,9 @@ +package restorepoints + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VMSizeProperties struct { + VCPUsAvailable *int64 `json:"vCPUsAvailable,omitempty"` + VCPUsPerCore *int64 `json:"vCPUsPerCore,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_windowsconfiguration.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_windowsconfiguration.go new file mode 100644 index 000000000000..8260015420f1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_windowsconfiguration.go @@ -0,0 +1,14 @@ +package restorepoints + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WindowsConfiguration struct { + AdditionalUnattendContent *[]AdditionalUnattendContent `json:"additionalUnattendContent,omitempty"` + EnableAutomaticUpdates *bool `json:"enableAutomaticUpdates,omitempty"` + EnableVMAgentPlatformUpdates *bool `json:"enableVMAgentPlatformUpdates,omitempty"` + PatchSettings *PatchSettings `json:"patchSettings,omitempty"` + ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` + TimeZone *string `json:"timeZone,omitempty"` + WinRM *WinRMConfiguration `json:"winRM,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_windowsvmguestpatchautomaticbyplatformsettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_windowsvmguestpatchautomaticbyplatformsettings.go new file mode 100644 index 000000000000..4a654678566a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_windowsvmguestpatchautomaticbyplatformsettings.go @@ -0,0 +1,9 @@ +package restorepoints + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WindowsVMGuestPatchAutomaticByPlatformSettings struct { + BypassPlatformSafetyChecksOnUserSchedule *bool `json:"bypassPlatformSafetyChecksOnUserSchedule,omitempty"` + RebootSetting *WindowsVMGuestPatchAutomaticByPlatformRebootSetting `json:"rebootSetting,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_winrmconfiguration.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_winrmconfiguration.go new file mode 100644 index 000000000000..09a7b12f0d31 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_winrmconfiguration.go @@ -0,0 +1,8 @@ +package restorepoints + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WinRMConfiguration struct { + Listeners *[]WinRMListener `json:"listeners,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_winrmlistener.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_winrmlistener.go new file mode 100644 index 000000000000..c9ff579e87ef --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/model_winrmlistener.go @@ -0,0 +1,9 @@ +package restorepoints + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WinRMListener struct { + CertificateUrl *string `json:"certificateUrl,omitempty"` + Protocol *ProtocolTypes `json:"protocol,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/version.go new file mode 100644 index 000000000000..14ad7bf2f4c9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints/version.go @@ -0,0 +1,12 @@ +package restorepoints + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2024-03-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/restorepoints/%s", defaultApiVersion) +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 7b5d86361c9d..b96ebfb73f4e 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -345,6 +345,7 @@ github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/availabili github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/dedicatedhostgroups github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/dedicatedhosts github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections +github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/sshpublickeys github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/virtualmachineextensions github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/virtualmachineimages diff --git a/website/docs/r/restore_point.html.markdown b/website/docs/r/restore_point.html.markdown new file mode 100644 index 000000000000..300af25e5d1c --- /dev/null +++ b/website/docs/r/restore_point.html.markdown @@ -0,0 +1,125 @@ +--- +subcategory: "Compute" +layout: "azurerm" +page_title: "Azure Resource Manager: azurerm_restore_point" +description: |- + Manages a Restore Point Collection +--- + +# azurerm_restore_point + +Manages a Restore Point. + +## Example Usage + +```hcl +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "example" { + name = "example-resources" + location = "West Europe" +} + +resource "azurerm_virtual_network" "example" { + name = "example-network" + address_space = ["10.0.0.0/16"] + location = azurerm_resource_group.example.location + resource_group_name = azurerm_resource_group.example.name +} + +resource "azurerm_subnet" "example" { + name = "internal" + resource_group_name = azurerm_resource_group.example.name + virtual_network_name = azurerm_virtual_network.example.name + address_prefixes = ["10.0.2.0/24"] +} + +resource "azurerm_network_interface" "example" { + name = "example-nic" + location = azurerm_resource_group.example.location + resource_group_name = azurerm_resource_group.example.name + + ip_configuration { + name = "internal" + subnet_id = azurerm_subnet.example.id + private_ip_address_allocation = "Dynamic" + } +} + +resource "azurerm_linux_virtual_machine" "example" { + name = "example-machine" + resource_group_name = azurerm_resource_group.example.name + location = azurerm_resource_group.example.location + size = "Standard_F2" + admin_username = "adminuser" + network_interface_ids = [ + azurerm_network_interface.example.id, + ] + + admin_ssh_key { + username = "adminuser" + public_key = file("~/.ssh/id_rsa.pub") + } + + os_disk { + caching = "ReadWrite" + storage_account_type = "Standard_LRS" + } + + source_image_reference { + publisher = "Canonical" + offer = "0001-com-ubuntu-server-jammy" + sku = "22_04-lts" + version = "latest" + } +} + +resource "azurerm_restore_point_collection" "example" { + name = "example-collection" + resource_group_name = azurerm_resource_group.example.name + location = azurerm_linux_virtual_machine.example.location + source_virtual_machine_id = azurerm_linux_virtual_machine.example.id +} + +resource "azurerm_restore_point" "example" { + name = "example-restore-point" + restore_point_collection_id = azurerm_restore_point_collection.test.id +} +``` + +## Argument Reference + +The following arguments are supported: + +* `name` - (Required) Specifies the name of the Restore Point. Changing this forces a new resource to be created. + +* `restore_point_collection_id` - (Required) Specifies the name of the Restore Point Collection the Restore Point will be associated with. Changing this forces a new resource to be created. + +* `crash_consistency_mode_enabled` - (Optional) Is Crash Consistent the Consistency Mode of the Restore Point. Defaults to `false`. Changing this forces a new resource to be created. + +* `excluded_disks` - (Optional) A list of disks that will be excluded from the Restore Point. Changing this forces a new resource to be created. + +## Attributes Reference + +In addition to the Arguments listed above - the following Attributes are exported: + +* `id` - The ID of the Restore Point. + +## Timeouts + +The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: + +* `create` - (Defaults to 45 minutes) Used when creating the Restore Point. +* `update` - (Defaults to 45 minutes) Used when updating the Restore Point. +* `delete` - (Defaults to 45 minutes) Used when deleting the Restore Point. +* `read` - (Defaults to 5 minutes) Used when retrieving the Restore Point. + +## Import + +Restore Point can be imported using the `resource id`, e.g. + +```shell +terraform import azurerm_restore_point.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Compute/restorePointCollections/collection1/restorePoints/restorePoint1 +``` From f2f36b30b4945a6584211b647dabf2064b5bc809 Mon Sep 17 00:00:00 2001 From: Matthew Date: Tue, 2 Jul 2024 16:37:46 -0700 Subject: [PATCH 3/6] Fix TestAccRestorePoint_excludedDisks --- internal/services/compute/restore_point_resource_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/compute/restore_point_resource_test.go b/internal/services/compute/restore_point_resource_test.go index 3e0a3a3ab764..b764fbf738f2 100644 --- a/internal/services/compute/restore_point_resource_test.go +++ b/internal/services/compute/restore_point_resource_test.go @@ -36,7 +36,7 @@ func TestAccRestorePoint_excludedDisks(t *testing.T) { data.ResourceTest(t, r, []acceptance.TestStep{ { - Config: r.basic(data), + Config: r.excludedDisks(data), Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), ), From f5387440301c490bf7b8648751fbb44dcd40bbdd Mon Sep 17 00:00:00 2001 From: Matthew Date: Wed, 3 Jul 2024 13:22:27 -0700 Subject: [PATCH 4/6] Fix TestAccRestorePoint_excludedDisks --- .../compute/restore_point_resource_test.go | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/internal/services/compute/restore_point_resource_test.go b/internal/services/compute/restore_point_resource_test.go index b764fbf738f2..379c192393f8 100644 --- a/internal/services/compute/restore_point_resource_test.go +++ b/internal/services/compute/restore_point_resource_test.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "testing" + "time" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepoints" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" @@ -36,7 +37,11 @@ func TestAccRestorePoint_excludedDisks(t *testing.T) { data.ResourceTest(t, r, []acceptance.TestStep{ { - Config: r.excludedDisks(data), + Config: r.addedDisks(data), + }, + { + PreConfig: func() { time.Sleep(5 * time.Minute) }, + Config: r.excludedDisks(data), Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), ), @@ -105,6 +110,32 @@ resource "azurerm_restore_point" "test" { `, r.template(data), data.RandomString) } +func (r RestorePointResource) addedDisks(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +%[1]s + +resource "azurerm_managed_disk" "test" { + name = "acctest%[2]s" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + storage_account_type = "Standard_LRS" + create_option = "Empty" + disk_size_gb = 10 +} + +resource "azurerm_virtual_machine_data_disk_attachment" "test" { + managed_disk_id = azurerm_managed_disk.test.id + virtual_machine_id = azurerm_linux_virtual_machine.test.id + lun = "11" + caching = "ReadWrite" +} +`, r.template(data), data.RandomString) +} + func (r RestorePointResource) template(data acceptance.TestData) string { return fmt.Sprintf(` resource "azurerm_resource_group" "test" { From dfdaafbcbd434413f590987aaf5fd7378c0b1f20 Mon Sep 17 00:00:00 2001 From: Matthew Date: Wed, 3 Jul 2024 15:36:08 -0700 Subject: [PATCH 5/6] merge with main --- internal/services/compute/restore_point_resource_test.go | 2 +- website/docs/r/restore_point.html.markdown | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/services/compute/restore_point_resource_test.go b/internal/services/compute/restore_point_resource_test.go index 379c192393f8..4d07d08eb7e2 100644 --- a/internal/services/compute/restore_point_resource_test.go +++ b/internal/services/compute/restore_point_resource_test.go @@ -151,7 +151,7 @@ resource "azurerm_virtual_network" "test" { } resource "azurerm_subnet" "test" { - name = "internal-%[1]d" + name = "acctestinternal-%[1]d" resource_group_name = azurerm_resource_group.test.name virtual_network_name = azurerm_virtual_network.test.name address_prefixes = ["10.0.0.0/24"] diff --git a/website/docs/r/restore_point.html.markdown b/website/docs/r/restore_point.html.markdown index 300af25e5d1c..18071fcee246 100644 --- a/website/docs/r/restore_point.html.markdown +++ b/website/docs/r/restore_point.html.markdown @@ -111,9 +111,9 @@ In addition to the Arguments listed above - the following Attributes are exporte The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: -* `create` - (Defaults to 45 minutes) Used when creating the Restore Point. -* `update` - (Defaults to 45 minutes) Used when updating the Restore Point. -* `delete` - (Defaults to 45 minutes) Used when deleting the Restore Point. +* `create` - (Defaults to 30 minutes) Used when creating the Restore Point. +* `update` - (Defaults to 30 minutes) Used when updating the Restore Point. +* `delete` - (Defaults to 30 minutes) Used when deleting the Restore Point. * `read` - (Defaults to 5 minutes) Used when retrieving the Restore Point. ## Import From 1701281dbcd3cacafa676fc8b0b196daa7275767 Mon Sep 17 00:00:00 2001 From: Matthew Date: Fri, 5 Jul 2024 14:04:46 -0700 Subject: [PATCH 6/6] address reivew --- internal/services/compute/registration.go | 3 +- .../restore_point_collection_resource.go | 6 + ...chine_restore_point_collection_resource.go | 218 ++++++++++++++++++ ..._restore_point_collection_resource_test.go | 169 ++++++++++++++ ...virtual_machine_restore_point_resource.go} | 44 ++-- ...al_machine_restore_point_resource_test.go} | 38 +-- ...rtual_machine_restore_point.html.markdown} | 30 +-- ...ne_restore_point_collection.html.markdown} | 34 +-- 8 files changed, 468 insertions(+), 74 deletions(-) create mode 100644 internal/services/compute/virtual_machine_restore_point_collection_resource.go create mode 100644 internal/services/compute/virtual_machine_restore_point_collection_resource_test.go rename internal/services/compute/{restore_point_resource.go => virtual_machine_restore_point_resource.go} (74%) rename internal/services/compute/{restore_point_resource_test.go => virtual_machine_restore_point_resource_test.go} (78%) rename website/docs/r/{restore_point.html.markdown => virtual_machine_restore_point.html.markdown} (69%) rename website/docs/r/{restore_point_collection.html.markdown => virtual_machine_restore_point_collection.html.markdown} (61%) diff --git a/internal/services/compute/registration.go b/internal/services/compute/registration.go index 2f62ac2c8e49..638a52652d07 100644 --- a/internal/services/compute/registration.go +++ b/internal/services/compute/registration.go @@ -93,7 +93,8 @@ func (r Registration) Resources() []sdk.Resource { GalleryApplicationResource{}, GalleryApplicationVersionResource{}, RestorePointCollectionResource{}, - RestorePointResource{}, + VirtualMachineRestorePointCollectionResource{}, + VirtualMachineRestorePointResource{}, VirtualMachineGalleryApplicationAssignmentResource{}, } } diff --git a/internal/services/compute/restore_point_collection_resource.go b/internal/services/compute/restore_point_collection_resource.go index dd00d732ca96..216008f4676f 100644 --- a/internal/services/compute/restore_point_collection_resource.go +++ b/internal/services/compute/restore_point_collection_resource.go @@ -16,9 +16,15 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" ) +// RestorePointCollectionResource remove this in 4.0, the resource is renamed type RestorePointCollectionResource struct{} var _ sdk.ResourceWithUpdate = RestorePointCollectionResource{} +var _ sdk.ResourceWithDeprecationReplacedBy = RestorePointCollectionResource{} + +func (r RestorePointCollectionResource) DeprecatedInFavourOfResource() string { + return "azurerm_virtual_machine_restore_point_collection" +} func (r RestorePointCollectionResource) ModelObject() interface{} { return &RestorePointCollectionResourceModel{} diff --git a/internal/services/compute/virtual_machine_restore_point_collection_resource.go b/internal/services/compute/virtual_machine_restore_point_collection_resource.go new file mode 100644 index 000000000000..9fa564802c64 --- /dev/null +++ b/internal/services/compute/virtual_machine_restore_point_collection_resource.go @@ -0,0 +1,218 @@ +package compute + +import ( + "context" + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/pointer" + "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" + "github.com/hashicorp/go-azure-helpers/resourcemanager/location" + "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections" + "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" +) + +// VirtualMachineRestorePointCollectionResource remove this in 4.0, the resource is renamed +type VirtualMachineRestorePointCollectionResource struct{} + +var _ sdk.ResourceWithUpdate = VirtualMachineRestorePointCollectionResource{} +var _ sdk.ResourceWithDeprecationReplacedBy = VirtualMachineRestorePointCollectionResource{} + +func (r VirtualMachineRestorePointCollectionResource) DeprecatedInFavourOfResource() string { + return "azurerm_virtual_machine_restore_point_collection" +} + +func (r VirtualMachineRestorePointCollectionResource) ModelObject() interface{} { + return &VirtualMachineRestorePointCollectionResourceModel{} +} + +type VirtualMachineRestorePointCollectionResourceModel struct { + Name string `tfschema:"name"` + ResourceGroup string `tfschema:"resource_group_name"` + Location string `tfschema:"location"` + SourceVirtualMachineId string `tfschema:"source_virtual_machine_id"` + Tags map[string]interface{} `tfschema:"tags"` +} + +func (r VirtualMachineRestorePointCollectionResource) IDValidationFunc() pluginsdk.SchemaValidateFunc { + return restorepointcollections.ValidateRestorePointCollectionID +} + +func (r VirtualMachineRestorePointCollectionResource) ResourceType() string { + return "azurerm_virtual_machine_restore_point_collection" +} + +func (r VirtualMachineRestorePointCollectionResource) Arguments() map[string]*pluginsdk.Schema { + return map[string]*pluginsdk.Schema{ + "name": { + ForceNew: true, + Required: true, + Type: pluginsdk.TypeString, + }, + + "resource_group_name": commonschema.ResourceGroupName(), + + "location": commonschema.Location(), + + "source_virtual_machine_id": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: commonids.ValidateVirtualMachineID, + }, + + "tags": commonschema.Tags(), + } +} + +func (r VirtualMachineRestorePointCollectionResource) Attributes() map[string]*pluginsdk.Schema { + return map[string]*pluginsdk.Schema{} +} + +func (r VirtualMachineRestorePointCollectionResource) Create() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 30 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + client := metadata.Client.Compute.RestorePointCollectionsClient + subscriptionId := metadata.Client.Account.SubscriptionId + + var config VirtualMachineRestorePointCollectionResourceModel + if err := metadata.Decode(&config); err != nil { + return fmt.Errorf("decoding: %+v", err) + } + + id := restorepointcollections.NewRestorePointCollectionID(subscriptionId, config.ResourceGroup, config.Name) + + existing, err := client.Get(ctx, id, restorepointcollections.DefaultGetOperationOptions()) + if err != nil { + if !response.WasNotFound(existing.HttpResponse) { + return fmt.Errorf("checking for the presence of an existing %s: %+v", id, err) + } + } + if !response.WasNotFound(existing.HttpResponse) { + return metadata.ResourceRequiresImport(r.ResourceType(), id) + } + + parameters := restorepointcollections.RestorePointCollection{ + Location: location.Normalize(config.Location), + Properties: &restorepointcollections.RestorePointCollectionProperties{ + Source: &restorepointcollections.RestorePointCollectionSourceProperties{ + Id: pointer.To(config.SourceVirtualMachineId), + }, + }, + Tags: tags.Expand(config.Tags), + } + + if _, err = client.CreateOrUpdate(ctx, id, parameters); err != nil { + return fmt.Errorf("creating %s: %+v", id, err) + } + + metadata.SetID(id) + return nil + }, + } +} + +func (r VirtualMachineRestorePointCollectionResource) Read() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 5 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + client := metadata.Client.Compute.RestorePointCollectionsClient + + schema := VirtualMachineRestorePointCollectionResourceModel{} + + id, err := restorepointcollections.ParseRestorePointCollectionID(metadata.ResourceData.Id()) + if err != nil { + return err + } + + resp, err := client.Get(ctx, *id, restorepointcollections.DefaultGetOperationOptions()) + if err != nil { + if response.WasNotFound(resp.HttpResponse) { + return metadata.MarkAsGone(*id) + } + return fmt.Errorf("retrieving %s: %+v", *id, err) + } + + if model := resp.Model; model != nil { + schema.Name = id.RestorePointCollectionName + schema.ResourceGroup = id.ResourceGroupName + + if props := model.Properties; props != nil { + if source := props.Source; source != nil { + schema.SourceVirtualMachineId = pointer.From(source.Id) + schema.Location = location.Normalize(pointer.From(source.Location)) + } + } + + schema.Tags = tags.Flatten(model.Tags) + } + + return metadata.Encode(&schema) + }, + } +} + +func (r VirtualMachineRestorePointCollectionResource) Update() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 30 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + client := metadata.Client.Compute.RestorePointCollectionsClient + + id, err := restorepointcollections.ParseRestorePointCollectionID(metadata.ResourceData.Id()) + if err != nil { + return err + } + + existing, err := client.Get(ctx, *id, restorepointcollections.DefaultGetOperationOptions()) + if err != nil { + return fmt.Errorf("retrieving %s: %+v", id, err) + } + + if existing.Model == nil { + return fmt.Errorf("retrieving %s: `model` was nil", id) + } + + payload := *existing.Model + + var config VirtualMachineRestorePointCollectionResourceModel + if err := metadata.Decode(&config); err != nil { + return fmt.Errorf("decoding: %+v", err) + } + + if metadata.ResourceData.HasChange("tags") { + payload.Tags = tags.Expand(config.Tags) + } + + if _, err = client.CreateOrUpdate(ctx, *id, payload); err != nil { + return fmt.Errorf("updating %s: %+v", *id, err) + } + + return nil + }, + } +} + +func (r VirtualMachineRestorePointCollectionResource) Delete() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 30 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + client := metadata.Client.Compute.RestorePointCollectionsClient + + id, err := restorepointcollections.ParseRestorePointCollectionID(metadata.ResourceData.Id()) + if err != nil { + return err + } + + if err := client.DeleteThenPoll(ctx, *id); err != nil { + return fmt.Errorf("deleting %s: %+v", *id, err) + } + + return nil + }, + } +} diff --git a/internal/services/compute/virtual_machine_restore_point_collection_resource_test.go b/internal/services/compute/virtual_machine_restore_point_collection_resource_test.go new file mode 100644 index 000000000000..690b21a73fca --- /dev/null +++ b/internal/services/compute/virtual_machine_restore_point_collection_resource_test.go @@ -0,0 +1,169 @@ +package compute_test + +import ( + "context" + "fmt" + "testing" + + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2024-03-01/restorepointcollections" + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" + "github.com/hashicorp/terraform-provider-azurerm/internal/clients" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" + "github.com/hashicorp/terraform-provider-azurerm/utils" +) + +type VirtualMachineRestorePointCollectionResource struct{} + +func TestAccVirtualMachineRestorePointCollection_basic(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_virtual_machine_restore_point_collection", "test") + r := VirtualMachineRestorePointCollectionResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + }) +} + +func TestAccVirtualMachineRestorePointCollection_update(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_virtual_machine_restore_point_collection", "test") + r := VirtualMachineRestorePointCollectionResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + { + Config: r.update(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + }) +} + +func (r VirtualMachineRestorePointCollectionResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { + id, err := restorepointcollections.ParseRestorePointCollectionID(state.ID) + if err != nil { + return nil, err + } + + resp, err := clients.Compute.RestorePointCollectionsClient.Get(ctx, *id, restorepointcollections.DefaultGetOperationOptions()) + if err != nil { + return nil, fmt.Errorf("reading %s: %+v", *id, err) + } + + return utils.Bool(resp.Model != nil), nil +} + +func (r VirtualMachineRestorePointCollectionResource) basic(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} +%[1]s +resource "azurerm_virtual_machine_restore_point_collection" "test" { + name = "acctestRPC-%[2]s" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_linux_virtual_machine.test.location + source_virtual_machine_id = azurerm_linux_virtual_machine.test.id + + tags = { + foo = "bar" + } +} +`, r.template(data), data.RandomString) +} + +func (r VirtualMachineRestorePointCollectionResource) update(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} +%[1]s +resource "azurerm_virtual_machine_restore_point_collection" "test" { + name = "acctestRPC-%[2]s" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_linux_virtual_machine.test.location + source_virtual_machine_id = azurerm_linux_virtual_machine.test.id + + tags = { + bar = "foo" + } +} +`, r.template(data), data.RandomString) +} + +func (r VirtualMachineRestorePointCollectionResource) template(data acceptance.TestData) string { + return fmt.Sprintf(` +resource "azurerm_resource_group" "test" { + name = "acctestRG-Compute-%[1]d" + location = "%[2]s" +} + + +resource "azurerm_virtual_network" "test" { + name = "acctestnw-%[1]d" + address_space = ["10.0.0.0/16"] + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name +} + +resource "azurerm_subnet" "test" { + name = "acctestinternal-%[1]d" + resource_group_name = azurerm_resource_group.test.name + virtual_network_name = azurerm_virtual_network.test.name + address_prefixes = ["10.0.0.0/24"] +} + +resource "azurerm_network_interface" "test" { + name = "acctestnic-%[1]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + ip_configuration { + name = "internal" + subnet_id = azurerm_subnet.test.id + private_ip_address_allocation = "Dynamic" + } +} + +resource "azurerm_linux_virtual_machine" "test" { + name = "acctestVM-%[1]d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + size = "Standard_F2" + admin_username = "adminuser" + admin_password = "P@$$w0rd1234!" + network_interface_ids = [ + azurerm_network_interface.test.id, + ] + + admin_ssh_key { + username = "adminuser" + public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+wWK73dCr+jgQOAxNsHAnNNNMEMWOHYEccp6wJm2gotpr9katuF/ZAdou5AaW1C61slRkHRkpRRX9FA9CYBiitZgvCCz+3nWNN7l/Up54Zps/pHWGZLHNJZRYyAB6j5yVLMVHIHriY49d/GZTZVNB8GoJv9Gakwc/fuEZYYl4YDFiGMBP///TzlI4jhiJzjKnEvqPFki5p2ZRJqcbCiF4pJrxUQR/RXqVFQdbRLZgYfJ8xGB878RENq3yQ39d8dVOkq4edbkzwcUmwwwkYVPIoDGsYLaRHnG+To7FvMeyO7xDVQkMKzopTQV8AuKpyvpqu0a9pWOMaiCyDytO7GGN you@me.com" + } + + os_disk { + caching = "ReadWrite" + storage_account_type = "Standard_LRS" + } + + source_image_reference { + publisher = "Canonical" + offer = "0001-com-ubuntu-server-jammy" + sku = "22_04-lts" + version = "latest" + } +} +`, data.RandomInteger, data.Locations.Primary) +} diff --git a/internal/services/compute/restore_point_resource.go b/internal/services/compute/virtual_machine_restore_point_resource.go similarity index 74% rename from internal/services/compute/restore_point_resource.go rename to internal/services/compute/virtual_machine_restore_point_resource.go index f6aca1ae8d6d..7223f82e9738 100644 --- a/internal/services/compute/restore_point_resource.go +++ b/internal/services/compute/virtual_machine_restore_point_resource.go @@ -15,30 +15,30 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" ) -type RestorePointResource struct{} +type VirtualMachineRestorePointResource struct{} -var _ sdk.Resource = RestorePointResource{} +var _ sdk.Resource = VirtualMachineRestorePointResource{} -func (r RestorePointResource) ModelObject() interface{} { - return &RestorePointResourceModel{} +func (r VirtualMachineRestorePointResource) ModelObject() interface{} { + return &VirtualMachineRestorePointResourceModel{} } -type RestorePointResourceModel struct { - Name string `tfschema:"name"` - RestorePointCollectionId string `tfschema:"restore_point_collection_id"` - CrashConsistencyModeEnabled bool `tfschema:"crash_consistency_mode_enabled"` - ExcludedDisks []string `tfschema:"excluded_disks"` +type VirtualMachineRestorePointResourceModel struct { + Name string `tfschema:"name"` + VirtualMachineRestorePointCollectionId string `tfschema:"virtual_machine_restore_point_collection_id"` + CrashConsistencyModeEnabled bool `tfschema:"crash_consistency_mode_enabled"` + ExcludedDisks []string `tfschema:"excluded_disks"` } -func (r RestorePointResource) IDValidationFunc() pluginsdk.SchemaValidateFunc { +func (r VirtualMachineRestorePointResource) IDValidationFunc() pluginsdk.SchemaValidateFunc { return restorepoints.ValidateRestorePointID } -func (r RestorePointResource) ResourceType() string { - return "azurerm_restore_point" +func (r VirtualMachineRestorePointResource) ResourceType() string { + return "azurerm_virtual_machine_restore_point" } -func (r RestorePointResource) Arguments() map[string]*pluginsdk.Schema { +func (r VirtualMachineRestorePointResource) Arguments() map[string]*pluginsdk.Schema { return map[string]*pluginsdk.Schema{ "name": { ForceNew: true, @@ -46,7 +46,7 @@ func (r RestorePointResource) Arguments() map[string]*pluginsdk.Schema { Type: pluginsdk.TypeString, }, - "restore_point_collection_id": { + "virtual_machine_restore_point_collection_id": { ForceNew: true, Required: true, Type: pluginsdk.TypeString, @@ -72,22 +72,22 @@ func (r RestorePointResource) Arguments() map[string]*pluginsdk.Schema { } } -func (r RestorePointResource) Attributes() map[string]*pluginsdk.Schema { +func (r VirtualMachineRestorePointResource) Attributes() map[string]*pluginsdk.Schema { return map[string]*pluginsdk.Schema{} } -func (r RestorePointResource) Create() sdk.ResourceFunc { +func (r VirtualMachineRestorePointResource) Create() sdk.ResourceFunc { return sdk.ResourceFunc{ Timeout: 30 * time.Minute, Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { client := metadata.Client.Compute.RestorePointsClient - var config RestorePointResourceModel + var config VirtualMachineRestorePointResourceModel if err := metadata.Decode(&config); err != nil { return fmt.Errorf("decoding: %+v", err) } - collectionId, err := restorepointcollections.ParseRestorePointCollectionID(config.RestorePointCollectionId) + collectionId, err := restorepointcollections.ParseRestorePointCollectionID(config.VirtualMachineRestorePointCollectionId) if err != nil { return err } @@ -133,13 +133,13 @@ func (r RestorePointResource) Create() sdk.ResourceFunc { } } -func (r RestorePointResource) Read() sdk.ResourceFunc { +func (r VirtualMachineRestorePointResource) Read() sdk.ResourceFunc { return sdk.ResourceFunc{ Timeout: 5 * time.Minute, Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { client := metadata.Client.Compute.RestorePointsClient - schema := RestorePointResourceModel{} + schema := VirtualMachineRestorePointResourceModel{} id, err := restorepoints.ParseRestorePointID(metadata.ResourceData.Id()) if err != nil { @@ -156,7 +156,7 @@ func (r RestorePointResource) Read() sdk.ResourceFunc { if model := resp.Model; model != nil { schema.Name = id.RestorePointName - schema.RestorePointCollectionId = restorepointcollections.NewRestorePointCollectionID(id.SubscriptionId, id.ResourceGroupName, id.RestorePointCollectionName).ID() + schema.VirtualMachineRestorePointCollectionId = restorepointcollections.NewRestorePointCollectionID(id.SubscriptionId, id.ResourceGroupName, id.RestorePointCollectionName).ID() if props := model.Properties; props != nil { schema.CrashConsistencyModeEnabled = strings.EqualFold(string(pointer.From(props.ConsistencyMode)), string(restorepoints.ConsistencyModeTypesCrashConsistent)) @@ -176,7 +176,7 @@ func (r RestorePointResource) Read() sdk.ResourceFunc { } } -func (r RestorePointResource) Delete() sdk.ResourceFunc { +func (r VirtualMachineRestorePointResource) Delete() sdk.ResourceFunc { return sdk.ResourceFunc{ Timeout: 30 * time.Minute, Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { diff --git a/internal/services/compute/restore_point_resource_test.go b/internal/services/compute/virtual_machine_restore_point_resource_test.go similarity index 78% rename from internal/services/compute/restore_point_resource_test.go rename to internal/services/compute/virtual_machine_restore_point_resource_test.go index 4d07d08eb7e2..8303d388199a 100644 --- a/internal/services/compute/restore_point_resource_test.go +++ b/internal/services/compute/virtual_machine_restore_point_resource_test.go @@ -14,11 +14,11 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/utils" ) -type RestorePointResource struct{} +type VirtualMachineRestorePointResource struct{} -func TestAccRestorePoint_basic(t *testing.T) { - data := acceptance.BuildTestData(t, "azurerm_restore_point", "test") - r := RestorePointResource{} +func TestAccVirtualMachineRestorePoint_basic(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_virtual_machine_restore_point", "test") + r := VirtualMachineRestorePointResource{} data.ResourceTest(t, r, []acceptance.TestStep{ { @@ -31,9 +31,9 @@ func TestAccRestorePoint_basic(t *testing.T) { }) } -func TestAccRestorePoint_excludedDisks(t *testing.T) { - data := acceptance.BuildTestData(t, "azurerm_restore_point", "test") - r := RestorePointResource{} +func TestAccVirtualMachineRestorePoint_excludedDisks(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_virtual_machine_restore_point", "test") + r := VirtualMachineRestorePointResource{} data.ResourceTest(t, r, []acceptance.TestStep{ { @@ -50,7 +50,7 @@ func TestAccRestorePoint_excludedDisks(t *testing.T) { }) } -func (r RestorePointResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { +func (r VirtualMachineRestorePointResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { id, err := restorepoints.ParseRestorePointID(state.ID) if err != nil { return nil, err @@ -64,7 +64,7 @@ func (r RestorePointResource) Exists(ctx context.Context, clients *clients.Clien return utils.Bool(resp.Model != nil), nil } -func (r RestorePointResource) basic(data acceptance.TestData) string { +func (r VirtualMachineRestorePointResource) basic(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { features {} @@ -72,14 +72,14 @@ provider "azurerm" { %[1]s -resource "azurerm_restore_point" "test" { - name = "acctestRP-%[2]s" - restore_point_collection_id = azurerm_restore_point_collection.test.id +resource "azurerm_virtual_machine_restore_point" "test" { + name = "acctestRP-%[2]s" + virtual_machine_restore_point_collection_id = azurerm_virtual_machine_restore_point_collection.test.id } `, r.template(data), data.RandomString) } -func (r RestorePointResource) excludedDisks(data acceptance.TestData) string { +func (r VirtualMachineRestorePointResource) excludedDisks(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { features {} @@ -103,14 +103,14 @@ resource "azurerm_virtual_machine_data_disk_attachment" "test" { caching = "ReadWrite" } -resource "azurerm_restore_point" "test" { - name = "acctestRP-%[2]s" - restore_point_collection_id = azurerm_restore_point_collection.test.id +resource "azurerm_virtual_machine_restore_point" "test" { + name = "acctestRP-%[2]s" + virtual_machine_restore_point_collection_id = azurerm_virtual_machine_restore_point_collection.test.id } `, r.template(data), data.RandomString) } -func (r RestorePointResource) addedDisks(data acceptance.TestData) string { +func (r VirtualMachineRestorePointResource) addedDisks(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { features {} @@ -136,7 +136,7 @@ resource "azurerm_virtual_machine_data_disk_attachment" "test" { `, r.template(data), data.RandomString) } -func (r RestorePointResource) template(data acceptance.TestData) string { +func (r VirtualMachineRestorePointResource) template(data acceptance.TestData) string { return fmt.Sprintf(` resource "azurerm_resource_group" "test" { name = "acctestRG-Compute-%[1]d" @@ -194,7 +194,7 @@ resource "azurerm_linux_virtual_machine" "test" { } } -resource "azurerm_restore_point_collection" "test" { +resource "azurerm_virtual_machine_restore_point_collection" "test" { name = "acctestRPC-%[1]d" resource_group_name = azurerm_resource_group.test.name location = azurerm_linux_virtual_machine.test.location diff --git a/website/docs/r/restore_point.html.markdown b/website/docs/r/virtual_machine_restore_point.html.markdown similarity index 69% rename from website/docs/r/restore_point.html.markdown rename to website/docs/r/virtual_machine_restore_point.html.markdown index 18071fcee246..56615b51ea11 100644 --- a/website/docs/r/restore_point.html.markdown +++ b/website/docs/r/virtual_machine_restore_point.html.markdown @@ -1,14 +1,14 @@ --- subcategory: "Compute" layout: "azurerm" -page_title: "Azure Resource Manager: azurerm_restore_point" +page_title: "Azure Resource Manager: azurerm_virtual_machine_restore_point" description: |- - Manages a Restore Point Collection + Manages a Virtual Machine Restore Point. --- # azurerm_restore_point -Manages a Restore Point. +Manages a Virtual Machine Restore Point. ## Example Usage @@ -76,14 +76,14 @@ resource "azurerm_linux_virtual_machine" "example" { } } -resource "azurerm_restore_point_collection" "example" { +resource "azurerm_virtual_machine_restore_point_collection" "example" { name = "example-collection" resource_group_name = azurerm_resource_group.example.name location = azurerm_linux_virtual_machine.example.location source_virtual_machine_id = azurerm_linux_virtual_machine.example.id } -resource "azurerm_restore_point" "example" { +resource "azurerm_virtual_machine_restore_point" "example" { name = "example-restore-point" restore_point_collection_id = azurerm_restore_point_collection.test.id } @@ -93,32 +93,32 @@ resource "azurerm_restore_point" "example" { The following arguments are supported: -* `name` - (Required) Specifies the name of the Restore Point. Changing this forces a new resource to be created. +* `name` - (Required) Specifies the name of the Virtual Machine Restore Point. Changing this forces a new resource to be created. -* `restore_point_collection_id` - (Required) Specifies the name of the Restore Point Collection the Restore Point will be associated with. Changing this forces a new resource to be created. +* `restore_point_collection_id` - (Required) Specifies the name of the Virtual Machine Restore Point Collection the Virtual Machine Restore Point will be associated with. Changing this forces a new resource to be created. -* `crash_consistency_mode_enabled` - (Optional) Is Crash Consistent the Consistency Mode of the Restore Point. Defaults to `false`. Changing this forces a new resource to be created. +* `crash_consistency_mode_enabled` - (Optional) Is Crash Consistent the Consistency Mode of the Virtual Machine Restore Point. Defaults to `false`. Changing this forces a new resource to be created. -* `excluded_disks` - (Optional) A list of disks that will be excluded from the Restore Point. Changing this forces a new resource to be created. +* `excluded_disks` - (Optional) A list of disks that will be excluded from the Virtual Machine Restore Point. Changing this forces a new resource to be created. ## Attributes Reference In addition to the Arguments listed above - the following Attributes are exported: -* `id` - The ID of the Restore Point. +* `id` - The ID of the Virtual Machine Restore Point. ## Timeouts The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: -* `create` - (Defaults to 30 minutes) Used when creating the Restore Point. -* `update` - (Defaults to 30 minutes) Used when updating the Restore Point. -* `delete` - (Defaults to 30 minutes) Used when deleting the Restore Point. -* `read` - (Defaults to 5 minutes) Used when retrieving the Restore Point. +* `create` - (Defaults to 30 minutes) Used when creating the Virtual Machine Restore Point. +* `update` - (Defaults to 30 minutes) Used when updating the Virtual Machine Restore Point. +* `delete` - (Defaults to 30 minutes) Used when deleting the Virtual Machine Restore Point. +* `read` - (Defaults to 5 minutes) Used when retrieving the Virtual Machine Restore Point. ## Import -Restore Point can be imported using the `resource id`, e.g. +Virtual Machine Restore Point can be imported using the `resource id`, e.g. ```shell terraform import azurerm_restore_point.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Compute/restorePointCollections/collection1/restorePoints/restorePoint1 diff --git a/website/docs/r/restore_point_collection.html.markdown b/website/docs/r/virtual_machine_restore_point_collection.html.markdown similarity index 61% rename from website/docs/r/restore_point_collection.html.markdown rename to website/docs/r/virtual_machine_restore_point_collection.html.markdown index 4872ec418f71..8f84f5cabe35 100644 --- a/website/docs/r/restore_point_collection.html.markdown +++ b/website/docs/r/virtual_machine_restore_point_collection.html.markdown @@ -1,14 +1,14 @@ --- subcategory: "Compute" layout: "azurerm" -page_title: "Azure Resource Manager: azurerm_restore_point_collection" +page_title: "Azure Resource Manager: azurerm_virtual_machine_restore_point_collection" description: |- - Manages a Restore Point Collection + Manages a Virtual Machine Restore Point Collection --- -# azurerm_restore_point_collection +# azurerm_virtual_machine_restore_point_collection -Manages a Restore Point Collection. +Manages a Virtual Machine Restore Point Collection. ## Example Usage @@ -76,7 +76,7 @@ resource "azurerm_linux_virtual_machine" "example" { } } -resource "azurerm_restore_point_collection" "example" { +resource "azurerm_virtual_machine_restore_point_collection" "example" { name = "example-collection" resource_group_name = azurerm_resource_group.example.name location = azurerm_linux_virtual_machine.example.location @@ -88,36 +88,36 @@ resource "azurerm_restore_point_collection" "example" { The following arguments are supported: -* `name` - (Required) Specifies the name of the Restore Point Collection. Changing this forces a new resource to be created. +* `name` - (Required) Specifies the name of the Virtual Machine Restore Point Collection. Changing this forces a new resource to be created. -* `location` - (Required) The Azure location where the Restore Point Collection should exist. Changing this forces a new resource to be created. +* `location` - (Required) The Azure location where the Virtual Machine Restore Point Collection should exist. Changing this forces a new resource to be created. -* `resource_group_name` - (Required) The name of the Resource Group in which the Restore Point Collection should exist. Changing this forces a new resource to be created. +* `resource_group_name` - (Required) The name of the Resource Group in which the Virtual Machine Restore Point Collection should exist. Changing this forces a new resource to be created. -* `source_virtual_machine_id` - (Required) The ID of the virtual machine that will be associated with this Restore Point Collection. Changing this forces a new resource to be created. +* `source_virtual_machine_id` - (Required) The ID of the virtual machine that will be associated with this Virtual Machine Restore Point Collection. Changing this forces a new resource to be created. -* `tags` - (Optional) A mapping of tags which should be assigned to this Restore Point Collection. +* `tags` - (Optional) A mapping of tags which should be assigned to this Virtual Machine Restore Point Collection. ## Attributes Reference In addition to the Arguments listed above - the following Attributes are exported: -* `id` - The ID of the Restore Point Collection. +* `id` - The ID of the Virtual Machine Restore Point Collection. ## Timeouts The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: -* `create` - (Defaults to 30 minutes) Used when creating the Restore Point Collection. -* `update` - (Defaults to 30 minutes) Used when updating the Restore Point Collection. -* `delete` - (Defaults to 30 minutes) Used when deleting the Restore Point Collection. -* `read` - (Defaults to 5 minutes) Used when retrieving the Restore Point Collection. +* `create` - (Defaults to 30 minutes) Used when creating the Virtual Machine Restore Point Collection. +* `update` - (Defaults to 30 minutes) Used when updating the Virtual Machine Restore Point Collection. +* `delete` - (Defaults to 30 minutes) Used when deleting the Virtual Machine Restore Point Collection. +* `read` - (Defaults to 5 minutes) Used when retrieving the Virtual Machine Restore Point Collection. ## Import -Restore Point Collections can be imported using the `resource id`, e.g. +Virtual Machine Restore Point Collections can be imported using the `resource id`, e.g. ```shell -terraform import azurerm_restore_point_collection.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Compute/restorePointCollections/collection1 +terraform import azurerm_virtual_machine_restore_point_collection.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Compute/restorePointCollections/collection1 ```