From de0d48aa66e55e386fb230bfe5e04e23c581a59e Mon Sep 17 00:00:00 2001 From: neil-yechenwei Date: Tue, 28 Nov 2023 16:56:50 +0800 Subject: [PATCH 1/7] New Resource: azurerm_system_center_virtual_machine_manager_availability_set --- internal/clients/client.go | 246 +++++----- internal/provider/services.go | 2 + .../client/client.go | 20 + .../registration.go | 35 ++ ...chine_manager_availability_set_resource.go | 227 +++++++++ ..._manager_availability_set_resource_test.go | 182 ++++++++ ...l_machine_manager_availability_set_name.go | 20 + ...hine_manager_availability_set_name_test.go | 58 +++ .../2023-10-07/availabilitysets/README.md | 116 +++++ .../2023-10-07/availabilitysets/client.go | 26 ++ .../2023-10-07/availabilitysets/constants.go | 110 +++++ .../availabilitysets/id_availabilityset.go | 127 +++++ .../availabilitysets/method_createorupdate.go | 74 +++ .../availabilitysets/method_delete.go | 98 ++++ .../2023-10-07/availabilitysets/method_get.go | 51 ++ .../method_listbyresourcegroup.go | 90 ++++ .../method_listbysubscription.go | 90 ++++ .../availabilitysets/method_update.go | 74 +++ .../availabilitysets/model_availabilityset.go | 19 + .../model_availabilitysetproperties.go | 10 + .../model_extendedlocation.go | 9 + .../availabilitysets/model_resourcepatch.go | 8 + .../2023-10-07/availabilitysets/predicates.go | 32 ++ .../2023-10-07/availabilitysets/version.go | 12 + .../2023-10-07/client.go | 100 ++++ .../2023-10-07/clouds/README.md | 116 +++++ .../2023-10-07/clouds/client.go | 26 ++ .../2023-10-07/clouds/constants.go | 110 +++++ .../2023-10-07/clouds/id_cloud.go | 127 +++++ .../clouds/method_createorupdate.go | 74 +++ .../2023-10-07/clouds/method_delete.go | 98 ++++ .../2023-10-07/clouds/method_get.go | 51 ++ .../clouds/method_listbyresourcegroup.go | 90 ++++ .../clouds/method_listbysubscription.go | 90 ++++ .../2023-10-07/clouds/method_update.go | 74 +++ .../2023-10-07/clouds/model_cloud.go | 19 + .../2023-10-07/clouds/model_cloudcapacity.go | 10 + .../clouds/model_cloudproperties.go | 14 + .../clouds/model_extendedlocation.go | 9 + .../2023-10-07/clouds/model_resourcepatch.go | 8 + .../clouds/model_storageqospolicy.go | 13 + .../2023-10-07/clouds/predicates.go | 32 ++ .../2023-10-07/clouds/version.go | 12 + .../2023-10-07/inventoryitems/README.md | 90 ++++ .../2023-10-07/inventoryitems/client.go | 26 ++ .../2023-10-07/inventoryitems/constants.go | 160 +++++++ .../inventoryitems/id_inventoryitem.go | 140 ++++++ .../2023-10-07/inventoryitems/id_vmmserver.go | 127 +++++ .../inventoryitems/method_create.go | 56 +++ .../inventoryitems/method_delete.go | 47 ++ .../2023-10-07/inventoryitems/method_get.go | 51 ++ .../inventoryitems/method_listbyvmmserver.go | 89 ++++ .../model_cloudinventoryitem.go | 44 ++ .../inventoryitems/model_inventoryitem.go | 50 ++ .../model_inventoryitemdetails.go | 9 + .../model_inventoryitemproperties.go | 77 +++ .../model_virtualmachineinventoryitem.go | 52 +++ ...del_virtualmachinetemplateinventoryitem.go | 48 ++ .../model_virtualnetworkinventoryitem.go | 44 ++ .../2023-10-07/inventoryitems/predicates.go | 32 ++ .../2023-10-07/inventoryitems/version.go | 12 + .../virtualmachineinstances/README.md | 191 ++++++++ .../virtualmachineinstances/client.go | 26 ++ .../virtualmachineinstances/constants.go | 441 ++++++++++++++++++ .../method_createcheckpoint.go | 74 +++ .../method_createorupdate.go | 75 +++ .../virtualmachineinstances/method_delete.go | 103 ++++ .../method_deletecheckpoint.go | 74 +++ .../virtualmachineinstances/method_get.go | 53 +++ .../virtualmachineinstances/method_list.go | 90 ++++ .../virtualmachineinstances/method_restart.go | 70 +++ .../method_restorecheckpoint.go | 74 +++ .../virtualmachineinstances/method_start.go | 70 +++ .../virtualmachineinstances/method_stop.go | 74 +++ .../virtualmachineinstances/method_update.go | 75 +++ ...ilabilitysetlistavailabilitysetsinlined.go | 9 + .../model_checkpoint.go | 11 + .../model_extendedlocation.go | 9 + .../model_hardwareprofile.go | 14 + .../model_hardwareprofileupdate.go | 13 + .../model_infrastructureprofile.go | 18 + .../model_infrastructureprofileupdate.go | 8 + .../model_networkinterface.go | 18 + .../model_networkinterfaceupdate.go | 14 + .../model_networkprofile.go | 8 + .../model_networkprofileupdate.go | 8 + .../model_osprofileforvminstance.go | 12 + .../model_stopvirtualmachineoptions.go | 8 + .../model_storageprofile.go | 8 + .../model_storageprofileupdate.go | 8 + .../model_storageqospolicydetails.go | 9 + .../model_virtualdisk.go | 21 + .../model_virtualdiskupdate.go | 15 + .../model_virtualmachinecreatecheckpoint.go | 9 + .../model_virtualmachinedeletecheckpoint.go | 8 + .../model_virtualmachineinstance.go | 17 + .../model_virtualmachineinstanceproperties.go | 15 + .../model_virtualmachineinstanceupdate.go | 8 + ..._virtualmachineinstanceupdateproperties.go | 12 + .../model_virtualmachinerestorecheckpoint.go | 8 + .../virtualmachineinstances/predicates.go | 27 ++ .../virtualmachineinstances/version.go | 12 + .../virtualmachinetemplates/README.md | 116 +++++ .../virtualmachinetemplates/client.go | 26 ++ .../virtualmachinetemplates/constants.go | 400 ++++++++++++++++ .../id_virtualmachinetemplate.go | 127 +++++ .../method_createorupdate.go | 74 +++ .../virtualmachinetemplates/method_delete.go | 98 ++++ .../virtualmachinetemplates/method_get.go | 51 ++ .../method_listbyresourcegroup.go | 90 ++++ .../method_listbysubscription.go | 90 ++++ .../virtualmachinetemplates/method_update.go | 74 +++ .../model_extendedlocation.go | 9 + .../model_networkinterface.go | 18 + .../model_resourcepatch.go | 8 + .../model_storageqospolicydetails.go | 9 + .../model_virtualdisk.go | 21 + .../model_virtualmachinetemplate.go | 19 + .../model_virtualmachinetemplateproperties.go | 25 + .../virtualmachinetemplates/predicates.go | 32 ++ .../virtualmachinetemplates/version.go | 12 + .../2023-10-07/virtualnetworks/README.md | 116 +++++ .../2023-10-07/virtualnetworks/client.go | 26 ++ .../2023-10-07/virtualnetworks/constants.go | 110 +++++ .../virtualnetworks/id_virtualnetwork.go | 127 +++++ .../virtualnetworks/method_createorupdate.go | 74 +++ .../virtualnetworks/method_delete.go | 98 ++++ .../2023-10-07/virtualnetworks/method_get.go | 51 ++ .../method_listbyresourcegroup.go | 90 ++++ .../method_listbysubscription.go | 90 ++++ .../virtualnetworks/method_update.go | 74 +++ .../virtualnetworks/model_extendedlocation.go | 9 + .../virtualnetworks/model_resourcepatch.go | 8 + .../virtualnetworks/model_virtualnetwork.go | 19 + .../model_virtualnetworkproperties.go | 12 + .../2023-10-07/virtualnetworks/predicates.go | 32 ++ .../2023-10-07/virtualnetworks/version.go | 12 + .../vminstanceguestagents/README.md | 86 ++++ .../vminstanceguestagents/client.go | 26 ++ .../vminstanceguestagents/constants.go | 113 +++++ .../vminstanceguestagents/method_create.go | 75 +++ .../vminstanceguestagents/method_delete.go | 49 ++ .../vminstanceguestagents/method_get.go | 53 +++ .../vminstanceguestagents/method_list.go | 90 ++++ .../vminstanceguestagents/model_guestagent.go | 16 + .../model_guestagentproperties.go | 14 + .../model_guestcredential.go | 9 + .../model_httpproxyconfiguration.go | 8 + .../vminstanceguestagents/predicates.go | 27 ++ .../vminstanceguestagents/version.go | 12 + .../README.md | 53 +++ .../client.go | 26 ++ .../constants.go | 69 +++ ...achineinstancehybrididentitymetadataget.go | 53 +++ ...chineinstancehybrididentitymetadatalist.go | 90 ++++ .../model_vminstancehybrididentitymetadata.go | 16 + ...nstancehybrididentitymetadataproperties.go | 10 + .../predicates.go | 27 ++ .../version.go | 12 + .../2023-10-07/vmmservers/README.md | 116 +++++ .../2023-10-07/vmmservers/client.go | 26 ++ .../2023-10-07/vmmservers/constants.go | 110 +++++ .../2023-10-07/vmmservers/id_vmmserver.go | 127 +++++ .../vmmservers/method_createorupdate.go | 74 +++ .../2023-10-07/vmmservers/method_delete.go | 98 ++++ .../2023-10-07/vmmservers/method_get.go | 51 ++ .../vmmservers/method_listbyresourcegroup.go | 90 ++++ .../vmmservers/method_listbysubscription.go | 90 ++++ .../2023-10-07/vmmservers/method_update.go | 74 +++ .../vmmservers/model_extendedlocation.go | 9 + .../vmmservers/model_resourcepatch.go | 8 + .../vmmservers/model_vmmcredential.go | 9 + .../2023-10-07/vmmservers/model_vmmserver.go | 19 + .../vmmservers/model_vmmserverproperties.go | 15 + .../2023-10-07/vmmservers/predicates.go | 32 ++ .../2023-10-07/vmmservers/version.go | 12 + vendor/modules.txt | 10 + ...ine_manager_availability_set.html.markdown | 78 ++++ 178 files changed, 9889 insertions(+), 120 deletions(-) create mode 100644 internal/services/systemcentervirtualmachinemanager/client/client.go create mode 100644 internal/services/systemcentervirtualmachinemanager/registration.go create mode 100644 internal/services/systemcentervirtualmachinemanager/system_center_virtual_machine_manager_availability_set_resource.go create mode 100644 internal/services/systemcentervirtualmachinemanager/system_center_virtual_machine_manager_availability_set_resource_test.go create mode 100644 internal/services/systemcentervirtualmachinemanager/validate/system_center_virtual_machine_manager_availability_set_name.go create mode 100644 internal/services/systemcentervirtualmachinemanager/validate/system_center_virtual_machine_manager_availability_set_name_test.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/id_availabilityset.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/method_createorupdate.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/method_delete.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/method_get.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/method_listbyresourcegroup.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/method_listbysubscription.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/method_update.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/model_availabilityset.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/model_availabilitysetproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/model_extendedlocation.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/model_resourcepatch.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/predicates.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/version.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/id_cloud.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/method_createorupdate.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/method_delete.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/method_get.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/method_listbyresourcegroup.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/method_listbysubscription.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/method_update.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/model_cloud.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/model_cloudcapacity.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/model_cloudproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/model_extendedlocation.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/model_resourcepatch.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/model_storageqospolicy.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/predicates.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/version.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/id_inventoryitem.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/id_vmmserver.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/method_create.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/method_delete.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/method_get.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/method_listbyvmmserver.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/model_cloudinventoryitem.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/model_inventoryitem.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/model_inventoryitemdetails.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/model_inventoryitemproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/model_virtualmachineinventoryitem.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/model_virtualmachinetemplateinventoryitem.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/model_virtualnetworkinventoryitem.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/predicates.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/version.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/method_createcheckpoint.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/method_createorupdate.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/method_delete.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/method_deletecheckpoint.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/method_get.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/method_list.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/method_restart.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/method_restorecheckpoint.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/method_start.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/method_stop.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/method_update.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_availabilitysetlistavailabilitysetsinlined.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_checkpoint.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_extendedlocation.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_hardwareprofile.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_hardwareprofileupdate.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_infrastructureprofile.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_infrastructureprofileupdate.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_networkinterface.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_networkinterfaceupdate.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_networkprofile.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_networkprofileupdate.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_osprofileforvminstance.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_stopvirtualmachineoptions.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_storageprofile.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_storageprofileupdate.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_storageqospolicydetails.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_virtualdisk.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_virtualdiskupdate.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_virtualmachinecreatecheckpoint.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_virtualmachinedeletecheckpoint.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_virtualmachineinstance.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_virtualmachineinstanceproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_virtualmachineinstanceupdate.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_virtualmachineinstanceupdateproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_virtualmachinerestorecheckpoint.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/predicates.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/version.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/id_virtualmachinetemplate.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/method_createorupdate.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/method_delete.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/method_get.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/method_listbyresourcegroup.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/method_listbysubscription.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/method_update.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/model_extendedlocation.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/model_networkinterface.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/model_resourcepatch.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/model_storageqospolicydetails.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/model_virtualdisk.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/model_virtualmachinetemplate.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/model_virtualmachinetemplateproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/predicates.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/version.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/id_virtualnetwork.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/method_createorupdate.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/method_delete.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/method_get.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/method_listbyresourcegroup.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/method_listbysubscription.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/method_update.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/model_extendedlocation.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/model_resourcepatch.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/model_virtualnetwork.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/model_virtualnetworkproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/predicates.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/version.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/method_create.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/method_delete.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/method_get.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/method_list.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/model_guestagent.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/model_guestagentproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/model_guestcredential.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/model_httpproxyconfiguration.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/predicates.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/version.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstancehybrididentitymetadata/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstancehybrididentitymetadata/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstancehybrididentitymetadata/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstancehybrididentitymetadata/method_virtualmachineinstancehybrididentitymetadataget.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstancehybrididentitymetadata/method_virtualmachineinstancehybrididentitymetadatalist.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstancehybrididentitymetadata/model_vminstancehybrididentitymetadata.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstancehybrididentitymetadata/model_vminstancehybrididentitymetadataproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstancehybrididentitymetadata/predicates.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstancehybrididentitymetadata/version.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/README.md create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/client.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/constants.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/id_vmmserver.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/method_createorupdate.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/method_delete.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/method_get.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/method_listbyresourcegroup.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/method_listbysubscription.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/method_update.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/model_extendedlocation.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/model_resourcepatch.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/model_vmmcredential.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/model_vmmserver.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/model_vmmserverproperties.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/predicates.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/version.go create mode 100644 website/docs/r/system_center_virtual_machine_manager_availability_set.html.markdown diff --git a/internal/clients/client.go b/internal/clients/client.go index afdf55cee8e4..d085fecd7d4d 100644 --- a/internal/clients/client.go +++ b/internal/clients/client.go @@ -20,6 +20,7 @@ import ( redis_2023_08_01 "github.com/hashicorp/go-azure-sdk/resource-manager/redis/2023-08-01" servicenetworking_v2023_05_01_preview "github.com/hashicorp/go-azure-sdk/resource-manager/servicenetworking/2023-05-01-preview" storagecache_2023_05_01 "github.com/hashicorp/go-azure-sdk/resource-manager/storagecache/2023-05-01" + systemcentervirtualmachinemanager_2023_10_07 "github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07" timeseriesinsights_v2020_05_15 "github.com/hashicorp/go-azure-sdk/resource-manager/timeseriesinsights/2020-05-15" "github.com/hashicorp/terraform-provider-azurerm/internal/common" "github.com/hashicorp/terraform-provider-azurerm/internal/features" @@ -138,6 +139,7 @@ import ( streamAnalytics "github.com/hashicorp/terraform-provider-azurerm/internal/services/streamanalytics/client" subscription "github.com/hashicorp/terraform-provider-azurerm/internal/services/subscription/client" synapse "github.com/hashicorp/terraform-provider-azurerm/internal/services/synapse/client" + systemCenterVirtualMachineManager "github.com/hashicorp/terraform-provider-azurerm/internal/services/systemcentervirtualmachinemanager/client" trafficManager "github.com/hashicorp/terraform-provider-azurerm/internal/services/trafficmanager/client" videoAnalyzer "github.com/hashicorp/terraform-provider-azurerm/internal/services/videoanalyzer/client" vmware "github.com/hashicorp/terraform-provider-azurerm/internal/services/vmware/client" @@ -154,126 +156,127 @@ type Client struct { Account *ResourceManagerAccount Features features.UserFeatures - AadB2c *aadb2c_v2021_04_01_preview.Client - Advisor *advisor.Client - AnalysisServices *analysisservices_v2017_08_01.Client - ApiManagement *apiManagement.Client - AppConfiguration *appConfiguration.Client - AppInsights *applicationInsights.Client - AppPlatform *appPlatform.Client - AppService *appService.Client - ArcKubernetes *arckubernetes.Client - ArcResourceBridge *arcResourceBridge.Client - Attestation *attestation.Client - Authorization *authorization.Client - Automanage *automanage.Client - Automation *automation.Client - AzureStackHCI *azurestackhci_v2023_08_01.Client - Batch *batch.Client - Blueprints *blueprints.Client - Bot *bot.Client - Cdn *cdn.Client - Cognitive *cognitiveServices.Client - Communication *communication.Client - Compute *compute.Client - ConfidentialLedger *confidentialledger.Client - Connections *connections.Client - Consumption *consumption.Client - ContainerApps *containerapps.Client - Containers *containerServices.Client - Cosmos *cosmosdb.Client - CostManagement *costmanagement.Client - CustomProviders *customproviders.Client - Dashboard *dashboard.Client - DatabaseMigration *datamigration.Client - DataBricks *databricks.Client - DataboxEdge *databoxedge.Client - Datadog *datadog_v2021_03_01.Client - DataFactory *datafactory.Client - DataProtection *dataprotection.Client - DataShare *datashare.Client - DesktopVirtualization *desktopvirtualization.Client - DevTestLabs *devtestlabs.Client - DigitalTwins *digitaltwins.Client - Disks *disks.Client - Dns *dns_v2018_05_01.Client - DomainServices *domainservices.Client - Elastic *elastic.Client - EventGrid *eventgrid_v2022_06_15.Client - Eventhub *eventhub.Client - FluidRelay *fluidrelay_2022_05_26.Client - Frontdoor *frontdoor.Client - Graph *graph.Client - HSM *hsm.Client - HDInsight *hdinsight.Client - HybridCompute *hybridcompute.Client - HealthCare *healthcare.Client - IoTCentral *iotcentral.Client - IoTHub *iothub.Client - IoTTimeSeriesInsights *timeseriesinsights_v2020_05_15.Client - KeyVault *keyvault.Client - Kusto *kusto.Client - LabService *labservice.Client - Legacy *legacy.Client - Lighthouse *lighthouse.Client - LoadBalancers *loadbalancers.Client - LogAnalytics *loganalytics.Client - Logic *logic.Client - Logz *logz.Client - MachineLearning *machinelearning.Client - Maintenance *maintenance.Client - ManagedApplication *managedapplication.Client - ManagementGroups *managementgroup.Client - Maps *maps.Client - MariaDB *mariadb.Client - Media *media.Client - MixedReality *mixedreality.Client - Monitor *monitor.Client - MobileNetwork *mobilenetwork.Client - MSSQL *mssql.Client - MSSQLManagedInstance *mssqlmanagedinstance.Client - MySQL *mysql.Client - NetApp *netapp.Client - Network *network.Client - NetworkFunction *networkfunction.Client - NewRelic *newrelic.Client - Nginx *nginx2.Client - NotificationHubs *notificationhub.Client - Orbital *orbital.Client - PaloAlto *paloalto.Client - Policy *policy.Client - Portal *portal.Client - Postgres *postgres.Client - PowerBI *powerBI.Client - PrivateDns *privatedns.Client - PrivateDnsResolver *dnsresolver.Client - Purview *purview.Client - RecoveryServices *recoveryServices.Client - Redis *redis_2023_08_01.Client - RedisEnterprise *redisenterprise.Client - Relay *relay.Client - Resource *resource.Client - Search *search.Client - SecurityCenter *securityCenter.Client - Sentinel *sentinel.Client - ServiceBus *serviceBus.Client - ServiceConnector *serviceConnector.Client - ServiceFabric *serviceFabric.Client - ServiceFabricManaged *serviceFabricManaged.Client - ServiceNetworking *servicenetworking_v2023_05_01_preview.Client - SignalR *signalr.Client - Storage *storage.Client - StorageCache *storagecache_2023_05_01.Client - StorageMover *storageMover.Client - StreamAnalytics *streamAnalytics.Client - Subscription *subscription.Client - Sql *sql.Client - Synapse *synapse.Client - TrafficManager *trafficManager.Client - VideoAnalyzer *videoAnalyzer.Client - Vmware *vmware.Client - VoiceServices *voiceServices.Client - Web *web.Client + AadB2c *aadb2c_v2021_04_01_preview.Client + Advisor *advisor.Client + AnalysisServices *analysisservices_v2017_08_01.Client + ApiManagement *apiManagement.Client + AppConfiguration *appConfiguration.Client + AppInsights *applicationInsights.Client + AppPlatform *appPlatform.Client + AppService *appService.Client + ArcKubernetes *arckubernetes.Client + ArcResourceBridge *arcResourceBridge.Client + Attestation *attestation.Client + Authorization *authorization.Client + Automanage *automanage.Client + Automation *automation.Client + AzureStackHCI *azurestackhci_v2023_08_01.Client + Batch *batch.Client + Blueprints *blueprints.Client + Bot *bot.Client + Cdn *cdn.Client + Cognitive *cognitiveServices.Client + Communication *communication.Client + Compute *compute.Client + ConfidentialLedger *confidentialledger.Client + Connections *connections.Client + Consumption *consumption.Client + ContainerApps *containerapps.Client + Containers *containerServices.Client + Cosmos *cosmosdb.Client + CostManagement *costmanagement.Client + CustomProviders *customproviders.Client + Dashboard *dashboard.Client + DatabaseMigration *datamigration.Client + DataBricks *databricks.Client + DataboxEdge *databoxedge.Client + Datadog *datadog_v2021_03_01.Client + DataFactory *datafactory.Client + DataProtection *dataprotection.Client + DataShare *datashare.Client + DesktopVirtualization *desktopvirtualization.Client + DevTestLabs *devtestlabs.Client + DigitalTwins *digitaltwins.Client + Disks *disks.Client + Dns *dns_v2018_05_01.Client + DomainServices *domainservices.Client + Elastic *elastic.Client + EventGrid *eventgrid_v2022_06_15.Client + Eventhub *eventhub.Client + FluidRelay *fluidrelay_2022_05_26.Client + Frontdoor *frontdoor.Client + Graph *graph.Client + HSM *hsm.Client + HDInsight *hdinsight.Client + HybridCompute *hybridcompute.Client + HealthCare *healthcare.Client + IoTCentral *iotcentral.Client + IoTHub *iothub.Client + IoTTimeSeriesInsights *timeseriesinsights_v2020_05_15.Client + KeyVault *keyvault.Client + Kusto *kusto.Client + LabService *labservice.Client + Legacy *legacy.Client + Lighthouse *lighthouse.Client + LoadBalancers *loadbalancers.Client + LogAnalytics *loganalytics.Client + Logic *logic.Client + Logz *logz.Client + MachineLearning *machinelearning.Client + Maintenance *maintenance.Client + ManagedApplication *managedapplication.Client + ManagementGroups *managementgroup.Client + Maps *maps.Client + MariaDB *mariadb.Client + Media *media.Client + MixedReality *mixedreality.Client + Monitor *monitor.Client + MobileNetwork *mobilenetwork.Client + MSSQL *mssql.Client + MSSQLManagedInstance *mssqlmanagedinstance.Client + MySQL *mysql.Client + NetApp *netapp.Client + Network *network.Client + NetworkFunction *networkfunction.Client + NewRelic *newrelic.Client + Nginx *nginx2.Client + NotificationHubs *notificationhub.Client + Orbital *orbital.Client + PaloAlto *paloalto.Client + Policy *policy.Client + Portal *portal.Client + Postgres *postgres.Client + PowerBI *powerBI.Client + PrivateDns *privatedns.Client + PrivateDnsResolver *dnsresolver.Client + Purview *purview.Client + RecoveryServices *recoveryServices.Client + Redis *redis_2023_08_01.Client + RedisEnterprise *redisenterprise.Client + Relay *relay.Client + Resource *resource.Client + Search *search.Client + SecurityCenter *securityCenter.Client + Sentinel *sentinel.Client + ServiceBus *serviceBus.Client + ServiceConnector *serviceConnector.Client + ServiceFabric *serviceFabric.Client + ServiceFabricManaged *serviceFabricManaged.Client + ServiceNetworking *servicenetworking_v2023_05_01_preview.Client + SignalR *signalr.Client + Storage *storage.Client + StorageCache *storagecache_2023_05_01.Client + StorageMover *storageMover.Client + StreamAnalytics *streamAnalytics.Client + Subscription *subscription.Client + Sql *sql.Client + Synapse *synapse.Client + SystemCenterVirtualMachineManager *systemcentervirtualmachinemanager_2023_10_07.Client + TrafficManager *trafficManager.Client + VideoAnalyzer *videoAnalyzer.Client + Vmware *vmware.Client + VoiceServices *voiceServices.Client + Web *web.Client } // NOTE: it should be possible for this method to become Private once the top level Client's removed @@ -591,6 +594,9 @@ func (client *Client) Build(ctx context.Context, o *common.ClientOptions) error client.StreamAnalytics = streamAnalytics.NewClient(o) client.Subscription = subscription.NewClient(o) client.Synapse = synapse.NewClient(o) + if client.SystemCenterVirtualMachineManager, err = systemCenterVirtualMachineManager.NewClient(o); err != nil { + return fmt.Errorf("building clients for System Center Virtual Machine Manager: %+v", err) + } if client.TrafficManager, err = trafficManager.NewClient(o); err != nil { return fmt.Errorf("building clients for Traffic Manager: %+v", err) } diff --git a/internal/provider/services.go b/internal/provider/services.go index 3624de11fe90..2da5d63c630f 100644 --- a/internal/provider/services.go +++ b/internal/provider/services.go @@ -123,6 +123,7 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/services/streamanalytics" "github.com/hashicorp/terraform-provider-azurerm/internal/services/subscription" "github.com/hashicorp/terraform-provider-azurerm/internal/services/synapse" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/systemcentervirtualmachinemanager" "github.com/hashicorp/terraform-provider-azurerm/internal/services/trafficmanager" "github.com/hashicorp/terraform-provider-azurerm/internal/services/videoanalyzer" "github.com/hashicorp/terraform-provider-azurerm/internal/services/vmware" @@ -201,6 +202,7 @@ func SupportedTypedServices() []sdk.TypedServiceRegistration { search.Registration{}, springcloud.Registration{}, securitycenter.Registration{}, + systemcentervirtualmachinemanager.Registration{}, vmware.Registration{}, voiceservices.Registration{}, web.Registration{}, diff --git a/internal/services/systemcentervirtualmachinemanager/client/client.go b/internal/services/systemcentervirtualmachinemanager/client/client.go new file mode 100644 index 000000000000..69d8f5876462 --- /dev/null +++ b/internal/services/systemcentervirtualmachinemanager/client/client.go @@ -0,0 +1,20 @@ +package client + +import ( + "fmt" + + systemcentervirtualmachinemanager_2023_10_07 "github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/terraform-provider-azurerm/internal/common" +) + +func NewClient(o *common.ClientOptions) (*systemcentervirtualmachinemanager_2023_10_07.Client, error) { + client, err := systemcentervirtualmachinemanager_2023_10_07.NewClientWithBaseURI(o.Environment.ResourceManager, func(c *resourcemanager.Client) { + o.Configure(c, o.Authorizers.ResourceManager) + }) + if err != nil { + return nil, fmt.Errorf("building System Center Virtual Machine Manager client: %+v", err) + } + + return client, nil +} diff --git a/internal/services/systemcentervirtualmachinemanager/registration.go b/internal/services/systemcentervirtualmachinemanager/registration.go new file mode 100644 index 000000000000..216e2684fd24 --- /dev/null +++ b/internal/services/systemcentervirtualmachinemanager/registration.go @@ -0,0 +1,35 @@ +package systemcentervirtualmachinemanager + +import ( + "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" +) + +type Registration struct{} + +var _ sdk.TypedServiceRegistrationWithAGitHubLabel = Registration{} + +func (r Registration) AssociatedGitHubLabel() string { + return "service/systemcentervirtualmachinemanager" +} + +// Name is the name of this Service +func (r Registration) Name() string { + return "System Center Virtual Machine Manager" +} + +// WebsiteCategories returns a list of categories which can be used for the sidebar +func (r Registration) WebsiteCategories() []string { + return []string{ + "System Center Virtual Machine Manager", + } +} + +func (r Registration) DataSources() []sdk.DataSource { + return []sdk.DataSource{} +} + +func (r Registration) Resources() []sdk.Resource { + return []sdk.Resource{ + SystemCenterVirtualMachineManagerAvailabilitySetResource{}, + } +} diff --git a/internal/services/systemcentervirtualmachinemanager/system_center_virtual_machine_manager_availability_set_resource.go b/internal/services/systemcentervirtualmachinemanager/system_center_virtual_machine_manager_availability_set_resource.go new file mode 100644 index 000000000000..25e3e99d0d64 --- /dev/null +++ b/internal/services/systemcentervirtualmachinemanager/system_center_virtual_machine_manager_availability_set_resource.go @@ -0,0 +1,227 @@ +package systemcentervirtualmachinemanager + +import ( + "context" + "fmt" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/systemcentervirtualmachinemanager/validate" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/pointer" + "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/systemcentervirtualmachinemanager/2023-10-07/availabilitysets" + "github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers" + "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" + "github.com/hashicorp/terraform-provider-azurerm/utils" +) + +type SystemCenterVirtualMachineManagerAvailabilitySetModel struct { + Name string `tfschema:"name"` + Location string `tfschema:"location"` + CustomLocationId string `tfschema:"custom_location_id"` + SystemCenterVirtualMachineManagerServerId string `tfschema:"system_center_virtual_machine_manager_server_id"` + Tags map[string]string `tfschema:"tags"` +} + +var _ sdk.Resource = SystemCenterVirtualMachineManagerAvailabilitySetResource{} +var _ sdk.ResourceWithUpdate = SystemCenterVirtualMachineManagerAvailabilitySetResource{} + +type SystemCenterVirtualMachineManagerAvailabilitySetResource struct{} + +func (r SystemCenterVirtualMachineManagerAvailabilitySetResource) ModelObject() interface{} { + return &SystemCenterVirtualMachineManagerAvailabilitySetModel{} +} + +func (r SystemCenterVirtualMachineManagerAvailabilitySetResource) IDValidationFunc() pluginsdk.SchemaValidateFunc { + return availabilitysets.ValidateAvailabilitySetID +} + +func (r SystemCenterVirtualMachineManagerAvailabilitySetResource) ResourceType() string { + return "azurerm_system_center_virtual_machine_manager_availability_set" +} + +func (r SystemCenterVirtualMachineManagerAvailabilitySetResource) Arguments() map[string]*pluginsdk.Schema { + return map[string]*pluginsdk.Schema{ + "name": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validate.SystemCenterVirtualMachineManagerAvailabilitySetName, + }, + + "location": commonschema.Location(), + + "custom_location_id": { + Type: pluginsdk.TypeString, + Required: true, + ValidateFunc: validation.StringIsNotEmpty, + }, + + "system_center_virtual_machine_manager_server_id": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.StringIsNotEmpty, + }, + + "tags": commonschema.Tags(), + } +} + +func (r SystemCenterVirtualMachineManagerAvailabilitySetResource) Attributes() map[string]*pluginsdk.Schema { + return map[string]*pluginsdk.Schema{} +} + +func (r SystemCenterVirtualMachineManagerAvailabilitySetResource) Create() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 30 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + subscriptionId := metadata.Client.Account.SubscriptionId + client := metadata.Client.SystemCenterVirtualMachineManager.AvailabilitySets + + var model SystemCenterVirtualMachineManagerAvailabilitySetModel + if err := metadata.Decode(&model); err != nil { + return fmt.Errorf("decoding: %+v", err) + } + + scvmmServerId, err := vmmservers.ParseVMmServerID(model.SystemCenterVirtualMachineManagerServerId) + if err != nil { + return err + } + + id := availabilitysets.NewAvailabilitySetID(subscriptionId, scvmmServerId.ResourceGroupName, model.Name) + + existing, err := client.Get(ctx, id) + if err != nil { + if !response.WasNotFound(existing.HttpResponse) { + return fmt.Errorf("checking for the presence of an existing %s: %+v", id, err) + } + } + if !response.WasNotFound(existing.HttpResponse) { + return metadata.ResourceRequiresImport(r.ResourceType(), id) + } + + parameters := availabilitysets.AvailabilitySet{ + ExtendedLocation: availabilitysets.ExtendedLocation{ + Type: utils.String("customLocation"), + Name: utils.String(model.CustomLocationId), + }, + Location: location.Normalize(model.Location), + Properties: availabilitysets.AvailabilitySetProperties{ + AvailabilitySetName: utils.String(scvmmServerId.VmmServerName), + VMmServerId: utils.String(scvmmServerId.ID()), + }, + Tags: pointer.To(model.Tags), + } + + if err := client.CreateOrUpdateThenPoll(ctx, id, parameters); err != nil { + return fmt.Errorf("creating %s: %+v", id, err) + } + + metadata.SetID(id) + return nil + }, + } +} + +func (r SystemCenterVirtualMachineManagerAvailabilitySetResource) Read() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 5 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + client := metadata.Client.SystemCenterVirtualMachineManager.AvailabilitySets + + id, err := availabilitysets.ParseAvailabilitySetID(metadata.ResourceData.Id()) + if err != nil { + return err + } + + resp, err := client.Get(ctx, *id) + if err != nil { + if response.WasNotFound(resp.HttpResponse) { + return metadata.MarkAsGone(*id) + } + return fmt.Errorf("retrieving %s: %+v", *id, err) + } + + state := SystemCenterVirtualMachineManagerAvailabilitySetModel{} + if model := resp.Model; model != nil { + state.CustomLocationId = pointer.From(model.ExtendedLocation.Name) + state.Location = location.Normalize(model.Location) + state.Name = id.AvailabilitySetName + state.SystemCenterVirtualMachineManagerServerId = vmmservers.NewVMmServerID(id.SubscriptionId, id.ResourceGroupName, pointer.From(model.Properties.AvailabilitySetName)).ID() + state.Tags = pointer.From(model.Tags) + } + + return metadata.Encode(&state) + }, + } +} + +func (r SystemCenterVirtualMachineManagerAvailabilitySetResource) Update() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 30 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + client := metadata.Client.SystemCenterVirtualMachineManager.AvailabilitySets + + id, err := availabilitysets.ParseAvailabilitySetID(metadata.ResourceData.Id()) + if err != nil { + return err + } + + var model SystemCenterVirtualMachineManagerAvailabilitySetModel + if err := metadata.Decode(&model); err != nil { + return fmt.Errorf("decoding: %+v", err) + } + + existing, err := client.Get(ctx, *id) + if err != nil { + return fmt.Errorf("retrieving %s: %+v", *id, err) + } + + parameters := existing.Model + if parameters == nil { + return fmt.Errorf("retrieving %s: model was nil", *id) + } + + if metadata.ResourceData.HasChange("custom_location_id") { + parameters.ExtendedLocation = availabilitysets.ExtendedLocation{ + Type: utils.String("customLocation"), + Name: utils.String(model.CustomLocationId), + } + } + + if metadata.ResourceData.HasChange("tags") { + parameters.Tags = pointer.To(model.Tags) + } + + if err := client.CreateOrUpdateThenPoll(ctx, *id, *parameters); err != nil { + return fmt.Errorf("updating %s: %+v", *id, err) + } + + return nil + }, + } +} + +func (r SystemCenterVirtualMachineManagerAvailabilitySetResource) Delete() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 30 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + client := metadata.Client.SystemCenterVirtualMachineManager.AvailabilitySets + + id, err := availabilitysets.ParseAvailabilitySetID(metadata.ResourceData.Id()) + if err != nil { + return err + } + + if err := client.DeleteThenPoll(ctx, *id, availabilitysets.DeleteOperationOptions{Force: pointer.To(availabilitysets.ForceTrue)}); err != nil { + return fmt.Errorf("deleting %s: %+v", *id, err) + } + + return nil + }, + } +} diff --git a/internal/services/systemcentervirtualmachinemanager/system_center_virtual_machine_manager_availability_set_resource_test.go b/internal/services/systemcentervirtualmachinemanager/system_center_virtual_machine_manager_availability_set_resource_test.go new file mode 100644 index 000000000000..6cb314e63d01 --- /dev/null +++ b/internal/services/systemcentervirtualmachinemanager/system_center_virtual_machine_manager_availability_set_resource_test.go @@ -0,0 +1,182 @@ +package systemcentervirtualmachinemanager_test + +import ( + "context" + "fmt" + "testing" + + "github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets" + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" + "github.com/hashicorp/terraform-provider-azurerm/internal/clients" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" + "github.com/hashicorp/terraform-provider-azurerm/utils" +) + +type SystemCenterVirtualMachineManagerAvailabilitySetResource struct{} + +func TestAccSystemCenterVirtualMachineManagerAvailabilitySet_basic(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_system_center_virtual_machine_manager_availability_set", "test") + r := SystemCenterVirtualMachineManagerAvailabilitySetResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + }) +} + +func TestAccSystemCenterVirtualMachineManagerAvailabilitySet_requiresImport(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_system_center_virtual_machine_manager_availability_set", "test") + r := SystemCenterVirtualMachineManagerAvailabilitySetResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.RequiresImportErrorStep(r.requiresImport), + }) +} + +func TestAccSystemCenterVirtualMachineManagerAvailabilitySet_complete(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_system_center_virtual_machine_manager_availability_set", "test") + r := SystemCenterVirtualMachineManagerAvailabilitySetResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.complete(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + }) +} + +func TestAccSystemCenterVirtualMachineManagerAvailabilitySet_update(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_system_center_virtual_machine_manager_availability_set", "test") + r := SystemCenterVirtualMachineManagerAvailabilitySetResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.complete(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + { + Config: r.update(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + }) +} + +func (r SystemCenterVirtualMachineManagerAvailabilitySetResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { + id, err := availabilitysets.ParseAvailabilitySetID(state.ID) + if err != nil { + return nil, err + } + + resp, err := clients.SystemCenterVirtualMachineManager.AvailabilitySets.Get(ctx, *id) + if err != nil { + return nil, fmt.Errorf("reading %s: %+v", *id, err) + } + + return utils.Bool(resp.Model != nil), nil +} + +func (r SystemCenterVirtualMachineManagerAvailabilitySetResource) basic(data acceptance.TestData) string { + return fmt.Sprintf(` +%s + +resource "azurerm_system_center_virtual_machine_manager_availability_set" "test" { + name = "acctest-scvmmas-%d" + location = azurerm_resource_group.test.location + custom_location_id = azurerm_custom_location.test.id + system_center_virtual_machine_manager_server_id = azurerm_system_center_virtual_machine_manager_server.test.id +} +`, r.template(data), data.RandomInteger) +} + +func (r SystemCenterVirtualMachineManagerAvailabilitySetResource) requiresImport(data acceptance.TestData) string { + return fmt.Sprintf(` +%s + +resource "azurerm_system_center_virtual_machine_manager_availability_set" "import" { + name = azurerm_system_center_virtual_machine_manager_availability_set.test.name + location = azurerm_system_center_virtual_machine_manager_availability_set.test.location + custom_location_id = azurerm_system_center_virtual_machine_manager_availability_set.test.custom_location_id + system_center_virtual_machine_manager_server_id = azurerm_system_center_virtual_machine_manager_availability_set.test.system_center_virtual_machine_manager_server_id +} +`, r.basic(data)) +} + +func (r SystemCenterVirtualMachineManagerAvailabilitySetResource) complete(data acceptance.TestData) string { + return fmt.Sprintf(` +%s + +resource "azurerm_system_center_virtual_machine_manager_availability_set" "test" { + name = "acctest-scvmmas-%d" + location = azurerm_resource_group.test.location + custom_location_id = azurerm_custom_location.test.id + system_center_virtual_machine_manager_server_id = azurerm_system_center_virtual_machine_manager_server.test.id + + tags = { + env = "Test" + } +} +`, r.template(data), data.RandomInteger) +} + +func (r SystemCenterVirtualMachineManagerAvailabilitySetResource) update(data acceptance.TestData) string { + return fmt.Sprintf(` +%s + +resource "azurerm_system_center_virtual_machine_manager_availability_set" "test" { + name = "acctest-scvmmas-%d" + location = azurerm_resource_group.test.location + custom_location_id = azurerm_custom_location.test.id + system_center_virtual_machine_manager_server_id = azurerm_system_center_virtual_machine_manager_server.test.id + + tags = { + env = "Test2" + } +} +`, r.template(data), data.RandomInteger) +} + +func (r SystemCenterVirtualMachineManagerAvailabilitySetResource) template(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestrg-scvmmas-%d" + location = "%s" +} + +resource "azurerm_custom_location" "test" { + name = "acctest-cl-%d" +} + +resource "azurerm_system_center_virtual_machine_manager_server" "test" { + name = "acctest-scvmmms-%d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + custom_location_id = azurerm_custom_location.test.id + fqdn = "testdomain.com" +} +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger) +} diff --git a/internal/services/systemcentervirtualmachinemanager/validate/system_center_virtual_machine_manager_availability_set_name.go b/internal/services/systemcentervirtualmachinemanager/validate/system_center_virtual_machine_manager_availability_set_name.go new file mode 100644 index 000000000000..720818f9013d --- /dev/null +++ b/internal/services/systemcentervirtualmachinemanager/validate/system_center_virtual_machine_manager_availability_set_name.go @@ -0,0 +1,20 @@ +package validate + +import ( + "fmt" + "regexp" +) + +func SystemCenterVirtualMachineManagerAvailabilitySetName(i interface{}, k string) (warnings []string, errors []error) { + v, ok := i.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected type of %q to be string", k)) + return + } + + if !regexp.MustCompile("^[a-zA-Z0-9]([-.a-zA-Z0-9]{0,52}[a-zA-Z0-9])?$").MatchString(v) { + errors = append(errors, fmt.Errorf("%q must start and end with an alphanumeric character, may contain alphanumeric characters, dashes or periods and must be between 1 and 54 characters long", k)) + } + + return warnings, errors +} diff --git a/internal/services/systemcentervirtualmachinemanager/validate/system_center_virtual_machine_manager_availability_set_name_test.go b/internal/services/systemcentervirtualmachinemanager/validate/system_center_virtual_machine_manager_availability_set_name_test.go new file mode 100644 index 000000000000..b64b15faedb6 --- /dev/null +++ b/internal/services/systemcentervirtualmachinemanager/validate/system_center_virtual_machine_manager_availability_set_name_test.go @@ -0,0 +1,58 @@ +package validate + +import ( + "strings" + "testing" +) + +func TestSystemCenterVirtualMachineManagerAvailabilitySetName(t *testing.T) { + testCases := []struct { + Input string + Expected bool + }{ + { + Input: "", + Expected: false, + }, + { + Input: "a", + Expected: true, + }, + { + Input: "a8a", + Expected: true, + }, + { + Input: "a-8.a", + Expected: true, + }, + { + Input: "a-", + Expected: false, + }, + { + Input: "a.", + Expected: false, + }, + { + Input: strings.Repeat("s", 53), + Expected: true, + }, + { + Input: strings.Repeat("s", 54), + Expected: true, + }, + { + Input: strings.Repeat("s", 55), + Expected: false, + }, + } + + for _, v := range testCases { + _, errors := SystemCenterVirtualMachineManagerAvailabilitySetName(v.Input, "name") + result := len(errors) == 0 + if result != v.Expected { + t.Fatalf("Expected the result to be %t but got %t (and %d errors)", v.Expected, result, len(errors)) + } + } +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/README.md new file mode 100644 index 000000000000..3205b183e57e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/README.md @@ -0,0 +1,116 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets` Documentation + +The `availabilitysets` SDK allows for interaction with the Azure Resource Manager Service `systemcentervirtualmachinemanager` (API Version `2023-10-07`). + +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/systemcentervirtualmachinemanager/2023-10-07/availabilitysets" +``` + + +### Client Initialization + +```go +client := availabilitysets.NewAvailabilitySetsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `AvailabilitySetsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := availabilitysets.NewAvailabilitySetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "availabilitySetValue") + +payload := availabilitysets.AvailabilitySet{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `AvailabilitySetsClient.Delete` + +```go +ctx := context.TODO() +id := availabilitysets.NewAvailabilitySetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "availabilitySetValue") + +if err := client.DeleteThenPoll(ctx, id, availabilitysets.DefaultDeleteOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `AvailabilitySetsClient.Get` + +```go +ctx := context.TODO() +id := availabilitysets.NewAvailabilitySetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "availabilitySetValue") + +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: `AvailabilitySetsClient.ListByResourceGroup` + +```go +ctx := context.TODO() +id := availabilitysets.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: `AvailabilitySetsClient.ListBySubscription` + +```go +ctx := context.TODO() +id := availabilitysets.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.ListBySubscription(ctx, id)` can be used to do batched pagination +items, err := client.ListBySubscriptionComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `AvailabilitySetsClient.Update` + +```go +ctx := context.TODO() +id := availabilitysets.NewAvailabilitySetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "availabilitySetValue") + +payload := availabilitysets.ResourcePatch{ + // ... +} + + +if err := client.UpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/client.go new file mode 100644 index 000000000000..54ef249b4a80 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/client.go @@ -0,0 +1,26 @@ +package availabilitysets + +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 AvailabilitySetsClient struct { + Client *resourcemanager.Client +} + +func NewAvailabilitySetsClientWithBaseURI(sdkApi sdkEnv.Api) (*AvailabilitySetsClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "availabilitysets", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating AvailabilitySetsClient: %+v", err) + } + + return &AvailabilitySetsClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/constants.go new file mode 100644 index 000000000000..4de67ae6b667 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/constants.go @@ -0,0 +1,110 @@ +package availabilitysets + +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 Force string + +const ( + ForceFalse Force = "false" + ForceTrue Force = "true" +) + +func PossibleValuesForForce() []string { + return []string{ + string(ForceFalse), + string(ForceTrue), + } +} + +func (s *Force) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseForce(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseForce(input string) (*Force, error) { + vals := map[string]Force{ + "false": ForceFalse, + "true": ForceTrue, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := Force(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateAccepted ProvisioningState = "Accepted" + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreated ProvisioningState = "Created" + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateProvisioning ProvisioningState = "Provisioning" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateAccepted), + string(ProvisioningStateCanceled), + string(ProvisioningStateCreated), + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateProvisioning), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "accepted": ProvisioningStateAccepted, + "canceled": ProvisioningStateCanceled, + "created": ProvisioningStateCreated, + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "provisioning": ProvisioningStateProvisioning, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/id_availabilityset.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/id_availabilityset.go new file mode 100644 index 000000000000..ae57f4330c97 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/id_availabilityset.go @@ -0,0 +1,127 @@ +package availabilitysets + +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 = AvailabilitySetId{} + +// AvailabilitySetId is a struct representing the Resource ID for a Availability Set +type AvailabilitySetId struct { + SubscriptionId string + ResourceGroupName string + AvailabilitySetName string +} + +// NewAvailabilitySetID returns a new AvailabilitySetId struct +func NewAvailabilitySetID(subscriptionId string, resourceGroupName string, availabilitySetName string) AvailabilitySetId { + return AvailabilitySetId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AvailabilitySetName: availabilitySetName, + } +} + +// ParseAvailabilitySetID parses 'input' into a AvailabilitySetId +func ParseAvailabilitySetID(input string) (*AvailabilitySetId, error) { + parser := resourceids.NewParserFromResourceIdType(AvailabilitySetId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := AvailabilitySetId{} + + 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.AvailabilitySetName, ok = parsed.Parsed["availabilitySetName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "availabilitySetName", *parsed) + } + + return &id, nil +} + +// ParseAvailabilitySetIDInsensitively parses 'input' case-insensitively into a AvailabilitySetId +// note: this method should only be used for API response data and not user input +func ParseAvailabilitySetIDInsensitively(input string) (*AvailabilitySetId, error) { + parser := resourceids.NewParserFromResourceIdType(AvailabilitySetId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := AvailabilitySetId{} + + 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.AvailabilitySetName, ok = parsed.Parsed["availabilitySetName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "availabilitySetName", *parsed) + } + + return &id, nil +} + +// ValidateAvailabilitySetID checks that 'input' can be parsed as a Availability Set ID +func ValidateAvailabilitySetID(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 := ParseAvailabilitySetID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Availability Set ID +func (id AvailabilitySetId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ScVmm/availabilitySets/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AvailabilitySetName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Availability Set ID +func (id AvailabilitySetId) 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("staticMicrosoftScVmm", "Microsoft.ScVmm", "Microsoft.ScVmm"), + resourceids.StaticSegment("staticAvailabilitySets", "availabilitySets", "availabilitySets"), + resourceids.UserSpecifiedSegment("availabilitySetName", "availabilitySetValue"), + } +} + +// String returns a human-readable description of this Availability Set ID +func (id AvailabilitySetId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Availability Set Name: %q", id.AvailabilitySetName), + } + return fmt.Sprintf("Availability Set (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/method_createorupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/method_createorupdate.go new file mode 100644 index 000000000000..63ada7c8e684 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/method_createorupdate.go @@ -0,0 +1,74 @@ +package availabilitysets + +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 AvailabilitySetsClient) CreateOrUpdate(ctx context.Context, id AvailabilitySetId, input AvailabilitySet) (result CreateOrUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed +func (c AvailabilitySetsClient) CreateOrUpdateThenPoll(ctx context.Context, id AvailabilitySetId, input AvailabilitySet) 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/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/method_delete.go new file mode 100644 index 000000000000..feb65fd44090 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/method_delete.go @@ -0,0 +1,98 @@ +package availabilitysets + +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 +} + +type DeleteOperationOptions struct { + Force *Force +} + +func DefaultDeleteOperationOptions() DeleteOperationOptions { + return DeleteOperationOptions{} +} + +func (o DeleteOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + + return &out +} + +func (o DeleteOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o DeleteOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + if o.Force != nil { + out.Append("force", fmt.Sprintf("%v", *o.Force)) + } + return &out +} + +// Delete ... +func (c AvailabilitySetsClient) Delete(ctx context.Context, id AvailabilitySetId, options DeleteOperationOptions) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + OptionsObject: options, + } + + 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 AvailabilitySetsClient) DeleteThenPoll(ctx context.Context, id AvailabilitySetId, options DeleteOperationOptions) error { + result, err := c.Delete(ctx, id, options) + 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/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/method_get.go new file mode 100644 index 000000000000..5aee17cea0c6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/method_get.go @@ -0,0 +1,51 @@ +package availabilitysets + +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 *AvailabilitySet +} + +// Get ... +func (c AvailabilitySetsClient) Get(ctx context.Context, id AvailabilitySetId) (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/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/method_listbyresourcegroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/method_listbyresourcegroup.go new file mode 100644 index 000000000000..7e58d9fff3ac --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/method_listbyresourcegroup.go @@ -0,0 +1,90 @@ +package availabilitysets + +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 *[]AvailabilitySet +} + +type ListByResourceGroupCompleteResult struct { + Items []AvailabilitySet +} + +// ListByResourceGroup ... +func (c AvailabilitySetsClient) 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.ScVmm/availabilitySets", 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 *[]AvailabilitySet `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 AvailabilitySetsClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { + return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, AvailabilitySetOperationPredicate{}) +} + +// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c AvailabilitySetsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate AvailabilitySetOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { + items := make([]AvailabilitySet, 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/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/method_listbysubscription.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/method_listbysubscription.go new file mode 100644 index 000000000000..d834bb04e8a2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/method_listbysubscription.go @@ -0,0 +1,90 @@ +package availabilitysets + +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 ListBySubscriptionOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]AvailabilitySet +} + +type ListBySubscriptionCompleteResult struct { + Items []AvailabilitySet +} + +// ListBySubscription ... +func (c AvailabilitySetsClient) ListBySubscription(ctx context.Context, id commonids.SubscriptionId) (result ListBySubscriptionOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.ScVmm/availabilitySets", 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 *[]AvailabilitySet `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListBySubscriptionComplete retrieves all the results into a single object +func (c AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId) (ListBySubscriptionCompleteResult, error) { + return c.ListBySubscriptionCompleteMatchingPredicate(ctx, id, AvailabilitySetOperationPredicate{}) +} + +// ListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c AvailabilitySetsClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate AvailabilitySetOperationPredicate) (result ListBySubscriptionCompleteResult, err error) { + items := make([]AvailabilitySet, 0) + + resp, err := c.ListBySubscription(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 = ListBySubscriptionCompleteResult{ + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/method_update.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/method_update.go new file mode 100644 index 000000000000..610729e2284c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/method_update.go @@ -0,0 +1,74 @@ +package availabilitysets + +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 AvailabilitySetsClient) Update(ctx context.Context, id AvailabilitySetId, input ResourcePatch) (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 AvailabilitySetsClient) UpdateThenPoll(ctx context.Context, id AvailabilitySetId, input ResourcePatch) 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/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/model_availabilityset.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/model_availabilityset.go new file mode 100644 index 000000000000..c1bb50264991 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/model_availabilityset.go @@ -0,0 +1,19 @@ +package availabilitysets + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AvailabilitySet struct { + ExtendedLocation ExtendedLocation `json:"extendedLocation"` + Id *string `json:"id,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties AvailabilitySetProperties `json:"properties"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/model_availabilitysetproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/model_availabilitysetproperties.go new file mode 100644 index 000000000000..519440060de5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/model_availabilitysetproperties.go @@ -0,0 +1,10 @@ +package availabilitysets + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AvailabilitySetProperties struct { + AvailabilitySetName *string `json:"availabilitySetName,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + VMmServerId *string `json:"vmmServerId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/model_extendedlocation.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/model_extendedlocation.go new file mode 100644 index 000000000000..da53bf74ea1c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/model_extendedlocation.go @@ -0,0 +1,9 @@ +package availabilitysets + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExtendedLocation struct { + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/model_resourcepatch.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/model_resourcepatch.go new file mode 100644 index 000000000000..8ddbdd73387b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/model_resourcepatch.go @@ -0,0 +1,8 @@ +package availabilitysets + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ResourcePatch struct { + Tags *map[string]string `json:"tags,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/predicates.go new file mode 100644 index 000000000000..bb3e2b2b319f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/predicates.go @@ -0,0 +1,32 @@ +package availabilitysets + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AvailabilitySetOperationPredicate struct { + Id *string + Location *string + Name *string + Type *string +} + +func (p AvailabilitySetOperationPredicate) Matches(input AvailabilitySet) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Location != nil && *p.Location != input.Location { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/version.go new file mode 100644 index 000000000000..b5ddd1201cca --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets/version.go @@ -0,0 +1,12 @@ +package availabilitysets + +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-10-07" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/availabilitysets/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/client.go new file mode 100644 index 000000000000..3523a8784b20 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/client.go @@ -0,0 +1,100 @@ +package v2023_10_07 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets" + "github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds" + "github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems" + "github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances" + "github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates" + "github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks" + "github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents" + "github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstancehybrididentitymetadata" + "github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +type Client struct { + AvailabilitySets *availabilitysets.AvailabilitySetsClient + Clouds *clouds.CloudsClient + InventoryItems *inventoryitems.InventoryItemsClient + VMInstanceGuestAgents *vminstanceguestagents.VMInstanceGuestAgentsClient + VMInstanceHybridIdentityMetadata *vminstancehybrididentitymetadata.VMInstanceHybridIdentityMetadataClient + VMmServers *vmmservers.VMmServersClient + VirtualMachineInstances *virtualmachineinstances.VirtualMachineInstancesClient + VirtualMachineTemplates *virtualmachinetemplates.VirtualMachineTemplatesClient + VirtualNetworks *virtualnetworks.VirtualNetworksClient +} + +func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) { + availabilitySetsClient, err := availabilitysets.NewAvailabilitySetsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building AvailabilitySets client: %+v", err) + } + configureFunc(availabilitySetsClient.Client) + + cloudsClient, err := clouds.NewCloudsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building Clouds client: %+v", err) + } + configureFunc(cloudsClient.Client) + + inventoryItemsClient, err := inventoryitems.NewInventoryItemsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building InventoryItems client: %+v", err) + } + configureFunc(inventoryItemsClient.Client) + + vMInstanceGuestAgentsClient, err := vminstanceguestagents.NewVMInstanceGuestAgentsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building VMInstanceGuestAgents client: %+v", err) + } + configureFunc(vMInstanceGuestAgentsClient.Client) + + vMInstanceHybridIdentityMetadataClient, err := vminstancehybrididentitymetadata.NewVMInstanceHybridIdentityMetadataClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building VMInstanceHybridIdentityMetadata client: %+v", err) + } + configureFunc(vMInstanceHybridIdentityMetadataClient.Client) + + vMmServersClient, err := vmmservers.NewVMmServersClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building VMmServers client: %+v", err) + } + configureFunc(vMmServersClient.Client) + + virtualMachineInstancesClient, err := virtualmachineinstances.NewVirtualMachineInstancesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building VirtualMachineInstances client: %+v", err) + } + configureFunc(virtualMachineInstancesClient.Client) + + virtualMachineTemplatesClient, err := virtualmachinetemplates.NewVirtualMachineTemplatesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building VirtualMachineTemplates client: %+v", err) + } + configureFunc(virtualMachineTemplatesClient.Client) + + virtualNetworksClient, err := virtualnetworks.NewVirtualNetworksClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building VirtualNetworks client: %+v", err) + } + configureFunc(virtualNetworksClient.Client) + + return &Client{ + AvailabilitySets: availabilitySetsClient, + Clouds: cloudsClient, + InventoryItems: inventoryItemsClient, + VMInstanceGuestAgents: vMInstanceGuestAgentsClient, + VMInstanceHybridIdentityMetadata: vMInstanceHybridIdentityMetadataClient, + VMmServers: vMmServersClient, + VirtualMachineInstances: virtualMachineInstancesClient, + VirtualMachineTemplates: virtualMachineTemplatesClient, + VirtualNetworks: virtualNetworksClient, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/README.md new file mode 100644 index 000000000000..4338e93e4e63 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/README.md @@ -0,0 +1,116 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds` Documentation + +The `clouds` SDK allows for interaction with the Azure Resource Manager Service `systemcentervirtualmachinemanager` (API Version `2023-10-07`). + +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/systemcentervirtualmachinemanager/2023-10-07/clouds" +``` + + +### Client Initialization + +```go +client := clouds.NewCloudsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `CloudsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := clouds.NewCloudID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudValue") + +payload := clouds.Cloud{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `CloudsClient.Delete` + +```go +ctx := context.TODO() +id := clouds.NewCloudID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudValue") + +if err := client.DeleteThenPoll(ctx, id, clouds.DefaultDeleteOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `CloudsClient.Get` + +```go +ctx := context.TODO() +id := clouds.NewCloudID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudValue") + +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: `CloudsClient.ListByResourceGroup` + +```go +ctx := context.TODO() +id := clouds.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: `CloudsClient.ListBySubscription` + +```go +ctx := context.TODO() +id := clouds.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.ListBySubscription(ctx, id)` can be used to do batched pagination +items, err := client.ListBySubscriptionComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `CloudsClient.Update` + +```go +ctx := context.TODO() +id := clouds.NewCloudID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudValue") + +payload := clouds.ResourcePatch{ + // ... +} + + +if err := client.UpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/client.go new file mode 100644 index 000000000000..9720d3715983 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/client.go @@ -0,0 +1,26 @@ +package clouds + +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 CloudsClient struct { + Client *resourcemanager.Client +} + +func NewCloudsClientWithBaseURI(sdkApi sdkEnv.Api) (*CloudsClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "clouds", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating CloudsClient: %+v", err) + } + + return &CloudsClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/constants.go new file mode 100644 index 000000000000..416af769cd75 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/constants.go @@ -0,0 +1,110 @@ +package clouds + +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 Force string + +const ( + ForceFalse Force = "false" + ForceTrue Force = "true" +) + +func PossibleValuesForForce() []string { + return []string{ + string(ForceFalse), + string(ForceTrue), + } +} + +func (s *Force) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseForce(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseForce(input string) (*Force, error) { + vals := map[string]Force{ + "false": ForceFalse, + "true": ForceTrue, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := Force(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateAccepted ProvisioningState = "Accepted" + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreated ProvisioningState = "Created" + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateProvisioning ProvisioningState = "Provisioning" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateAccepted), + string(ProvisioningStateCanceled), + string(ProvisioningStateCreated), + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateProvisioning), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "accepted": ProvisioningStateAccepted, + "canceled": ProvisioningStateCanceled, + "created": ProvisioningStateCreated, + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "provisioning": ProvisioningStateProvisioning, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/id_cloud.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/id_cloud.go new file mode 100644 index 000000000000..57d2b09f4552 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/id_cloud.go @@ -0,0 +1,127 @@ +package clouds + +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 = CloudId{} + +// CloudId is a struct representing the Resource ID for a Cloud +type CloudId struct { + SubscriptionId string + ResourceGroupName string + CloudName string +} + +// NewCloudID returns a new CloudId struct +func NewCloudID(subscriptionId string, resourceGroupName string, cloudName string) CloudId { + return CloudId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + CloudName: cloudName, + } +} + +// ParseCloudID parses 'input' into a CloudId +func ParseCloudID(input string) (*CloudId, error) { + parser := resourceids.NewParserFromResourceIdType(CloudId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := CloudId{} + + 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.CloudName, ok = parsed.Parsed["cloudName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "cloudName", *parsed) + } + + return &id, nil +} + +// ParseCloudIDInsensitively parses 'input' case-insensitively into a CloudId +// note: this method should only be used for API response data and not user input +func ParseCloudIDInsensitively(input string) (*CloudId, error) { + parser := resourceids.NewParserFromResourceIdType(CloudId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := CloudId{} + + 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.CloudName, ok = parsed.Parsed["cloudName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "cloudName", *parsed) + } + + return &id, nil +} + +// ValidateCloudID checks that 'input' can be parsed as a Cloud ID +func ValidateCloudID(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 := ParseCloudID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Cloud ID +func (id CloudId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ScVmm/clouds/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.CloudName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Cloud ID +func (id CloudId) 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("staticMicrosoftScVmm", "Microsoft.ScVmm", "Microsoft.ScVmm"), + resourceids.StaticSegment("staticClouds", "clouds", "clouds"), + resourceids.UserSpecifiedSegment("cloudName", "cloudValue"), + } +} + +// String returns a human-readable description of this Cloud ID +func (id CloudId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Cloud Name: %q", id.CloudName), + } + return fmt.Sprintf("Cloud (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/method_createorupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/method_createorupdate.go new file mode 100644 index 000000000000..92e82bc5145c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/method_createorupdate.go @@ -0,0 +1,74 @@ +package clouds + +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 CloudsClient) CreateOrUpdate(ctx context.Context, id CloudId, input Cloud) (result CreateOrUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed +func (c CloudsClient) CreateOrUpdateThenPoll(ctx context.Context, id CloudId, input Cloud) 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/systemcentervirtualmachinemanager/2023-10-07/clouds/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/method_delete.go new file mode 100644 index 000000000000..c0f1ded3cfce --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/method_delete.go @@ -0,0 +1,98 @@ +package clouds + +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 +} + +type DeleteOperationOptions struct { + Force *Force +} + +func DefaultDeleteOperationOptions() DeleteOperationOptions { + return DeleteOperationOptions{} +} + +func (o DeleteOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + + return &out +} + +func (o DeleteOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o DeleteOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + if o.Force != nil { + out.Append("force", fmt.Sprintf("%v", *o.Force)) + } + return &out +} + +// Delete ... +func (c CloudsClient) Delete(ctx context.Context, id CloudId, options DeleteOperationOptions) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + OptionsObject: options, + } + + 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 CloudsClient) DeleteThenPoll(ctx context.Context, id CloudId, options DeleteOperationOptions) error { + result, err := c.Delete(ctx, id, options) + 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/systemcentervirtualmachinemanager/2023-10-07/clouds/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/method_get.go new file mode 100644 index 000000000000..5524d6f14e16 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/method_get.go @@ -0,0 +1,51 @@ +package clouds + +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 *Cloud +} + +// Get ... +func (c CloudsClient) Get(ctx context.Context, id CloudId) (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/systemcentervirtualmachinemanager/2023-10-07/clouds/method_listbyresourcegroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/method_listbyresourcegroup.go new file mode 100644 index 000000000000..280242331e35 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/method_listbyresourcegroup.go @@ -0,0 +1,90 @@ +package clouds + +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 *[]Cloud +} + +type ListByResourceGroupCompleteResult struct { + Items []Cloud +} + +// ListByResourceGroup ... +func (c CloudsClient) 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.ScVmm/clouds", 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 *[]Cloud `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 CloudsClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { + return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, CloudOperationPredicate{}) +} + +// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c CloudsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate CloudOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { + items := make([]Cloud, 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/systemcentervirtualmachinemanager/2023-10-07/clouds/method_listbysubscription.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/method_listbysubscription.go new file mode 100644 index 000000000000..dd82391ffc54 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/method_listbysubscription.go @@ -0,0 +1,90 @@ +package clouds + +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 ListBySubscriptionOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]Cloud +} + +type ListBySubscriptionCompleteResult struct { + Items []Cloud +} + +// ListBySubscription ... +func (c CloudsClient) ListBySubscription(ctx context.Context, id commonids.SubscriptionId) (result ListBySubscriptionOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.ScVmm/clouds", 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 *[]Cloud `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListBySubscriptionComplete retrieves all the results into a single object +func (c CloudsClient) ListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId) (ListBySubscriptionCompleteResult, error) { + return c.ListBySubscriptionCompleteMatchingPredicate(ctx, id, CloudOperationPredicate{}) +} + +// ListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c CloudsClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate CloudOperationPredicate) (result ListBySubscriptionCompleteResult, err error) { + items := make([]Cloud, 0) + + resp, err := c.ListBySubscription(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 = ListBySubscriptionCompleteResult{ + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/method_update.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/method_update.go new file mode 100644 index 000000000000..3909ba8abe6e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/method_update.go @@ -0,0 +1,74 @@ +package clouds + +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 CloudsClient) Update(ctx context.Context, id CloudId, input ResourcePatch) (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 CloudsClient) UpdateThenPoll(ctx context.Context, id CloudId, input ResourcePatch) 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/systemcentervirtualmachinemanager/2023-10-07/clouds/model_cloud.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/model_cloud.go new file mode 100644 index 000000000000..54782e1c6b58 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/model_cloud.go @@ -0,0 +1,19 @@ +package clouds + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Cloud struct { + ExtendedLocation ExtendedLocation `json:"extendedLocation"` + Id *string `json:"id,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties CloudProperties `json:"properties"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/model_cloudcapacity.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/model_cloudcapacity.go new file mode 100644 index 000000000000..7fbcddbb947c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/model_cloudcapacity.go @@ -0,0 +1,10 @@ +package clouds + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CloudCapacity struct { + CpuCount *int64 `json:"cpuCount,omitempty"` + MemoryMB *int64 `json:"memoryMB,omitempty"` + VMCount *int64 `json:"vmCount,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/model_cloudproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/model_cloudproperties.go new file mode 100644 index 000000000000..dfac177c333f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/model_cloudproperties.go @@ -0,0 +1,14 @@ +package clouds + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CloudProperties struct { + CloudCapacity *CloudCapacity `json:"cloudCapacity,omitempty"` + CloudName *string `json:"cloudName,omitempty"` + InventoryItemId *string `json:"inventoryItemId,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + StorageQoSPolicies *[]StorageQoSPolicy `json:"storageQoSPolicies,omitempty"` + Uuid *string `json:"uuid,omitempty"` + VMmServerId *string `json:"vmmServerId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/model_extendedlocation.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/model_extendedlocation.go new file mode 100644 index 000000000000..256e3cfbe79a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/model_extendedlocation.go @@ -0,0 +1,9 @@ +package clouds + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExtendedLocation struct { + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/model_resourcepatch.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/model_resourcepatch.go new file mode 100644 index 000000000000..2b70badeeb85 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/model_resourcepatch.go @@ -0,0 +1,8 @@ +package clouds + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ResourcePatch struct { + Tags *map[string]string `json:"tags,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/model_storageqospolicy.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/model_storageqospolicy.go new file mode 100644 index 000000000000..8425348c5c63 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/model_storageqospolicy.go @@ -0,0 +1,13 @@ +package clouds + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StorageQoSPolicy struct { + BandwidthLimit *int64 `json:"bandwidthLimit,omitempty"` + Id *string `json:"id,omitempty"` + IopsMaximum *int64 `json:"iopsMaximum,omitempty"` + IopsMinimum *int64 `json:"iopsMinimum,omitempty"` + Name *string `json:"name,omitempty"` + PolicyId *string `json:"policyId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/predicates.go new file mode 100644 index 000000000000..6e1395597d1e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/predicates.go @@ -0,0 +1,32 @@ +package clouds + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CloudOperationPredicate struct { + Id *string + Location *string + Name *string + Type *string +} + +func (p CloudOperationPredicate) Matches(input Cloud) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Location != nil && *p.Location != input.Location { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/version.go new file mode 100644 index 000000000000..1935d3db1000 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds/version.go @@ -0,0 +1,12 @@ +package clouds + +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-10-07" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/clouds/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/README.md new file mode 100644 index 000000000000..c76bf2a8e039 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/README.md @@ -0,0 +1,90 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems` Documentation + +The `inventoryitems` SDK allows for interaction with the Azure Resource Manager Service `systemcentervirtualmachinemanager` (API Version `2023-10-07`). + +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/systemcentervirtualmachinemanager/2023-10-07/inventoryitems" +``` + + +### Client Initialization + +```go +client := inventoryitems.NewInventoryItemsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `InventoryItemsClient.Create` + +```go +ctx := context.TODO() +id := inventoryitems.NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmmServerValue", "inventoryItemValue") + +payload := inventoryitems.InventoryItem{ + // ... +} + + +read, err := client.Create(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `InventoryItemsClient.Delete` + +```go +ctx := context.TODO() +id := inventoryitems.NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmmServerValue", "inventoryItemValue") + +read, err := client.Delete(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `InventoryItemsClient.Get` + +```go +ctx := context.TODO() +id := inventoryitems.NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmmServerValue", "inventoryItemValue") + +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: `InventoryItemsClient.ListByVMMServer` + +```go +ctx := context.TODO() +id := inventoryitems.NewVMmServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmmServerValue") + +// alternatively `client.ListByVMMServer(ctx, id)` can be used to do batched pagination +items, err := client.ListByVMMServerComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/client.go new file mode 100644 index 000000000000..fbe00f649ccb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/client.go @@ -0,0 +1,26 @@ +package inventoryitems + +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 InventoryItemsClient struct { + Client *resourcemanager.Client +} + +func NewInventoryItemsClientWithBaseURI(sdkApi sdkEnv.Api) (*InventoryItemsClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "inventoryitems", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating InventoryItemsClient: %+v", err) + } + + return &InventoryItemsClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/constants.go new file mode 100644 index 000000000000..d7e2dc448d89 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/constants.go @@ -0,0 +1,160 @@ +package inventoryitems + +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 InventoryType string + +const ( + InventoryTypeCloud InventoryType = "Cloud" + InventoryTypeVirtualMachine InventoryType = "VirtualMachine" + InventoryTypeVirtualMachineTemplate InventoryType = "VirtualMachineTemplate" + InventoryTypeVirtualNetwork InventoryType = "VirtualNetwork" +) + +func PossibleValuesForInventoryType() []string { + return []string{ + string(InventoryTypeCloud), + string(InventoryTypeVirtualMachine), + string(InventoryTypeVirtualMachineTemplate), + string(InventoryTypeVirtualNetwork), + } +} + +func (s *InventoryType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseInventoryType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseInventoryType(input string) (*InventoryType, error) { + vals := map[string]InventoryType{ + "cloud": InventoryTypeCloud, + "virtualmachine": InventoryTypeVirtualMachine, + "virtualmachinetemplate": InventoryTypeVirtualMachineTemplate, + "virtualnetwork": InventoryTypeVirtualNetwork, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := InventoryType(input) + return &out, nil +} + +type OsType string + +const ( + OsTypeLinux OsType = "Linux" + OsTypeOther OsType = "Other" + OsTypeWindows OsType = "Windows" +) + +func PossibleValuesForOsType() []string { + return []string{ + string(OsTypeLinux), + string(OsTypeOther), + string(OsTypeWindows), + } +} + +func (s *OsType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseOsType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseOsType(input string) (*OsType, error) { + vals := map[string]OsType{ + "linux": OsTypeLinux, + "other": OsTypeOther, + "windows": OsTypeWindows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OsType(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateAccepted ProvisioningState = "Accepted" + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreated ProvisioningState = "Created" + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateProvisioning ProvisioningState = "Provisioning" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateAccepted), + string(ProvisioningStateCanceled), + string(ProvisioningStateCreated), + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateProvisioning), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "accepted": ProvisioningStateAccepted, + "canceled": ProvisioningStateCanceled, + "created": ProvisioningStateCreated, + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "provisioning": ProvisioningStateProvisioning, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/id_inventoryitem.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/id_inventoryitem.go new file mode 100644 index 000000000000..1814b6aabd07 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/id_inventoryitem.go @@ -0,0 +1,140 @@ +package inventoryitems + +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 = InventoryItemId{} + +// InventoryItemId is a struct representing the Resource ID for a Inventory Item +type InventoryItemId struct { + SubscriptionId string + ResourceGroupName string + VmmServerName string + InventoryItemName string +} + +// NewInventoryItemID returns a new InventoryItemId struct +func NewInventoryItemID(subscriptionId string, resourceGroupName string, vmmServerName string, inventoryItemName string) InventoryItemId { + return InventoryItemId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + VmmServerName: vmmServerName, + InventoryItemName: inventoryItemName, + } +} + +// ParseInventoryItemID parses 'input' into a InventoryItemId +func ParseInventoryItemID(input string) (*InventoryItemId, error) { + parser := resourceids.NewParserFromResourceIdType(InventoryItemId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := InventoryItemId{} + + 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.VmmServerName, ok = parsed.Parsed["vmmServerName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "vmmServerName", *parsed) + } + + if id.InventoryItemName, ok = parsed.Parsed["inventoryItemName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "inventoryItemName", *parsed) + } + + return &id, nil +} + +// ParseInventoryItemIDInsensitively parses 'input' case-insensitively into a InventoryItemId +// note: this method should only be used for API response data and not user input +func ParseInventoryItemIDInsensitively(input string) (*InventoryItemId, error) { + parser := resourceids.NewParserFromResourceIdType(InventoryItemId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := InventoryItemId{} + + 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.VmmServerName, ok = parsed.Parsed["vmmServerName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "vmmServerName", *parsed) + } + + if id.InventoryItemName, ok = parsed.Parsed["inventoryItemName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "inventoryItemName", *parsed) + } + + return &id, nil +} + +// ValidateInventoryItemID checks that 'input' can be parsed as a Inventory Item ID +func ValidateInventoryItemID(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 := ParseInventoryItemID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Inventory Item ID +func (id InventoryItemId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ScVmm/vmmServers/%s/inventoryItems/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VmmServerName, id.InventoryItemName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Inventory Item ID +func (id InventoryItemId) 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("staticMicrosoftScVmm", "Microsoft.ScVmm", "Microsoft.ScVmm"), + resourceids.StaticSegment("staticVmmServers", "vmmServers", "vmmServers"), + resourceids.UserSpecifiedSegment("vmmServerName", "vmmServerValue"), + resourceids.StaticSegment("staticInventoryItems", "inventoryItems", "inventoryItems"), + resourceids.UserSpecifiedSegment("inventoryItemName", "inventoryItemValue"), + } +} + +// String returns a human-readable description of this Inventory Item ID +func (id InventoryItemId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Vmm Server Name: %q", id.VmmServerName), + fmt.Sprintf("Inventory Item Name: %q", id.InventoryItemName), + } + return fmt.Sprintf("Inventory Item (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/id_vmmserver.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/id_vmmserver.go new file mode 100644 index 000000000000..22a411b74225 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/id_vmmserver.go @@ -0,0 +1,127 @@ +package inventoryitems + +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 = VMmServerId{} + +// VMmServerId is a struct representing the Resource ID for a V Mm Server +type VMmServerId struct { + SubscriptionId string + ResourceGroupName string + VmmServerName string +} + +// NewVMmServerID returns a new VMmServerId struct +func NewVMmServerID(subscriptionId string, resourceGroupName string, vmmServerName string) VMmServerId { + return VMmServerId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + VmmServerName: vmmServerName, + } +} + +// ParseVMmServerID parses 'input' into a VMmServerId +func ParseVMmServerID(input string) (*VMmServerId, error) { + parser := resourceids.NewParserFromResourceIdType(VMmServerId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VMmServerId{} + + 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.VmmServerName, ok = parsed.Parsed["vmmServerName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "vmmServerName", *parsed) + } + + return &id, nil +} + +// ParseVMmServerIDInsensitively parses 'input' case-insensitively into a VMmServerId +// note: this method should only be used for API response data and not user input +func ParseVMmServerIDInsensitively(input string) (*VMmServerId, error) { + parser := resourceids.NewParserFromResourceIdType(VMmServerId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VMmServerId{} + + 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.VmmServerName, ok = parsed.Parsed["vmmServerName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "vmmServerName", *parsed) + } + + return &id, nil +} + +// ValidateVMmServerID checks that 'input' can be parsed as a V Mm Server ID +func ValidateVMmServerID(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 := ParseVMmServerID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted V Mm Server ID +func (id VMmServerId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ScVmm/vmmServers/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VmmServerName) +} + +// Segments returns a slice of Resource ID Segments which comprise this V Mm Server ID +func (id VMmServerId) 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("staticMicrosoftScVmm", "Microsoft.ScVmm", "Microsoft.ScVmm"), + resourceids.StaticSegment("staticVmmServers", "vmmServers", "vmmServers"), + resourceids.UserSpecifiedSegment("vmmServerName", "vmmServerValue"), + } +} + +// String returns a human-readable description of this V Mm Server ID +func (id VMmServerId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Vmm Server Name: %q", id.VmmServerName), + } + return fmt.Sprintf("V Mm Server (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/method_create.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/method_create.go new file mode 100644 index 000000000000..ab6fe5391575 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/method_create.go @@ -0,0 +1,56 @@ +package inventoryitems + +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 CreateOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *InventoryItem +} + +// Create ... +func (c InventoryItemsClient) Create(ctx context.Context, id InventoryItemId, input InventoryItem) (result CreateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/method_delete.go new file mode 100644 index 000000000000..12d362566681 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/method_delete.go @@ -0,0 +1,47 @@ +package inventoryitems + +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 DeleteOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData +} + +// Delete ... +func (c InventoryItemsClient) Delete(ctx context.Context, id InventoryItemId) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + 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 + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/method_get.go new file mode 100644 index 000000000000..ba12f1d9f3b8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/method_get.go @@ -0,0 +1,51 @@ +package inventoryitems + +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 *InventoryItem +} + +// Get ... +func (c InventoryItemsClient) Get(ctx context.Context, id InventoryItemId) (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/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/method_listbyvmmserver.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/method_listbyvmmserver.go new file mode 100644 index 000000000000..2dd129180ef1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/method_listbyvmmserver.go @@ -0,0 +1,89 @@ +package inventoryitems + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListByVMMServerOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]InventoryItem +} + +type ListByVMMServerCompleteResult struct { + Items []InventoryItem +} + +// ListByVMMServer ... +func (c InventoryItemsClient) ListByVMMServer(ctx context.Context, id VMmServerId) (result ListByVMMServerOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/inventoryItems", 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 *[]InventoryItem `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListByVMMServerComplete retrieves all the results into a single object +func (c InventoryItemsClient) ListByVMMServerComplete(ctx context.Context, id VMmServerId) (ListByVMMServerCompleteResult, error) { + return c.ListByVMMServerCompleteMatchingPredicate(ctx, id, InventoryItemOperationPredicate{}) +} + +// ListByVMMServerCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c InventoryItemsClient) ListByVMMServerCompleteMatchingPredicate(ctx context.Context, id VMmServerId, predicate InventoryItemOperationPredicate) (result ListByVMMServerCompleteResult, err error) { + items := make([]InventoryItem, 0) + + resp, err := c.ListByVMMServer(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 = ListByVMMServerCompleteResult{ + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/model_cloudinventoryitem.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/model_cloudinventoryitem.go new file mode 100644 index 000000000000..b8d67d2a4b2d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/model_cloudinventoryitem.go @@ -0,0 +1,44 @@ +package inventoryitems + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ InventoryItemProperties = CloudInventoryItem{} + +type CloudInventoryItem struct { + + // Fields inherited from InventoryItemProperties + InventoryItemName *string `json:"inventoryItemName,omitempty"` + ManagedResourceId *string `json:"managedResourceId,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + Uuid *string `json:"uuid,omitempty"` +} + +var _ json.Marshaler = CloudInventoryItem{} + +func (s CloudInventoryItem) MarshalJSON() ([]byte, error) { + type wrapper CloudInventoryItem + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling CloudInventoryItem: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling CloudInventoryItem: %+v", err) + } + decoded["inventoryType"] = "Cloud" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling CloudInventoryItem: %+v", err) + } + + return encoded, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/model_inventoryitem.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/model_inventoryitem.go new file mode 100644 index 000000000000..92f80c1062df --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/model_inventoryitem.go @@ -0,0 +1,50 @@ +package inventoryitems + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type InventoryItem struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties InventoryItemProperties `json:"properties"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +var _ json.Unmarshaler = &InventoryItem{} + +func (s *InventoryItem) UnmarshalJSON(bytes []byte) error { + type alias InventoryItem + var decoded alias + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling into InventoryItem: %+v", err) + } + + s.Id = decoded.Id + s.Kind = decoded.Kind + s.Name = decoded.Name + s.SystemData = decoded.SystemData + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling InventoryItem into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["properties"]; ok { + impl, err := unmarshalInventoryItemPropertiesImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Properties' for 'InventoryItem': %+v", err) + } + s.Properties = impl + } + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/model_inventoryitemdetails.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/model_inventoryitemdetails.go new file mode 100644 index 000000000000..e5636a2456da --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/model_inventoryitemdetails.go @@ -0,0 +1,9 @@ +package inventoryitems + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type InventoryItemDetails struct { + InventoryItemId *string `json:"inventoryItemId,omitempty"` + InventoryItemName *string `json:"inventoryItemName,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/model_inventoryitemproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/model_inventoryitemproperties.go new file mode 100644 index 000000000000..897fb127207a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/model_inventoryitemproperties.go @@ -0,0 +1,77 @@ +package inventoryitems + +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 InventoryItemProperties interface { +} + +// RawInventoryItemPropertiesImpl is returned when the Discriminated Value +// doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawInventoryItemPropertiesImpl struct { + Type string + Values map[string]interface{} +} + +func unmarshalInventoryItemPropertiesImplementation(input []byte) (InventoryItemProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling InventoryItemProperties into map[string]interface: %+v", err) + } + + value, ok := temp["inventoryType"].(string) + if !ok { + return nil, nil + } + + if strings.EqualFold(value, "Cloud") { + var out CloudInventoryItem + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into CloudInventoryItem: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "VirtualMachine") { + var out VirtualMachineInventoryItem + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into VirtualMachineInventoryItem: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "VirtualMachineTemplate") { + var out VirtualMachineTemplateInventoryItem + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into VirtualMachineTemplateInventoryItem: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "VirtualNetwork") { + var out VirtualNetworkInventoryItem + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into VirtualNetworkInventoryItem: %+v", err) + } + return out, nil + } + + out := RawInventoryItemPropertiesImpl{ + Type: value, + Values: temp, + } + return out, nil + +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/model_virtualmachineinventoryitem.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/model_virtualmachineinventoryitem.go new file mode 100644 index 000000000000..8feb3388a141 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/model_virtualmachineinventoryitem.go @@ -0,0 +1,52 @@ +package inventoryitems + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ InventoryItemProperties = VirtualMachineInventoryItem{} + +type VirtualMachineInventoryItem struct { + BiosGuid *string `json:"biosGuid,omitempty"` + Cloud *InventoryItemDetails `json:"cloud,omitempty"` + IPAddresses *[]string `json:"ipAddresses,omitempty"` + ManagedMachineResourceId *string `json:"managedMachineResourceId,omitempty"` + OsName *string `json:"osName,omitempty"` + OsType *OsType `json:"osType,omitempty"` + OsVersion *string `json:"osVersion,omitempty"` + PowerState *string `json:"powerState,omitempty"` + + // Fields inherited from InventoryItemProperties + InventoryItemName *string `json:"inventoryItemName,omitempty"` + ManagedResourceId *string `json:"managedResourceId,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + Uuid *string `json:"uuid,omitempty"` +} + +var _ json.Marshaler = VirtualMachineInventoryItem{} + +func (s VirtualMachineInventoryItem) MarshalJSON() ([]byte, error) { + type wrapper VirtualMachineInventoryItem + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling VirtualMachineInventoryItem: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling VirtualMachineInventoryItem: %+v", err) + } + decoded["inventoryType"] = "VirtualMachine" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling VirtualMachineInventoryItem: %+v", err) + } + + return encoded, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/model_virtualmachinetemplateinventoryitem.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/model_virtualmachinetemplateinventoryitem.go new file mode 100644 index 000000000000..d039273b7497 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/model_virtualmachinetemplateinventoryitem.go @@ -0,0 +1,48 @@ +package inventoryitems + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ InventoryItemProperties = VirtualMachineTemplateInventoryItem{} + +type VirtualMachineTemplateInventoryItem struct { + CpuCount *int64 `json:"cpuCount,omitempty"` + MemoryMB *int64 `json:"memoryMB,omitempty"` + OsName *string `json:"osName,omitempty"` + OsType *OsType `json:"osType,omitempty"` + + // Fields inherited from InventoryItemProperties + InventoryItemName *string `json:"inventoryItemName,omitempty"` + ManagedResourceId *string `json:"managedResourceId,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + Uuid *string `json:"uuid,omitempty"` +} + +var _ json.Marshaler = VirtualMachineTemplateInventoryItem{} + +func (s VirtualMachineTemplateInventoryItem) MarshalJSON() ([]byte, error) { + type wrapper VirtualMachineTemplateInventoryItem + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling VirtualMachineTemplateInventoryItem: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling VirtualMachineTemplateInventoryItem: %+v", err) + } + decoded["inventoryType"] = "VirtualMachineTemplate" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling VirtualMachineTemplateInventoryItem: %+v", err) + } + + return encoded, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/model_virtualnetworkinventoryitem.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/model_virtualnetworkinventoryitem.go new file mode 100644 index 000000000000..23e698f13a8a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/model_virtualnetworkinventoryitem.go @@ -0,0 +1,44 @@ +package inventoryitems + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ InventoryItemProperties = VirtualNetworkInventoryItem{} + +type VirtualNetworkInventoryItem struct { + + // Fields inherited from InventoryItemProperties + InventoryItemName *string `json:"inventoryItemName,omitempty"` + ManagedResourceId *string `json:"managedResourceId,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + Uuid *string `json:"uuid,omitempty"` +} + +var _ json.Marshaler = VirtualNetworkInventoryItem{} + +func (s VirtualNetworkInventoryItem) MarshalJSON() ([]byte, error) { + type wrapper VirtualNetworkInventoryItem + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling VirtualNetworkInventoryItem: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling VirtualNetworkInventoryItem: %+v", err) + } + decoded["inventoryType"] = "VirtualNetwork" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling VirtualNetworkInventoryItem: %+v", err) + } + + return encoded, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/predicates.go new file mode 100644 index 000000000000..228f404a3763 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/predicates.go @@ -0,0 +1,32 @@ +package inventoryitems + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type InventoryItemOperationPredicate struct { + Id *string + Kind *string + Name *string + Type *string +} + +func (p InventoryItemOperationPredicate) Matches(input InventoryItem) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Kind != nil && (input.Kind == nil || *p.Kind != *input.Kind) { + 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/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/version.go new file mode 100644 index 000000000000..9aa6fde2110d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems/version.go @@ -0,0 +1,12 @@ +package inventoryitems + +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-10-07" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/inventoryitems/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/README.md new file mode 100644 index 000000000000..be60d7605937 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/README.md @@ -0,0 +1,191 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances` Documentation + +The `virtualmachineinstances` SDK allows for interaction with the Azure Resource Manager Service `systemcentervirtualmachinemanager` (API Version `2023-10-07`). + +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/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances" +``` + + +### Client Initialization + +```go +client := virtualmachineinstances.NewVirtualMachineInstancesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VirtualMachineInstancesClient.CreateCheckpoint` + +```go +ctx := context.TODO() +id := virtualmachineinstances.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +payload := virtualmachineinstances.VirtualMachineCreateCheckpoint{ + // ... +} + + +if err := client.CreateCheckpointThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualMachineInstancesClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := virtualmachineinstances.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +payload := virtualmachineinstances.VirtualMachineInstance{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualMachineInstancesClient.Delete` + +```go +ctx := context.TODO() +id := virtualmachineinstances.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +if err := client.DeleteThenPoll(ctx, id, virtualmachineinstances.DefaultDeleteOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualMachineInstancesClient.DeleteCheckpoint` + +```go +ctx := context.TODO() +id := virtualmachineinstances.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +payload := virtualmachineinstances.VirtualMachineDeleteCheckpoint{ + // ... +} + + +if err := client.DeleteCheckpointThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualMachineInstancesClient.Get` + +```go +ctx := context.TODO() +id := virtualmachineinstances.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +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: `VirtualMachineInstancesClient.List` + +```go +ctx := context.TODO() +id := virtualmachineinstances.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +// alternatively `client.List(ctx, id)` can be used to do batched pagination +items, err := client.ListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `VirtualMachineInstancesClient.Restart` + +```go +ctx := context.TODO() +id := virtualmachineinstances.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +if err := client.RestartThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualMachineInstancesClient.RestoreCheckpoint` + +```go +ctx := context.TODO() +id := virtualmachineinstances.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +payload := virtualmachineinstances.VirtualMachineRestoreCheckpoint{ + // ... +} + + +if err := client.RestoreCheckpointThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualMachineInstancesClient.Start` + +```go +ctx := context.TODO() +id := virtualmachineinstances.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +if err := client.StartThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualMachineInstancesClient.Stop` + +```go +ctx := context.TODO() +id := virtualmachineinstances.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +payload := virtualmachineinstances.StopVirtualMachineOptions{ + // ... +} + + +if err := client.StopThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualMachineInstancesClient.Update` + +```go +ctx := context.TODO() +id := virtualmachineinstances.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +payload := virtualmachineinstances.VirtualMachineInstanceUpdate{ + // ... +} + + +if err := client.UpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/client.go new file mode 100644 index 000000000000..e40ddc4adf55 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/client.go @@ -0,0 +1,26 @@ +package virtualmachineinstances + +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 VirtualMachineInstancesClient struct { + Client *resourcemanager.Client +} + +func NewVirtualMachineInstancesClientWithBaseURI(sdkApi sdkEnv.Api) (*VirtualMachineInstancesClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "virtualmachineinstances", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating VirtualMachineInstancesClient: %+v", err) + } + + return &VirtualMachineInstancesClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/constants.go new file mode 100644 index 000000000000..14c1b12df63d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/constants.go @@ -0,0 +1,441 @@ +package virtualmachineinstances + +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 AllocationMethod string + +const ( + AllocationMethodDynamic AllocationMethod = "Dynamic" + AllocationMethodStatic AllocationMethod = "Static" +) + +func PossibleValuesForAllocationMethod() []string { + return []string{ + string(AllocationMethodDynamic), + string(AllocationMethodStatic), + } +} + +func (s *AllocationMethod) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAllocationMethod(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAllocationMethod(input string) (*AllocationMethod, error) { + vals := map[string]AllocationMethod{ + "dynamic": AllocationMethodDynamic, + "static": AllocationMethodStatic, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AllocationMethod(input) + return &out, nil +} + +type CreateDiffDisk string + +const ( + CreateDiffDiskFalse CreateDiffDisk = "false" + CreateDiffDiskTrue CreateDiffDisk = "true" +) + +func PossibleValuesForCreateDiffDisk() []string { + return []string{ + string(CreateDiffDiskFalse), + string(CreateDiffDiskTrue), + } +} + +func (s *CreateDiffDisk) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCreateDiffDisk(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseCreateDiffDisk(input string) (*CreateDiffDisk, error) { + vals := map[string]CreateDiffDisk{ + "false": CreateDiffDiskFalse, + "true": CreateDiffDiskTrue, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CreateDiffDisk(input) + return &out, nil +} + +type DeleteFromHost string + +const ( + DeleteFromHostFalse DeleteFromHost = "false" + DeleteFromHostTrue DeleteFromHost = "true" +) + +func PossibleValuesForDeleteFromHost() []string { + return []string{ + string(DeleteFromHostFalse), + string(DeleteFromHostTrue), + } +} + +func (s *DeleteFromHost) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeleteFromHost(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeleteFromHost(input string) (*DeleteFromHost, error) { + vals := map[string]DeleteFromHost{ + "false": DeleteFromHostFalse, + "true": DeleteFromHostTrue, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeleteFromHost(input) + return &out, nil +} + +type DynamicMemoryEnabled string + +const ( + DynamicMemoryEnabledFalse DynamicMemoryEnabled = "false" + DynamicMemoryEnabledTrue DynamicMemoryEnabled = "true" +) + +func PossibleValuesForDynamicMemoryEnabled() []string { + return []string{ + string(DynamicMemoryEnabledFalse), + string(DynamicMemoryEnabledTrue), + } +} + +func (s *DynamicMemoryEnabled) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDynamicMemoryEnabled(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDynamicMemoryEnabled(input string) (*DynamicMemoryEnabled, error) { + vals := map[string]DynamicMemoryEnabled{ + "false": DynamicMemoryEnabledFalse, + "true": DynamicMemoryEnabledTrue, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DynamicMemoryEnabled(input) + return &out, nil +} + +type Force string + +const ( + ForceFalse Force = "false" + ForceTrue Force = "true" +) + +func PossibleValuesForForce() []string { + return []string{ + string(ForceFalse), + string(ForceTrue), + } +} + +func (s *Force) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseForce(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseForce(input string) (*Force, error) { + vals := map[string]Force{ + "false": ForceFalse, + "true": ForceTrue, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := Force(input) + return &out, nil +} + +type IsHighlyAvailable string + +const ( + IsHighlyAvailableFalse IsHighlyAvailable = "false" + IsHighlyAvailableTrue IsHighlyAvailable = "true" +) + +func PossibleValuesForIsHighlyAvailable() []string { + return []string{ + string(IsHighlyAvailableFalse), + string(IsHighlyAvailableTrue), + } +} + +func (s *IsHighlyAvailable) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIsHighlyAvailable(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIsHighlyAvailable(input string) (*IsHighlyAvailable, error) { + vals := map[string]IsHighlyAvailable{ + "false": IsHighlyAvailableFalse, + "true": IsHighlyAvailableTrue, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IsHighlyAvailable(input) + return &out, nil +} + +type LimitCPUForMigration string + +const ( + LimitCPUForMigrationFalse LimitCPUForMigration = "false" + LimitCPUForMigrationTrue LimitCPUForMigration = "true" +) + +func PossibleValuesForLimitCPUForMigration() []string { + return []string{ + string(LimitCPUForMigrationFalse), + string(LimitCPUForMigrationTrue), + } +} + +func (s *LimitCPUForMigration) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLimitCPUForMigration(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLimitCPUForMigration(input string) (*LimitCPUForMigration, error) { + vals := map[string]LimitCPUForMigration{ + "false": LimitCPUForMigrationFalse, + "true": LimitCPUForMigrationTrue, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LimitCPUForMigration(input) + return &out, nil +} + +type OsType string + +const ( + OsTypeLinux OsType = "Linux" + OsTypeOther OsType = "Other" + OsTypeWindows OsType = "Windows" +) + +func PossibleValuesForOsType() []string { + return []string{ + string(OsTypeLinux), + string(OsTypeOther), + string(OsTypeWindows), + } +} + +func (s *OsType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseOsType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseOsType(input string) (*OsType, error) { + vals := map[string]OsType{ + "linux": OsTypeLinux, + "other": OsTypeOther, + "windows": OsTypeWindows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OsType(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateAccepted ProvisioningState = "Accepted" + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreated ProvisioningState = "Created" + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateProvisioning ProvisioningState = "Provisioning" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateAccepted), + string(ProvisioningStateCanceled), + string(ProvisioningStateCreated), + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateProvisioning), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "accepted": ProvisioningStateAccepted, + "canceled": ProvisioningStateCanceled, + "created": ProvisioningStateCreated, + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "provisioning": ProvisioningStateProvisioning, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} + +type SkipShutdown string + +const ( + SkipShutdownFalse SkipShutdown = "false" + SkipShutdownTrue SkipShutdown = "true" +) + +func PossibleValuesForSkipShutdown() []string { + return []string{ + string(SkipShutdownFalse), + string(SkipShutdownTrue), + } +} + +func (s *SkipShutdown) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSkipShutdown(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSkipShutdown(input string) (*SkipShutdown, error) { + vals := map[string]SkipShutdown{ + "false": SkipShutdownFalse, + "true": SkipShutdownTrue, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SkipShutdown(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/method_createcheckpoint.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/method_createcheckpoint.go new file mode 100644 index 000000000000..10ad40383b7a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/method_createcheckpoint.go @@ -0,0 +1,74 @@ +package virtualmachineinstances + +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/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 CreateCheckpointOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// CreateCheckpoint ... +func (c VirtualMachineInstancesClient) CreateCheckpoint(ctx context.Context, id commonids.ScopeId, input VirtualMachineCreateCheckpoint) (result CreateCheckpointOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/providers/Microsoft.ScVmm/virtualMachineInstances/default/createCheckpoint", 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 +} + +// CreateCheckpointThenPoll performs CreateCheckpoint then polls until it's completed +func (c VirtualMachineInstancesClient) CreateCheckpointThenPoll(ctx context.Context, id commonids.ScopeId, input VirtualMachineCreateCheckpoint) error { + result, err := c.CreateCheckpoint(ctx, id, input) + if err != nil { + return fmt.Errorf("performing CreateCheckpoint: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after CreateCheckpoint: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/method_createorupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/method_createorupdate.go new file mode 100644 index 000000000000..dc5d3e8647da --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/method_createorupdate.go @@ -0,0 +1,75 @@ +package virtualmachineinstances + +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/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 VirtualMachineInstancesClient) CreateOrUpdate(ctx context.Context, id commonids.ScopeId, input VirtualMachineInstance) (result CreateOrUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: fmt.Sprintf("%s/providers/Microsoft.ScVmm/virtualMachineInstances/default", 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 VirtualMachineInstancesClient) CreateOrUpdateThenPoll(ctx context.Context, id commonids.ScopeId, input VirtualMachineInstance) 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/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/method_delete.go new file mode 100644 index 000000000000..a5b03734e588 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/method_delete.go @@ -0,0 +1,103 @@ +package virtualmachineinstances + +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/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 +} + +type DeleteOperationOptions struct { + DeleteFromHost *DeleteFromHost + Force *Force +} + +func DefaultDeleteOperationOptions() DeleteOperationOptions { + return DeleteOperationOptions{} +} + +func (o DeleteOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + + return &out +} + +func (o DeleteOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o DeleteOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + if o.DeleteFromHost != nil { + out.Append("deleteFromHost", fmt.Sprintf("%v", *o.DeleteFromHost)) + } + if o.Force != nil { + out.Append("force", fmt.Sprintf("%v", *o.Force)) + } + return &out +} + +// Delete ... +func (c VirtualMachineInstancesClient) Delete(ctx context.Context, id commonids.ScopeId, options DeleteOperationOptions) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + }, + HttpMethod: http.MethodDelete, + Path: fmt.Sprintf("%s/providers/Microsoft.ScVmm/virtualMachineInstances/default", id.ID()), + OptionsObject: options, + } + + 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 VirtualMachineInstancesClient) DeleteThenPoll(ctx context.Context, id commonids.ScopeId, options DeleteOperationOptions) error { + result, err := c.Delete(ctx, id, options) + 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/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/method_deletecheckpoint.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/method_deletecheckpoint.go new file mode 100644 index 000000000000..b355bcd3c840 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/method_deletecheckpoint.go @@ -0,0 +1,74 @@ +package virtualmachineinstances + +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/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 DeleteCheckpointOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// DeleteCheckpoint ... +func (c VirtualMachineInstancesClient) DeleteCheckpoint(ctx context.Context, id commonids.ScopeId, input VirtualMachineDeleteCheckpoint) (result DeleteCheckpointOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/providers/Microsoft.ScVmm/virtualMachineInstances/default/deleteCheckpoint", 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 +} + +// DeleteCheckpointThenPoll performs DeleteCheckpoint then polls until it's completed +func (c VirtualMachineInstancesClient) DeleteCheckpointThenPoll(ctx context.Context, id commonids.ScopeId, input VirtualMachineDeleteCheckpoint) error { + result, err := c.DeleteCheckpoint(ctx, id, input) + if err != nil { + return fmt.Errorf("performing DeleteCheckpoint: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after DeleteCheckpoint: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/method_get.go new file mode 100644 index 000000000000..409ceb486d9b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/method_get.go @@ -0,0 +1,53 @@ +package virtualmachineinstances + +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 GetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *VirtualMachineInstance +} + +// Get ... +func (c VirtualMachineInstancesClient) Get(ctx context.Context, id commonids.ScopeId) (result GetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.ScVmm/virtualMachineInstances/default", 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/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/method_list.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/method_list.go new file mode 100644 index 000000000000..60ea514a81ea --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/method_list.go @@ -0,0 +1,90 @@ +package virtualmachineinstances + +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 *[]VirtualMachineInstance +} + +type ListCompleteResult struct { + Items []VirtualMachineInstance +} + +// List ... +func (c VirtualMachineInstancesClient) List(ctx context.Context, id commonids.ScopeId) (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.ScVmm/virtualMachineInstances", 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 *[]VirtualMachineInstance `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 VirtualMachineInstancesClient) ListComplete(ctx context.Context, id commonids.ScopeId) (ListCompleteResult, error) { + return c.ListCompleteMatchingPredicate(ctx, id, VirtualMachineInstanceOperationPredicate{}) +} + +// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c VirtualMachineInstancesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ScopeId, predicate VirtualMachineInstanceOperationPredicate) (result ListCompleteResult, err error) { + items := make([]VirtualMachineInstance, 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/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/method_restart.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/method_restart.go new file mode 100644 index 000000000000..6d7dbeeaba48 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/method_restart.go @@ -0,0 +1,70 @@ +package virtualmachineinstances + +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/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 RestartOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Restart ... +func (c VirtualMachineInstancesClient) Restart(ctx context.Context, id commonids.ScopeId) (result RestartOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/providers/Microsoft.ScVmm/virtualMachineInstances/default/restart", 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 +} + +// RestartThenPoll performs Restart then polls until it's completed +func (c VirtualMachineInstancesClient) RestartThenPoll(ctx context.Context, id commonids.ScopeId) error { + result, err := c.Restart(ctx, id) + if err != nil { + return fmt.Errorf("performing Restart: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Restart: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/method_restorecheckpoint.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/method_restorecheckpoint.go new file mode 100644 index 000000000000..482733633552 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/method_restorecheckpoint.go @@ -0,0 +1,74 @@ +package virtualmachineinstances + +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/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 RestoreCheckpointOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// RestoreCheckpoint ... +func (c VirtualMachineInstancesClient) RestoreCheckpoint(ctx context.Context, id commonids.ScopeId, input VirtualMachineRestoreCheckpoint) (result RestoreCheckpointOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/providers/Microsoft.ScVmm/virtualMachineInstances/default/restoreCheckpoint", 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 +} + +// RestoreCheckpointThenPoll performs RestoreCheckpoint then polls until it's completed +func (c VirtualMachineInstancesClient) RestoreCheckpointThenPoll(ctx context.Context, id commonids.ScopeId, input VirtualMachineRestoreCheckpoint) error { + result, err := c.RestoreCheckpoint(ctx, id, input) + if err != nil { + return fmt.Errorf("performing RestoreCheckpoint: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after RestoreCheckpoint: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/method_start.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/method_start.go new file mode 100644 index 000000000000..0ef71d0d7250 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/method_start.go @@ -0,0 +1,70 @@ +package virtualmachineinstances + +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/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 StartOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Start ... +func (c VirtualMachineInstancesClient) Start(ctx context.Context, id commonids.ScopeId) (result StartOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/providers/Microsoft.ScVmm/virtualMachineInstances/default/start", 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 +} + +// StartThenPoll performs Start then polls until it's completed +func (c VirtualMachineInstancesClient) StartThenPoll(ctx context.Context, id commonids.ScopeId) error { + result, err := c.Start(ctx, id) + if err != nil { + return fmt.Errorf("performing Start: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Start: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/method_stop.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/method_stop.go new file mode 100644 index 000000000000..6f7f1e3cd31a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/method_stop.go @@ -0,0 +1,74 @@ +package virtualmachineinstances + +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/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 StopOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Stop ... +func (c VirtualMachineInstancesClient) Stop(ctx context.Context, id commonids.ScopeId, input StopVirtualMachineOptions) (result StopOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/providers/Microsoft.ScVmm/virtualMachineInstances/default/stop", 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 +} + +// StopThenPoll performs Stop then polls until it's completed +func (c VirtualMachineInstancesClient) StopThenPoll(ctx context.Context, id commonids.ScopeId, input StopVirtualMachineOptions) error { + result, err := c.Stop(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Stop: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Stop: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/method_update.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/method_update.go new file mode 100644 index 000000000000..a6f082325675 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/method_update.go @@ -0,0 +1,75 @@ +package virtualmachineinstances + +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/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 VirtualMachineInstancesClient) Update(ctx context.Context, id commonids.ScopeId, input VirtualMachineInstanceUpdate) (result UpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPatch, + Path: fmt.Sprintf("%s/providers/Microsoft.ScVmm/virtualMachineInstances/default", 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 VirtualMachineInstancesClient) UpdateThenPoll(ctx context.Context, id commonids.ScopeId, input VirtualMachineInstanceUpdate) 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/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_availabilitysetlistavailabilitysetsinlined.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_availabilitysetlistavailabilitysetsinlined.go new file mode 100644 index 000000000000..eeee23b8d4bc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_availabilitysetlistavailabilitysetsinlined.go @@ -0,0 +1,9 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AvailabilitySetListAvailabilitySetsInlined struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_checkpoint.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_checkpoint.go new file mode 100644 index 000000000000..15a4dd74ae18 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_checkpoint.go @@ -0,0 +1,11 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Checkpoint struct { + CheckpointID *string `json:"checkpointID,omitempty"` + Description *string `json:"description,omitempty"` + Name *string `json:"name,omitempty"` + ParentCheckpointID *string `json:"parentCheckpointID,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_extendedlocation.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_extendedlocation.go new file mode 100644 index 000000000000..a86814d6f629 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_extendedlocation.go @@ -0,0 +1,9 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExtendedLocation struct { + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_hardwareprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_hardwareprofile.go new file mode 100644 index 000000000000..1d9b975390c1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_hardwareprofile.go @@ -0,0 +1,14 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HardwareProfile struct { + CpuCount *int64 `json:"cpuCount,omitempty"` + DynamicMemoryEnabled *DynamicMemoryEnabled `json:"dynamicMemoryEnabled,omitempty"` + DynamicMemoryMaxMB *int64 `json:"dynamicMemoryMaxMB,omitempty"` + DynamicMemoryMinMB *int64 `json:"dynamicMemoryMinMB,omitempty"` + IsHighlyAvailable *IsHighlyAvailable `json:"isHighlyAvailable,omitempty"` + LimitCPUForMigration *LimitCPUForMigration `json:"limitCpuForMigration,omitempty"` + MemoryMB *int64 `json:"memoryMB,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_hardwareprofileupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_hardwareprofileupdate.go new file mode 100644 index 000000000000..b94c91c58b0b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_hardwareprofileupdate.go @@ -0,0 +1,13 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HardwareProfileUpdate struct { + CpuCount *int64 `json:"cpuCount,omitempty"` + DynamicMemoryEnabled *DynamicMemoryEnabled `json:"dynamicMemoryEnabled,omitempty"` + DynamicMemoryMaxMB *int64 `json:"dynamicMemoryMaxMB,omitempty"` + DynamicMemoryMinMB *int64 `json:"dynamicMemoryMinMB,omitempty"` + LimitCPUForMigration *LimitCPUForMigration `json:"limitCpuForMigration,omitempty"` + MemoryMB *int64 `json:"memoryMB,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_infrastructureprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_infrastructureprofile.go new file mode 100644 index 000000000000..22fac2ad6808 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_infrastructureprofile.go @@ -0,0 +1,18 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type InfrastructureProfile struct { + BiosGuid *string `json:"biosGuid,omitempty"` + CheckpointType *string `json:"checkpointType,omitempty"` + Checkpoints *[]Checkpoint `json:"checkpoints,omitempty"` + CloudId *string `json:"cloudId,omitempty"` + Generation *int64 `json:"generation,omitempty"` + InventoryItemId *string `json:"inventoryItemId,omitempty"` + LastRestoredVMCheckpoint *Checkpoint `json:"lastRestoredVMCheckpoint,omitempty"` + TemplateId *string `json:"templateId,omitempty"` + Uuid *string `json:"uuid,omitempty"` + VMmServerId *string `json:"vmmServerId,omitempty"` + VirtualMachineName *string `json:"vmName,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_infrastructureprofileupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_infrastructureprofileupdate.go new file mode 100644 index 000000000000..dc63b0086fec --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_infrastructureprofileupdate.go @@ -0,0 +1,8 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type InfrastructureProfileUpdate struct { + CheckpointType *string `json:"checkpointType,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_networkinterface.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_networkinterface.go new file mode 100644 index 000000000000..5bd4c50160ad --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_networkinterface.go @@ -0,0 +1,18 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkInterface struct { + DisplayName *string `json:"displayName,omitempty"` + IPv4AddressType *AllocationMethod `json:"ipv4AddressType,omitempty"` + IPv4Addresses *[]string `json:"ipv4Addresses,omitempty"` + IPv6AddressType *AllocationMethod `json:"ipv6AddressType,omitempty"` + IPv6Addresses *[]string `json:"ipv6Addresses,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + MacAddressType *AllocationMethod `json:"macAddressType,omitempty"` + Name *string `json:"name,omitempty"` + NetworkName *string `json:"networkName,omitempty"` + NicId *string `json:"nicId,omitempty"` + VirtualNetworkId *string `json:"virtualNetworkId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_networkinterfaceupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_networkinterfaceupdate.go new file mode 100644 index 000000000000..5c00dd7add31 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_networkinterfaceupdate.go @@ -0,0 +1,14 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkInterfaceUpdate struct { + IPv4AddressType *AllocationMethod `json:"ipv4AddressType,omitempty"` + IPv6AddressType *AllocationMethod `json:"ipv6AddressType,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + MacAddressType *AllocationMethod `json:"macAddressType,omitempty"` + Name *string `json:"name,omitempty"` + NicId *string `json:"nicId,omitempty"` + VirtualNetworkId *string `json:"virtualNetworkId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_networkprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_networkprofile.go new file mode 100644 index 000000000000..b1085e716f8e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_networkprofile.go @@ -0,0 +1,8 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkProfile struct { + NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_networkprofileupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_networkprofileupdate.go new file mode 100644 index 000000000000..dcc323d7f683 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_networkprofileupdate.go @@ -0,0 +1,8 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkProfileUpdate struct { + NetworkInterfaces *[]NetworkInterfaceUpdate `json:"networkInterfaces,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_osprofileforvminstance.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_osprofileforvminstance.go new file mode 100644 index 000000000000..e1837a1b7c9b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_osprofileforvminstance.go @@ -0,0 +1,12 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type OsProfileForVMInstance struct { + AdminPassword *string `json:"adminPassword,omitempty"` + ComputerName *string `json:"computerName,omitempty"` + OsSku *string `json:"osSku,omitempty"` + OsType *OsType `json:"osType,omitempty"` + OsVersion *string `json:"osVersion,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_stopvirtualmachineoptions.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_stopvirtualmachineoptions.go new file mode 100644 index 000000000000..5d7c04bfd445 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_stopvirtualmachineoptions.go @@ -0,0 +1,8 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StopVirtualMachineOptions struct { + SkipShutdown *SkipShutdown `json:"skipShutdown,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_storageprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_storageprofile.go new file mode 100644 index 000000000000..1fcda71bf221 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_storageprofile.go @@ -0,0 +1,8 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StorageProfile struct { + Disks *[]VirtualDisk `json:"disks,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_storageprofileupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_storageprofileupdate.go new file mode 100644 index 000000000000..c9b1f05dc0c8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_storageprofileupdate.go @@ -0,0 +1,8 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StorageProfileUpdate struct { + Disks *[]VirtualDiskUpdate `json:"disks,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_storageqospolicydetails.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_storageqospolicydetails.go new file mode 100644 index 000000000000..4b919e02a871 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_storageqospolicydetails.go @@ -0,0 +1,9 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StorageQoSPolicyDetails struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_virtualdisk.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_virtualdisk.go new file mode 100644 index 000000000000..ffd700958da0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_virtualdisk.go @@ -0,0 +1,21 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualDisk struct { + Bus *int64 `json:"bus,omitempty"` + BusType *string `json:"busType,omitempty"` + CreateDiffDisk *CreateDiffDisk `json:"createDiffDisk,omitempty"` + DiskId *string `json:"diskId,omitempty"` + DiskSizeGB *int64 `json:"diskSizeGB,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + Lun *int64 `json:"lun,omitempty"` + MaxDiskSizeGB *int64 `json:"maxDiskSizeGB,omitempty"` + Name *string `json:"name,omitempty"` + StorageQoSPolicy *StorageQoSPolicyDetails `json:"storageQoSPolicy,omitempty"` + TemplateDiskId *string `json:"templateDiskId,omitempty"` + VhdFormatType *string `json:"vhdFormatType,omitempty"` + VhdType *string `json:"vhdType,omitempty"` + VolumeType *string `json:"volumeType,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_virtualdiskupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_virtualdiskupdate.go new file mode 100644 index 000000000000..49d92b465d7d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_virtualdiskupdate.go @@ -0,0 +1,15 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualDiskUpdate struct { + Bus *int64 `json:"bus,omitempty"` + BusType *string `json:"busType,omitempty"` + DiskId *string `json:"diskId,omitempty"` + DiskSizeGB *int64 `json:"diskSizeGB,omitempty"` + Lun *int64 `json:"lun,omitempty"` + Name *string `json:"name,omitempty"` + StorageQoSPolicy *StorageQoSPolicyDetails `json:"storageQoSPolicy,omitempty"` + VhdType *string `json:"vhdType,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_virtualmachinecreatecheckpoint.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_virtualmachinecreatecheckpoint.go new file mode 100644 index 000000000000..162ee0cfa4c2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_virtualmachinecreatecheckpoint.go @@ -0,0 +1,9 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineCreateCheckpoint struct { + Description *string `json:"description,omitempty"` + Name *string `json:"name,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_virtualmachinedeletecheckpoint.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_virtualmachinedeletecheckpoint.go new file mode 100644 index 000000000000..71ab42fa81b3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_virtualmachinedeletecheckpoint.go @@ -0,0 +1,8 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineDeleteCheckpoint struct { + Id *string `json:"id,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_virtualmachineinstance.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_virtualmachineinstance.go new file mode 100644 index 000000000000..22578153c53a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_virtualmachineinstance.go @@ -0,0 +1,17 @@ +package virtualmachineinstances + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineInstance struct { + ExtendedLocation ExtendedLocation `json:"extendedLocation"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties VirtualMachineInstanceProperties `json:"properties"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_virtualmachineinstanceproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_virtualmachineinstanceproperties.go new file mode 100644 index 000000000000..b8549a4145e7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_virtualmachineinstanceproperties.go @@ -0,0 +1,15 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineInstanceProperties struct { + AvailabilitySets *[]AvailabilitySetListAvailabilitySetsInlined `json:"availabilitySets,omitempty"` + HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` + InfrastructureProfile *InfrastructureProfile `json:"infrastructureProfile,omitempty"` + NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` + OsProfile *OsProfileForVMInstance `json:"osProfile,omitempty"` + PowerState *string `json:"powerState,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + StorageProfile *StorageProfile `json:"storageProfile,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_virtualmachineinstanceupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_virtualmachineinstanceupdate.go new file mode 100644 index 000000000000..f95bd091276e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_virtualmachineinstanceupdate.go @@ -0,0 +1,8 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineInstanceUpdate struct { + Properties *VirtualMachineInstanceUpdateProperties `json:"properties,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_virtualmachineinstanceupdateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_virtualmachineinstanceupdateproperties.go new file mode 100644 index 000000000000..de7604d85c4f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_virtualmachineinstanceupdateproperties.go @@ -0,0 +1,12 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineInstanceUpdateProperties struct { + AvailabilitySets *[]AvailabilitySetListAvailabilitySetsInlined `json:"availabilitySets,omitempty"` + HardwareProfile *HardwareProfileUpdate `json:"hardwareProfile,omitempty"` + InfrastructureProfile *InfrastructureProfileUpdate `json:"infrastructureProfile,omitempty"` + NetworkProfile *NetworkProfileUpdate `json:"networkProfile,omitempty"` + StorageProfile *StorageProfileUpdate `json:"storageProfile,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_virtualmachinerestorecheckpoint.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_virtualmachinerestorecheckpoint.go new file mode 100644 index 000000000000..43279778e524 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/model_virtualmachinerestorecheckpoint.go @@ -0,0 +1,8 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineRestoreCheckpoint struct { + Id *string `json:"id,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/predicates.go new file mode 100644 index 000000000000..e4d7d84f3570 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/predicates.go @@ -0,0 +1,27 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineInstanceOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p VirtualMachineInstanceOperationPredicate) Matches(input VirtualMachineInstance) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + 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/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/version.go new file mode 100644 index 000000000000..ff7feb152741 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances/version.go @@ -0,0 +1,12 @@ +package virtualmachineinstances + +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-10-07" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/virtualmachineinstances/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/README.md new file mode 100644 index 000000000000..b945813c38be --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/README.md @@ -0,0 +1,116 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates` Documentation + +The `virtualmachinetemplates` SDK allows for interaction with the Azure Resource Manager Service `systemcentervirtualmachinemanager` (API Version `2023-10-07`). + +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/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates" +``` + + +### Client Initialization + +```go +client := virtualmachinetemplates.NewVirtualMachineTemplatesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VirtualMachineTemplatesClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := virtualmachinetemplates.NewVirtualMachineTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineTemplateValue") + +payload := virtualmachinetemplates.VirtualMachineTemplate{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualMachineTemplatesClient.Delete` + +```go +ctx := context.TODO() +id := virtualmachinetemplates.NewVirtualMachineTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineTemplateValue") + +if err := client.DeleteThenPoll(ctx, id, virtualmachinetemplates.DefaultDeleteOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualMachineTemplatesClient.Get` + +```go +ctx := context.TODO() +id := virtualmachinetemplates.NewVirtualMachineTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineTemplateValue") + +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: `VirtualMachineTemplatesClient.ListByResourceGroup` + +```go +ctx := context.TODO() +id := virtualmachinetemplates.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: `VirtualMachineTemplatesClient.ListBySubscription` + +```go +ctx := context.TODO() +id := virtualmachinetemplates.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.ListBySubscription(ctx, id)` can be used to do batched pagination +items, err := client.ListBySubscriptionComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `VirtualMachineTemplatesClient.Update` + +```go +ctx := context.TODO() +id := virtualmachinetemplates.NewVirtualMachineTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineTemplateValue") + +payload := virtualmachinetemplates.ResourcePatch{ + // ... +} + + +if err := client.UpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/client.go new file mode 100644 index 000000000000..12c5314c789e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/client.go @@ -0,0 +1,26 @@ +package virtualmachinetemplates + +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 VirtualMachineTemplatesClient struct { + Client *resourcemanager.Client +} + +func NewVirtualMachineTemplatesClientWithBaseURI(sdkApi sdkEnv.Api) (*VirtualMachineTemplatesClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "virtualmachinetemplates", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating VirtualMachineTemplatesClient: %+v", err) + } + + return &VirtualMachineTemplatesClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/constants.go new file mode 100644 index 000000000000..a3405ff11e2e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/constants.go @@ -0,0 +1,400 @@ +package virtualmachinetemplates + +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 AllocationMethod string + +const ( + AllocationMethodDynamic AllocationMethod = "Dynamic" + AllocationMethodStatic AllocationMethod = "Static" +) + +func PossibleValuesForAllocationMethod() []string { + return []string{ + string(AllocationMethodDynamic), + string(AllocationMethodStatic), + } +} + +func (s *AllocationMethod) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAllocationMethod(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAllocationMethod(input string) (*AllocationMethod, error) { + vals := map[string]AllocationMethod{ + "dynamic": AllocationMethodDynamic, + "static": AllocationMethodStatic, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AllocationMethod(input) + return &out, nil +} + +type CreateDiffDisk string + +const ( + CreateDiffDiskFalse CreateDiffDisk = "false" + CreateDiffDiskTrue CreateDiffDisk = "true" +) + +func PossibleValuesForCreateDiffDisk() []string { + return []string{ + string(CreateDiffDiskFalse), + string(CreateDiffDiskTrue), + } +} + +func (s *CreateDiffDisk) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCreateDiffDisk(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseCreateDiffDisk(input string) (*CreateDiffDisk, error) { + vals := map[string]CreateDiffDisk{ + "false": CreateDiffDiskFalse, + "true": CreateDiffDiskTrue, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CreateDiffDisk(input) + return &out, nil +} + +type DynamicMemoryEnabled string + +const ( + DynamicMemoryEnabledFalse DynamicMemoryEnabled = "false" + DynamicMemoryEnabledTrue DynamicMemoryEnabled = "true" +) + +func PossibleValuesForDynamicMemoryEnabled() []string { + return []string{ + string(DynamicMemoryEnabledFalse), + string(DynamicMemoryEnabledTrue), + } +} + +func (s *DynamicMemoryEnabled) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDynamicMemoryEnabled(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDynamicMemoryEnabled(input string) (*DynamicMemoryEnabled, error) { + vals := map[string]DynamicMemoryEnabled{ + "false": DynamicMemoryEnabledFalse, + "true": DynamicMemoryEnabledTrue, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DynamicMemoryEnabled(input) + return &out, nil +} + +type Force string + +const ( + ForceFalse Force = "false" + ForceTrue Force = "true" +) + +func PossibleValuesForForce() []string { + return []string{ + string(ForceFalse), + string(ForceTrue), + } +} + +func (s *Force) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseForce(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseForce(input string) (*Force, error) { + vals := map[string]Force{ + "false": ForceFalse, + "true": ForceTrue, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := Force(input) + return &out, nil +} + +type IsCustomizable string + +const ( + IsCustomizableFalse IsCustomizable = "false" + IsCustomizableTrue IsCustomizable = "true" +) + +func PossibleValuesForIsCustomizable() []string { + return []string{ + string(IsCustomizableFalse), + string(IsCustomizableTrue), + } +} + +func (s *IsCustomizable) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIsCustomizable(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIsCustomizable(input string) (*IsCustomizable, error) { + vals := map[string]IsCustomizable{ + "false": IsCustomizableFalse, + "true": IsCustomizableTrue, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IsCustomizable(input) + return &out, nil +} + +type IsHighlyAvailable string + +const ( + IsHighlyAvailableFalse IsHighlyAvailable = "false" + IsHighlyAvailableTrue IsHighlyAvailable = "true" +) + +func PossibleValuesForIsHighlyAvailable() []string { + return []string{ + string(IsHighlyAvailableFalse), + string(IsHighlyAvailableTrue), + } +} + +func (s *IsHighlyAvailable) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIsHighlyAvailable(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIsHighlyAvailable(input string) (*IsHighlyAvailable, error) { + vals := map[string]IsHighlyAvailable{ + "false": IsHighlyAvailableFalse, + "true": IsHighlyAvailableTrue, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IsHighlyAvailable(input) + return &out, nil +} + +type LimitCPUForMigration string + +const ( + LimitCPUForMigrationFalse LimitCPUForMigration = "false" + LimitCPUForMigrationTrue LimitCPUForMigration = "true" +) + +func PossibleValuesForLimitCPUForMigration() []string { + return []string{ + string(LimitCPUForMigrationFalse), + string(LimitCPUForMigrationTrue), + } +} + +func (s *LimitCPUForMigration) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLimitCPUForMigration(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLimitCPUForMigration(input string) (*LimitCPUForMigration, error) { + vals := map[string]LimitCPUForMigration{ + "false": LimitCPUForMigrationFalse, + "true": LimitCPUForMigrationTrue, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LimitCPUForMigration(input) + return &out, nil +} + +type OsType string + +const ( + OsTypeLinux OsType = "Linux" + OsTypeOther OsType = "Other" + OsTypeWindows OsType = "Windows" +) + +func PossibleValuesForOsType() []string { + return []string{ + string(OsTypeLinux), + string(OsTypeOther), + string(OsTypeWindows), + } +} + +func (s *OsType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseOsType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseOsType(input string) (*OsType, error) { + vals := map[string]OsType{ + "linux": OsTypeLinux, + "other": OsTypeOther, + "windows": OsTypeWindows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OsType(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateAccepted ProvisioningState = "Accepted" + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreated ProvisioningState = "Created" + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateProvisioning ProvisioningState = "Provisioning" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateAccepted), + string(ProvisioningStateCanceled), + string(ProvisioningStateCreated), + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateProvisioning), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "accepted": ProvisioningStateAccepted, + "canceled": ProvisioningStateCanceled, + "created": ProvisioningStateCreated, + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "provisioning": ProvisioningStateProvisioning, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/id_virtualmachinetemplate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/id_virtualmachinetemplate.go new file mode 100644 index 000000000000..5b723986aad5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/id_virtualmachinetemplate.go @@ -0,0 +1,127 @@ +package virtualmachinetemplates + +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 = VirtualMachineTemplateId{} + +// VirtualMachineTemplateId is a struct representing the Resource ID for a Virtual Machine Template +type VirtualMachineTemplateId struct { + SubscriptionId string + ResourceGroupName string + VirtualMachineTemplateName string +} + +// NewVirtualMachineTemplateID returns a new VirtualMachineTemplateId struct +func NewVirtualMachineTemplateID(subscriptionId string, resourceGroupName string, virtualMachineTemplateName string) VirtualMachineTemplateId { + return VirtualMachineTemplateId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + VirtualMachineTemplateName: virtualMachineTemplateName, + } +} + +// ParseVirtualMachineTemplateID parses 'input' into a VirtualMachineTemplateId +func ParseVirtualMachineTemplateID(input string) (*VirtualMachineTemplateId, error) { + parser := resourceids.NewParserFromResourceIdType(VirtualMachineTemplateId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VirtualMachineTemplateId{} + + 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.VirtualMachineTemplateName, ok = parsed.Parsed["virtualMachineTemplateName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "virtualMachineTemplateName", *parsed) + } + + return &id, nil +} + +// ParseVirtualMachineTemplateIDInsensitively parses 'input' case-insensitively into a VirtualMachineTemplateId +// note: this method should only be used for API response data and not user input +func ParseVirtualMachineTemplateIDInsensitively(input string) (*VirtualMachineTemplateId, error) { + parser := resourceids.NewParserFromResourceIdType(VirtualMachineTemplateId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VirtualMachineTemplateId{} + + 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.VirtualMachineTemplateName, ok = parsed.Parsed["virtualMachineTemplateName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "virtualMachineTemplateName", *parsed) + } + + return &id, nil +} + +// ValidateVirtualMachineTemplateID checks that 'input' can be parsed as a Virtual Machine Template ID +func ValidateVirtualMachineTemplateID(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 := ParseVirtualMachineTemplateID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Virtual Machine Template ID +func (id VirtualMachineTemplateId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ScVmm/virtualMachineTemplates/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VirtualMachineTemplateName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Virtual Machine Template ID +func (id VirtualMachineTemplateId) 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("staticMicrosoftScVmm", "Microsoft.ScVmm", "Microsoft.ScVmm"), + resourceids.StaticSegment("staticVirtualMachineTemplates", "virtualMachineTemplates", "virtualMachineTemplates"), + resourceids.UserSpecifiedSegment("virtualMachineTemplateName", "virtualMachineTemplateValue"), + } +} + +// String returns a human-readable description of this Virtual Machine Template ID +func (id VirtualMachineTemplateId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Virtual Machine Template Name: %q", id.VirtualMachineTemplateName), + } + return fmt.Sprintf("Virtual Machine Template (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/method_createorupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/method_createorupdate.go new file mode 100644 index 000000000000..73838ea80a2e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/method_createorupdate.go @@ -0,0 +1,74 @@ +package virtualmachinetemplates + +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 VirtualMachineTemplatesClient) CreateOrUpdate(ctx context.Context, id VirtualMachineTemplateId, input VirtualMachineTemplate) (result CreateOrUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed +func (c VirtualMachineTemplatesClient) CreateOrUpdateThenPoll(ctx context.Context, id VirtualMachineTemplateId, input VirtualMachineTemplate) 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/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/method_delete.go new file mode 100644 index 000000000000..98efca73c621 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/method_delete.go @@ -0,0 +1,98 @@ +package virtualmachinetemplates + +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 +} + +type DeleteOperationOptions struct { + Force *Force +} + +func DefaultDeleteOperationOptions() DeleteOperationOptions { + return DeleteOperationOptions{} +} + +func (o DeleteOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + + return &out +} + +func (o DeleteOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o DeleteOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + if o.Force != nil { + out.Append("force", fmt.Sprintf("%v", *o.Force)) + } + return &out +} + +// Delete ... +func (c VirtualMachineTemplatesClient) Delete(ctx context.Context, id VirtualMachineTemplateId, options DeleteOperationOptions) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + OptionsObject: options, + } + + 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 VirtualMachineTemplatesClient) DeleteThenPoll(ctx context.Context, id VirtualMachineTemplateId, options DeleteOperationOptions) error { + result, err := c.Delete(ctx, id, options) + 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/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/method_get.go new file mode 100644 index 000000000000..c5baf634da30 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/method_get.go @@ -0,0 +1,51 @@ +package virtualmachinetemplates + +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 *VirtualMachineTemplate +} + +// Get ... +func (c VirtualMachineTemplatesClient) Get(ctx context.Context, id VirtualMachineTemplateId) (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/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/method_listbyresourcegroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/method_listbyresourcegroup.go new file mode 100644 index 000000000000..251bf07ca7b1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/method_listbyresourcegroup.go @@ -0,0 +1,90 @@ +package virtualmachinetemplates + +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 *[]VirtualMachineTemplate +} + +type ListByResourceGroupCompleteResult struct { + Items []VirtualMachineTemplate +} + +// ListByResourceGroup ... +func (c VirtualMachineTemplatesClient) 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.ScVmm/virtualMachineTemplates", 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 *[]VirtualMachineTemplate `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 VirtualMachineTemplatesClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { + return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, VirtualMachineTemplateOperationPredicate{}) +} + +// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c VirtualMachineTemplatesClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate VirtualMachineTemplateOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { + items := make([]VirtualMachineTemplate, 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/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/method_listbysubscription.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/method_listbysubscription.go new file mode 100644 index 000000000000..727516da0f13 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/method_listbysubscription.go @@ -0,0 +1,90 @@ +package virtualmachinetemplates + +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 ListBySubscriptionOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]VirtualMachineTemplate +} + +type ListBySubscriptionCompleteResult struct { + Items []VirtualMachineTemplate +} + +// ListBySubscription ... +func (c VirtualMachineTemplatesClient) ListBySubscription(ctx context.Context, id commonids.SubscriptionId) (result ListBySubscriptionOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.ScVmm/virtualMachineTemplates", 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 *[]VirtualMachineTemplate `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListBySubscriptionComplete retrieves all the results into a single object +func (c VirtualMachineTemplatesClient) ListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId) (ListBySubscriptionCompleteResult, error) { + return c.ListBySubscriptionCompleteMatchingPredicate(ctx, id, VirtualMachineTemplateOperationPredicate{}) +} + +// ListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c VirtualMachineTemplatesClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate VirtualMachineTemplateOperationPredicate) (result ListBySubscriptionCompleteResult, err error) { + items := make([]VirtualMachineTemplate, 0) + + resp, err := c.ListBySubscription(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 = ListBySubscriptionCompleteResult{ + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/method_update.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/method_update.go new file mode 100644 index 000000000000..c23f8763b26e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/method_update.go @@ -0,0 +1,74 @@ +package virtualmachinetemplates + +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 VirtualMachineTemplatesClient) Update(ctx context.Context, id VirtualMachineTemplateId, input ResourcePatch) (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 VirtualMachineTemplatesClient) UpdateThenPoll(ctx context.Context, id VirtualMachineTemplateId, input ResourcePatch) 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/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/model_extendedlocation.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/model_extendedlocation.go new file mode 100644 index 000000000000..7be44f383732 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/model_extendedlocation.go @@ -0,0 +1,9 @@ +package virtualmachinetemplates + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExtendedLocation struct { + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/model_networkinterface.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/model_networkinterface.go new file mode 100644 index 000000000000..48a373dc3882 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/model_networkinterface.go @@ -0,0 +1,18 @@ +package virtualmachinetemplates + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkInterface struct { + DisplayName *string `json:"displayName,omitempty"` + IPv4AddressType *AllocationMethod `json:"ipv4AddressType,omitempty"` + IPv4Addresses *[]string `json:"ipv4Addresses,omitempty"` + IPv6AddressType *AllocationMethod `json:"ipv6AddressType,omitempty"` + IPv6Addresses *[]string `json:"ipv6Addresses,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + MacAddressType *AllocationMethod `json:"macAddressType,omitempty"` + Name *string `json:"name,omitempty"` + NetworkName *string `json:"networkName,omitempty"` + NicId *string `json:"nicId,omitempty"` + VirtualNetworkId *string `json:"virtualNetworkId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/model_resourcepatch.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/model_resourcepatch.go new file mode 100644 index 000000000000..9158fc48b415 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/model_resourcepatch.go @@ -0,0 +1,8 @@ +package virtualmachinetemplates + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ResourcePatch struct { + Tags *map[string]string `json:"tags,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/model_storageqospolicydetails.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/model_storageqospolicydetails.go new file mode 100644 index 000000000000..e39a41230bc3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/model_storageqospolicydetails.go @@ -0,0 +1,9 @@ +package virtualmachinetemplates + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StorageQoSPolicyDetails struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/model_virtualdisk.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/model_virtualdisk.go new file mode 100644 index 000000000000..ba2d57b6dc34 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/model_virtualdisk.go @@ -0,0 +1,21 @@ +package virtualmachinetemplates + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualDisk struct { + Bus *int64 `json:"bus,omitempty"` + BusType *string `json:"busType,omitempty"` + CreateDiffDisk *CreateDiffDisk `json:"createDiffDisk,omitempty"` + DiskId *string `json:"diskId,omitempty"` + DiskSizeGB *int64 `json:"diskSizeGB,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + Lun *int64 `json:"lun,omitempty"` + MaxDiskSizeGB *int64 `json:"maxDiskSizeGB,omitempty"` + Name *string `json:"name,omitempty"` + StorageQoSPolicy *StorageQoSPolicyDetails `json:"storageQoSPolicy,omitempty"` + TemplateDiskId *string `json:"templateDiskId,omitempty"` + VhdFormatType *string `json:"vhdFormatType,omitempty"` + VhdType *string `json:"vhdType,omitempty"` + VolumeType *string `json:"volumeType,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/model_virtualmachinetemplate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/model_virtualmachinetemplate.go new file mode 100644 index 000000000000..d7b80cd73821 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/model_virtualmachinetemplate.go @@ -0,0 +1,19 @@ +package virtualmachinetemplates + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineTemplate struct { + ExtendedLocation ExtendedLocation `json:"extendedLocation"` + Id *string `json:"id,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties VirtualMachineTemplateProperties `json:"properties"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/model_virtualmachinetemplateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/model_virtualmachinetemplateproperties.go new file mode 100644 index 000000000000..9e470ff000a7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/model_virtualmachinetemplateproperties.go @@ -0,0 +1,25 @@ +package virtualmachinetemplates + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineTemplateProperties struct { + ComputerName *string `json:"computerName,omitempty"` + CpuCount *int64 `json:"cpuCount,omitempty"` + Disks *[]VirtualDisk `json:"disks,omitempty"` + DynamicMemoryEnabled *DynamicMemoryEnabled `json:"dynamicMemoryEnabled,omitempty"` + DynamicMemoryMaxMB *int64 `json:"dynamicMemoryMaxMB,omitempty"` + DynamicMemoryMinMB *int64 `json:"dynamicMemoryMinMB,omitempty"` + Generation *int64 `json:"generation,omitempty"` + InventoryItemId *string `json:"inventoryItemId,omitempty"` + IsCustomizable *IsCustomizable `json:"isCustomizable,omitempty"` + IsHighlyAvailable *IsHighlyAvailable `json:"isHighlyAvailable,omitempty"` + LimitCPUForMigration *LimitCPUForMigration `json:"limitCpuForMigration,omitempty"` + MemoryMB *int64 `json:"memoryMB,omitempty"` + NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` + OsName *string `json:"osName,omitempty"` + OsType *OsType `json:"osType,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + Uuid *string `json:"uuid,omitempty"` + VMmServerId *string `json:"vmmServerId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/predicates.go new file mode 100644 index 000000000000..89c36171228e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/predicates.go @@ -0,0 +1,32 @@ +package virtualmachinetemplates + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineTemplateOperationPredicate struct { + Id *string + Location *string + Name *string + Type *string +} + +func (p VirtualMachineTemplateOperationPredicate) Matches(input VirtualMachineTemplate) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Location != nil && *p.Location != input.Location { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/version.go new file mode 100644 index 000000000000..719a261728d0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates/version.go @@ -0,0 +1,12 @@ +package virtualmachinetemplates + +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-10-07" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/virtualmachinetemplates/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/README.md new file mode 100644 index 000000000000..a3f6730d05e7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/README.md @@ -0,0 +1,116 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks` Documentation + +The `virtualnetworks` SDK allows for interaction with the Azure Resource Manager Service `systemcentervirtualmachinemanager` (API Version `2023-10-07`). + +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/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks" +``` + + +### Client Initialization + +```go +client := virtualnetworks.NewVirtualNetworksClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VirtualNetworksClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := virtualnetworks.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") + +payload := virtualnetworks.VirtualNetwork{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworksClient.Delete` + +```go +ctx := context.TODO() +id := virtualnetworks.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") + +if err := client.DeleteThenPoll(ctx, id, virtualnetworks.DefaultDeleteOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworksClient.Get` + +```go +ctx := context.TODO() +id := virtualnetworks.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") + +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: `VirtualNetworksClient.ListByResourceGroup` + +```go +ctx := context.TODO() +id := virtualnetworks.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: `VirtualNetworksClient.ListBySubscription` + +```go +ctx := context.TODO() +id := virtualnetworks.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.ListBySubscription(ctx, id)` can be used to do batched pagination +items, err := client.ListBySubscriptionComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `VirtualNetworksClient.Update` + +```go +ctx := context.TODO() +id := virtualnetworks.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") + +payload := virtualnetworks.ResourcePatch{ + // ... +} + + +if err := client.UpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/client.go new file mode 100644 index 000000000000..15c346279f67 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/client.go @@ -0,0 +1,26 @@ +package virtualnetworks + +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 VirtualNetworksClient struct { + Client *resourcemanager.Client +} + +func NewVirtualNetworksClientWithBaseURI(sdkApi sdkEnv.Api) (*VirtualNetworksClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "virtualnetworks", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating VirtualNetworksClient: %+v", err) + } + + return &VirtualNetworksClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/constants.go new file mode 100644 index 000000000000..351afacd3d60 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/constants.go @@ -0,0 +1,110 @@ +package virtualnetworks + +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 Force string + +const ( + ForceFalse Force = "false" + ForceTrue Force = "true" +) + +func PossibleValuesForForce() []string { + return []string{ + string(ForceFalse), + string(ForceTrue), + } +} + +func (s *Force) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseForce(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseForce(input string) (*Force, error) { + vals := map[string]Force{ + "false": ForceFalse, + "true": ForceTrue, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := Force(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateAccepted ProvisioningState = "Accepted" + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreated ProvisioningState = "Created" + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateProvisioning ProvisioningState = "Provisioning" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateAccepted), + string(ProvisioningStateCanceled), + string(ProvisioningStateCreated), + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateProvisioning), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "accepted": ProvisioningStateAccepted, + "canceled": ProvisioningStateCanceled, + "created": ProvisioningStateCreated, + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "provisioning": ProvisioningStateProvisioning, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/id_virtualnetwork.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/id_virtualnetwork.go new file mode 100644 index 000000000000..2b3547af7032 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/id_virtualnetwork.go @@ -0,0 +1,127 @@ +package virtualnetworks + +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 = VirtualNetworkId{} + +// VirtualNetworkId is a struct representing the Resource ID for a Virtual Network +type VirtualNetworkId struct { + SubscriptionId string + ResourceGroupName string + VirtualNetworkName string +} + +// NewVirtualNetworkID returns a new VirtualNetworkId struct +func NewVirtualNetworkID(subscriptionId string, resourceGroupName string, virtualNetworkName string) VirtualNetworkId { + return VirtualNetworkId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + VirtualNetworkName: virtualNetworkName, + } +} + +// ParseVirtualNetworkID parses 'input' into a VirtualNetworkId +func ParseVirtualNetworkID(input string) (*VirtualNetworkId, error) { + parser := resourceids.NewParserFromResourceIdType(VirtualNetworkId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VirtualNetworkId{} + + 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.VirtualNetworkName, ok = parsed.Parsed["virtualNetworkName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "virtualNetworkName", *parsed) + } + + return &id, nil +} + +// ParseVirtualNetworkIDInsensitively parses 'input' case-insensitively into a VirtualNetworkId +// note: this method should only be used for API response data and not user input +func ParseVirtualNetworkIDInsensitively(input string) (*VirtualNetworkId, error) { + parser := resourceids.NewParserFromResourceIdType(VirtualNetworkId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VirtualNetworkId{} + + 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.VirtualNetworkName, ok = parsed.Parsed["virtualNetworkName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "virtualNetworkName", *parsed) + } + + return &id, nil +} + +// ValidateVirtualNetworkID checks that 'input' can be parsed as a Virtual Network ID +func ValidateVirtualNetworkID(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 := ParseVirtualNetworkID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Virtual Network ID +func (id VirtualNetworkId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ScVmm/virtualNetworks/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VirtualNetworkName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Virtual Network ID +func (id VirtualNetworkId) 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("staticMicrosoftScVmm", "Microsoft.ScVmm", "Microsoft.ScVmm"), + resourceids.StaticSegment("staticVirtualNetworks", "virtualNetworks", "virtualNetworks"), + resourceids.UserSpecifiedSegment("virtualNetworkName", "virtualNetworkValue"), + } +} + +// String returns a human-readable description of this Virtual Network ID +func (id VirtualNetworkId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Virtual Network Name: %q", id.VirtualNetworkName), + } + return fmt.Sprintf("Virtual Network (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/method_createorupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/method_createorupdate.go new file mode 100644 index 000000000000..1db606260864 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/method_createorupdate.go @@ -0,0 +1,74 @@ +package virtualnetworks + +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 VirtualNetworksClient) CreateOrUpdate(ctx context.Context, id VirtualNetworkId, input VirtualNetwork) (result CreateOrUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed +func (c VirtualNetworksClient) CreateOrUpdateThenPoll(ctx context.Context, id VirtualNetworkId, input VirtualNetwork) 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/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/method_delete.go new file mode 100644 index 000000000000..01a9c4496d60 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/method_delete.go @@ -0,0 +1,98 @@ +package virtualnetworks + +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 +} + +type DeleteOperationOptions struct { + Force *Force +} + +func DefaultDeleteOperationOptions() DeleteOperationOptions { + return DeleteOperationOptions{} +} + +func (o DeleteOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + + return &out +} + +func (o DeleteOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o DeleteOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + if o.Force != nil { + out.Append("force", fmt.Sprintf("%v", *o.Force)) + } + return &out +} + +// Delete ... +func (c VirtualNetworksClient) Delete(ctx context.Context, id VirtualNetworkId, options DeleteOperationOptions) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + OptionsObject: options, + } + + 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 VirtualNetworksClient) DeleteThenPoll(ctx context.Context, id VirtualNetworkId, options DeleteOperationOptions) error { + result, err := c.Delete(ctx, id, options) + 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/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/method_get.go new file mode 100644 index 000000000000..479941ebdb3b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/method_get.go @@ -0,0 +1,51 @@ +package virtualnetworks + +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 *VirtualNetwork +} + +// Get ... +func (c VirtualNetworksClient) Get(ctx context.Context, id VirtualNetworkId) (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/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/method_listbyresourcegroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/method_listbyresourcegroup.go new file mode 100644 index 000000000000..fbd2e3549f29 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/method_listbyresourcegroup.go @@ -0,0 +1,90 @@ +package virtualnetworks + +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 *[]VirtualNetwork +} + +type ListByResourceGroupCompleteResult struct { + Items []VirtualNetwork +} + +// ListByResourceGroup ... +func (c VirtualNetworksClient) 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.ScVmm/virtualNetworks", 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 *[]VirtualNetwork `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 VirtualNetworksClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { + return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, VirtualNetworkOperationPredicate{}) +} + +// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c VirtualNetworksClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate VirtualNetworkOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { + items := make([]VirtualNetwork, 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/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/method_listbysubscription.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/method_listbysubscription.go new file mode 100644 index 000000000000..0a396c5cbc87 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/method_listbysubscription.go @@ -0,0 +1,90 @@ +package virtualnetworks + +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 ListBySubscriptionOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]VirtualNetwork +} + +type ListBySubscriptionCompleteResult struct { + Items []VirtualNetwork +} + +// ListBySubscription ... +func (c VirtualNetworksClient) ListBySubscription(ctx context.Context, id commonids.SubscriptionId) (result ListBySubscriptionOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.ScVmm/virtualNetworks", 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 *[]VirtualNetwork `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListBySubscriptionComplete retrieves all the results into a single object +func (c VirtualNetworksClient) ListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId) (ListBySubscriptionCompleteResult, error) { + return c.ListBySubscriptionCompleteMatchingPredicate(ctx, id, VirtualNetworkOperationPredicate{}) +} + +// ListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c VirtualNetworksClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate VirtualNetworkOperationPredicate) (result ListBySubscriptionCompleteResult, err error) { + items := make([]VirtualNetwork, 0) + + resp, err := c.ListBySubscription(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 = ListBySubscriptionCompleteResult{ + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/method_update.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/method_update.go new file mode 100644 index 000000000000..bbaaaa799c09 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/method_update.go @@ -0,0 +1,74 @@ +package virtualnetworks + +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 VirtualNetworksClient) Update(ctx context.Context, id VirtualNetworkId, input ResourcePatch) (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 VirtualNetworksClient) UpdateThenPoll(ctx context.Context, id VirtualNetworkId, input ResourcePatch) 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/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/model_extendedlocation.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/model_extendedlocation.go new file mode 100644 index 000000000000..a3a28fb038c9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/model_extendedlocation.go @@ -0,0 +1,9 @@ +package virtualnetworks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExtendedLocation struct { + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/model_resourcepatch.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/model_resourcepatch.go new file mode 100644 index 000000000000..b8e4e3ef99a5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/model_resourcepatch.go @@ -0,0 +1,8 @@ +package virtualnetworks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ResourcePatch struct { + Tags *map[string]string `json:"tags,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/model_virtualnetwork.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/model_virtualnetwork.go new file mode 100644 index 000000000000..9ac2cb963907 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/model_virtualnetwork.go @@ -0,0 +1,19 @@ +package virtualnetworks + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualNetwork struct { + ExtendedLocation ExtendedLocation `json:"extendedLocation"` + Id *string `json:"id,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties VirtualNetworkProperties `json:"properties"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/model_virtualnetworkproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/model_virtualnetworkproperties.go new file mode 100644 index 000000000000..11c6f71f8ded --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/model_virtualnetworkproperties.go @@ -0,0 +1,12 @@ +package virtualnetworks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualNetworkProperties struct { + InventoryItemId *string `json:"inventoryItemId,omitempty"` + NetworkName *string `json:"networkName,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + Uuid *string `json:"uuid,omitempty"` + VMmServerId *string `json:"vmmServerId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/predicates.go new file mode 100644 index 000000000000..34e415f32c22 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/predicates.go @@ -0,0 +1,32 @@ +package virtualnetworks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualNetworkOperationPredicate struct { + Id *string + Location *string + Name *string + Type *string +} + +func (p VirtualNetworkOperationPredicate) Matches(input VirtualNetwork) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Location != nil && *p.Location != input.Location { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/version.go new file mode 100644 index 000000000000..da76573b44dd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks/version.go @@ -0,0 +1,12 @@ +package virtualnetworks + +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-10-07" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/virtualnetworks/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/README.md new file mode 100644 index 000000000000..b0c4d0c79438 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/README.md @@ -0,0 +1,86 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents` Documentation + +The `vminstanceguestagents` SDK allows for interaction with the Azure Resource Manager Service `systemcentervirtualmachinemanager` (API Version `2023-10-07`). + +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/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents" +``` + + +### Client Initialization + +```go +client := vminstanceguestagents.NewVMInstanceGuestAgentsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VMInstanceGuestAgentsClient.Create` + +```go +ctx := context.TODO() +id := vminstanceguestagents.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +payload := vminstanceguestagents.GuestAgent{ + // ... +} + + +if err := client.CreateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VMInstanceGuestAgentsClient.Delete` + +```go +ctx := context.TODO() +id := vminstanceguestagents.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +read, err := client.Delete(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VMInstanceGuestAgentsClient.Get` + +```go +ctx := context.TODO() +id := vminstanceguestagents.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +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: `VMInstanceGuestAgentsClient.List` + +```go +ctx := context.TODO() +id := vminstanceguestagents.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +// alternatively `client.List(ctx, id)` can be used to do batched pagination +items, err := client.ListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/client.go new file mode 100644 index 000000000000..c50f66637063 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/client.go @@ -0,0 +1,26 @@ +package vminstanceguestagents + +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 VMInstanceGuestAgentsClient struct { + Client *resourcemanager.Client +} + +func NewVMInstanceGuestAgentsClientWithBaseURI(sdkApi sdkEnv.Api) (*VMInstanceGuestAgentsClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "vminstanceguestagents", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating VMInstanceGuestAgentsClient: %+v", err) + } + + return &VMInstanceGuestAgentsClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/constants.go new file mode 100644 index 000000000000..03950ff6bc5a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/constants.go @@ -0,0 +1,113 @@ +package vminstanceguestagents + +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 ProvisioningAction string + +const ( + ProvisioningActionInstall ProvisioningAction = "install" + ProvisioningActionRepair ProvisioningAction = "repair" + ProvisioningActionUninstall ProvisioningAction = "uninstall" +) + +func PossibleValuesForProvisioningAction() []string { + return []string{ + string(ProvisioningActionInstall), + string(ProvisioningActionRepair), + string(ProvisioningActionUninstall), + } +} + +func (s *ProvisioningAction) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningAction(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningAction(input string) (*ProvisioningAction, error) { + vals := map[string]ProvisioningAction{ + "install": ProvisioningActionInstall, + "repair": ProvisioningActionRepair, + "uninstall": ProvisioningActionUninstall, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningAction(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateAccepted ProvisioningState = "Accepted" + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreated ProvisioningState = "Created" + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateProvisioning ProvisioningState = "Provisioning" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateAccepted), + string(ProvisioningStateCanceled), + string(ProvisioningStateCreated), + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateProvisioning), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "accepted": ProvisioningStateAccepted, + "canceled": ProvisioningStateCanceled, + "created": ProvisioningStateCreated, + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "provisioning": ProvisioningStateProvisioning, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/method_create.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/method_create.go new file mode 100644 index 000000000000..a07cd066be32 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/method_create.go @@ -0,0 +1,75 @@ +package vminstanceguestagents + +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/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Create ... +func (c VMInstanceGuestAgentsClient) Create(ctx context.Context, id commonids.ScopeId, input GuestAgent) (result CreateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: fmt.Sprintf("%s/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents/default", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateThenPoll performs Create then polls until it's completed +func (c VMInstanceGuestAgentsClient) CreateThenPoll(ctx context.Context, id commonids.ScopeId, input GuestAgent) error { + result, err := c.Create(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Create: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Create: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/method_delete.go new file mode 100644 index 000000000000..a71146bce61b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/method_delete.go @@ -0,0 +1,49 @@ +package vminstanceguestagents + +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 DeleteOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData +} + +// Delete ... +func (c VMInstanceGuestAgentsClient) Delete(ctx context.Context, id commonids.ScopeId) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusNoContent, + http.StatusOK, + }, + HttpMethod: http.MethodDelete, + Path: fmt.Sprintf("%s/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents/default", 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 + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/method_get.go new file mode 100644 index 000000000000..d849d2789f69 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/method_get.go @@ -0,0 +1,53 @@ +package vminstanceguestagents + +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 GetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *GuestAgent +} + +// Get ... +func (c VMInstanceGuestAgentsClient) Get(ctx context.Context, id commonids.ScopeId) (result GetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents/default", 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/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/method_list.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/method_list.go new file mode 100644 index 000000000000..b0e54e24c31f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/method_list.go @@ -0,0 +1,90 @@ +package vminstanceguestagents + +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 *[]GuestAgent +} + +type ListCompleteResult struct { + Items []GuestAgent +} + +// List ... +func (c VMInstanceGuestAgentsClient) List(ctx context.Context, id commonids.ScopeId) (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.ScVmm/virtualMachineInstances/default/guestAgents", 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 *[]GuestAgent `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 VMInstanceGuestAgentsClient) ListComplete(ctx context.Context, id commonids.ScopeId) (ListCompleteResult, error) { + return c.ListCompleteMatchingPredicate(ctx, id, GuestAgentOperationPredicate{}) +} + +// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c VMInstanceGuestAgentsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ScopeId, predicate GuestAgentOperationPredicate) (result ListCompleteResult, err error) { + items := make([]GuestAgent, 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/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/model_guestagent.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/model_guestagent.go new file mode 100644 index 000000000000..195f7e64aaed --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/model_guestagent.go @@ -0,0 +1,16 @@ +package vminstanceguestagents + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GuestAgent struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties GuestAgentProperties `json:"properties"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/model_guestagentproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/model_guestagentproperties.go new file mode 100644 index 000000000000..7f01590b94f8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/model_guestagentproperties.go @@ -0,0 +1,14 @@ +package vminstanceguestagents + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GuestAgentProperties struct { + Credentials *GuestCredential `json:"credentials,omitempty"` + CustomResourceName *string `json:"customResourceName,omitempty"` + HTTPProxyConfig *HTTPProxyConfiguration `json:"httpProxyConfig,omitempty"` + ProvisioningAction *ProvisioningAction `json:"provisioningAction,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + Status *string `json:"status,omitempty"` + Uuid *string `json:"uuid,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/model_guestcredential.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/model_guestcredential.go new file mode 100644 index 000000000000..4d4b3bdfa33a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/model_guestcredential.go @@ -0,0 +1,9 @@ +package vminstanceguestagents + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GuestCredential struct { + Password string `json:"password"` + Username string `json:"username"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/model_httpproxyconfiguration.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/model_httpproxyconfiguration.go new file mode 100644 index 000000000000..bc2cbf6e7769 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/model_httpproxyconfiguration.go @@ -0,0 +1,8 @@ +package vminstanceguestagents + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HTTPProxyConfiguration struct { + HTTPSProxy *string `json:"httpsProxy,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/predicates.go new file mode 100644 index 000000000000..748083659003 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/predicates.go @@ -0,0 +1,27 @@ +package vminstanceguestagents + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GuestAgentOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p GuestAgentOperationPredicate) Matches(input GuestAgent) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + 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/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/version.go new file mode 100644 index 000000000000..1b2f08a3bd16 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents/version.go @@ -0,0 +1,12 @@ +package vminstanceguestagents + +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-10-07" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/vminstanceguestagents/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstancehybrididentitymetadata/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstancehybrididentitymetadata/README.md new file mode 100644 index 000000000000..f75ff0643aed --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstancehybrididentitymetadata/README.md @@ -0,0 +1,53 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstancehybrididentitymetadata` Documentation + +The `vminstancehybrididentitymetadata` SDK allows for interaction with the Azure Resource Manager Service `systemcentervirtualmachinemanager` (API Version `2023-10-07`). + +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/systemcentervirtualmachinemanager/2023-10-07/vminstancehybrididentitymetadata" +``` + + +### Client Initialization + +```go +client := vminstancehybrididentitymetadata.NewVMInstanceHybridIdentityMetadataClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VMInstanceHybridIdentityMetadataClient.VirtualMachineInstanceHybridIdentityMetadataGet` + +```go +ctx := context.TODO() +id := vminstancehybrididentitymetadata.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +read, err := client.VirtualMachineInstanceHybridIdentityMetadataGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VMInstanceHybridIdentityMetadataClient.VirtualMachineInstanceHybridIdentityMetadataList` + +```go +ctx := context.TODO() +id := vminstancehybrididentitymetadata.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +// alternatively `client.VirtualMachineInstanceHybridIdentityMetadataList(ctx, id)` can be used to do batched pagination +items, err := client.VirtualMachineInstanceHybridIdentityMetadataListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstancehybrididentitymetadata/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstancehybrididentitymetadata/client.go new file mode 100644 index 000000000000..605e66135cb9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstancehybrididentitymetadata/client.go @@ -0,0 +1,26 @@ +package vminstancehybrididentitymetadata + +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 VMInstanceHybridIdentityMetadataClient struct { + Client *resourcemanager.Client +} + +func NewVMInstanceHybridIdentityMetadataClientWithBaseURI(sdkApi sdkEnv.Api) (*VMInstanceHybridIdentityMetadataClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "vminstancehybrididentitymetadata", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating VMInstanceHybridIdentityMetadataClient: %+v", err) + } + + return &VMInstanceHybridIdentityMetadataClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstancehybrididentitymetadata/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstancehybrididentitymetadata/constants.go new file mode 100644 index 000000000000..09f22289913c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstancehybrididentitymetadata/constants.go @@ -0,0 +1,69 @@ +package vminstancehybrididentitymetadata + +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 ProvisioningState string + +const ( + ProvisioningStateAccepted ProvisioningState = "Accepted" + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreated ProvisioningState = "Created" + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateProvisioning ProvisioningState = "Provisioning" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateAccepted), + string(ProvisioningStateCanceled), + string(ProvisioningStateCreated), + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateProvisioning), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "accepted": ProvisioningStateAccepted, + "canceled": ProvisioningStateCanceled, + "created": ProvisioningStateCreated, + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "provisioning": ProvisioningStateProvisioning, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstancehybrididentitymetadata/method_virtualmachineinstancehybrididentitymetadataget.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstancehybrididentitymetadata/method_virtualmachineinstancehybrididentitymetadataget.go new file mode 100644 index 000000000000..d24b0da5259a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstancehybrididentitymetadata/method_virtualmachineinstancehybrididentitymetadataget.go @@ -0,0 +1,53 @@ +package vminstancehybrididentitymetadata + +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 VirtualMachineInstanceHybridIdentityMetadataGetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *VMInstanceHybridIdentityMetadata +} + +// VirtualMachineInstanceHybridIdentityMetadataGet ... +func (c VMInstanceHybridIdentityMetadataClient) VirtualMachineInstanceHybridIdentityMetadataGet(ctx context.Context, id commonids.ScopeId) (result VirtualMachineInstanceHybridIdentityMetadataGetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.ScVmm/virtualMachineInstances/default/hybridIdentityMetadata/default", 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/systemcentervirtualmachinemanager/2023-10-07/vminstancehybrididentitymetadata/method_virtualmachineinstancehybrididentitymetadatalist.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstancehybrididentitymetadata/method_virtualmachineinstancehybrididentitymetadatalist.go new file mode 100644 index 000000000000..e47f31db7a8b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstancehybrididentitymetadata/method_virtualmachineinstancehybrididentitymetadatalist.go @@ -0,0 +1,90 @@ +package vminstancehybrididentitymetadata + +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 VirtualMachineInstanceHybridIdentityMetadataListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]VMInstanceHybridIdentityMetadata +} + +type VirtualMachineInstanceHybridIdentityMetadataListCompleteResult struct { + Items []VMInstanceHybridIdentityMetadata +} + +// VirtualMachineInstanceHybridIdentityMetadataList ... +func (c VMInstanceHybridIdentityMetadataClient) VirtualMachineInstanceHybridIdentityMetadataList(ctx context.Context, id commonids.ScopeId) (result VirtualMachineInstanceHybridIdentityMetadataListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.ScVmm/virtualMachineInstances/default/hybridIdentityMetadata", 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 *[]VMInstanceHybridIdentityMetadata `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// VirtualMachineInstanceHybridIdentityMetadataListComplete retrieves all the results into a single object +func (c VMInstanceHybridIdentityMetadataClient) VirtualMachineInstanceHybridIdentityMetadataListComplete(ctx context.Context, id commonids.ScopeId) (VirtualMachineInstanceHybridIdentityMetadataListCompleteResult, error) { + return c.VirtualMachineInstanceHybridIdentityMetadataListCompleteMatchingPredicate(ctx, id, VMInstanceHybridIdentityMetadataOperationPredicate{}) +} + +// VirtualMachineInstanceHybridIdentityMetadataListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c VMInstanceHybridIdentityMetadataClient) VirtualMachineInstanceHybridIdentityMetadataListCompleteMatchingPredicate(ctx context.Context, id commonids.ScopeId, predicate VMInstanceHybridIdentityMetadataOperationPredicate) (result VirtualMachineInstanceHybridIdentityMetadataListCompleteResult, err error) { + items := make([]VMInstanceHybridIdentityMetadata, 0) + + resp, err := c.VirtualMachineInstanceHybridIdentityMetadataList(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 = VirtualMachineInstanceHybridIdentityMetadataListCompleteResult{ + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstancehybrididentitymetadata/model_vminstancehybrididentitymetadata.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstancehybrididentitymetadata/model_vminstancehybrididentitymetadata.go new file mode 100644 index 000000000000..c84683e12195 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstancehybrididentitymetadata/model_vminstancehybrididentitymetadata.go @@ -0,0 +1,16 @@ +package vminstancehybrididentitymetadata + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VMInstanceHybridIdentityMetadata struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties VMInstanceHybridIdentityMetadataProperties `json:"properties"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstancehybrididentitymetadata/model_vminstancehybrididentitymetadataproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstancehybrididentitymetadata/model_vminstancehybrididentitymetadataproperties.go new file mode 100644 index 000000000000..67e5598fff71 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstancehybrididentitymetadata/model_vminstancehybrididentitymetadataproperties.go @@ -0,0 +1,10 @@ +package vminstancehybrididentitymetadata + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VMInstanceHybridIdentityMetadataProperties struct { + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + PublicKey *string `json:"publicKey,omitempty"` + ResourceUid *string `json:"resourceUid,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstancehybrididentitymetadata/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstancehybrididentitymetadata/predicates.go new file mode 100644 index 000000000000..2b14e1e41ff7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstancehybrididentitymetadata/predicates.go @@ -0,0 +1,27 @@ +package vminstancehybrididentitymetadata + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VMInstanceHybridIdentityMetadataOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p VMInstanceHybridIdentityMetadataOperationPredicate) Matches(input VMInstanceHybridIdentityMetadata) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + 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/systemcentervirtualmachinemanager/2023-10-07/vminstancehybrididentitymetadata/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstancehybrididentitymetadata/version.go new file mode 100644 index 000000000000..e7b052b612a6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstancehybrididentitymetadata/version.go @@ -0,0 +1,12 @@ +package vminstancehybrididentitymetadata + +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-10-07" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/vminstancehybrididentitymetadata/%s", defaultApiVersion) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/README.md new file mode 100644 index 000000000000..3a6a1c40d820 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/README.md @@ -0,0 +1,116 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers` Documentation + +The `vmmservers` SDK allows for interaction with the Azure Resource Manager Service `systemcentervirtualmachinemanager` (API Version `2023-10-07`). + +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/systemcentervirtualmachinemanager/2023-10-07/vmmservers" +``` + + +### Client Initialization + +```go +client := vmmservers.NewVMmServersClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VMmServersClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := vmmservers.NewVMmServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmmServerValue") + +payload := vmmservers.VMMServer{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VMmServersClient.Delete` + +```go +ctx := context.TODO() +id := vmmservers.NewVMmServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmmServerValue") + +if err := client.DeleteThenPoll(ctx, id, vmmservers.DefaultDeleteOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `VMmServersClient.Get` + +```go +ctx := context.TODO() +id := vmmservers.NewVMmServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmmServerValue") + +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: `VMmServersClient.ListByResourceGroup` + +```go +ctx := context.TODO() +id := vmmservers.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: `VMmServersClient.ListBySubscription` + +```go +ctx := context.TODO() +id := vmmservers.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.ListBySubscription(ctx, id)` can be used to do batched pagination +items, err := client.ListBySubscriptionComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `VMmServersClient.Update` + +```go +ctx := context.TODO() +id := vmmservers.NewVMmServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vmmServerValue") + +payload := vmmservers.ResourcePatch{ + // ... +} + + +if err := client.UpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/client.go new file mode 100644 index 000000000000..ff1fc1061d59 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/client.go @@ -0,0 +1,26 @@ +package vmmservers + +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 VMmServersClient struct { + Client *resourcemanager.Client +} + +func NewVMmServersClientWithBaseURI(sdkApi sdkEnv.Api) (*VMmServersClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "vmmservers", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating VMmServersClient: %+v", err) + } + + return &VMmServersClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/constants.go new file mode 100644 index 000000000000..6eeaba57dab0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/constants.go @@ -0,0 +1,110 @@ +package vmmservers + +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 Force string + +const ( + ForceFalse Force = "false" + ForceTrue Force = "true" +) + +func PossibleValuesForForce() []string { + return []string{ + string(ForceFalse), + string(ForceTrue), + } +} + +func (s *Force) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseForce(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseForce(input string) (*Force, error) { + vals := map[string]Force{ + "false": ForceFalse, + "true": ForceTrue, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := Force(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateAccepted ProvisioningState = "Accepted" + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreated ProvisioningState = "Created" + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateProvisioning ProvisioningState = "Provisioning" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateAccepted), + string(ProvisioningStateCanceled), + string(ProvisioningStateCreated), + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateProvisioning), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "accepted": ProvisioningStateAccepted, + "canceled": ProvisioningStateCanceled, + "created": ProvisioningStateCreated, + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "provisioning": ProvisioningStateProvisioning, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/id_vmmserver.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/id_vmmserver.go new file mode 100644 index 000000000000..962171b7d305 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/id_vmmserver.go @@ -0,0 +1,127 @@ +package vmmservers + +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 = VMmServerId{} + +// VMmServerId is a struct representing the Resource ID for a V Mm Server +type VMmServerId struct { + SubscriptionId string + ResourceGroupName string + VmmServerName string +} + +// NewVMmServerID returns a new VMmServerId struct +func NewVMmServerID(subscriptionId string, resourceGroupName string, vmmServerName string) VMmServerId { + return VMmServerId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + VmmServerName: vmmServerName, + } +} + +// ParseVMmServerID parses 'input' into a VMmServerId +func ParseVMmServerID(input string) (*VMmServerId, error) { + parser := resourceids.NewParserFromResourceIdType(VMmServerId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VMmServerId{} + + 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.VmmServerName, ok = parsed.Parsed["vmmServerName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "vmmServerName", *parsed) + } + + return &id, nil +} + +// ParseVMmServerIDInsensitively parses 'input' case-insensitively into a VMmServerId +// note: this method should only be used for API response data and not user input +func ParseVMmServerIDInsensitively(input string) (*VMmServerId, error) { + parser := resourceids.NewParserFromResourceIdType(VMmServerId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := VMmServerId{} + + 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.VmmServerName, ok = parsed.Parsed["vmmServerName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "vmmServerName", *parsed) + } + + return &id, nil +} + +// ValidateVMmServerID checks that 'input' can be parsed as a V Mm Server ID +func ValidateVMmServerID(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 := ParseVMmServerID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted V Mm Server ID +func (id VMmServerId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ScVmm/vmmServers/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VmmServerName) +} + +// Segments returns a slice of Resource ID Segments which comprise this V Mm Server ID +func (id VMmServerId) 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("staticMicrosoftScVmm", "Microsoft.ScVmm", "Microsoft.ScVmm"), + resourceids.StaticSegment("staticVmmServers", "vmmServers", "vmmServers"), + resourceids.UserSpecifiedSegment("vmmServerName", "vmmServerValue"), + } +} + +// String returns a human-readable description of this V Mm Server ID +func (id VMmServerId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Vmm Server Name: %q", id.VmmServerName), + } + return fmt.Sprintf("V Mm Server (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/method_createorupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/method_createorupdate.go new file mode 100644 index 000000000000..df8dcc4b8929 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/method_createorupdate.go @@ -0,0 +1,74 @@ +package vmmservers + +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 VMmServersClient) CreateOrUpdate(ctx context.Context, id VMmServerId, input VMMServer) (result CreateOrUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed +func (c VMmServersClient) CreateOrUpdateThenPoll(ctx context.Context, id VMmServerId, input VMMServer) 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/systemcentervirtualmachinemanager/2023-10-07/vmmservers/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/method_delete.go new file mode 100644 index 000000000000..b68e32b8439b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/method_delete.go @@ -0,0 +1,98 @@ +package vmmservers + +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 +} + +type DeleteOperationOptions struct { + Force *Force +} + +func DefaultDeleteOperationOptions() DeleteOperationOptions { + return DeleteOperationOptions{} +} + +func (o DeleteOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + + return &out +} + +func (o DeleteOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o DeleteOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + if o.Force != nil { + out.Append("force", fmt.Sprintf("%v", *o.Force)) + } + return &out +} + +// Delete ... +func (c VMmServersClient) Delete(ctx context.Context, id VMmServerId, options DeleteOperationOptions) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + OptionsObject: options, + } + + 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 VMmServersClient) DeleteThenPoll(ctx context.Context, id VMmServerId, options DeleteOperationOptions) error { + result, err := c.Delete(ctx, id, options) + 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/systemcentervirtualmachinemanager/2023-10-07/vmmservers/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/method_get.go new file mode 100644 index 000000000000..a3a67be4c9f2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/method_get.go @@ -0,0 +1,51 @@ +package vmmservers + +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 *VMMServer +} + +// Get ... +func (c VMmServersClient) Get(ctx context.Context, id VMmServerId) (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/systemcentervirtualmachinemanager/2023-10-07/vmmservers/method_listbyresourcegroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/method_listbyresourcegroup.go new file mode 100644 index 000000000000..75e4a74c0a62 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/method_listbyresourcegroup.go @@ -0,0 +1,90 @@ +package vmmservers + +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 *[]VMMServer +} + +type ListByResourceGroupCompleteResult struct { + Items []VMMServer +} + +// ListByResourceGroup ... +func (c VMmServersClient) 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.ScVmm/vmmServers", 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 *[]VMMServer `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 VMmServersClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { + return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, VMMServerOperationPredicate{}) +} + +// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c VMmServersClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate VMMServerOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { + items := make([]VMMServer, 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/systemcentervirtualmachinemanager/2023-10-07/vmmservers/method_listbysubscription.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/method_listbysubscription.go new file mode 100644 index 000000000000..109aab801a0e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/method_listbysubscription.go @@ -0,0 +1,90 @@ +package vmmservers + +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 ListBySubscriptionOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]VMMServer +} + +type ListBySubscriptionCompleteResult struct { + Items []VMMServer +} + +// ListBySubscription ... +func (c VMmServersClient) ListBySubscription(ctx context.Context, id commonids.SubscriptionId) (result ListBySubscriptionOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.ScVmm/vmmServers", 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 *[]VMMServer `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListBySubscriptionComplete retrieves all the results into a single object +func (c VMmServersClient) ListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId) (ListBySubscriptionCompleteResult, error) { + return c.ListBySubscriptionCompleteMatchingPredicate(ctx, id, VMMServerOperationPredicate{}) +} + +// ListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c VMmServersClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate VMMServerOperationPredicate) (result ListBySubscriptionCompleteResult, err error) { + items := make([]VMMServer, 0) + + resp, err := c.ListBySubscription(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 = ListBySubscriptionCompleteResult{ + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/method_update.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/method_update.go new file mode 100644 index 000000000000..9d6098e8bdd0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/method_update.go @@ -0,0 +1,74 @@ +package vmmservers + +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 VMmServersClient) Update(ctx context.Context, id VMmServerId, input ResourcePatch) (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 VMmServersClient) UpdateThenPoll(ctx context.Context, id VMmServerId, input ResourcePatch) 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/systemcentervirtualmachinemanager/2023-10-07/vmmservers/model_extendedlocation.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/model_extendedlocation.go new file mode 100644 index 000000000000..ef8c8a113bce --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/model_extendedlocation.go @@ -0,0 +1,9 @@ +package vmmservers + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExtendedLocation struct { + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/model_resourcepatch.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/model_resourcepatch.go new file mode 100644 index 000000000000..b5b742ed7b12 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/model_resourcepatch.go @@ -0,0 +1,8 @@ +package vmmservers + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ResourcePatch struct { + Tags *map[string]string `json:"tags,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/model_vmmcredential.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/model_vmmcredential.go new file mode 100644 index 000000000000..139ef67e0e2f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/model_vmmcredential.go @@ -0,0 +1,9 @@ +package vmmservers + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VMMCredential struct { + Password *string `json:"password,omitempty"` + Username *string `json:"username,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/model_vmmserver.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/model_vmmserver.go new file mode 100644 index 000000000000..bb0e9a9b3394 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/model_vmmserver.go @@ -0,0 +1,19 @@ +package vmmservers + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VMMServer struct { + ExtendedLocation ExtendedLocation `json:"extendedLocation"` + Id *string `json:"id,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties VMMServerProperties `json:"properties"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/model_vmmserverproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/model_vmmserverproperties.go new file mode 100644 index 000000000000..6532dae951fd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/model_vmmserverproperties.go @@ -0,0 +1,15 @@ +package vmmservers + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VMMServerProperties struct { + ConnectionStatus *string `json:"connectionStatus,omitempty"` + Credentials *VMMCredential `json:"credentials,omitempty"` + ErrorMessage *string `json:"errorMessage,omitempty"` + Fqdn string `json:"fqdn"` + Port *int64 `json:"port,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + Uuid *string `json:"uuid,omitempty"` + Version *string `json:"version,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/predicates.go new file mode 100644 index 000000000000..c2a867ae8f50 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/predicates.go @@ -0,0 +1,32 @@ +package vmmservers + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VMMServerOperationPredicate struct { + Id *string + Location *string + Name *string + Type *string +} + +func (p VMMServerOperationPredicate) Matches(input VMMServer) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Location != nil && *p.Location != input.Location { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/version.go new file mode 100644 index 000000000000..42b3cbefc9f9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers/version.go @@ -0,0 +1,12 @@ +package vmmservers + +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-10-07" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/vmmservers/%s", defaultApiVersion) +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 22c358e2ec6a..97be29e7a851 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -960,6 +960,16 @@ github.com/hashicorp/go-azure-sdk/resource-manager/streamanalytics/2020-03-01/st github.com/hashicorp/go-azure-sdk/resource-manager/streamanalytics/2020-03-01/transformations github.com/hashicorp/go-azure-sdk/resource-manager/streamanalytics/2021-10-01-preview/outputs github.com/hashicorp/go-azure-sdk/resource-manager/subscription/2021-10-01/subscriptions +github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07 +github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets +github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/clouds +github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/inventoryitems +github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachineinstances +github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualmachinetemplates +github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/virtualnetworks +github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstanceguestagents +github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vminstancehybrididentitymetadata +github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers github.com/hashicorp/go-azure-sdk/resource-manager/timeseriesinsights/2020-05-15 github.com/hashicorp/go-azure-sdk/resource-manager/timeseriesinsights/2020-05-15/accesspolicies github.com/hashicorp/go-azure-sdk/resource-manager/timeseriesinsights/2020-05-15/environments diff --git a/website/docs/r/system_center_virtual_machine_manager_availability_set.html.markdown b/website/docs/r/system_center_virtual_machine_manager_availability_set.html.markdown new file mode 100644 index 000000000000..294a90b3a3a3 --- /dev/null +++ b/website/docs/r/system_center_virtual_machine_manager_availability_set.html.markdown @@ -0,0 +1,78 @@ +--- +subcategory: "System Center Virtual Machine Manager" +layout: "azurerm" +page_title: "Azure Resource Manager: azurerm_system_center_virtual_machine_manager_availability_set" +description: |- + Manages a System Center Virtual Machine Manager Availability Set. +--- + +# azurerm_system_center_virtual_machine_manager_availability_set + +Manages a System Center Virtual Machine Manager Availability Set. + +## Example Usage + +```hcl +resource "azurerm_resource_group" "example" { + name = "example-resources" + location = "West Europe" +} + +resource "azurerm_custom_location" "example" { + name = "example-cl" +} + +resource "azurerm_system_center_virtual_machine_manager_server" "example" { + name = "example-scvmmms" + resource_group_name = azurerm_resource_group.example.name + location = azurerm_resource_group.example.location + custom_location_id = azurerm_custom_location.example.id + fqdn = "exampledomain.com" +} + +resource "azurerm_system_center_virtual_machine_manager_availability_set" "example" { + name = "example-scvmmas" + location = azurerm_resource_group.example.location + custom_location_id = azurerm_custom_location.example.id + system_center_virtual_machine_manager_server_id = azurerm_system_center_virtual_machine_manager_server.example.id +} +``` + +## Arguments Reference + +The following arguments are supported: + +* `name` - (Required) (Required) The name which should be used for this System Center Virtual Machine Manager Availability Set. Changing this forces a new resource to be created. + +* `location` - (Required) The Azure Region where the System Center Virtual Machine Manager Availability Set should exist. Changing this forces a new resource to be created. + +* `custom_location_id` - (Required) The ID of the Custom Location for the System Center Virtual Machine Manager Availability Set. + +* `system_center_virtual_machine_manager_server_id` - (Required) The ID of the System Center Virtual Machine Manager Server. Changing this forces a new resource to be created. + +* `tags` - (Optional) A mapping of tags which should be assigned to the System Center Virtual Machine Manager Availability Set. + +## Attributes Reference + +In addition to the Arguments listed above - the following Attributes are exported: + +* `id` - The ID of the System Center Virtual Machine Manager Availability Set. + +--- + +## Timeouts + +The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/docs/configuration/resources.html#timeouts) for certain actions: + +* `create` - (Defaults to 30 minutes) Used when creating this System Center Virtual Machine Manager Availability Set. +* `read` - (Defaults to 5 minutes) Used when retrieving this System Center Virtual Machine Manager Availability Set. +* `update` - (Defaults to 30 minutes) Used when updating this System Center Virtual Machine Manager Availability Set. +* `delete` - (Defaults to 30 minutes) Used when deleting this System Center Virtual Machine Manager Availability Set. + +## Import + +System Center Virtual Machine Manager Availability Sets can be imported into Terraform using the `resource id`, e.g. + +```shell +terraform import azurerm_system_center_virtual_machine_manager_availability_set.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.ScVmm/availabilitySets/availabilitySet1 +``` From b00d537c250e4d0a0fc6e6af8f103c8a5a57da7a Mon Sep 17 00:00:00 2001 From: neil-yechenwei Date: Tue, 28 Nov 2023 17:43:31 +0800 Subject: [PATCH 2/7] update code --- .github/labeler-issue-triage.yml | 3 +++ .github/labeler-pull-request-triage.yml | 3 +++ .teamcity/components/generated/services.kt | 1 + website/allowed-subcategories | 1 + 4 files changed, 8 insertions(+) diff --git a/.github/labeler-issue-triage.yml b/.github/labeler-issue-triage.yml index f04cd5c8c531..2146735f8eb4 100644 --- a/.github/labeler-issue-triage.yml +++ b/.github/labeler-issue-triage.yml @@ -333,6 +333,9 @@ service/subscription: service/synapse: - '### (|New or )Affected Resource\(s\)\/Data Source\(s\)((.|\n)*)azurerm_synapse_((.|\n)*)###' +service/systemcentervirtualmachinemanager: + - '### (|New or )Affected Resource\(s\)\/Data Source\(s\)((.|\n)*)azurerm_system_center_virtual_machine_manager_availability_set((.|\n)*)###' + service/traffic-manager: - '### (|New or )Affected Resource\(s\)\/Data Source\(s\)((.|\n)*)azurerm_traffic_manager_((.|\n)*)###' diff --git a/.github/labeler-pull-request-triage.yml b/.github/labeler-pull-request-triage.yml index 46c06b2981d2..71014b40b8d0 100644 --- a/.github/labeler-pull-request-triage.yml +++ b/.github/labeler-pull-request-triage.yml @@ -336,6 +336,9 @@ service/subscription: service/synapse: - internal/services/synapse/**/* +service/systemcentervirtualmachinemanager: + - internal/services/systemcentervirtualmachinemanager/**/* + service/traffic-manager: - internal/services/trafficmanager/**/* diff --git a/.teamcity/components/generated/services.kt b/.teamcity/components/generated/services.kt index 086857766ba2..cf0823fb3c08 100644 --- a/.teamcity/components/generated/services.kt +++ b/.teamcity/components/generated/services.kt @@ -122,6 +122,7 @@ var services = mapOf( "streamanalytics" to "Stream Analytics", "subscription" to "Subscription", "synapse" to "Synapse", + "systemcentervirtualmachinemanager" to "System Center Virtual Machine Manager", "iottimeseriesinsights" to "Time Series Insights", "trafficmanager" to "Traffic Manager", "vmware" to "VMware", diff --git a/website/allowed-subcategories b/website/allowed-subcategories index 89cd7a82e828..450fe278c521 100644 --- a/website/allowed-subcategories +++ b/website/allowed-subcategories @@ -101,6 +101,7 @@ Storage Storage Mover Stream Analytics Synapse +System Center Virtual Machine Manager Template Time Series Insights VMware (AVS) From b501c096a1333ee552dd2fe78d3bd5bf3886b542 Mon Sep 17 00:00:00 2001 From: neil-yechenwei Date: Wed, 21 Feb 2024 16:29:50 +0800 Subject: [PATCH 3/7] update code --- ...chine_manager_availability_set_resource.go | 53 +++++---------- ..._manager_availability_set_resource_test.go | 68 +++++++++++++------ ...ine_manager_availability_set.html.markdown | 15 ++-- 3 files changed, 72 insertions(+), 64 deletions(-) diff --git a/internal/services/systemcentervirtualmachinemanager/system_center_virtual_machine_manager_availability_set_resource.go b/internal/services/systemcentervirtualmachinemanager/system_center_virtual_machine_manager_availability_set_resource.go index 4afb528ef83c..40b974588a17 100644 --- a/internal/services/systemcentervirtualmachinemanager/system_center_virtual_machine_manager_availability_set_resource.go +++ b/internal/services/systemcentervirtualmachinemanager/system_center_virtual_machine_manager_availability_set_resource.go @@ -9,17 +9,18 @@ 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/extendedlocation/2021-08-15/customlocations" "github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets" "github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/vmmservers" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/services/systemcentervirtualmachinemanager/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" - "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" "github.com/hashicorp/terraform-provider-azurerm/utils" ) type SystemCenterVirtualMachineManagerAvailabilitySetModel struct { Name string `tfschema:"name"` + ResourceGroupName string `tfschema:"resource_group_name"` Location string `tfschema:"location"` CustomLocationId string `tfschema:"custom_location_id"` SystemCenterVirtualMachineManagerServerId string `tfschema:"system_center_virtual_machine_manager_server_id"` @@ -52,20 +53,13 @@ func (r SystemCenterVirtualMachineManagerAvailabilitySetResource) Arguments() ma ValidateFunc: validate.SystemCenterVirtualMachineManagerAvailabilitySetName, }, + "resource_group_name": commonschema.ResourceGroupName(), + "location": commonschema.Location(), - "custom_location_id": { - Type: pluginsdk.TypeString, - Required: true, - ValidateFunc: validation.StringIsNotEmpty, - }, + "custom_location_id": commonschema.ResourceIDReferenceRequiredForceNew(&customlocations.CustomLocationId{}), - "system_center_virtual_machine_manager_server_id": { - Type: pluginsdk.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validation.StringIsNotEmpty, - }, + "system_center_virtual_machine_manager_server_id": commonschema.ResourceIDReferenceRequiredForceNew(&vmmservers.VMmServerId{}), "tags": commonschema.Tags(), } @@ -92,7 +86,7 @@ func (r SystemCenterVirtualMachineManagerAvailabilitySetResource) Create() sdk.R return err } - id := availabilitysets.NewAvailabilitySetID(subscriptionId, scvmmServerId.ResourceGroupName, model.Name) + id := availabilitysets.NewAvailabilitySetID(subscriptionId, model.ResourceGroupName, model.Name) existing, err := client.Get(ctx, id) if err != nil { @@ -148,11 +142,17 @@ func (r SystemCenterVirtualMachineManagerAvailabilitySetResource) Read() sdk.Res state := SystemCenterVirtualMachineManagerAvailabilitySetModel{} if model := resp.Model; model != nil { - state.CustomLocationId = pointer.From(model.ExtendedLocation.Name) state.Location = location.Normalize(model.Location) + state.ResourceGroupName = id.ResourceGroupName state.Name = id.AvailabilitySetName - state.SystemCenterVirtualMachineManagerServerId = vmmservers.NewVMmServerID(id.SubscriptionId, id.ResourceGroupName, pointer.From(model.Properties.AvailabilitySetName)).ID() + state.CustomLocationId = pointer.From(model.ExtendedLocation.Name) state.Tags = pointer.From(model.Tags) + + scvmmServerId, err := vmmservers.ParseVMmServerID(pointer.From(model.Properties.VMmServerId)) + if err != nil { + return err + } + state.SystemCenterVirtualMachineManagerServerId = scvmmServerId.ID() } return metadata.Encode(&state) @@ -176,28 +176,11 @@ func (r SystemCenterVirtualMachineManagerAvailabilitySetResource) Update() sdk.R return fmt.Errorf("decoding: %+v", err) } - existing, err := client.Get(ctx, *id) - if err != nil { - return fmt.Errorf("retrieving %s: %+v", *id, err) - } - - parameters := existing.Model - if parameters == nil { - return fmt.Errorf("retrieving %s: model was nil", *id) - } - - if metadata.ResourceData.HasChange("custom_location_id") { - parameters.ExtendedLocation = availabilitysets.ExtendedLocation{ - Type: utils.String("customLocation"), - Name: utils.String(model.CustomLocationId), - } - } - - if metadata.ResourceData.HasChange("tags") { - parameters.Tags = pointer.To(model.Tags) + parameters := availabilitysets.ResourcePatch{ + Tags: pointer.To(model.Tags), } - if err := client.CreateOrUpdateThenPoll(ctx, *id, *parameters); err != nil { + if err := client.UpdateThenPoll(ctx, *id, parameters); err != nil { return fmt.Errorf("updating %s: %+v", *id, err) } diff --git a/internal/services/systemcentervirtualmachinemanager/system_center_virtual_machine_manager_availability_set_resource_test.go b/internal/services/systemcentervirtualmachinemanager/system_center_virtual_machine_manager_availability_set_resource_test.go index 6cb314e63d01..87c5dce7b836 100644 --- a/internal/services/systemcentervirtualmachinemanager/system_center_virtual_machine_manager_availability_set_resource_test.go +++ b/internal/services/systemcentervirtualmachinemanager/system_center_virtual_machine_manager_availability_set_resource_test.go @@ -3,6 +3,7 @@ package systemcentervirtualmachinemanager_test import ( "context" "fmt" + "os" "testing" "github.com/hashicorp/go-azure-sdk/resource-manager/systemcentervirtualmachinemanager/2023-10-07/availabilitysets" @@ -15,11 +16,28 @@ import ( type SystemCenterVirtualMachineManagerAvailabilitySetResource struct{} -func TestAccSystemCenterVirtualMachineManagerAvailabilitySet_basic(t *testing.T) { +func TestAccSystemCenterVirtualMachineManagerAvailabilitySetSequential(t *testing.T) { + // NOTE: this is a combined test rather than separate split out tests because only one System Center Virtual Machine Manager Server can be onboarded at a time on a given Custom Location + + if os.Getenv("ARM_TEST_CUSTOM_LOCATION_ID") == "" || os.Getenv("ARM_TEST_FQDN") == "" || os.Getenv("ARM_TEST_USERNAME") == "" || os.Getenv("ARM_TEST_PASSWORD") == "" { + t.Skip("Skipping as one of `ARM_TEST_CUSTOM_LOCATION_ID`, `ARM_TEST_FQDN`, `ARM_TEST_USERNAME`, `ARM_TEST_PASSWORD` was not specified") + } + + acceptance.RunTestsInSequence(t, map[string]map[string]func(t *testing.T){ + "scvmmAvailabilitySet": { + "basic": testAccSystemCenterVirtualMachineManagerAvailabilitySet_basic, + "requiresImport": testAccSystemCenterVirtualMachineManagerAvailabilitySet_requiresImport, + "complete": testAccSystemCenterVirtualMachineManagerAvailabilitySet_complete, + "update": testAccSystemCenterVirtualMachineManagerAvailabilitySet_update, + }, + }) +} + +func testAccSystemCenterVirtualMachineManagerAvailabilitySet_basic(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_system_center_virtual_machine_manager_availability_set", "test") r := SystemCenterVirtualMachineManagerAvailabilitySetResource{} - data.ResourceTest(t, r, []acceptance.TestStep{ + data.ResourceSequentialTest(t, r, []acceptance.TestStep{ { Config: r.basic(data), Check: acceptance.ComposeTestCheckFunc( @@ -30,11 +48,11 @@ func TestAccSystemCenterVirtualMachineManagerAvailabilitySet_basic(t *testing.T) }) } -func TestAccSystemCenterVirtualMachineManagerAvailabilitySet_requiresImport(t *testing.T) { +func testAccSystemCenterVirtualMachineManagerAvailabilitySet_requiresImport(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_system_center_virtual_machine_manager_availability_set", "test") r := SystemCenterVirtualMachineManagerAvailabilitySetResource{} - data.ResourceTest(t, r, []acceptance.TestStep{ + data.ResourceSequentialTest(t, r, []acceptance.TestStep{ { Config: r.basic(data), Check: acceptance.ComposeTestCheckFunc( @@ -45,11 +63,11 @@ func TestAccSystemCenterVirtualMachineManagerAvailabilitySet_requiresImport(t *t }) } -func TestAccSystemCenterVirtualMachineManagerAvailabilitySet_complete(t *testing.T) { +func testAccSystemCenterVirtualMachineManagerAvailabilitySet_complete(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_system_center_virtual_machine_manager_availability_set", "test") r := SystemCenterVirtualMachineManagerAvailabilitySetResource{} - data.ResourceTest(t, r, []acceptance.TestStep{ + data.ResourceSequentialTest(t, r, []acceptance.TestStep{ { Config: r.complete(data), Check: acceptance.ComposeTestCheckFunc( @@ -60,11 +78,11 @@ func TestAccSystemCenterVirtualMachineManagerAvailabilitySet_complete(t *testing }) } -func TestAccSystemCenterVirtualMachineManagerAvailabilitySet_update(t *testing.T) { +func testAccSystemCenterVirtualMachineManagerAvailabilitySet_update(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_system_center_virtual_machine_manager_availability_set", "test") r := SystemCenterVirtualMachineManagerAvailabilitySetResource{} - data.ResourceTest(t, r, []acceptance.TestStep{ + data.ResourceSequentialTest(t, r, []acceptance.TestStep{ { Config: r.complete(data), Check: acceptance.ComposeTestCheckFunc( @@ -100,10 +118,14 @@ func (r SystemCenterVirtualMachineManagerAvailabilitySetResource) basic(data acc return fmt.Sprintf(` %s +provider "azurerm" { + features {} +} + resource "azurerm_system_center_virtual_machine_manager_availability_set" "test" { name = "acctest-scvmmas-%d" location = azurerm_resource_group.test.location - custom_location_id = azurerm_custom_location.test.id + custom_location_id = azurerm_system_center_virtual_machine_manager_server.test.custom_location_id system_center_virtual_machine_manager_server_id = azurerm_system_center_virtual_machine_manager_server.test.id } `, r.template(data), data.RandomInteger) @@ -126,10 +148,14 @@ func (r SystemCenterVirtualMachineManagerAvailabilitySetResource) complete(data return fmt.Sprintf(` %s +provider "azurerm" { + features {} +} + resource "azurerm_system_center_virtual_machine_manager_availability_set" "test" { name = "acctest-scvmmas-%d" location = azurerm_resource_group.test.location - custom_location_id = azurerm_custom_location.test.id + custom_location_id = azurerm_system_center_virtual_machine_manager_server.test.custom_location_id system_center_virtual_machine_manager_server_id = azurerm_system_center_virtual_machine_manager_server.test.id tags = { @@ -143,10 +169,14 @@ func (r SystemCenterVirtualMachineManagerAvailabilitySetResource) update(data ac return fmt.Sprintf(` %s +provider "azurerm" { + features {} +} + resource "azurerm_system_center_virtual_machine_manager_availability_set" "test" { name = "acctest-scvmmas-%d" location = azurerm_resource_group.test.location - custom_location_id = azurerm_custom_location.test.id + custom_location_id = azurerm_system_center_virtual_machine_manager_server.test.custom_location_id system_center_virtual_machine_manager_server_id = azurerm_system_center_virtual_machine_manager_server.test.id tags = { @@ -158,25 +188,19 @@ resource "azurerm_system_center_virtual_machine_manager_availability_set" "test" func (r SystemCenterVirtualMachineManagerAvailabilitySetResource) template(data acceptance.TestData) string { return fmt.Sprintf(` -provider "azurerm" { - features {} -} - resource "azurerm_resource_group" "test" { name = "acctestrg-scvmmas-%d" location = "%s" } -resource "azurerm_custom_location" "test" { - name = "acctest-cl-%d" -} - resource "azurerm_system_center_virtual_machine_manager_server" "test" { name = "acctest-scvmmms-%d" resource_group_name = azurerm_resource_group.test.name location = azurerm_resource_group.test.location - custom_location_id = azurerm_custom_location.test.id - fqdn = "testdomain.com" + custom_location_id = "%s" + fqdn = "%s" + username = "%s" + password = "%s" } -`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger) +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, os.Getenv("ARM_TEST_CUSTOM_LOCATION_ID"), os.Getenv("ARM_TEST_FQDN"), os.Getenv("ARM_TEST_USERNAME"), os.Getenv("ARM_TEST_PASSWORD")) } diff --git a/website/docs/r/system_center_virtual_machine_manager_availability_set.html.markdown b/website/docs/r/system_center_virtual_machine_manager_availability_set.html.markdown index 294a90b3a3a3..cbfbfc023e7a 100644 --- a/website/docs/r/system_center_virtual_machine_manager_availability_set.html.markdown +++ b/website/docs/r/system_center_virtual_machine_manager_availability_set.html.markdown @@ -18,20 +18,19 @@ resource "azurerm_resource_group" "example" { location = "West Europe" } -resource "azurerm_custom_location" "example" { - name = "example-cl" -} - resource "azurerm_system_center_virtual_machine_manager_server" "example" { name = "example-scvmmms" resource_group_name = azurerm_resource_group.example.name location = azurerm_resource_group.example.location - custom_location_id = azurerm_custom_location.example.id - fqdn = "exampledomain.com" + custom_location_id = "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.ExtendedLocation/customLocations/customLocation1" + fqdn = "example.labtest" + username = "testUser" + password = "H@Sh1CoR3!" } resource "azurerm_system_center_virtual_machine_manager_availability_set" "example" { name = "example-scvmmas" + resource_group_name = azurerm_resource_group.example.name location = azurerm_resource_group.example.location custom_location_id = azurerm_custom_location.example.id system_center_virtual_machine_manager_server_id = azurerm_system_center_virtual_machine_manager_server.example.id @@ -44,9 +43,11 @@ The following arguments are supported: * `name` - (Required) (Required) The name which should be used for this System Center Virtual Machine Manager Availability Set. Changing this forces a new resource to be created. +* `resource_group_name` - (Required) The name of the Resource Group where the System Center Virtual Machine Manager Availability Set should exist. Changing this forces a new resource to be created. + * `location` - (Required) The Azure Region where the System Center Virtual Machine Manager Availability Set should exist. Changing this forces a new resource to be created. -* `custom_location_id` - (Required) The ID of the Custom Location for the System Center Virtual Machine Manager Availability Set. +* `custom_location_id` - (Required) The ID of the Custom Location for the System Center Virtual Machine Manager Availability Set. Changing this forces a new resource to be created. * `system_center_virtual_machine_manager_server_id` - (Required) The ID of the System Center Virtual Machine Manager Server. Changing this forces a new resource to be created. From 248110656c03fc1da240b4551ef7569303bb5225 Mon Sep 17 00:00:00 2001 From: neil-yechenwei Date: Wed, 21 Feb 2024 16:39:41 +0800 Subject: [PATCH 4/7] update code --- ...ter_virtual_machine_manager_availability_set_resource.go | 6 +++--- ...r_virtual_machine_manager_availability_set.html.markdown | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/services/systemcentervirtualmachinemanager/system_center_virtual_machine_manager_availability_set_resource.go b/internal/services/systemcentervirtualmachinemanager/system_center_virtual_machine_manager_availability_set_resource.go index 40b974588a17..4ed8116e1f74 100644 --- a/internal/services/systemcentervirtualmachinemanager/system_center_virtual_machine_manager_availability_set_resource.go +++ b/internal/services/systemcentervirtualmachinemanager/system_center_virtual_machine_manager_availability_set_resource.go @@ -99,11 +99,11 @@ func (r SystemCenterVirtualMachineManagerAvailabilitySetResource) Create() sdk.R } parameters := availabilitysets.AvailabilitySet{ + Location: location.Normalize(model.Location), ExtendedLocation: availabilitysets.ExtendedLocation{ Type: utils.String("customLocation"), Name: utils.String(model.CustomLocationId), }, - Location: location.Normalize(model.Location), Properties: availabilitysets.AvailabilitySetProperties{ AvailabilitySetName: utils.String(id.AvailabilitySetName), VMmServerId: utils.String(scvmmServerId.ID()), @@ -142,9 +142,9 @@ func (r SystemCenterVirtualMachineManagerAvailabilitySetResource) Read() sdk.Res state := SystemCenterVirtualMachineManagerAvailabilitySetModel{} if model := resp.Model; model != nil { - state.Location = location.Normalize(model.Location) - state.ResourceGroupName = id.ResourceGroupName state.Name = id.AvailabilitySetName + state.ResourceGroupName = id.ResourceGroupName + state.Location = location.Normalize(model.Location) state.CustomLocationId = pointer.From(model.ExtendedLocation.Name) state.Tags = pointer.From(model.Tags) diff --git a/website/docs/r/system_center_virtual_machine_manager_availability_set.html.markdown b/website/docs/r/system_center_virtual_machine_manager_availability_set.html.markdown index cbfbfc023e7a..3ed436036449 100644 --- a/website/docs/r/system_center_virtual_machine_manager_availability_set.html.markdown +++ b/website/docs/r/system_center_virtual_machine_manager_availability_set.html.markdown @@ -32,7 +32,7 @@ resource "azurerm_system_center_virtual_machine_manager_availability_set" "examp name = "example-scvmmas" resource_group_name = azurerm_resource_group.example.name location = azurerm_resource_group.example.location - custom_location_id = azurerm_custom_location.example.id + custom_location_id = azurerm_system_center_virtual_machine_manager_server.example.id system_center_virtual_machine_manager_server_id = azurerm_system_center_virtual_machine_manager_server.example.id } ``` From a6ad5fca19ea97e4610833a9d31f148140924a1a Mon Sep 17 00:00:00 2001 From: neil-yechenwei Date: Thu, 22 Feb 2024 11:12:02 +0800 Subject: [PATCH 5/7] update code --- ...irtual_machine_manager_availability_set_resource_test.go | 4 ++++ ...r_virtual_machine_manager_availability_set.html.markdown | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/internal/services/systemcentervirtualmachinemanager/system_center_virtual_machine_manager_availability_set_resource_test.go b/internal/services/systemcentervirtualmachinemanager/system_center_virtual_machine_manager_availability_set_resource_test.go index 87c5dce7b836..1a903a4ed5cb 100644 --- a/internal/services/systemcentervirtualmachinemanager/system_center_virtual_machine_manager_availability_set_resource_test.go +++ b/internal/services/systemcentervirtualmachinemanager/system_center_virtual_machine_manager_availability_set_resource_test.go @@ -124,6 +124,7 @@ provider "azurerm" { resource "azurerm_system_center_virtual_machine_manager_availability_set" "test" { name = "acctest-scvmmas-%d" + resource_group_name = azurerm_resource_group.test.name location = azurerm_resource_group.test.location custom_location_id = azurerm_system_center_virtual_machine_manager_server.test.custom_location_id system_center_virtual_machine_manager_server_id = azurerm_system_center_virtual_machine_manager_server.test.id @@ -137,6 +138,7 @@ func (r SystemCenterVirtualMachineManagerAvailabilitySetResource) requiresImport resource "azurerm_system_center_virtual_machine_manager_availability_set" "import" { name = azurerm_system_center_virtual_machine_manager_availability_set.test.name + resource_group_name = azurerm_system_center_virtual_machine_manager_availability_set.test.resource_group_name location = azurerm_system_center_virtual_machine_manager_availability_set.test.location custom_location_id = azurerm_system_center_virtual_machine_manager_availability_set.test.custom_location_id system_center_virtual_machine_manager_server_id = azurerm_system_center_virtual_machine_manager_availability_set.test.system_center_virtual_machine_manager_server_id @@ -154,6 +156,7 @@ provider "azurerm" { resource "azurerm_system_center_virtual_machine_manager_availability_set" "test" { name = "acctest-scvmmas-%d" + resource_group_name = azurerm_resource_group.test.name location = azurerm_resource_group.test.location custom_location_id = azurerm_system_center_virtual_machine_manager_server.test.custom_location_id system_center_virtual_machine_manager_server_id = azurerm_system_center_virtual_machine_manager_server.test.id @@ -175,6 +178,7 @@ provider "azurerm" { resource "azurerm_system_center_virtual_machine_manager_availability_set" "test" { name = "acctest-scvmmas-%d" + resource_group_name = azurerm_resource_group.test.name location = azurerm_resource_group.test.location custom_location_id = azurerm_system_center_virtual_machine_manager_server.test.custom_location_id system_center_virtual_machine_manager_server_id = azurerm_system_center_virtual_machine_manager_server.test.id diff --git a/website/docs/r/system_center_virtual_machine_manager_availability_set.html.markdown b/website/docs/r/system_center_virtual_machine_manager_availability_set.html.markdown index 3ed436036449..c82227a556b3 100644 --- a/website/docs/r/system_center_virtual_machine_manager_availability_set.html.markdown +++ b/website/docs/r/system_center_virtual_machine_manager_availability_set.html.markdown @@ -32,7 +32,7 @@ resource "azurerm_system_center_virtual_machine_manager_availability_set" "examp name = "example-scvmmas" resource_group_name = azurerm_resource_group.example.name location = azurerm_resource_group.example.location - custom_location_id = azurerm_system_center_virtual_machine_manager_server.example.id + custom_location_id = azurerm_system_center_virtual_machine_manager_server.example.custom_location_id system_center_virtual_machine_manager_server_id = azurerm_system_center_virtual_machine_manager_server.example.id } ``` @@ -41,9 +41,9 @@ resource "azurerm_system_center_virtual_machine_manager_availability_set" "examp The following arguments are supported: -* `name` - (Required) (Required) The name which should be used for this System Center Virtual Machine Manager Availability Set. Changing this forces a new resource to be created. +* `name` - (Required) The name of the System Center Virtual Machine Manager Availability Set. Changing this forces a new resource to be created. -* `resource_group_name` - (Required) The name of the Resource Group where the System Center Virtual Machine Manager Availability Set should exist. Changing this forces a new resource to be created. +* `resource_group_name` - (Required) The name of the Resource Group where the System Center Virtual Machine Availability Set should exist. Changing this forces a new resource to be created. * `location` - (Required) The Azure Region where the System Center Virtual Machine Manager Availability Set should exist. Changing this forces a new resource to be created. From 704b14453ccae878b6c97178e6a489450c3e92c4 Mon Sep 17 00:00:00 2001 From: neil-yechenwei Date: Thu, 22 Feb 2024 12:50:37 +0800 Subject: [PATCH 6/7] update code --- ..._virtual_machine_manager_availability_set_resource_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/services/systemcentervirtualmachinemanager/system_center_virtual_machine_manager_availability_set_resource_test.go b/internal/services/systemcentervirtualmachinemanager/system_center_virtual_machine_manager_availability_set_resource_test.go index 1a903a4ed5cb..a5f77241176e 100644 --- a/internal/services/systemcentervirtualmachinemanager/system_center_virtual_machine_manager_availability_set_resource_test.go +++ b/internal/services/systemcentervirtualmachinemanager/system_center_virtual_machine_manager_availability_set_resource_test.go @@ -160,7 +160,7 @@ resource "azurerm_system_center_virtual_machine_manager_availability_set" "test" location = azurerm_resource_group.test.location custom_location_id = azurerm_system_center_virtual_machine_manager_server.test.custom_location_id system_center_virtual_machine_manager_server_id = azurerm_system_center_virtual_machine_manager_server.test.id - + tags = { env = "Test" } @@ -182,7 +182,7 @@ resource "azurerm_system_center_virtual_machine_manager_availability_set" "test" location = azurerm_resource_group.test.location custom_location_id = azurerm_system_center_virtual_machine_manager_server.test.custom_location_id system_center_virtual_machine_manager_server_id = azurerm_system_center_virtual_machine_manager_server.test.id - + tags = { env = "Test2" } From c4a3ad36f825ae5c19de81a7f3c4e0a81347b8cb Mon Sep 17 00:00:00 2001 From: neil-yechenwei Date: Mon, 26 Feb 2024 09:50:55 +0800 Subject: [PATCH 7/7] update code --- ...al_machine_manager_availability_set_resource.go | 8 +++++--- ...chine_manager_availability_set_resource_test.go | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/internal/services/systemcentervirtualmachinemanager/system_center_virtual_machine_manager_availability_set_resource.go b/internal/services/systemcentervirtualmachinemanager/system_center_virtual_machine_manager_availability_set_resource.go index 4ed8116e1f74..3ca3126bf673 100644 --- a/internal/services/systemcentervirtualmachinemanager/system_center_virtual_machine_manager_availability_set_resource.go +++ b/internal/services/systemcentervirtualmachinemanager/system_center_virtual_machine_manager_availability_set_resource.go @@ -148,7 +148,7 @@ func (r SystemCenterVirtualMachineManagerAvailabilitySetResource) Read() sdk.Res state.CustomLocationId = pointer.From(model.ExtendedLocation.Name) state.Tags = pointer.From(model.Tags) - scvmmServerId, err := vmmservers.ParseVMmServerID(pointer.From(model.Properties.VMmServerId)) + scvmmServerId, err := vmmservers.ParseVMmServerIDInsensitively(pointer.From(model.Properties.VMmServerId)) if err != nil { return err } @@ -176,8 +176,10 @@ func (r SystemCenterVirtualMachineManagerAvailabilitySetResource) Update() sdk.R return fmt.Errorf("decoding: %+v", err) } - parameters := availabilitysets.ResourcePatch{ - Tags: pointer.To(model.Tags), + parameters := availabilitysets.ResourcePatch{} + + if metadata.ResourceData.HasChange("tags") { + parameters.Tags = pointer.To(model.Tags) } if err := client.UpdateThenPoll(ctx, *id, parameters); err != nil { diff --git a/internal/services/systemcentervirtualmachinemanager/system_center_virtual_machine_manager_availability_set_resource_test.go b/internal/services/systemcentervirtualmachinemanager/system_center_virtual_machine_manager_availability_set_resource_test.go index a5f77241176e..6f81943dc9f4 100644 --- a/internal/services/systemcentervirtualmachinemanager/system_center_virtual_machine_manager_availability_set_resource_test.go +++ b/internal/services/systemcentervirtualmachinemanager/system_center_virtual_machine_manager_availability_set_resource_test.go @@ -83,6 +83,13 @@ func testAccSystemCenterVirtualMachineManagerAvailabilitySet_update(t *testing.T r := SystemCenterVirtualMachineManagerAvailabilitySetResource{} data.ResourceSequentialTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), { Config: r.complete(data), Check: acceptance.ComposeTestCheckFunc( @@ -97,6 +104,13 @@ func testAccSystemCenterVirtualMachineManagerAvailabilitySet_update(t *testing.T ), }, data.ImportStep(), + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), }) }