From d14a4a0146145e982eac41b2a611b95a0f127efe Mon Sep 17 00:00:00 2001 From: Zhenhua Hu Date: Tue, 5 Sep 2023 13:25:46 +0800 Subject: [PATCH 1/2] update api version --- internal/services/compute/client/client.go | 2 +- .../services/compute/disk_encryption_set.go | 2 +- .../compute/disk_sas_token_resource.go | 2 +- .../compute/disk_sas_token_resource_test.go | 2 +- .../services/compute/encryption_settings.go | 2 +- internal/services/compute/image_resource.go | 2 +- .../compute/linux_virtual_machine_resource.go | 2 +- .../compute/managed_disk_data_source.go | 2 +- .../services/compute/managed_disk_resource.go | 2 +- .../compute/managed_disk_resource_test.go | 2 +- .../migration/managed_disk_v0_to_v1.go | 2 +- .../services/compute/no_downtime_resize.go | 2 +- internal/services/compute/virtual_machine.go | 2 +- ...l_machine_data_disk_attachment_resource.go | 2 +- .../windows_virtual_machine_resource.go | 2 +- ...rotection_backup_instance_disk_resource.go | 2 +- .../disk_pool_iscsi_target_lun_resource.go | 2 +- ...k_pool_managed_disk_attachment_resource.go | 2 +- .../disk_pool_managed_disk_attachment.go | 2 +- .../disk_pool_managed_disk_attachment_test.go | 2 +- .../services/disks/parse/iscsitarget_lun.go | 2 +- .../disks/parse/iscsitarget_lun_test.go | 2 +- .../legacy/virtual_machine_resource.go | 2 +- .../legacy/virtual_machine_resource_test.go | 2 +- .../site_recovery_replicated_vm_resource.go | 2 +- .../compute/2023-04-02/disks/README.md | 145 ++++ .../compute/2023-04-02/disks/client.go | 26 + .../compute/2023-04-02/disks/constants.go | 618 ++++++++++++++++++ .../compute/2023-04-02/disks/id_disk.go | 127 ++++ .../2023-04-02/disks/method_createorupdate.go | 74 +++ .../compute/2023-04-02/disks/method_delete.go | 71 ++ .../compute/2023-04-02/disks/method_get.go | 51 ++ .../2023-04-02/disks/method_grantaccess.go | 74 +++ .../compute/2023-04-02/disks/method_list.go | 90 +++ .../disks/method_listbyresourcegroup.go | 90 +++ .../2023-04-02/disks/method_revokeaccess.go | 70 ++ .../compute/2023-04-02/disks/method_update.go | 74 +++ .../2023-04-02/disks/model_accessuri.go | 9 + .../2023-04-02/disks/model_creationdata.go | 19 + .../compute/2023-04-02/disks/model_disk.go | 23 + .../2023-04-02/disks/model_diskproperties.go | 81 +++ .../disks/model_disksecurityprofile.go | 9 + .../compute/2023-04-02/disks/model_disksku.go | 9 + .../2023-04-02/disks/model_diskupdate.go | 10 + .../disks/model_diskupdateproperties.go | 27 + .../2023-04-02/disks/model_encryption.go | 9 + .../model_encryptionsettingscollection.go | 10 + .../disks/model_encryptionsettingselement.go | 9 + .../2023-04-02/disks/model_grantaccessdata.go | 11 + .../disks/model_imagediskreference.go | 11 + .../disks/model_keyvaultandkeyreference.go | 9 + .../disks/model_keyvaultandsecretreference.go | 9 + .../disks/model_propertyupdatesinprogress.go | 8 + .../2023-04-02/disks/model_purchaseplan.go | 11 + .../disks/model_shareinfoelement.go | 8 + .../2023-04-02/disks/model_sourcevault.go | 8 + .../disks/model_supportedcapabilities.go | 10 + .../compute/2023-04-02/disks/predicates.go | 37 ++ .../compute/2023-04-02/disks/version.go | 12 + vendor/modules.txt | 2 +- 60 files changed, 1885 insertions(+), 26 deletions(-) create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/id_disk.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/method_createorupdate.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/method_delete.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/method_get.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/method_grantaccess.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/method_list.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/method_listbyresourcegroup.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/method_revokeaccess.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/method_update.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_accessuri.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_creationdata.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_disk.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_diskproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_disksecurityprofile.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_disksku.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_diskupdate.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_diskupdateproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_encryption.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_encryptionsettingscollection.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_encryptionsettingselement.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_grantaccessdata.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_imagediskreference.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_keyvaultandkeyreference.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_keyvaultandsecretreference.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_propertyupdatesinprogress.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_purchaseplan.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_shareinfoelement.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_sourcevault.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_supportedcapabilities.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/predicates.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/version.go diff --git a/internal/services/compute/client/client.go b/internal/services/compute/client/client.go index d0e33a8ea1ac..33030a1779ba 100644 --- a/internal/services/compute/client/client.go +++ b/internal/services/compute/client/client.go @@ -21,12 +21,12 @@ import ( "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-01/proximityplacementgroups" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/diskaccesses" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/diskencryptionsets" - "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/snapshots" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-03/galleries" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-03/galleryapplications" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-03/galleryapplicationversions" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-03/gallerysharingupdate" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks" "github.com/hashicorp/go-azure-sdk/resource-manager/marketplaceordering/2015-06-01/agreements" "github.com/hashicorp/terraform-provider-azurerm/internal/common" "github.com/hashicorp/terraform-provider-azurerm/internal/services/compute/parse" diff --git a/internal/services/compute/disk_encryption_set.go b/internal/services/compute/disk_encryption_set.go index 4ae2dbf3385a..c0f4c94c4e82 100644 --- a/internal/services/compute/disk_encryption_set.go +++ b/internal/services/compute/disk_encryption_set.go @@ -8,7 +8,7 @@ import ( "fmt" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/diskencryptionsets" - "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks" ) // retrieveDiskEncryptionSetEncryptionType returns encryption type of the disk encryption set diff --git a/internal/services/compute/disk_sas_token_resource.go b/internal/services/compute/disk_sas_token_resource.go index 089a32b0d3fe..2430a0950679 100644 --- a/internal/services/compute/disk_sas_token_resource.go +++ b/internal/services/compute/disk_sas_token_resource.go @@ -8,7 +8,7 @@ import ( "log" "time" - "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" diff --git a/internal/services/compute/disk_sas_token_resource_test.go b/internal/services/compute/disk_sas_token_resource_test.go index 88eaebb58388..2c393e009bc0 100644 --- a/internal/services/compute/disk_sas_token_resource_test.go +++ b/internal/services/compute/disk_sas_token_resource_test.go @@ -8,7 +8,7 @@ import ( "fmt" "testing" - "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks" "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" diff --git a/internal/services/compute/encryption_settings.go b/internal/services/compute/encryption_settings.go index d4701e154716..1bf0254552f1 100644 --- a/internal/services/compute/encryption_settings.go +++ b/internal/services/compute/encryption_settings.go @@ -4,8 +4,8 @@ package compute import ( - "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/snapshots" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks" "github.com/hashicorp/terraform-provider-azurerm/internal/features" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/utils" diff --git a/internal/services/compute/image_resource.go b/internal/services/compute/image_resource.go index 054c34331834..e7df3da38de8 100644 --- a/internal/services/compute/image_resource.go +++ b/internal/services/compute/image_resource.go @@ -13,7 +13,7 @@ import ( "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/2022-03-01/images" - "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/compute/validate" diff --git a/internal/services/compute/linux_virtual_machine_resource.go b/internal/services/compute/linux_virtual_machine_resource.go index 72cd33b9e643..f33b4569c80a 100644 --- a/internal/services/compute/linux_virtual_machine_resource.go +++ b/internal/services/compute/linux_virtual_machine_resource.go @@ -19,7 +19,7 @@ import ( "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-01/capacityreservationgroups" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-01/images" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-01/proximityplacementgroups" - "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" azValidate "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" diff --git a/internal/services/compute/managed_disk_data_source.go b/internal/services/compute/managed_disk_data_source.go index 3fc142b41a96..d36e8da82ced 100644 --- a/internal/services/compute/managed_disk_data_source.go +++ b/internal/services/compute/managed_disk_data_source.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" "github.com/hashicorp/go-azure-helpers/resourcemanager/zones" - "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" diff --git a/internal/services/compute/managed_disk_resource.go b/internal/services/compute/managed_disk_resource.go index f5c2602fc544..4ad87811a1fb 100644 --- a/internal/services/compute/managed_disk_resource.go +++ b/internal/services/compute/managed_disk_resource.go @@ -17,7 +17,7 @@ import ( "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/2022-03-02/diskaccesses" - "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/compute/managed_disk_resource_test.go b/internal/services/compute/managed_disk_resource_test.go index e45f15a2b1ce..9604dacc4a82 100644 --- a/internal/services/compute/managed_disk_resource_test.go +++ b/internal/services/compute/managed_disk_resource_test.go @@ -10,7 +10,7 @@ import ( "testing" "time" - "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks" "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" diff --git a/internal/services/compute/migration/managed_disk_v0_to_v1.go b/internal/services/compute/migration/managed_disk_v0_to_v1.go index bbfc3beb7149..82b0224dcd9c 100644 --- a/internal/services/compute/migration/managed_disk_v0_to_v1.go +++ b/internal/services/compute/migration/managed_disk_v0_to_v1.go @@ -7,7 +7,7 @@ import ( "context" "log" - "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" ) diff --git a/internal/services/compute/no_downtime_resize.go b/internal/services/compute/no_downtime_resize.go index 5e951b2691e7..f7125a4f9018 100644 --- a/internal/services/compute/no_downtime_resize.go +++ b/internal/services/compute/no_downtime_resize.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-07-01/skus" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2021-11-01/virtualmachines" - "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks" ) // The logic on this file is based on: diff --git a/internal/services/compute/virtual_machine.go b/internal/services/compute/virtual_machine.go index c111f1d09e70..64e935f6313b 100644 --- a/internal/services/compute/virtual_machine.go +++ b/internal/services/compute/virtual_machine.go @@ -9,8 +9,8 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" - "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-03/galleryapplicationversions" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks" azValidate "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/services/compute/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" diff --git a/internal/services/compute/virtual_machine_data_disk_attachment_resource.go b/internal/services/compute/virtual_machine_data_disk_attachment_resource.go index eebddfe24fd2..53355ab94ab2 100644 --- a/internal/services/compute/virtual_machine_data_disk_attachment_resource.go +++ b/internal/services/compute/virtual_machine_data_disk_attachment_resource.go @@ -9,7 +9,7 @@ import ( "time" "github.com/hashicorp/go-azure-helpers/lang/response" - "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/locks" diff --git a/internal/services/compute/windows_virtual_machine_resource.go b/internal/services/compute/windows_virtual_machine_resource.go index c869e0a5c26a..6d379077a861 100644 --- a/internal/services/compute/windows_virtual_machine_resource.go +++ b/internal/services/compute/windows_virtual_machine_resource.go @@ -20,7 +20,7 @@ import ( "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-01/capacityreservationgroups" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-01/images" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-01/proximityplacementgroups" - "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" azValidate "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" diff --git a/internal/services/dataprotection/data_protection_backup_instance_disk_resource.go b/internal/services/dataprotection/data_protection_backup_instance_disk_resource.go index ba1bdf68f060..6bcab8333bba 100644 --- a/internal/services/dataprotection/data_protection_backup_instance_disk_resource.go +++ b/internal/services/dataprotection/data_protection_backup_instance_disk_resource.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/go-azure-helpers/lang/response" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" - "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks" "github.com/hashicorp/go-azure-sdk/resource-manager/dataprotection/2022-04-01/backupinstances" "github.com/hashicorp/go-azure-sdk/resource-manager/dataprotection/2022-04-01/backuppolicies" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" diff --git a/internal/services/disks/disk_pool_iscsi_target_lun_resource.go b/internal/services/disks/disk_pool_iscsi_target_lun_resource.go index 49369686fb37..f1ca6045eec3 100644 --- a/internal/services/disks/disk_pool_iscsi_target_lun_resource.go +++ b/internal/services/disks/disk_pool_iscsi_target_lun_resource.go @@ -12,7 +12,7 @@ import ( "time" "github.com/hashicorp/go-azure-helpers/lang/response" - "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks" "github.com/hashicorp/go-azure-sdk/resource-manager/storagepool/2021-08-01/diskpools" "github.com/hashicorp/go-azure-sdk/resource-manager/storagepool/2021-08-01/iscsitargets" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" diff --git a/internal/services/disks/disk_pool_managed_disk_attachment_resource.go b/internal/services/disks/disk_pool_managed_disk_attachment_resource.go index ce84d7e8e670..4ac92c0c3b66 100644 --- a/internal/services/disks/disk_pool_managed_disk_attachment_resource.go +++ b/internal/services/disks/disk_pool_managed_disk_attachment_resource.go @@ -9,7 +9,7 @@ import ( "time" "github.com/hashicorp/go-azure-helpers/lang/response" - "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks" "github.com/hashicorp/go-azure-sdk/resource-manager/storagepool/2021-08-01/diskpools" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-provider-azurerm/internal/locks" diff --git a/internal/services/disks/parse/disk_pool_managed_disk_attachment.go b/internal/services/disks/parse/disk_pool_managed_disk_attachment.go index bc446c47a1d9..09b53334ad8e 100644 --- a/internal/services/disks/parse/disk_pool_managed_disk_attachment.go +++ b/internal/services/disks/parse/disk_pool_managed_disk_attachment.go @@ -8,7 +8,7 @@ import ( "strings" "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" - "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks" "github.com/hashicorp/go-azure-sdk/resource-manager/storagepool/2021-08-01/diskpools" ) diff --git a/internal/services/disks/parse/disk_pool_managed_disk_attachment_test.go b/internal/services/disks/parse/disk_pool_managed_disk_attachment_test.go index d397281f4177..98626bb5a14f 100644 --- a/internal/services/disks/parse/disk_pool_managed_disk_attachment_test.go +++ b/internal/services/disks/parse/disk_pool_managed_disk_attachment_test.go @@ -6,7 +6,7 @@ package parse import ( "testing" - "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks" "github.com/hashicorp/go-azure-sdk/resource-manager/storagepool/2021-08-01/diskpools" ) diff --git a/internal/services/disks/parse/iscsitarget_lun.go b/internal/services/disks/parse/iscsitarget_lun.go index 0a3a25491047..97198db7e8b0 100644 --- a/internal/services/disks/parse/iscsitarget_lun.go +++ b/internal/services/disks/parse/iscsitarget_lun.go @@ -8,7 +8,7 @@ import ( "strings" "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" - "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks" "github.com/hashicorp/go-azure-sdk/resource-manager/storagepool/2021-08-01/iscsitargets" ) diff --git a/internal/services/disks/parse/iscsitarget_lun_test.go b/internal/services/disks/parse/iscsitarget_lun_test.go index d2338ab801a4..508bd8db4354 100644 --- a/internal/services/disks/parse/iscsitarget_lun_test.go +++ b/internal/services/disks/parse/iscsitarget_lun_test.go @@ -6,7 +6,7 @@ package parse import ( "testing" - "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks" "github.com/hashicorp/go-azure-sdk/resource-manager/storagepool/2021-08-01/iscsitargets" ) diff --git a/internal/services/legacy/virtual_machine_resource.go b/internal/services/legacy/virtual_machine_resource.go index a61fc122fc17..61884507983c 100644 --- a/internal/services/legacy/virtual_machine_resource.go +++ b/internal/services/legacy/virtual_machine_resource.go @@ -14,7 +14,7 @@ import ( "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" - "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/legacy/virtual_machine_resource_test.go b/internal/services/legacy/virtual_machine_resource_test.go index 3f151eda08b8..6ecf7696c668 100644 --- a/internal/services/legacy/virtual_machine_resource_test.go +++ b/internal/services/legacy/virtual_machine_resource_test.go @@ -8,7 +8,7 @@ import ( "fmt" "testing" - "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks" "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" diff --git a/internal/services/recoveryservices/site_recovery_replicated_vm_resource.go b/internal/services/recoveryservices/site_recovery_replicated_vm_resource.go index 7bad070cafec..4c8e6d5d3737 100644 --- a/internal/services/recoveryservices/site_recovery_replicated_vm_resource.go +++ b/internal/services/recoveryservices/site_recovery_replicated_vm_resource.go @@ -22,7 +22,7 @@ import ( "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-01/capacityreservationgroups" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-01/proximityplacementgroups" "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/diskencryptionsets" - "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks" + "github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks" "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservicessiterecovery/2022-10-01/replicationfabrics" "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservicessiterecovery/2022-10-01/replicationpolicies" "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservicessiterecovery/2022-10-01/replicationprotecteditems" diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/README.md new file mode 100644 index 000000000000..0b2841c6791d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/README.md @@ -0,0 +1,145 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks` Documentation + +The `disks` SDK allows for interaction with the Azure Resource Manager Service `compute` (API Version `2023-04-02`). + +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/2023-04-02/disks" +``` + + +### Client Initialization + +```go +client := disks.NewDisksClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `DisksClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := disks.NewDiskID("12345678-1234-9876-4563-123456789012", "example-resource-group", "diskValue") + +payload := disks.Disk{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `DisksClient.Delete` + +```go +ctx := context.TODO() +id := disks.NewDiskID("12345678-1234-9876-4563-123456789012", "example-resource-group", "diskValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `DisksClient.Get` + +```go +ctx := context.TODO() +id := disks.NewDiskID("12345678-1234-9876-4563-123456789012", "example-resource-group", "diskValue") + +read, err := client.Get(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `DisksClient.GrantAccess` + +```go +ctx := context.TODO() +id := disks.NewDiskID("12345678-1234-9876-4563-123456789012", "example-resource-group", "diskValue") + +payload := disks.GrantAccessData{ + // ... +} + + +if err := client.GrantAccessThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `DisksClient.List` + +```go +ctx := context.TODO() +id := disks.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// 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: `DisksClient.ListByResourceGroup` + +```go +ctx := context.TODO() +id := disks.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// alternatively `client.ListByResourceGroup(ctx, id)` can be used to do batched pagination +items, err := client.ListByResourceGroupComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `DisksClient.RevokeAccess` + +```go +ctx := context.TODO() +id := disks.NewDiskID("12345678-1234-9876-4563-123456789012", "example-resource-group", "diskValue") + +if err := client.RevokeAccessThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `DisksClient.Update` + +```go +ctx := context.TODO() +id := disks.NewDiskID("12345678-1234-9876-4563-123456789012", "example-resource-group", "diskValue") + +payload := disks.DiskUpdate{ + // ... +} + + +if err := client.UpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/client.go new file mode 100644 index 000000000000..16f70b8378d0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/client.go @@ -0,0 +1,26 @@ +package disks + +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 DisksClient struct { + Client *resourcemanager.Client +} + +func NewDisksClientWithBaseURI(sdkApi sdkEnv.Api) (*DisksClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "disks", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating DisksClient: %+v", err) + } + + return &DisksClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/constants.go new file mode 100644 index 000000000000..c4e76da34ef4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/constants.go @@ -0,0 +1,618 @@ +package disks + +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 AccessLevel string + +const ( + AccessLevelNone AccessLevel = "None" + AccessLevelRead AccessLevel = "Read" + AccessLevelWrite AccessLevel = "Write" +) + +func PossibleValuesForAccessLevel() []string { + return []string{ + string(AccessLevelNone), + string(AccessLevelRead), + string(AccessLevelWrite), + } +} + +func (s *AccessLevel) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAccessLevel(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAccessLevel(input string) (*AccessLevel, error) { + vals := map[string]AccessLevel{ + "none": AccessLevelNone, + "read": AccessLevelRead, + "write": AccessLevelWrite, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AccessLevel(input) + return &out, nil +} + +type Architecture string + +const ( + ArchitectureArmSixFour Architecture = "Arm64" + ArchitectureXSixFour Architecture = "x64" +) + +func PossibleValuesForArchitecture() []string { + return []string{ + string(ArchitectureArmSixFour), + string(ArchitectureXSixFour), + } +} + +func (s *Architecture) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseArchitecture(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseArchitecture(input string) (*Architecture, error) { + vals := map[string]Architecture{ + "arm64": ArchitectureArmSixFour, + "x64": ArchitectureXSixFour, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := Architecture(input) + return &out, nil +} + +type DataAccessAuthMode string + +const ( + DataAccessAuthModeAzureActiveDirectory DataAccessAuthMode = "AzureActiveDirectory" + DataAccessAuthModeNone DataAccessAuthMode = "None" +) + +func PossibleValuesForDataAccessAuthMode() []string { + return []string{ + string(DataAccessAuthModeAzureActiveDirectory), + string(DataAccessAuthModeNone), + } +} + +func (s *DataAccessAuthMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDataAccessAuthMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDataAccessAuthMode(input string) (*DataAccessAuthMode, error) { + vals := map[string]DataAccessAuthMode{ + "azureactivedirectory": DataAccessAuthModeAzureActiveDirectory, + "none": DataAccessAuthModeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DataAccessAuthMode(input) + return &out, nil +} + +type DiskCreateOption string + +const ( + DiskCreateOptionAttach DiskCreateOption = "Attach" + DiskCreateOptionCopy DiskCreateOption = "Copy" + DiskCreateOptionCopyFromSanSnapshot DiskCreateOption = "CopyFromSanSnapshot" + DiskCreateOptionCopyStart DiskCreateOption = "CopyStart" + DiskCreateOptionEmpty DiskCreateOption = "Empty" + DiskCreateOptionFromImage DiskCreateOption = "FromImage" + DiskCreateOptionImport DiskCreateOption = "Import" + DiskCreateOptionImportSecure DiskCreateOption = "ImportSecure" + DiskCreateOptionRestore DiskCreateOption = "Restore" + DiskCreateOptionUpload DiskCreateOption = "Upload" + DiskCreateOptionUploadPreparedSecure DiskCreateOption = "UploadPreparedSecure" +) + +func PossibleValuesForDiskCreateOption() []string { + return []string{ + string(DiskCreateOptionAttach), + string(DiskCreateOptionCopy), + string(DiskCreateOptionCopyFromSanSnapshot), + string(DiskCreateOptionCopyStart), + string(DiskCreateOptionEmpty), + string(DiskCreateOptionFromImage), + string(DiskCreateOptionImport), + string(DiskCreateOptionImportSecure), + string(DiskCreateOptionRestore), + string(DiskCreateOptionUpload), + string(DiskCreateOptionUploadPreparedSecure), + } +} + +func (s *DiskCreateOption) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDiskCreateOption(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDiskCreateOption(input string) (*DiskCreateOption, error) { + vals := map[string]DiskCreateOption{ + "attach": DiskCreateOptionAttach, + "copy": DiskCreateOptionCopy, + "copyfromsansnapshot": DiskCreateOptionCopyFromSanSnapshot, + "copystart": DiskCreateOptionCopyStart, + "empty": DiskCreateOptionEmpty, + "fromimage": DiskCreateOptionFromImage, + "import": DiskCreateOptionImport, + "importsecure": DiskCreateOptionImportSecure, + "restore": DiskCreateOptionRestore, + "upload": DiskCreateOptionUpload, + "uploadpreparedsecure": DiskCreateOptionUploadPreparedSecure, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DiskCreateOption(input) + return &out, nil +} + +type DiskSecurityTypes string + +const ( + DiskSecurityTypesConfidentialVMDiskEncryptedWithCustomerKey DiskSecurityTypes = "ConfidentialVM_DiskEncryptedWithCustomerKey" + DiskSecurityTypesConfidentialVMDiskEncryptedWithPlatformKey DiskSecurityTypes = "ConfidentialVM_DiskEncryptedWithPlatformKey" + DiskSecurityTypesConfidentialVMVMGuestStateOnlyEncryptedWithPlatformKey DiskSecurityTypes = "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey" + DiskSecurityTypesTrustedLaunch DiskSecurityTypes = "TrustedLaunch" +) + +func PossibleValuesForDiskSecurityTypes() []string { + return []string{ + string(DiskSecurityTypesConfidentialVMDiskEncryptedWithCustomerKey), + string(DiskSecurityTypesConfidentialVMDiskEncryptedWithPlatformKey), + string(DiskSecurityTypesConfidentialVMVMGuestStateOnlyEncryptedWithPlatformKey), + string(DiskSecurityTypesTrustedLaunch), + } +} + +func (s *DiskSecurityTypes) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDiskSecurityTypes(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDiskSecurityTypes(input string) (*DiskSecurityTypes, error) { + vals := map[string]DiskSecurityTypes{ + "confidentialvm_diskencryptedwithcustomerkey": DiskSecurityTypesConfidentialVMDiskEncryptedWithCustomerKey, + "confidentialvm_diskencryptedwithplatformkey": DiskSecurityTypesConfidentialVMDiskEncryptedWithPlatformKey, + "confidentialvm_vmgueststateonlyencryptedwithplatformkey": DiskSecurityTypesConfidentialVMVMGuestStateOnlyEncryptedWithPlatformKey, + "trustedlaunch": DiskSecurityTypesTrustedLaunch, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DiskSecurityTypes(input) + return &out, nil +} + +type DiskState string + +const ( + DiskStateActiveSAS DiskState = "ActiveSAS" + DiskStateActiveSASFrozen DiskState = "ActiveSASFrozen" + DiskStateActiveUpload DiskState = "ActiveUpload" + DiskStateAttached DiskState = "Attached" + DiskStateFrozen DiskState = "Frozen" + DiskStateReadyToUpload DiskState = "ReadyToUpload" + DiskStateReserved DiskState = "Reserved" + DiskStateUnattached DiskState = "Unattached" +) + +func PossibleValuesForDiskState() []string { + return []string{ + string(DiskStateActiveSAS), + string(DiskStateActiveSASFrozen), + string(DiskStateActiveUpload), + string(DiskStateAttached), + string(DiskStateFrozen), + string(DiskStateReadyToUpload), + string(DiskStateReserved), + string(DiskStateUnattached), + } +} + +func (s *DiskState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDiskState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDiskState(input string) (*DiskState, error) { + vals := map[string]DiskState{ + "activesas": DiskStateActiveSAS, + "activesasfrozen": DiskStateActiveSASFrozen, + "activeupload": DiskStateActiveUpload, + "attached": DiskStateAttached, + "frozen": DiskStateFrozen, + "readytoupload": DiskStateReadyToUpload, + "reserved": DiskStateReserved, + "unattached": DiskStateUnattached, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DiskState(input) + return &out, nil +} + +type DiskStorageAccountTypes string + +const ( + DiskStorageAccountTypesPremiumLRS DiskStorageAccountTypes = "Premium_LRS" + DiskStorageAccountTypesPremiumVTwoLRS DiskStorageAccountTypes = "PremiumV2_LRS" + DiskStorageAccountTypesPremiumZRS DiskStorageAccountTypes = "Premium_ZRS" + DiskStorageAccountTypesStandardLRS DiskStorageAccountTypes = "Standard_LRS" + DiskStorageAccountTypesStandardSSDLRS DiskStorageAccountTypes = "StandardSSD_LRS" + DiskStorageAccountTypesStandardSSDZRS DiskStorageAccountTypes = "StandardSSD_ZRS" + DiskStorageAccountTypesUltraSSDLRS DiskStorageAccountTypes = "UltraSSD_LRS" +) + +func PossibleValuesForDiskStorageAccountTypes() []string { + return []string{ + string(DiskStorageAccountTypesPremiumLRS), + string(DiskStorageAccountTypesPremiumVTwoLRS), + string(DiskStorageAccountTypesPremiumZRS), + string(DiskStorageAccountTypesStandardLRS), + string(DiskStorageAccountTypesStandardSSDLRS), + string(DiskStorageAccountTypesStandardSSDZRS), + string(DiskStorageAccountTypesUltraSSDLRS), + } +} + +func (s *DiskStorageAccountTypes) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDiskStorageAccountTypes(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDiskStorageAccountTypes(input string) (*DiskStorageAccountTypes, error) { + vals := map[string]DiskStorageAccountTypes{ + "premium_lrs": DiskStorageAccountTypesPremiumLRS, + "premiumv2_lrs": DiskStorageAccountTypesPremiumVTwoLRS, + "premium_zrs": DiskStorageAccountTypesPremiumZRS, + "standard_lrs": DiskStorageAccountTypesStandardLRS, + "standardssd_lrs": DiskStorageAccountTypesStandardSSDLRS, + "standardssd_zrs": DiskStorageAccountTypesStandardSSDZRS, + "ultrassd_lrs": DiskStorageAccountTypesUltraSSDLRS, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DiskStorageAccountTypes(input) + return &out, nil +} + +type EncryptionType string + +const ( + EncryptionTypeEncryptionAtRestWithCustomerKey EncryptionType = "EncryptionAtRestWithCustomerKey" + EncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys EncryptionType = "EncryptionAtRestWithPlatformAndCustomerKeys" + EncryptionTypeEncryptionAtRestWithPlatformKey EncryptionType = "EncryptionAtRestWithPlatformKey" +) + +func PossibleValuesForEncryptionType() []string { + return []string{ + string(EncryptionTypeEncryptionAtRestWithCustomerKey), + string(EncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys), + string(EncryptionTypeEncryptionAtRestWithPlatformKey), + } +} + +func (s *EncryptionType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseEncryptionType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseEncryptionType(input string) (*EncryptionType, error) { + vals := map[string]EncryptionType{ + "encryptionatrestwithcustomerkey": EncryptionTypeEncryptionAtRestWithCustomerKey, + "encryptionatrestwithplatformandcustomerkeys": EncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys, + "encryptionatrestwithplatformkey": EncryptionTypeEncryptionAtRestWithPlatformKey, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := EncryptionType(input) + return &out, nil +} + +type FileFormat string + +const ( + FileFormatVHD FileFormat = "VHD" + FileFormatVHDX FileFormat = "VHDX" +) + +func PossibleValuesForFileFormat() []string { + return []string{ + string(FileFormatVHD), + string(FileFormatVHDX), + } +} + +func (s *FileFormat) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFileFormat(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFileFormat(input string) (*FileFormat, error) { + vals := map[string]FileFormat{ + "vhd": FileFormatVHD, + "vhdx": FileFormatVHDX, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FileFormat(input) + return &out, nil +} + +type HyperVGeneration string + +const ( + HyperVGenerationVOne HyperVGeneration = "V1" + HyperVGenerationVTwo HyperVGeneration = "V2" +) + +func PossibleValuesForHyperVGeneration() []string { + return []string{ + string(HyperVGenerationVOne), + string(HyperVGenerationVTwo), + } +} + +func (s *HyperVGeneration) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseHyperVGeneration(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseHyperVGeneration(input string) (*HyperVGeneration, error) { + vals := map[string]HyperVGeneration{ + "v1": HyperVGenerationVOne, + "v2": HyperVGenerationVTwo, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := HyperVGeneration(input) + return &out, nil +} + +type NetworkAccessPolicy string + +const ( + NetworkAccessPolicyAllowAll NetworkAccessPolicy = "AllowAll" + NetworkAccessPolicyAllowPrivate NetworkAccessPolicy = "AllowPrivate" + NetworkAccessPolicyDenyAll NetworkAccessPolicy = "DenyAll" +) + +func PossibleValuesForNetworkAccessPolicy() []string { + return []string{ + string(NetworkAccessPolicyAllowAll), + string(NetworkAccessPolicyAllowPrivate), + string(NetworkAccessPolicyDenyAll), + } +} + +func (s *NetworkAccessPolicy) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkAccessPolicy(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkAccessPolicy(input string) (*NetworkAccessPolicy, error) { + vals := map[string]NetworkAccessPolicy{ + "allowall": NetworkAccessPolicyAllowAll, + "allowprivate": NetworkAccessPolicyAllowPrivate, + "denyall": NetworkAccessPolicyDenyAll, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkAccessPolicy(input) + return &out, nil +} + +type OperatingSystemTypes string + +const ( + OperatingSystemTypesLinux OperatingSystemTypes = "Linux" + OperatingSystemTypesWindows OperatingSystemTypes = "Windows" +) + +func PossibleValuesForOperatingSystemTypes() []string { + return []string{ + string(OperatingSystemTypesLinux), + string(OperatingSystemTypesWindows), + } +} + +func (s *OperatingSystemTypes) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseOperatingSystemTypes(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseOperatingSystemTypes(input string) (*OperatingSystemTypes, error) { + vals := map[string]OperatingSystemTypes{ + "linux": OperatingSystemTypesLinux, + "windows": OperatingSystemTypesWindows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OperatingSystemTypes(input) + return &out, nil +} + +type PublicNetworkAccess string + +const ( + PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled" + PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" +) + +func PossibleValuesForPublicNetworkAccess() []string { + return []string{ + string(PublicNetworkAccessDisabled), + string(PublicNetworkAccessEnabled), + } +} + +func (s *PublicNetworkAccess) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicNetworkAccess(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicNetworkAccess(input string) (*PublicNetworkAccess, error) { + vals := map[string]PublicNetworkAccess{ + "disabled": PublicNetworkAccessDisabled, + "enabled": PublicNetworkAccessEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicNetworkAccess(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/id_disk.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/id_disk.go new file mode 100644 index 000000000000..3415c385da73 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/id_disk.go @@ -0,0 +1,127 @@ +package disks + +import ( + "fmt" + "strings" + + "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. + +var _ resourceids.ResourceId = DiskId{} + +// DiskId is a struct representing the Resource ID for a Disk +type DiskId struct { + SubscriptionId string + ResourceGroupName string + DiskName string +} + +// NewDiskID returns a new DiskId struct +func NewDiskID(subscriptionId string, resourceGroupName string, diskName string) DiskId { + return DiskId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + DiskName: diskName, + } +} + +// ParseDiskID parses 'input' into a DiskId +func ParseDiskID(input string) (*DiskId, error) { + parser := resourceids.NewParserFromResourceIdType(DiskId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := DiskId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.DiskName, ok = parsed.Parsed["diskName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "diskName", *parsed) + } + + return &id, nil +} + +// ParseDiskIDInsensitively parses 'input' case-insensitively into a DiskId +// note: this method should only be used for API response data and not user input +func ParseDiskIDInsensitively(input string) (*DiskId, error) { + parser := resourceids.NewParserFromResourceIdType(DiskId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := DiskId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.DiskName, ok = parsed.Parsed["diskName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "diskName", *parsed) + } + + return &id, nil +} + +// ValidateDiskID checks that 'input' can be parsed as a Disk ID +func ValidateDiskID(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 := ParseDiskID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Disk ID +func (id DiskId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/disks/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.DiskName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Disk ID +func (id DiskId) 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("staticDisks", "disks", "disks"), + resourceids.UserSpecifiedSegment("diskName", "diskValue"), + } +} + +// String returns a human-readable description of this Disk ID +func (id DiskId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Disk Name: %q", id.DiskName), + } + return fmt.Sprintf("Disk (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/method_createorupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/method_createorupdate.go new file mode 100644 index 000000000000..e8910088195e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/method_createorupdate.go @@ -0,0 +1,74 @@ +package disks + +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 CreateOrUpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// CreateOrUpdate ... +func (c DisksClient) CreateOrUpdate(ctx context.Context, id DiskId, input Disk) (result CreateOrUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + 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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed +func (c DisksClient) CreateOrUpdateThenPoll(ctx context.Context, id DiskId, input Disk) error { + result, err := c.CreateOrUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing CreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after CreateOrUpdate: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/method_delete.go new file mode 100644 index 000000000000..457d47557351 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/method_delete.go @@ -0,0 +1,71 @@ +package disks + +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 DisksClient) Delete(ctx context.Context, id DiskId) (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 DisksClient) DeleteThenPoll(ctx context.Context, id DiskId) 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/2023-04-02/disks/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/method_get.go new file mode 100644 index 000000000000..eac7035ae397 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/method_get.go @@ -0,0 +1,51 @@ +package disks + +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 GetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *Disk +} + +// Get ... +func (c DisksClient) Get(ctx context.Context, id DiskId) (result GetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + 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 + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/method_grantaccess.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/method_grantaccess.go new file mode 100644 index 000000000000..d449d3f69b07 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/method_grantaccess.go @@ -0,0 +1,74 @@ +package disks + +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 GrantAccessOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// GrantAccess ... +func (c DisksClient) GrantAccess(ctx context.Context, id DiskId, input GrantAccessData) (result GrantAccessOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/beginGetAccess", 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 +} + +// GrantAccessThenPoll performs GrantAccess then polls until it's completed +func (c DisksClient) GrantAccessThenPoll(ctx context.Context, id DiskId, input GrantAccessData) error { + result, err := c.GrantAccess(ctx, id, input) + if err != nil { + return fmt.Errorf("performing GrantAccess: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after GrantAccess: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/method_list.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/method_list.go new file mode 100644 index 000000000000..bf07939f4a73 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/method_list.go @@ -0,0 +1,90 @@ +package disks + +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 *[]Disk +} + +type ListCompleteResult struct { + Items []Disk +} + +// List ... +func (c DisksClient) List(ctx context.Context, id commonids.SubscriptionId) (result ListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.Compute/disks", 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 *[]Disk `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 DisksClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { + return c.ListCompleteMatchingPredicate(ctx, id, DiskOperationPredicate{}) +} + +// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c DisksClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate DiskOperationPredicate) (result ListCompleteResult, err error) { + items := make([]Disk, 0) + + resp, err := c.List(ctx, id) + if err != nil { + 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{ + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/method_listbyresourcegroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/method_listbyresourcegroup.go new file mode 100644 index 000000000000..6580da90af90 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/method_listbyresourcegroup.go @@ -0,0 +1,90 @@ +package disks + +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 ListByResourceGroupOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]Disk +} + +type ListByResourceGroupCompleteResult struct { + Items []Disk +} + +// ListByResourceGroup ... +func (c DisksClient) ListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (result ListByResourceGroupOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.Compute/disks", 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 *[]Disk `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListByResourceGroupComplete retrieves all the results into a single object +func (c DisksClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { + return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, DiskOperationPredicate{}) +} + +// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c DisksClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate DiskOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { + items := make([]Disk, 0) + + resp, err := c.ListByResourceGroup(ctx, id) + if err != nil { + 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 = ListByResourceGroupCompleteResult{ + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/method_revokeaccess.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/method_revokeaccess.go new file mode 100644 index 000000000000..05157936bb30 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/method_revokeaccess.go @@ -0,0 +1,70 @@ +package disks + +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 RevokeAccessOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// RevokeAccess ... +func (c DisksClient) RevokeAccess(ctx context.Context, id DiskId) (result RevokeAccessOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/endGetAccess", 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 +} + +// RevokeAccessThenPoll performs RevokeAccess then polls until it's completed +func (c DisksClient) RevokeAccessThenPoll(ctx context.Context, id DiskId) error { + result, err := c.RevokeAccess(ctx, id) + if err != nil { + return fmt.Errorf("performing RevokeAccess: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after RevokeAccess: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/method_update.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/method_update.go new file mode 100644 index 000000000000..b2ed6c8f6307 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/method_update.go @@ -0,0 +1,74 @@ +package disks + +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 UpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Update ... +func (c DisksClient) Update(ctx context.Context, id DiskId, input DiskUpdate) (result UpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + 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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// UpdateThenPoll performs Update then polls until it's completed +func (c DisksClient) UpdateThenPoll(ctx context.Context, id DiskId, input DiskUpdate) error { + result, err := c.Update(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Update: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Update: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_accessuri.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_accessuri.go new file mode 100644 index 000000000000..58d3760048f7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_accessuri.go @@ -0,0 +1,9 @@ +package disks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AccessUri struct { + AccessSAS *string `json:"accessSAS,omitempty"` + SecurityDataAccessSAS *string `json:"securityDataAccessSAS,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_creationdata.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_creationdata.go new file mode 100644 index 000000000000..9b0d6e448793 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_creationdata.go @@ -0,0 +1,19 @@ +package disks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreationData struct { + CreateOption DiskCreateOption `json:"createOption"` + ElasticSanResourceId *string `json:"elasticSanResourceId,omitempty"` + GalleryImageReference *ImageDiskReference `json:"galleryImageReference,omitempty"` + ImageReference *ImageDiskReference `json:"imageReference,omitempty"` + LogicalSectorSize *int64 `json:"logicalSectorSize,omitempty"` + PerformancePlus *bool `json:"performancePlus,omitempty"` + SecurityDataUri *string `json:"securityDataUri,omitempty"` + SourceResourceId *string `json:"sourceResourceId,omitempty"` + SourceUniqueId *string `json:"sourceUniqueId,omitempty"` + SourceUri *string `json:"sourceUri,omitempty"` + StorageAccountId *string `json:"storageAccountId,omitempty"` + UploadSizeBytes *int64 `json:"uploadSizeBytes,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_disk.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_disk.go new file mode 100644 index 000000000000..bcc52a8530b5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_disk.go @@ -0,0 +1,23 @@ +package disks + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" + "github.com/hashicorp/go-azure-helpers/resourcemanager/zones" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Disk struct { + ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` + Id *string `json:"id,omitempty"` + Location string `json:"location"` + ManagedBy *string `json:"managedBy,omitempty"` + ManagedByExtended *[]string `json:"managedByExtended,omitempty"` + Name *string `json:"name,omitempty"` + Properties *DiskProperties `json:"properties,omitempty"` + Sku *DiskSku `json:"sku,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` + Zones *zones.Schema `json:"zones,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_diskproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_diskproperties.go new file mode 100644 index 000000000000..255deb54c1db --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_diskproperties.go @@ -0,0 +1,81 @@ +package disks + +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 DiskProperties struct { + BurstingEnabled *bool `json:"burstingEnabled,omitempty"` + BurstingEnabledTime *string `json:"burstingEnabledTime,omitempty"` + CompletionPercent *float64 `json:"completionPercent,omitempty"` + CreationData CreationData `json:"creationData"` + DataAccessAuthMode *DataAccessAuthMode `json:"dataAccessAuthMode,omitempty"` + DiskAccessId *string `json:"diskAccessId,omitempty"` + DiskIOPSReadOnly *int64 `json:"diskIOPSReadOnly,omitempty"` + DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` + DiskMBpsReadOnly *int64 `json:"diskMBpsReadOnly,omitempty"` + DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` + DiskSizeBytes *int64 `json:"diskSizeBytes,omitempty"` + DiskSizeGB *int64 `json:"diskSizeGB,omitempty"` + DiskState *DiskState `json:"diskState,omitempty"` + Encryption *Encryption `json:"encryption,omitempty"` + EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` + HyperVGeneration *HyperVGeneration `json:"hyperVGeneration,omitempty"` + LastOwnershipUpdateTime *string `json:"LastOwnershipUpdateTime,omitempty"` + MaxShares *int64 `json:"maxShares,omitempty"` + NetworkAccessPolicy *NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"` + OptimizedForFrequentAttach *bool `json:"optimizedForFrequentAttach,omitempty"` + OsType *OperatingSystemTypes `json:"osType,omitempty"` + PropertyUpdatesInProgress *PropertyUpdatesInProgress `json:"propertyUpdatesInProgress,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + PurchasePlan *PurchasePlan `json:"purchasePlan,omitempty"` + SecurityProfile *DiskSecurityProfile `json:"securityProfile,omitempty"` + ShareInfo *[]ShareInfoElement `json:"shareInfo,omitempty"` + SupportedCapabilities *SupportedCapabilities `json:"supportedCapabilities,omitempty"` + SupportsHibernation *bool `json:"supportsHibernation,omitempty"` + Tier *string `json:"tier,omitempty"` + TimeCreated *string `json:"timeCreated,omitempty"` + UniqueId *string `json:"uniqueId,omitempty"` +} + +func (o *DiskProperties) GetBurstingEnabledTimeAsTime() (*time.Time, error) { + if o.BurstingEnabledTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.BurstingEnabledTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *DiskProperties) SetBurstingEnabledTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.BurstingEnabledTime = &formatted +} + +func (o *DiskProperties) GetLastOwnershipUpdateTimeAsTime() (*time.Time, error) { + if o.LastOwnershipUpdateTime == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastOwnershipUpdateTime, "2006-01-02T15:04:05Z07:00") +} + +func (o *DiskProperties) SetLastOwnershipUpdateTimeAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastOwnershipUpdateTime = &formatted +} + +func (o *DiskProperties) GetTimeCreatedAsTime() (*time.Time, error) { + if o.TimeCreated == nil { + return nil, nil + } + return dates.ParseAsFormat(o.TimeCreated, "2006-01-02T15:04:05Z07:00") +} + +func (o *DiskProperties) 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/2023-04-02/disks/model_disksecurityprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_disksecurityprofile.go new file mode 100644 index 000000000000..e692c2aa6c62 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_disksecurityprofile.go @@ -0,0 +1,9 @@ +package disks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DiskSecurityProfile struct { + SecureVMDiskEncryptionSetId *string `json:"secureVMDiskEncryptionSetId,omitempty"` + SecurityType *DiskSecurityTypes `json:"securityType,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_disksku.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_disksku.go new file mode 100644 index 000000000000..ecfdb4a92f7d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_disksku.go @@ -0,0 +1,9 @@ +package disks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DiskSku struct { + Name *DiskStorageAccountTypes `json:"name,omitempty"` + Tier *string `json:"tier,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_diskupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_diskupdate.go new file mode 100644 index 000000000000..c77485a196fc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_diskupdate.go @@ -0,0 +1,10 @@ +package disks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DiskUpdate struct { + Properties *DiskUpdateProperties `json:"properties,omitempty"` + Sku *DiskSku `json:"sku,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_diskupdateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_diskupdateproperties.go new file mode 100644 index 000000000000..29d3b7441b4f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_diskupdateproperties.go @@ -0,0 +1,27 @@ +package disks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DiskUpdateProperties struct { + BurstingEnabled *bool `json:"burstingEnabled,omitempty"` + DataAccessAuthMode *DataAccessAuthMode `json:"dataAccessAuthMode,omitempty"` + DiskAccessId *string `json:"diskAccessId,omitempty"` + DiskIOPSReadOnly *int64 `json:"diskIOPSReadOnly,omitempty"` + DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` + DiskMBpsReadOnly *int64 `json:"diskMBpsReadOnly,omitempty"` + DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` + DiskSizeGB *int64 `json:"diskSizeGB,omitempty"` + Encryption *Encryption `json:"encryption,omitempty"` + EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` + MaxShares *int64 `json:"maxShares,omitempty"` + NetworkAccessPolicy *NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"` + OptimizedForFrequentAttach *bool `json:"optimizedForFrequentAttach,omitempty"` + OsType *OperatingSystemTypes `json:"osType,omitempty"` + PropertyUpdatesInProgress *PropertyUpdatesInProgress `json:"propertyUpdatesInProgress,omitempty"` + PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + PurchasePlan *PurchasePlan `json:"purchasePlan,omitempty"` + SupportedCapabilities *SupportedCapabilities `json:"supportedCapabilities,omitempty"` + SupportsHibernation *bool `json:"supportsHibernation,omitempty"` + Tier *string `json:"tier,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_encryption.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_encryption.go new file mode 100644 index 000000000000..a0f8d635ff20 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_encryption.go @@ -0,0 +1,9 @@ +package disks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Encryption struct { + DiskEncryptionSetId *string `json:"diskEncryptionSetId,omitempty"` + Type *EncryptionType `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_encryptionsettingscollection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_encryptionsettingscollection.go new file mode 100644 index 000000000000..9bdf2de002da --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_encryptionsettingscollection.go @@ -0,0 +1,10 @@ +package disks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type EncryptionSettingsCollection struct { + Enabled bool `json:"enabled"` + EncryptionSettings *[]EncryptionSettingsElement `json:"encryptionSettings,omitempty"` + EncryptionSettingsVersion *string `json:"encryptionSettingsVersion,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_encryptionsettingselement.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_encryptionsettingselement.go new file mode 100644 index 000000000000..21aa55d94134 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_encryptionsettingselement.go @@ -0,0 +1,9 @@ +package disks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type EncryptionSettingsElement struct { + DiskEncryptionKey *KeyVaultAndSecretReference `json:"diskEncryptionKey,omitempty"` + KeyEncryptionKey *KeyVaultAndKeyReference `json:"keyEncryptionKey,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_grantaccessdata.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_grantaccessdata.go new file mode 100644 index 000000000000..983cf1a40d52 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_grantaccessdata.go @@ -0,0 +1,11 @@ +package disks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GrantAccessData struct { + Access AccessLevel `json:"access"` + DurationInSeconds int64 `json:"durationInSeconds"` + FileFormat *FileFormat `json:"fileFormat,omitempty"` + GetSecureVMGuestStateSAS *bool `json:"getSecureVMGuestStateSAS,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_imagediskreference.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_imagediskreference.go new file mode 100644 index 000000000000..e593d428e372 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_imagediskreference.go @@ -0,0 +1,11 @@ +package disks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ImageDiskReference struct { + CommunityGalleryImageId *string `json:"communityGalleryImageId,omitempty"` + Id *string `json:"id,omitempty"` + Lun *int64 `json:"lun,omitempty"` + SharedGalleryImageId *string `json:"sharedGalleryImageId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_keyvaultandkeyreference.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_keyvaultandkeyreference.go new file mode 100644 index 000000000000..3e61fe328390 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_keyvaultandkeyreference.go @@ -0,0 +1,9 @@ +package disks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type KeyVaultAndKeyReference struct { + KeyUrl string `json:"keyUrl"` + SourceVault SourceVault `json:"sourceVault"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_keyvaultandsecretreference.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_keyvaultandsecretreference.go new file mode 100644 index 000000000000..714cd7c20b76 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_keyvaultandsecretreference.go @@ -0,0 +1,9 @@ +package disks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type KeyVaultAndSecretReference struct { + SecretUrl string `json:"secretUrl"` + SourceVault SourceVault `json:"sourceVault"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_propertyupdatesinprogress.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_propertyupdatesinprogress.go new file mode 100644 index 000000000000..9d485e8c8d5a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_propertyupdatesinprogress.go @@ -0,0 +1,8 @@ +package disks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PropertyUpdatesInProgress struct { + TargetTier *string `json:"targetTier,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_purchaseplan.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_purchaseplan.go new file mode 100644 index 000000000000..d0fc66624334 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_purchaseplan.go @@ -0,0 +1,11 @@ +package disks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PurchasePlan struct { + Name string `json:"name"` + Product string `json:"product"` + PromotionCode *string `json:"promotionCode,omitempty"` + Publisher string `json:"publisher"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_shareinfoelement.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_shareinfoelement.go new file mode 100644 index 000000000000..0fa0ff3e24ac --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_shareinfoelement.go @@ -0,0 +1,8 @@ +package disks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ShareInfoElement struct { + VMUri *string `json:"vmUri,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_sourcevault.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_sourcevault.go new file mode 100644 index 000000000000..00f5adeac818 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_sourcevault.go @@ -0,0 +1,8 @@ +package disks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SourceVault struct { + Id *string `json:"id,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_supportedcapabilities.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_supportedcapabilities.go new file mode 100644 index 000000000000..33c182741106 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/model_supportedcapabilities.go @@ -0,0 +1,10 @@ +package disks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SupportedCapabilities struct { + AcceleratedNetwork *bool `json:"acceleratedNetwork,omitempty"` + Architecture *Architecture `json:"architecture,omitempty"` + DiskControllerTypes *string `json:"diskControllerTypes,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/predicates.go new file mode 100644 index 000000000000..0c9aeb6430fe --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/predicates.go @@ -0,0 +1,37 @@ +package disks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DiskOperationPredicate struct { + Id *string + Location *string + ManagedBy *string + Name *string + Type *string +} + +func (p DiskOperationPredicate) Matches(input Disk) 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.ManagedBy != nil && (input.ManagedBy == nil || *p.ManagedBy != *input.ManagedBy) { + 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/2023-04-02/disks/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/version.go new file mode 100644 index 000000000000..f678fc2f3522 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks/version.go @@ -0,0 +1,12 @@ +package disks + +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 = "2023-04-02" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/disks/%s", defaultApiVersion) +} diff --git a/vendor/modules.txt b/vendor/modules.txt index ae083be5595a..b401b7cd7754 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -299,12 +299,12 @@ github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-01/images github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-01/proximityplacementgroups github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/diskaccesses github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/diskencryptionsets -github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/snapshots github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-03/galleries github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-03/galleryapplications github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-03/galleryapplicationversions github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-03/gallerysharingupdate +github.com/hashicorp/go-azure-sdk/resource-manager/compute/2023-04-02/disks github.com/hashicorp/go-azure-sdk/resource-manager/confidentialledger/2022-05-13/confidentialledger github.com/hashicorp/go-azure-sdk/resource-manager/consumption/2019-10-01/budgets github.com/hashicorp/go-azure-sdk/resource-manager/containerapps/2023-05-01/certificates From df1672c2765d53fed09fa18a57aa3a820f5eaa37 Mon Sep 17 00:00:00 2001 From: Zhenhua Hu Date: Mon, 11 Sep 2023 16:42:24 +0800 Subject: [PATCH 2/2] go mod vendor --- .../compute/2022-03-02/disks/README.md | 145 ----- .../compute/2022-03-02/disks/client.go | 26 - .../compute/2022-03-02/disks/constants.go | 574 ------------------ .../compute/2022-03-02/disks/id_disk.go | 127 ---- .../2022-03-02/disks/method_createorupdate.go | 74 --- .../compute/2022-03-02/disks/method_delete.go | 71 --- .../compute/2022-03-02/disks/method_get.go | 51 -- .../2022-03-02/disks/method_grantaccess.go | 74 --- .../compute/2022-03-02/disks/method_list.go | 90 --- .../disks/method_listbyresourcegroup.go | 90 --- .../2022-03-02/disks/method_revokeaccess.go | 70 --- .../compute/2022-03-02/disks/method_update.go | 74 --- .../2022-03-02/disks/model_accessuri.go | 9 - .../2022-03-02/disks/model_creationdata.go | 17 - .../compute/2022-03-02/disks/model_disk.go | 23 - .../2022-03-02/disks/model_diskproperties.go | 54 -- .../disks/model_disksecurityprofile.go | 9 - .../compute/2022-03-02/disks/model_disksku.go | 9 - .../2022-03-02/disks/model_diskupdate.go | 10 - .../disks/model_diskupdateproperties.go | 26 - .../2022-03-02/disks/model_encryption.go | 9 - .../model_encryptionsettingscollection.go | 10 - .../disks/model_encryptionsettingselement.go | 9 - .../2022-03-02/disks/model_grantaccessdata.go | 10 - .../disks/model_imagediskreference.go | 11 - .../disks/model_keyvaultandkeyreference.go | 9 - .../disks/model_keyvaultandsecretreference.go | 9 - .../disks/model_propertyupdatesinprogress.go | 8 - .../2022-03-02/disks/model_purchaseplan.go | 11 - .../disks/model_shareinfoelement.go | 8 - .../2022-03-02/disks/model_sourcevault.go | 8 - .../disks/model_supportedcapabilities.go | 9 - .../compute/2022-03-02/disks/predicates.go | 37 -- .../compute/2022-03-02/disks/version.go | 12 - 34 files changed, 1783 deletions(-) delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/README.md delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/client.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/constants.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/id_disk.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/method_createorupdate.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/method_delete.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/method_get.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/method_grantaccess.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/method_list.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/method_listbyresourcegroup.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/method_revokeaccess.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/method_update.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_accessuri.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_creationdata.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_disk.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_diskproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_disksecurityprofile.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_disksku.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_diskupdate.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_diskupdateproperties.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_encryption.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_encryptionsettingscollection.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_encryptionsettingselement.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_grantaccessdata.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_imagediskreference.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_keyvaultandkeyreference.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_keyvaultandsecretreference.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_propertyupdatesinprogress.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_purchaseplan.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_shareinfoelement.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_sourcevault.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_supportedcapabilities.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/predicates.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/version.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/README.md deleted file mode 100644 index 30c1ed95c096..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/README.md +++ /dev/null @@ -1,145 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks` Documentation - -The `disks` SDK allows for interaction with the Azure Resource Manager Service `compute` (API Version `2022-03-02`). - -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/2022-03-02/disks" -``` - - -### Client Initialization - -```go -client := disks.NewDisksClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `DisksClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := disks.NewDiskID("12345678-1234-9876-4563-123456789012", "example-resource-group", "diskValue") - -payload := disks.Disk{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `DisksClient.Delete` - -```go -ctx := context.TODO() -id := disks.NewDiskID("12345678-1234-9876-4563-123456789012", "example-resource-group", "diskValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `DisksClient.Get` - -```go -ctx := context.TODO() -id := disks.NewDiskID("12345678-1234-9876-4563-123456789012", "example-resource-group", "diskValue") - -read, err := client.Get(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `DisksClient.GrantAccess` - -```go -ctx := context.TODO() -id := disks.NewDiskID("12345678-1234-9876-4563-123456789012", "example-resource-group", "diskValue") - -payload := disks.GrantAccessData{ - // ... -} - - -if err := client.GrantAccessThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `DisksClient.List` - -```go -ctx := context.TODO() -id := disks.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// 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: `DisksClient.ListByResourceGroup` - -```go -ctx := context.TODO() -id := disks.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// alternatively `client.ListByResourceGroup(ctx, id)` can be used to do batched pagination -items, err := client.ListByResourceGroupComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `DisksClient.RevokeAccess` - -```go -ctx := context.TODO() -id := disks.NewDiskID("12345678-1234-9876-4563-123456789012", "example-resource-group", "diskValue") - -if err := client.RevokeAccessThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `DisksClient.Update` - -```go -ctx := context.TODO() -id := disks.NewDiskID("12345678-1234-9876-4563-123456789012", "example-resource-group", "diskValue") - -payload := disks.DiskUpdate{ - // ... -} - - -if err := client.UpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/client.go deleted file mode 100644 index 16f70b8378d0..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package disks - -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 DisksClient struct { - Client *resourcemanager.Client -} - -func NewDisksClientWithBaseURI(sdkApi sdkEnv.Api) (*DisksClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "disks", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating DisksClient: %+v", err) - } - - return &DisksClient{ - Client: client, - }, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/constants.go deleted file mode 100644 index 201b2c508eb6..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/constants.go +++ /dev/null @@ -1,574 +0,0 @@ -package disks - -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 AccessLevel string - -const ( - AccessLevelNone AccessLevel = "None" - AccessLevelRead AccessLevel = "Read" - AccessLevelWrite AccessLevel = "Write" -) - -func PossibleValuesForAccessLevel() []string { - return []string{ - string(AccessLevelNone), - string(AccessLevelRead), - string(AccessLevelWrite), - } -} - -func (s *AccessLevel) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAccessLevel(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAccessLevel(input string) (*AccessLevel, error) { - vals := map[string]AccessLevel{ - "none": AccessLevelNone, - "read": AccessLevelRead, - "write": AccessLevelWrite, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AccessLevel(input) - return &out, nil -} - -type Architecture string - -const ( - ArchitectureArmSixFour Architecture = "Arm64" - ArchitectureXSixFour Architecture = "x64" -) - -func PossibleValuesForArchitecture() []string { - return []string{ - string(ArchitectureArmSixFour), - string(ArchitectureXSixFour), - } -} - -func (s *Architecture) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseArchitecture(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseArchitecture(input string) (*Architecture, error) { - vals := map[string]Architecture{ - "arm64": ArchitectureArmSixFour, - "x64": ArchitectureXSixFour, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Architecture(input) - return &out, nil -} - -type DataAccessAuthMode string - -const ( - DataAccessAuthModeAzureActiveDirectory DataAccessAuthMode = "AzureActiveDirectory" - DataAccessAuthModeNone DataAccessAuthMode = "None" -) - -func PossibleValuesForDataAccessAuthMode() []string { - return []string{ - string(DataAccessAuthModeAzureActiveDirectory), - string(DataAccessAuthModeNone), - } -} - -func (s *DataAccessAuthMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDataAccessAuthMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDataAccessAuthMode(input string) (*DataAccessAuthMode, error) { - vals := map[string]DataAccessAuthMode{ - "azureactivedirectory": DataAccessAuthModeAzureActiveDirectory, - "none": DataAccessAuthModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DataAccessAuthMode(input) - return &out, nil -} - -type DiskCreateOption string - -const ( - DiskCreateOptionAttach DiskCreateOption = "Attach" - DiskCreateOptionCopy DiskCreateOption = "Copy" - DiskCreateOptionCopyStart DiskCreateOption = "CopyStart" - DiskCreateOptionEmpty DiskCreateOption = "Empty" - DiskCreateOptionFromImage DiskCreateOption = "FromImage" - DiskCreateOptionImport DiskCreateOption = "Import" - DiskCreateOptionImportSecure DiskCreateOption = "ImportSecure" - DiskCreateOptionRestore DiskCreateOption = "Restore" - DiskCreateOptionUpload DiskCreateOption = "Upload" - DiskCreateOptionUploadPreparedSecure DiskCreateOption = "UploadPreparedSecure" -) - -func PossibleValuesForDiskCreateOption() []string { - return []string{ - string(DiskCreateOptionAttach), - string(DiskCreateOptionCopy), - string(DiskCreateOptionCopyStart), - string(DiskCreateOptionEmpty), - string(DiskCreateOptionFromImage), - string(DiskCreateOptionImport), - string(DiskCreateOptionImportSecure), - string(DiskCreateOptionRestore), - string(DiskCreateOptionUpload), - string(DiskCreateOptionUploadPreparedSecure), - } -} - -func (s *DiskCreateOption) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDiskCreateOption(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDiskCreateOption(input string) (*DiskCreateOption, error) { - vals := map[string]DiskCreateOption{ - "attach": DiskCreateOptionAttach, - "copy": DiskCreateOptionCopy, - "copystart": DiskCreateOptionCopyStart, - "empty": DiskCreateOptionEmpty, - "fromimage": DiskCreateOptionFromImage, - "import": DiskCreateOptionImport, - "importsecure": DiskCreateOptionImportSecure, - "restore": DiskCreateOptionRestore, - "upload": DiskCreateOptionUpload, - "uploadpreparedsecure": DiskCreateOptionUploadPreparedSecure, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DiskCreateOption(input) - return &out, nil -} - -type DiskSecurityTypes string - -const ( - DiskSecurityTypesConfidentialVMDiskEncryptedWithCustomerKey DiskSecurityTypes = "ConfidentialVM_DiskEncryptedWithCustomerKey" - DiskSecurityTypesConfidentialVMDiskEncryptedWithPlatformKey DiskSecurityTypes = "ConfidentialVM_DiskEncryptedWithPlatformKey" - DiskSecurityTypesConfidentialVMVMGuestStateOnlyEncryptedWithPlatformKey DiskSecurityTypes = "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey" - DiskSecurityTypesTrustedLaunch DiskSecurityTypes = "TrustedLaunch" -) - -func PossibleValuesForDiskSecurityTypes() []string { - return []string{ - string(DiskSecurityTypesConfidentialVMDiskEncryptedWithCustomerKey), - string(DiskSecurityTypesConfidentialVMDiskEncryptedWithPlatformKey), - string(DiskSecurityTypesConfidentialVMVMGuestStateOnlyEncryptedWithPlatformKey), - string(DiskSecurityTypesTrustedLaunch), - } -} - -func (s *DiskSecurityTypes) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDiskSecurityTypes(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDiskSecurityTypes(input string) (*DiskSecurityTypes, error) { - vals := map[string]DiskSecurityTypes{ - "confidentialvm_diskencryptedwithcustomerkey": DiskSecurityTypesConfidentialVMDiskEncryptedWithCustomerKey, - "confidentialvm_diskencryptedwithplatformkey": DiskSecurityTypesConfidentialVMDiskEncryptedWithPlatformKey, - "confidentialvm_vmgueststateonlyencryptedwithplatformkey": DiskSecurityTypesConfidentialVMVMGuestStateOnlyEncryptedWithPlatformKey, - "trustedlaunch": DiskSecurityTypesTrustedLaunch, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DiskSecurityTypes(input) - return &out, nil -} - -type DiskState string - -const ( - DiskStateActiveSAS DiskState = "ActiveSAS" - DiskStateActiveSASFrozen DiskState = "ActiveSASFrozen" - DiskStateActiveUpload DiskState = "ActiveUpload" - DiskStateAttached DiskState = "Attached" - DiskStateFrozen DiskState = "Frozen" - DiskStateReadyToUpload DiskState = "ReadyToUpload" - DiskStateReserved DiskState = "Reserved" - DiskStateUnattached DiskState = "Unattached" -) - -func PossibleValuesForDiskState() []string { - return []string{ - string(DiskStateActiveSAS), - string(DiskStateActiveSASFrozen), - string(DiskStateActiveUpload), - string(DiskStateAttached), - string(DiskStateFrozen), - string(DiskStateReadyToUpload), - string(DiskStateReserved), - string(DiskStateUnattached), - } -} - -func (s *DiskState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDiskState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDiskState(input string) (*DiskState, error) { - vals := map[string]DiskState{ - "activesas": DiskStateActiveSAS, - "activesasfrozen": DiskStateActiveSASFrozen, - "activeupload": DiskStateActiveUpload, - "attached": DiskStateAttached, - "frozen": DiskStateFrozen, - "readytoupload": DiskStateReadyToUpload, - "reserved": DiskStateReserved, - "unattached": DiskStateUnattached, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DiskState(input) - return &out, nil -} - -type DiskStorageAccountTypes string - -const ( - DiskStorageAccountTypesPremiumLRS DiskStorageAccountTypes = "Premium_LRS" - DiskStorageAccountTypesPremiumVTwoLRS DiskStorageAccountTypes = "PremiumV2_LRS" - DiskStorageAccountTypesPremiumZRS DiskStorageAccountTypes = "Premium_ZRS" - DiskStorageAccountTypesStandardLRS DiskStorageAccountTypes = "Standard_LRS" - DiskStorageAccountTypesStandardSSDLRS DiskStorageAccountTypes = "StandardSSD_LRS" - DiskStorageAccountTypesStandardSSDZRS DiskStorageAccountTypes = "StandardSSD_ZRS" - DiskStorageAccountTypesUltraSSDLRS DiskStorageAccountTypes = "UltraSSD_LRS" -) - -func PossibleValuesForDiskStorageAccountTypes() []string { - return []string{ - string(DiskStorageAccountTypesPremiumLRS), - string(DiskStorageAccountTypesPremiumVTwoLRS), - string(DiskStorageAccountTypesPremiumZRS), - string(DiskStorageAccountTypesStandardLRS), - string(DiskStorageAccountTypesStandardSSDLRS), - string(DiskStorageAccountTypesStandardSSDZRS), - string(DiskStorageAccountTypesUltraSSDLRS), - } -} - -func (s *DiskStorageAccountTypes) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDiskStorageAccountTypes(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDiskStorageAccountTypes(input string) (*DiskStorageAccountTypes, error) { - vals := map[string]DiskStorageAccountTypes{ - "premium_lrs": DiskStorageAccountTypesPremiumLRS, - "premiumv2_lrs": DiskStorageAccountTypesPremiumVTwoLRS, - "premium_zrs": DiskStorageAccountTypesPremiumZRS, - "standard_lrs": DiskStorageAccountTypesStandardLRS, - "standardssd_lrs": DiskStorageAccountTypesStandardSSDLRS, - "standardssd_zrs": DiskStorageAccountTypesStandardSSDZRS, - "ultrassd_lrs": DiskStorageAccountTypesUltraSSDLRS, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DiskStorageAccountTypes(input) - return &out, nil -} - -type EncryptionType string - -const ( - EncryptionTypeEncryptionAtRestWithCustomerKey EncryptionType = "EncryptionAtRestWithCustomerKey" - EncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys EncryptionType = "EncryptionAtRestWithPlatformAndCustomerKeys" - EncryptionTypeEncryptionAtRestWithPlatformKey EncryptionType = "EncryptionAtRestWithPlatformKey" -) - -func PossibleValuesForEncryptionType() []string { - return []string{ - string(EncryptionTypeEncryptionAtRestWithCustomerKey), - string(EncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys), - string(EncryptionTypeEncryptionAtRestWithPlatformKey), - } -} - -func (s *EncryptionType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEncryptionType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEncryptionType(input string) (*EncryptionType, error) { - vals := map[string]EncryptionType{ - "encryptionatrestwithcustomerkey": EncryptionTypeEncryptionAtRestWithCustomerKey, - "encryptionatrestwithplatformandcustomerkeys": EncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys, - "encryptionatrestwithplatformkey": EncryptionTypeEncryptionAtRestWithPlatformKey, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EncryptionType(input) - return &out, nil -} - -type HyperVGeneration string - -const ( - HyperVGenerationVOne HyperVGeneration = "V1" - HyperVGenerationVTwo HyperVGeneration = "V2" -) - -func PossibleValuesForHyperVGeneration() []string { - return []string{ - string(HyperVGenerationVOne), - string(HyperVGenerationVTwo), - } -} - -func (s *HyperVGeneration) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseHyperVGeneration(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseHyperVGeneration(input string) (*HyperVGeneration, error) { - vals := map[string]HyperVGeneration{ - "v1": HyperVGenerationVOne, - "v2": HyperVGenerationVTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := HyperVGeneration(input) - return &out, nil -} - -type NetworkAccessPolicy string - -const ( - NetworkAccessPolicyAllowAll NetworkAccessPolicy = "AllowAll" - NetworkAccessPolicyAllowPrivate NetworkAccessPolicy = "AllowPrivate" - NetworkAccessPolicyDenyAll NetworkAccessPolicy = "DenyAll" -) - -func PossibleValuesForNetworkAccessPolicy() []string { - return []string{ - string(NetworkAccessPolicyAllowAll), - string(NetworkAccessPolicyAllowPrivate), - string(NetworkAccessPolicyDenyAll), - } -} - -func (s *NetworkAccessPolicy) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkAccessPolicy(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkAccessPolicy(input string) (*NetworkAccessPolicy, error) { - vals := map[string]NetworkAccessPolicy{ - "allowall": NetworkAccessPolicyAllowAll, - "allowprivate": NetworkAccessPolicyAllowPrivate, - "denyall": NetworkAccessPolicyDenyAll, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkAccessPolicy(input) - return &out, nil -} - -type OperatingSystemTypes string - -const ( - OperatingSystemTypesLinux OperatingSystemTypes = "Linux" - OperatingSystemTypesWindows OperatingSystemTypes = "Windows" -) - -func PossibleValuesForOperatingSystemTypes() []string { - return []string{ - string(OperatingSystemTypesLinux), - string(OperatingSystemTypesWindows), - } -} - -func (s *OperatingSystemTypes) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseOperatingSystemTypes(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseOperatingSystemTypes(input string) (*OperatingSystemTypes, error) { - vals := map[string]OperatingSystemTypes{ - "linux": OperatingSystemTypesLinux, - "windows": OperatingSystemTypesWindows, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := OperatingSystemTypes(input) - return &out, nil -} - -type PublicNetworkAccess string - -const ( - PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled" - PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" -) - -func PossibleValuesForPublicNetworkAccess() []string { - return []string{ - string(PublicNetworkAccessDisabled), - string(PublicNetworkAccessEnabled), - } -} - -func (s *PublicNetworkAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicNetworkAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicNetworkAccess(input string) (*PublicNetworkAccess, error) { - vals := map[string]PublicNetworkAccess{ - "disabled": PublicNetworkAccessDisabled, - "enabled": PublicNetworkAccessEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicNetworkAccess(input) - return &out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/id_disk.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/id_disk.go deleted file mode 100644 index 3415c385da73..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/id_disk.go +++ /dev/null @@ -1,127 +0,0 @@ -package disks - -import ( - "fmt" - "strings" - - "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. - -var _ resourceids.ResourceId = DiskId{} - -// DiskId is a struct representing the Resource ID for a Disk -type DiskId struct { - SubscriptionId string - ResourceGroupName string - DiskName string -} - -// NewDiskID returns a new DiskId struct -func NewDiskID(subscriptionId string, resourceGroupName string, diskName string) DiskId { - return DiskId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - DiskName: diskName, - } -} - -// ParseDiskID parses 'input' into a DiskId -func ParseDiskID(input string) (*DiskId, error) { - parser := resourceids.NewParserFromResourceIdType(DiskId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := DiskId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.DiskName, ok = parsed.Parsed["diskName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "diskName", *parsed) - } - - return &id, nil -} - -// ParseDiskIDInsensitively parses 'input' case-insensitively into a DiskId -// note: this method should only be used for API response data and not user input -func ParseDiskIDInsensitively(input string) (*DiskId, error) { - parser := resourceids.NewParserFromResourceIdType(DiskId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - var ok bool - id := DiskId{} - - if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) - } - - if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) - } - - if id.DiskName, ok = parsed.Parsed["diskName"]; !ok { - return nil, resourceids.NewSegmentNotSpecifiedError(id, "diskName", *parsed) - } - - return &id, nil -} - -// ValidateDiskID checks that 'input' can be parsed as a Disk ID -func ValidateDiskID(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 := ParseDiskID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Disk ID -func (id DiskId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/disks/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.DiskName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Disk ID -func (id DiskId) 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("staticDisks", "disks", "disks"), - resourceids.UserSpecifiedSegment("diskName", "diskValue"), - } -} - -// String returns a human-readable description of this Disk ID -func (id DiskId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Disk Name: %q", id.DiskName), - } - return fmt.Sprintf("Disk (%s)", strings.Join(components, "\n")) -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/method_createorupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/method_createorupdate.go deleted file mode 100644 index e8910088195e..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/method_createorupdate.go +++ /dev/null @@ -1,74 +0,0 @@ -package disks - -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 CreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// CreateOrUpdate ... -func (c DisksClient) CreateOrUpdate(ctx context.Context, id DiskId, input Disk) (result CreateOrUpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c DisksClient) CreateOrUpdateThenPoll(ctx context.Context, id DiskId, input Disk) error { - result, err := c.CreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing CreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after CreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/method_delete.go deleted file mode 100644 index 457d47557351..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package disks - -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 DisksClient) Delete(ctx context.Context, id DiskId) (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 DisksClient) DeleteThenPoll(ctx context.Context, id DiskId) 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/2022-03-02/disks/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/method_get.go deleted file mode 100644 index eac7035ae397..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/method_get.go +++ /dev/null @@ -1,51 +0,0 @@ -package disks - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Disk -} - -// Get ... -func (c DisksClient) Get(ctx context.Context, id DiskId) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - 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 - } - - if err = resp.Unmarshal(&result.Model); err != nil { - return - } - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/method_grantaccess.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/method_grantaccess.go deleted file mode 100644 index d449d3f69b07..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/method_grantaccess.go +++ /dev/null @@ -1,74 +0,0 @@ -package disks - -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 GrantAccessOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// GrantAccess ... -func (c DisksClient) GrantAccess(ctx context.Context, id DiskId, input GrantAccessData) (result GrantAccessOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/beginGetAccess", 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 -} - -// GrantAccessThenPoll performs GrantAccess then polls until it's completed -func (c DisksClient) GrantAccessThenPoll(ctx context.Context, id DiskId, input GrantAccessData) error { - result, err := c.GrantAccess(ctx, id, input) - if err != nil { - return fmt.Errorf("performing GrantAccess: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GrantAccess: %+v", err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/method_list.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/method_list.go deleted file mode 100644 index bf07939f4a73..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/method_list.go +++ /dev/null @@ -1,90 +0,0 @@ -package disks - -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 *[]Disk -} - -type ListCompleteResult struct { - Items []Disk -} - -// List ... -func (c DisksClient) List(ctx context.Context, id commonids.SubscriptionId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Compute/disks", 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 *[]Disk `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 DisksClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, DiskOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c DisksClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate DiskOperationPredicate) (result ListCompleteResult, err error) { - items := make([]Disk, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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{ - Items: items, - } - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/method_listbyresourcegroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/method_listbyresourcegroup.go deleted file mode 100644 index 6580da90af90..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/method_listbyresourcegroup.go +++ /dev/null @@ -1,90 +0,0 @@ -package disks - -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 ListByResourceGroupOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]Disk -} - -type ListByResourceGroupCompleteResult struct { - Items []Disk -} - -// ListByResourceGroup ... -func (c DisksClient) ListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (result ListByResourceGroupOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Compute/disks", 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 *[]Disk `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListByResourceGroupComplete retrieves all the results into a single object -func (c DisksClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, DiskOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c DisksClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate DiskOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]Disk, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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 = ListByResourceGroupCompleteResult{ - Items: items, - } - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/method_revokeaccess.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/method_revokeaccess.go deleted file mode 100644 index 05157936bb30..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/method_revokeaccess.go +++ /dev/null @@ -1,70 +0,0 @@ -package disks - -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 RevokeAccessOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// RevokeAccess ... -func (c DisksClient) RevokeAccess(ctx context.Context, id DiskId) (result RevokeAccessOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/endGetAccess", 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 -} - -// RevokeAccessThenPoll performs RevokeAccess then polls until it's completed -func (c DisksClient) RevokeAccessThenPoll(ctx context.Context, id DiskId) error { - result, err := c.RevokeAccess(ctx, id) - if err != nil { - return fmt.Errorf("performing RevokeAccess: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after RevokeAccess: %+v", err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/method_update.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/method_update.go deleted file mode 100644 index b2ed6c8f6307..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/method_update.go +++ /dev/null @@ -1,74 +0,0 @@ -package disks - -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 UpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Update ... -func (c DisksClient) Update(ctx context.Context, id DiskId, input DiskUpdate) (result UpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// UpdateThenPoll performs Update then polls until it's completed -func (c DisksClient) UpdateThenPoll(ctx context.Context, id DiskId, input DiskUpdate) error { - result, err := c.Update(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Update: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Update: %+v", err) - } - - return nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_accessuri.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_accessuri.go deleted file mode 100644 index 58d3760048f7..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_accessuri.go +++ /dev/null @@ -1,9 +0,0 @@ -package disks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AccessUri struct { - AccessSAS *string `json:"accessSAS,omitempty"` - SecurityDataAccessSAS *string `json:"securityDataAccessSAS,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_creationdata.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_creationdata.go deleted file mode 100644 index 93534a3e1691..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_creationdata.go +++ /dev/null @@ -1,17 +0,0 @@ -package disks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CreationData struct { - CreateOption DiskCreateOption `json:"createOption"` - GalleryImageReference *ImageDiskReference `json:"galleryImageReference,omitempty"` - ImageReference *ImageDiskReference `json:"imageReference,omitempty"` - LogicalSectorSize *int64 `json:"logicalSectorSize,omitempty"` - SecurityDataUri *string `json:"securityDataUri,omitempty"` - SourceResourceId *string `json:"sourceResourceId,omitempty"` - SourceUniqueId *string `json:"sourceUniqueId,omitempty"` - SourceUri *string `json:"sourceUri,omitempty"` - StorageAccountId *string `json:"storageAccountId,omitempty"` - UploadSizeBytes *int64 `json:"uploadSizeBytes,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_disk.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_disk.go deleted file mode 100644 index bcc52a8530b5..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_disk.go +++ /dev/null @@ -1,23 +0,0 @@ -package disks - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "github.com/hashicorp/go-azure-helpers/resourcemanager/zones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Disk struct { - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location string `json:"location"` - ManagedBy *string `json:"managedBy,omitempty"` - ManagedByExtended *[]string `json:"managedByExtended,omitempty"` - Name *string `json:"name,omitempty"` - Properties *DiskProperties `json:"properties,omitempty"` - Sku *DiskSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_diskproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_diskproperties.go deleted file mode 100644 index 604c5742566a..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_diskproperties.go +++ /dev/null @@ -1,54 +0,0 @@ -package disks - -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 DiskProperties struct { - BurstingEnabled *bool `json:"burstingEnabled,omitempty"` - CompletionPercent *float64 `json:"completionPercent,omitempty"` - CreationData CreationData `json:"creationData"` - DataAccessAuthMode *DataAccessAuthMode `json:"dataAccessAuthMode,omitempty"` - DiskAccessId *string `json:"diskAccessId,omitempty"` - DiskIOPSReadOnly *int64 `json:"diskIOPSReadOnly,omitempty"` - DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` - DiskMBpsReadOnly *int64 `json:"diskMBpsReadOnly,omitempty"` - DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` - DiskSizeBytes *int64 `json:"diskSizeBytes,omitempty"` - DiskSizeGB *int64 `json:"diskSizeGB,omitempty"` - DiskState *DiskState `json:"diskState,omitempty"` - Encryption *Encryption `json:"encryption,omitempty"` - EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` - HyperVGeneration *HyperVGeneration `json:"hyperVGeneration,omitempty"` - MaxShares *int64 `json:"maxShares,omitempty"` - NetworkAccessPolicy *NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"` - OsType *OperatingSystemTypes `json:"osType,omitempty"` - PropertyUpdatesInProgress *PropertyUpdatesInProgress `json:"propertyUpdatesInProgress,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` - PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` - PurchasePlan *PurchasePlan `json:"purchasePlan,omitempty"` - SecurityProfile *DiskSecurityProfile `json:"securityProfile,omitempty"` - ShareInfo *[]ShareInfoElement `json:"shareInfo,omitempty"` - SupportedCapabilities *SupportedCapabilities `json:"supportedCapabilities,omitempty"` - SupportsHibernation *bool `json:"supportsHibernation,omitempty"` - Tier *string `json:"tier,omitempty"` - TimeCreated *string `json:"timeCreated,omitempty"` - UniqueId *string `json:"uniqueId,omitempty"` -} - -func (o *DiskProperties) GetTimeCreatedAsTime() (*time.Time, error) { - if o.TimeCreated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.TimeCreated, "2006-01-02T15:04:05Z07:00") -} - -func (o *DiskProperties) 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/2022-03-02/disks/model_disksecurityprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_disksecurityprofile.go deleted file mode 100644 index e692c2aa6c62..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_disksecurityprofile.go +++ /dev/null @@ -1,9 +0,0 @@ -package disks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DiskSecurityProfile struct { - SecureVMDiskEncryptionSetId *string `json:"secureVMDiskEncryptionSetId,omitempty"` - SecurityType *DiskSecurityTypes `json:"securityType,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_disksku.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_disksku.go deleted file mode 100644 index ecfdb4a92f7d..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_disksku.go +++ /dev/null @@ -1,9 +0,0 @@ -package disks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DiskSku struct { - Name *DiskStorageAccountTypes `json:"name,omitempty"` - Tier *string `json:"tier,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_diskupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_diskupdate.go deleted file mode 100644 index c77485a196fc..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_diskupdate.go +++ /dev/null @@ -1,10 +0,0 @@ -package disks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DiskUpdate struct { - Properties *DiskUpdateProperties `json:"properties,omitempty"` - Sku *DiskSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_diskupdateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_diskupdateproperties.go deleted file mode 100644 index db0d9f71afdb..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_diskupdateproperties.go +++ /dev/null @@ -1,26 +0,0 @@ -package disks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DiskUpdateProperties struct { - BurstingEnabled *bool `json:"burstingEnabled,omitempty"` - DataAccessAuthMode *DataAccessAuthMode `json:"dataAccessAuthMode,omitempty"` - DiskAccessId *string `json:"diskAccessId,omitempty"` - DiskIOPSReadOnly *int64 `json:"diskIOPSReadOnly,omitempty"` - DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` - DiskMBpsReadOnly *int64 `json:"diskMBpsReadOnly,omitempty"` - DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` - DiskSizeGB *int64 `json:"diskSizeGB,omitempty"` - Encryption *Encryption `json:"encryption,omitempty"` - EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` - MaxShares *int64 `json:"maxShares,omitempty"` - NetworkAccessPolicy *NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"` - OsType *OperatingSystemTypes `json:"osType,omitempty"` - PropertyUpdatesInProgress *PropertyUpdatesInProgress `json:"propertyUpdatesInProgress,omitempty"` - PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` - PurchasePlan *PurchasePlan `json:"purchasePlan,omitempty"` - SupportedCapabilities *SupportedCapabilities `json:"supportedCapabilities,omitempty"` - SupportsHibernation *bool `json:"supportsHibernation,omitempty"` - Tier *string `json:"tier,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_encryption.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_encryption.go deleted file mode 100644 index a0f8d635ff20..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_encryption.go +++ /dev/null @@ -1,9 +0,0 @@ -package disks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Encryption struct { - DiskEncryptionSetId *string `json:"diskEncryptionSetId,omitempty"` - Type *EncryptionType `json:"type,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_encryptionsettingscollection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_encryptionsettingscollection.go deleted file mode 100644 index 9bdf2de002da..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_encryptionsettingscollection.go +++ /dev/null @@ -1,10 +0,0 @@ -package disks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EncryptionSettingsCollection struct { - Enabled bool `json:"enabled"` - EncryptionSettings *[]EncryptionSettingsElement `json:"encryptionSettings,omitempty"` - EncryptionSettingsVersion *string `json:"encryptionSettingsVersion,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_encryptionsettingselement.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_encryptionsettingselement.go deleted file mode 100644 index 21aa55d94134..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_encryptionsettingselement.go +++ /dev/null @@ -1,9 +0,0 @@ -package disks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EncryptionSettingsElement struct { - DiskEncryptionKey *KeyVaultAndSecretReference `json:"diskEncryptionKey,omitempty"` - KeyEncryptionKey *KeyVaultAndKeyReference `json:"keyEncryptionKey,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_grantaccessdata.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_grantaccessdata.go deleted file mode 100644 index 2ec02360cf44..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_grantaccessdata.go +++ /dev/null @@ -1,10 +0,0 @@ -package disks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GrantAccessData struct { - Access AccessLevel `json:"access"` - DurationInSeconds int64 `json:"durationInSeconds"` - GetSecureVMGuestStateSAS *bool `json:"getSecureVMGuestStateSAS,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_imagediskreference.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_imagediskreference.go deleted file mode 100644 index e593d428e372..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_imagediskreference.go +++ /dev/null @@ -1,11 +0,0 @@ -package disks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ImageDiskReference struct { - CommunityGalleryImageId *string `json:"communityGalleryImageId,omitempty"` - Id *string `json:"id,omitempty"` - Lun *int64 `json:"lun,omitempty"` - SharedGalleryImageId *string `json:"sharedGalleryImageId,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_keyvaultandkeyreference.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_keyvaultandkeyreference.go deleted file mode 100644 index 3e61fe328390..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_keyvaultandkeyreference.go +++ /dev/null @@ -1,9 +0,0 @@ -package disks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type KeyVaultAndKeyReference struct { - KeyUrl string `json:"keyUrl"` - SourceVault SourceVault `json:"sourceVault"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_keyvaultandsecretreference.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_keyvaultandsecretreference.go deleted file mode 100644 index 714cd7c20b76..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_keyvaultandsecretreference.go +++ /dev/null @@ -1,9 +0,0 @@ -package disks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type KeyVaultAndSecretReference struct { - SecretUrl string `json:"secretUrl"` - SourceVault SourceVault `json:"sourceVault"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_propertyupdatesinprogress.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_propertyupdatesinprogress.go deleted file mode 100644 index 9d485e8c8d5a..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_propertyupdatesinprogress.go +++ /dev/null @@ -1,8 +0,0 @@ -package disks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PropertyUpdatesInProgress struct { - TargetTier *string `json:"targetTier,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_purchaseplan.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_purchaseplan.go deleted file mode 100644 index d0fc66624334..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_purchaseplan.go +++ /dev/null @@ -1,11 +0,0 @@ -package disks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PurchasePlan struct { - Name string `json:"name"` - Product string `json:"product"` - PromotionCode *string `json:"promotionCode,omitempty"` - Publisher string `json:"publisher"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_shareinfoelement.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_shareinfoelement.go deleted file mode 100644 index 0fa0ff3e24ac..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_shareinfoelement.go +++ /dev/null @@ -1,8 +0,0 @@ -package disks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ShareInfoElement struct { - VMUri *string `json:"vmUri,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_sourcevault.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_sourcevault.go deleted file mode 100644 index 00f5adeac818..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_sourcevault.go +++ /dev/null @@ -1,8 +0,0 @@ -package disks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SourceVault struct { - Id *string `json:"id,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_supportedcapabilities.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_supportedcapabilities.go deleted file mode 100644 index 4d7f5bbea5a7..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/model_supportedcapabilities.go +++ /dev/null @@ -1,9 +0,0 @@ -package disks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SupportedCapabilities struct { - AcceleratedNetwork *bool `json:"acceleratedNetwork,omitempty"` - Architecture *Architecture `json:"architecture,omitempty"` -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/predicates.go deleted file mode 100644 index 0c9aeb6430fe..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package disks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DiskOperationPredicate struct { - Id *string - Location *string - ManagedBy *string - Name *string - Type *string -} - -func (p DiskOperationPredicate) Matches(input Disk) 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.ManagedBy != nil && (input.ManagedBy == nil || *p.ManagedBy != *input.ManagedBy) { - 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/2022-03-02/disks/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/version.go deleted file mode 100644 index 4c3637d6d79e..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/compute/2022-03-02/disks/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package disks - -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 = "2022-03-02" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/disks/%s", defaultApiVersion) -}