From 63095e68565b7d00dbdd23a64509f29f407bf1fc Mon Sep 17 00:00:00 2001 From: Tom Harvey Date: Fri, 9 Feb 2024 01:31:13 +0100 Subject: [PATCH] `managedhsm`: refactoring to use `hashicorp/go-azure-sdk`s base layer / API Version `2023-07-01` (#24761) * `managedhsm`: updating to use API Version `2023-07-01` (and `hashicorp/go-azure-sdk`s base layer) * go mod tidy && go mod vendor * linting * go mod vendor --------- Co-authored-by: kt --- internal/clients/client.go | 4 +- internal/services/managedhsm/client/client.go | 17 +- .../custompollers/hsm_purge_poller.go | 2 +- ...ed_hardware_security_module_data_source.go | 2 +- ...naged_hardware_security_module_resource.go | 2 +- ..._hardware_security_module_resource_test.go | 2 +- ...e_account_customer_managed_key_resource.go | 2 +- .../keyvault/2023-02-01/managedhsms/client.go | 18 -- ...thod_checkmhsmnameavailability_autorest.go | 71 ------ .../method_createorupdate_autorest.go | 80 ------- .../managedhsms/method_delete_autorest.go | 78 ------- .../managedhsms/method_get_autorest.go | 68 ------ .../managedhsms/method_getdeleted_autorest.go | 68 ------ .../method_listbyresourcegroup_autorest.go | 216 ------------------ .../method_listbysubscription_autorest.go | 216 ------------------ .../method_listdeleted_autorest.go | 187 --------------- .../method_purgedeleted_autorest.go | 78 ------- .../managedhsms/method_update_autorest.go | 80 ------- .../managedhsms/model_managedhsm.go | 19 -- .../managedhsms/README.md | 6 +- .../keyvault/2023-07-01/managedhsms/client.go | 26 +++ .../managedhsms/constants.go | 175 +++++++++++++- .../managedhsms/id_deletedmanagedhsm.go | 0 .../managedhsms/id_managedhsm.go | 0 .../method_checkmhsmnameavailability.go | 57 +++++ .../managedhsms/method_createorupdate.go | 75 ++++++ .../2023-07-01/managedhsms/method_delete.go | 71 ++++++ .../2023-07-01/managedhsms/method_get.go | 52 +++++ .../managedhsms/method_getdeleted.go | 51 +++++ .../managedhsms/method_listbyresourcegroup.go | 120 ++++++++++ .../managedhsms/method_listbysubscription.go | 120 ++++++++++ .../managedhsms/method_listdeleted.go | 92 ++++++++ .../managedhsms/method_purgedeleted.go | 69 ++++++ .../2023-07-01/managedhsms/method_update.go | 75 ++++++ ...del_checkmhsmnameavailabilityparameters.go | 0 .../model_checkmhsmnameavailabilityresult.go | 0 .../managedhsms/model_deletedmanagedhsm.go | 0 .../model_deletedmanagedhsmproperties.go | 0 .../managedhsms/model_managedhsm.go | 21 ++ .../managedhsms/model_managedhsmproperties.go | 0 ...odel_managedhsmsecuritydomainproperties.go | 0 .../managedhsms/model_managedhsmsku.go | 0 .../model_mhsmgeoreplicatedregion.go | 0 .../managedhsms/model_mhsmiprule.go | 0 .../managedhsms/model_mhsmnetworkruleset.go | 0 .../managedhsms/model_mhsmprivateendpoint.go | 0 ...model_mhsmprivateendpointconnectionitem.go | 0 ...mhsmprivateendpointconnectionproperties.go | 0 ...l_mhsmprivatelinkserviceconnectionstate.go | 0 .../model_mhsmvirtualnetworkrule.go | 0 .../managedhsms/predicates.go | 0 .../managedhsms/version.go | 2 +- vendor/modules.txt | 2 +- 53 files changed, 1027 insertions(+), 1197 deletions(-) delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/client.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/method_checkmhsmnameavailability_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/method_createorupdate_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/method_delete_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/method_get_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/method_getdeleted_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/method_listbyresourcegroup_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/method_listbysubscription_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/method_listdeleted_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/method_purgedeleted_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/method_update_autorest.go delete mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/model_managedhsm.go rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/{2023-02-01 => 2023-07-01}/managedhsms/README.md (97%) create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/client.go rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/{2023-02-01 => 2023-07-01}/managedhsms/constants.go (75%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/{2023-02-01 => 2023-07-01}/managedhsms/id_deletedmanagedhsm.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/{2023-02-01 => 2023-07-01}/managedhsms/id_managedhsm.go (100%) create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/method_checkmhsmnameavailability.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/method_createorupdate.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/method_delete.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/method_get.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/method_getdeleted.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/method_listbyresourcegroup.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/method_listbysubscription.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/method_listdeleted.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/method_purgedeleted.go create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/method_update.go rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/{2023-02-01 => 2023-07-01}/managedhsms/model_checkmhsmnameavailabilityparameters.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/{2023-02-01 => 2023-07-01}/managedhsms/model_checkmhsmnameavailabilityresult.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/{2023-02-01 => 2023-07-01}/managedhsms/model_deletedmanagedhsm.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/{2023-02-01 => 2023-07-01}/managedhsms/model_deletedmanagedhsmproperties.go (100%) create mode 100644 vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/model_managedhsm.go rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/{2023-02-01 => 2023-07-01}/managedhsms/model_managedhsmproperties.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/{2023-02-01 => 2023-07-01}/managedhsms/model_managedhsmsecuritydomainproperties.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/{2023-02-01 => 2023-07-01}/managedhsms/model_managedhsmsku.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/{2023-02-01 => 2023-07-01}/managedhsms/model_mhsmgeoreplicatedregion.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/{2023-02-01 => 2023-07-01}/managedhsms/model_mhsmiprule.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/{2023-02-01 => 2023-07-01}/managedhsms/model_mhsmnetworkruleset.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/{2023-02-01 => 2023-07-01}/managedhsms/model_mhsmprivateendpoint.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/{2023-02-01 => 2023-07-01}/managedhsms/model_mhsmprivateendpointconnectionitem.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/{2023-02-01 => 2023-07-01}/managedhsms/model_mhsmprivateendpointconnectionproperties.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/{2023-02-01 => 2023-07-01}/managedhsms/model_mhsmprivatelinkserviceconnectionstate.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/{2023-02-01 => 2023-07-01}/managedhsms/model_mhsmvirtualnetworkrule.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/{2023-02-01 => 2023-07-01}/managedhsms/predicates.go (100%) rename vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/{2023-02-01 => 2023-07-01}/managedhsms/version.go (88%) diff --git a/internal/clients/client.go b/internal/clients/client.go index ade800e891db..36124c6df42f 100644 --- a/internal/clients/client.go +++ b/internal/clients/client.go @@ -494,7 +494,9 @@ func (client *Client) Build(ctx context.Context, o *common.ClientOptions) error return fmt.Errorf("building clients for Managed Applications: %+v", err) } client.ManagementGroups = managementgroup.NewClient(o) - client.ManagedHSMs = managedhsm.NewClient(o) + if client.ManagedHSMs, err = managedhsm.NewClient(o); err != nil { + return fmt.Errorf("building clients for ManagedHSM: %+v", err) + } if client.Maps, err = maps.NewClient(o); err != nil { return fmt.Errorf("building clients for Maps: %+v", err) } diff --git a/internal/services/managedhsm/client/client.go b/internal/services/managedhsm/client/client.go index 2ee03bdc09cc..0da9356e36c2 100644 --- a/internal/services/managedhsm/client/client.go +++ b/internal/services/managedhsm/client/client.go @@ -4,7 +4,9 @@ package client import ( - "github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms" + "fmt" + + "github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms" "github.com/hashicorp/terraform-provider-azurerm/internal/common" dataplane "github.com/tombuildsstuff/kermit/sdk/keyvault/7.4/keyvault" ) @@ -27,9 +29,12 @@ type Client struct { DataPlaneSecurityDomainsClient *dataplane.HSMSecurityDomainClient } -func NewClient(o *common.ClientOptions) *Client { - managedHsmClient := managedhsms.NewManagedHsmsClientWithBaseURI(o.ResourceManagerEndpoint) - o.ConfigureClient(&managedHsmClient.Client, o.ResourceManagerAuthorizer) +func NewClient(o *common.ClientOptions) (*Client, error) { + managedHsmClient, err := managedhsms.NewManagedHsmsClientWithBaseURI(o.Environment.ResourceManager) + if err != nil { + return nil, fmt.Errorf("building ManagedHsms client: %+v", err) + } + o.Configure(managedHsmClient.Client, o.Authorizers.ResourceManager) managementClient := dataplane.New() o.ConfigureClient(&managementClient.Client, o.KeyVaultAuthorizer) @@ -45,12 +50,12 @@ func NewClient(o *common.ClientOptions) *Client { return &Client{ // Resource Manger - ManagedHsmClient: &managedHsmClient, + ManagedHsmClient: managedHsmClient, // Data Plane DataPlaneClient: &managementClient, DataPlaneSecurityDomainsClient: &securityDomainClient, DataPlaneRoleDefinitionsClient: &roleDefinitionsClient, DataPlaneRoleAssignmentsClient: &roleAssignmentsClient, - } + }, nil } diff --git a/internal/services/managedhsm/custompollers/hsm_purge_poller.go b/internal/services/managedhsm/custompollers/hsm_purge_poller.go index e8e9918dcb76..63e9d41807fa 100644 --- a/internal/services/managedhsm/custompollers/hsm_purge_poller.go +++ b/internal/services/managedhsm/custompollers/hsm_purge_poller.go @@ -9,7 +9,7 @@ import ( "time" "github.com/hashicorp/go-azure-helpers/lang/response" - "github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms" + "github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms" "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" ) diff --git a/internal/services/managedhsm/key_vault_managed_hardware_security_module_data_source.go b/internal/services/managedhsm/key_vault_managed_hardware_security_module_data_source.go index 18bcbc9da52b..d491a44556c2 100644 --- a/internal/services/managedhsm/key_vault_managed_hardware_security_module_data_source.go +++ b/internal/services/managedhsm/key_vault_managed_hardware_security_module_data_source.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" - "github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms" + "github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/managedhsm/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" diff --git a/internal/services/managedhsm/key_vault_managed_hardware_security_module_resource.go b/internal/services/managedhsm/key_vault_managed_hardware_security_module_resource.go index 1457e69033e8..51c3c2122396 100644 --- a/internal/services/managedhsm/key_vault_managed_hardware_security_module_resource.go +++ b/internal/services/managedhsm/key_vault_managed_hardware_security_module_resource.go @@ -18,7 +18,7 @@ import ( "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" "github.com/hashicorp/go-azure-helpers/resourcemanager/location" "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" - "github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms" + "github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms" "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" diff --git a/internal/services/managedhsm/key_vault_managed_hardware_security_module_resource_test.go b/internal/services/managedhsm/key_vault_managed_hardware_security_module_resource_test.go index f528958b8b76..c9e602d10eb6 100644 --- a/internal/services/managedhsm/key_vault_managed_hardware_security_module_resource_test.go +++ b/internal/services/managedhsm/key_vault_managed_hardware_security_module_resource_test.go @@ -8,7 +8,7 @@ import ( "fmt" "testing" - "github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms" + "github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/storage/storage_account_customer_managed_key_resource.go b/internal/services/storage/storage_account_customer_managed_key_resource.go index 95b7ba25b43b..41dcc056d732 100644 --- a/internal/services/storage/storage_account_customer_managed_key_resource.go +++ b/internal/services/storage/storage_account_customer_managed_key_resource.go @@ -11,7 +11,7 @@ import ( "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" // nolint: staticcheck "github.com/hashicorp/go-azure-helpers/lang/pointer" "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" - "github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms" + "github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/locks" diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/client.go deleted file mode 100644 index 3063f1368887..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/client.go +++ /dev/null @@ -1,18 +0,0 @@ -package managedhsms - -import "github.com/Azure/go-autorest/autorest" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedHsmsClient struct { - Client autorest.Client - baseUri string -} - -func NewManagedHsmsClientWithBaseURI(endpoint string) ManagedHsmsClient { - return ManagedHsmsClient{ - Client: autorest.NewClientWithUserAgent(userAgent()), - baseUri: endpoint, - } -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/method_checkmhsmnameavailability_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/method_checkmhsmnameavailability_autorest.go deleted file mode 100644 index 1d6648210ebb..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/method_checkmhsmnameavailability_autorest.go +++ /dev/null @@ -1,71 +0,0 @@ -package managedhsms - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CheckMhsmNameAvailabilityOperationResponse struct { - HttpResponse *http.Response - Model *CheckMhsmNameAvailabilityResult -} - -// CheckMhsmNameAvailability ... -func (c ManagedHsmsClient) CheckMhsmNameAvailability(ctx context.Context, id commonids.SubscriptionId, input CheckMhsmNameAvailabilityParameters) (result CheckMhsmNameAvailabilityOperationResponse, err error) { - req, err := c.preparerForCheckMhsmNameAvailability(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "managedhsms.ManagedHsmsClient", "CheckMhsmNameAvailability", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "managedhsms.ManagedHsmsClient", "CheckMhsmNameAvailability", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForCheckMhsmNameAvailability(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "managedhsms.ManagedHsmsClient", "CheckMhsmNameAvailability", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForCheckMhsmNameAvailability prepares the CheckMhsmNameAvailability request. -func (c ManagedHsmsClient) preparerForCheckMhsmNameAvailability(ctx context.Context, id commonids.SubscriptionId, input CheckMhsmNameAvailabilityParameters) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.KeyVault/checkMhsmNameAvailability", id.ID())), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForCheckMhsmNameAvailability handles the response to the CheckMhsmNameAvailability request. The method always -// closes the http.Response Body. -func (c ManagedHsmsClient) responderForCheckMhsmNameAvailability(resp *http.Response) (result CheckMhsmNameAvailabilityOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/method_createorupdate_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/method_createorupdate_autorest.go deleted file mode 100644 index 13ea1b5b54e7..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/method_createorupdate_autorest.go +++ /dev/null @@ -1,80 +0,0 @@ -package managedhsms - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// 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 polling.LongRunningPoller - HttpResponse *http.Response - Model *ManagedHsm -} - -// CreateOrUpdate ... -func (c ManagedHsmsClient) CreateOrUpdate(ctx context.Context, id ManagedHSMId, input ManagedHsm) (result CreateOrUpdateOperationResponse, err error) { - req, err := c.preparerForCreateOrUpdate(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "managedhsms.ManagedHsmsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = c.senderForCreateOrUpdate(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "managedhsms.ManagedHsmsClient", "CreateOrUpdate", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c ManagedHsmsClient) CreateOrUpdateThenPoll(ctx context.Context, id ManagedHSMId, input ManagedHsm) error { - result, err := c.CreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing CreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after CreateOrUpdate: %+v", err) - } - - return nil -} - -// preparerForCreateOrUpdate prepares the CreateOrUpdate request. -func (c ManagedHsmsClient) preparerForCreateOrUpdate(ctx context.Context, id ManagedHSMId, input ManagedHsm) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForCreateOrUpdate sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (c ManagedHsmsClient) senderForCreateOrUpdate(ctx context.Context, req *http.Request) (future CreateOrUpdateOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/method_delete_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/method_delete_autorest.go deleted file mode 100644 index 56fa4634de51..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/method_delete_autorest.go +++ /dev/null @@ -1,78 +0,0 @@ -package managedhsms - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// 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 polling.LongRunningPoller - HttpResponse *http.Response -} - -// Delete ... -func (c ManagedHsmsClient) Delete(ctx context.Context, id ManagedHSMId) (result DeleteOperationResponse, err error) { - req, err := c.preparerForDelete(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "managedhsms.ManagedHsmsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = c.senderForDelete(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "managedhsms.ManagedHsmsClient", "Delete", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// DeleteThenPoll performs Delete then polls until it's completed -func (c ManagedHsmsClient) DeleteThenPoll(ctx context.Context, id ManagedHSMId) error { - result, err := c.Delete(ctx, id) - if err != nil { - return fmt.Errorf("performing Delete: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after Delete: %+v", err) - } - - return nil -} - -// preparerForDelete prepares the Delete request. -func (c ManagedHsmsClient) preparerForDelete(ctx context.Context, id ManagedHSMId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsDelete(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForDelete sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (c ManagedHsmsClient) senderForDelete(ctx context.Context, req *http.Request) (future DeleteOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/method_get_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/method_get_autorest.go deleted file mode 100644 index 827011f2ea07..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/method_get_autorest.go +++ /dev/null @@ -1,68 +0,0 @@ -package managedhsms - -import ( - "context" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// 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 - Model *ManagedHsm -} - -// Get ... -func (c ManagedHsmsClient) Get(ctx context.Context, id ManagedHSMId) (result GetOperationResponse, err error) { - req, err := c.preparerForGet(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "managedhsms.ManagedHsmsClient", "Get", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "managedhsms.ManagedHsmsClient", "Get", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForGet(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "managedhsms.ManagedHsmsClient", "Get", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForGet prepares the Get request. -func (c ManagedHsmsClient) preparerForGet(ctx context.Context, id ManagedHSMId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForGet handles the response to the Get request. The method always -// closes the http.Response Body. -func (c ManagedHsmsClient) responderForGet(resp *http.Response) (result GetOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/method_getdeleted_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/method_getdeleted_autorest.go deleted file mode 100644 index ad43ab79e1b8..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/method_getdeleted_autorest.go +++ /dev/null @@ -1,68 +0,0 @@ -package managedhsms - -import ( - "context" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GetDeletedOperationResponse struct { - HttpResponse *http.Response - Model *DeletedManagedHsm -} - -// GetDeleted ... -func (c ManagedHsmsClient) GetDeleted(ctx context.Context, id DeletedManagedHSMId) (result GetDeletedOperationResponse, err error) { - req, err := c.preparerForGetDeleted(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "managedhsms.ManagedHsmsClient", "GetDeleted", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "managedhsms.ManagedHsmsClient", "GetDeleted", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForGetDeleted(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "managedhsms.ManagedHsmsClient", "GetDeleted", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForGetDeleted prepares the GetDeleted request. -func (c ManagedHsmsClient) preparerForGetDeleted(ctx context.Context, id DeletedManagedHSMId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForGetDeleted handles the response to the GetDeleted request. The method always -// closes the http.Response Body. -func (c ManagedHsmsClient) responderForGetDeleted(resp *http.Response) (result GetDeletedOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/method_listbyresourcegroup_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/method_listbyresourcegroup_autorest.go deleted file mode 100644 index 941be9aa8ee6..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/method_listbyresourcegroup_autorest.go +++ /dev/null @@ -1,216 +0,0 @@ -package managedhsms - -import ( - "context" - "fmt" - "net/http" - "net/url" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" -) - -// 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 - Model *[]ManagedHsm - - nextLink *string - nextPageFunc func(ctx context.Context, nextLink string) (ListByResourceGroupOperationResponse, error) -} - -type ListByResourceGroupCompleteResult struct { - Items []ManagedHsm -} - -func (r ListByResourceGroupOperationResponse) HasMore() bool { - return r.nextLink != nil -} - -func (r ListByResourceGroupOperationResponse) LoadMore(ctx context.Context) (resp ListByResourceGroupOperationResponse, err error) { - if !r.HasMore() { - err = fmt.Errorf("no more pages returned") - return - } - return r.nextPageFunc(ctx, *r.nextLink) -} - -type ListByResourceGroupOperationOptions struct { - Top *int64 -} - -func DefaultListByResourceGroupOperationOptions() ListByResourceGroupOperationOptions { - return ListByResourceGroupOperationOptions{} -} - -func (o ListByResourceGroupOperationOptions) toHeaders() map[string]interface{} { - out := make(map[string]interface{}) - - return out -} - -func (o ListByResourceGroupOperationOptions) toQueryString() map[string]interface{} { - out := make(map[string]interface{}) - - if o.Top != nil { - out["$top"] = *o.Top - } - - return out -} - -// ListByResourceGroup ... -func (c ManagedHsmsClient) ListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId, options ListByResourceGroupOperationOptions) (resp ListByResourceGroupOperationResponse, err error) { - req, err := c.preparerForListByResourceGroup(ctx, id, options) - if err != nil { - err = autorest.NewErrorWithError(err, "managedhsms.ManagedHsmsClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "managedhsms.ManagedHsmsClient", "ListByResourceGroup", resp.HttpResponse, "Failure sending request") - return - } - - resp, err = c.responderForListByResourceGroup(resp.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "managedhsms.ManagedHsmsClient", "ListByResourceGroup", resp.HttpResponse, "Failure responding to request") - return - } - return -} - -// preparerForListByResourceGroup prepares the ListByResourceGroup request. -func (c ManagedHsmsClient) preparerForListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId, options ListByResourceGroupOperationOptions) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - for k, v := range options.toQueryString() { - queryParameters[k] = autorest.Encode("query", v) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithHeaders(options.toHeaders()), - autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.KeyVault/managedHSMs", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// preparerForListByResourceGroupWithNextLink prepares the ListByResourceGroup request with the given nextLink token. -func (c ManagedHsmsClient) preparerForListByResourceGroupWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { - uri, err := url.Parse(nextLink) - if err != nil { - return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) - } - queryParameters := map[string]interface{}{} - for k, v := range uri.Query() { - if len(v) == 0 { - continue - } - val := v[0] - val = autorest.Encode("query", val) - queryParameters[k] = val - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(uri.Path), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForListByResourceGroup handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (c ManagedHsmsClient) responderForListByResourceGroup(resp *http.Response) (result ListByResourceGroupOperationResponse, err error) { - type page struct { - Values []ManagedHsm `json:"value"` - NextLink *string `json:"nextLink"` - } - var respObj page - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&respObj), - autorest.ByClosing()) - result.HttpResponse = resp - result.Model = &respObj.Values - result.nextLink = respObj.NextLink - if respObj.NextLink != nil { - result.nextPageFunc = func(ctx context.Context, nextLink string) (result ListByResourceGroupOperationResponse, err error) { - req, err := c.preparerForListByResourceGroupWithNextLink(ctx, nextLink) - if err != nil { - err = autorest.NewErrorWithError(err, "managedhsms.ManagedHsmsClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "managedhsms.ManagedHsmsClient", "ListByResourceGroup", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForListByResourceGroup(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "managedhsms.ManagedHsmsClient", "ListByResourceGroup", result.HttpResponse, "Failure responding to request") - return - } - - return - } - } - return -} - -// ListByResourceGroupComplete retrieves all of the results into a single object -func (c ManagedHsmsClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId, options ListByResourceGroupOperationOptions) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, options, ManagedHsmOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c ManagedHsmsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, options ListByResourceGroupOperationOptions, predicate ManagedHsmOperationPredicate) (resp ListByResourceGroupCompleteResult, err error) { - items := make([]ManagedHsm, 0) - - page, err := c.ListByResourceGroup(ctx, id, options) - if err != nil { - err = fmt.Errorf("loading the initial page: %+v", err) - return - } - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - for page.HasMore() { - page, err = page.LoadMore(ctx) - if err != nil { - err = fmt.Errorf("loading the next page: %+v", err) - return - } - - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - } - - out := ListByResourceGroupCompleteResult{ - Items: items, - } - return out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/method_listbysubscription_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/method_listbysubscription_autorest.go deleted file mode 100644 index fcf426e915ec..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/method_listbysubscription_autorest.go +++ /dev/null @@ -1,216 +0,0 @@ -package managedhsms - -import ( - "context" - "fmt" - "net/http" - "net/url" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" -) - -// 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 - Model *[]ManagedHsm - - nextLink *string - nextPageFunc func(ctx context.Context, nextLink string) (ListBySubscriptionOperationResponse, error) -} - -type ListBySubscriptionCompleteResult struct { - Items []ManagedHsm -} - -func (r ListBySubscriptionOperationResponse) HasMore() bool { - return r.nextLink != nil -} - -func (r ListBySubscriptionOperationResponse) LoadMore(ctx context.Context) (resp ListBySubscriptionOperationResponse, err error) { - if !r.HasMore() { - err = fmt.Errorf("no more pages returned") - return - } - return r.nextPageFunc(ctx, *r.nextLink) -} - -type ListBySubscriptionOperationOptions struct { - Top *int64 -} - -func DefaultListBySubscriptionOperationOptions() ListBySubscriptionOperationOptions { - return ListBySubscriptionOperationOptions{} -} - -func (o ListBySubscriptionOperationOptions) toHeaders() map[string]interface{} { - out := make(map[string]interface{}) - - return out -} - -func (o ListBySubscriptionOperationOptions) toQueryString() map[string]interface{} { - out := make(map[string]interface{}) - - if o.Top != nil { - out["$top"] = *o.Top - } - - return out -} - -// ListBySubscription ... -func (c ManagedHsmsClient) ListBySubscription(ctx context.Context, id commonids.SubscriptionId, options ListBySubscriptionOperationOptions) (resp ListBySubscriptionOperationResponse, err error) { - req, err := c.preparerForListBySubscription(ctx, id, options) - if err != nil { - err = autorest.NewErrorWithError(err, "managedhsms.ManagedHsmsClient", "ListBySubscription", nil, "Failure preparing request") - return - } - - resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "managedhsms.ManagedHsmsClient", "ListBySubscription", resp.HttpResponse, "Failure sending request") - return - } - - resp, err = c.responderForListBySubscription(resp.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "managedhsms.ManagedHsmsClient", "ListBySubscription", resp.HttpResponse, "Failure responding to request") - return - } - return -} - -// preparerForListBySubscription prepares the ListBySubscription request. -func (c ManagedHsmsClient) preparerForListBySubscription(ctx context.Context, id commonids.SubscriptionId, options ListBySubscriptionOperationOptions) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - for k, v := range options.toQueryString() { - queryParameters[k] = autorest.Encode("query", v) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithHeaders(options.toHeaders()), - autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.KeyVault/managedHSMs", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// preparerForListBySubscriptionWithNextLink prepares the ListBySubscription request with the given nextLink token. -func (c ManagedHsmsClient) preparerForListBySubscriptionWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { - uri, err := url.Parse(nextLink) - if err != nil { - return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) - } - queryParameters := map[string]interface{}{} - for k, v := range uri.Query() { - if len(v) == 0 { - continue - } - val := v[0] - val = autorest.Encode("query", val) - queryParameters[k] = val - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(uri.Path), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForListBySubscription handles the response to the ListBySubscription request. The method always -// closes the http.Response Body. -func (c ManagedHsmsClient) responderForListBySubscription(resp *http.Response) (result ListBySubscriptionOperationResponse, err error) { - type page struct { - Values []ManagedHsm `json:"value"` - NextLink *string `json:"nextLink"` - } - var respObj page - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&respObj), - autorest.ByClosing()) - result.HttpResponse = resp - result.Model = &respObj.Values - result.nextLink = respObj.NextLink - if respObj.NextLink != nil { - result.nextPageFunc = func(ctx context.Context, nextLink string) (result ListBySubscriptionOperationResponse, err error) { - req, err := c.preparerForListBySubscriptionWithNextLink(ctx, nextLink) - if err != nil { - err = autorest.NewErrorWithError(err, "managedhsms.ManagedHsmsClient", "ListBySubscription", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "managedhsms.ManagedHsmsClient", "ListBySubscription", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForListBySubscription(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "managedhsms.ManagedHsmsClient", "ListBySubscription", result.HttpResponse, "Failure responding to request") - return - } - - return - } - } - return -} - -// ListBySubscriptionComplete retrieves all of the results into a single object -func (c ManagedHsmsClient) ListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId, options ListBySubscriptionOperationOptions) (ListBySubscriptionCompleteResult, error) { - return c.ListBySubscriptionCompleteMatchingPredicate(ctx, id, options, ManagedHsmOperationPredicate{}) -} - -// ListBySubscriptionCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c ManagedHsmsClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, options ListBySubscriptionOperationOptions, predicate ManagedHsmOperationPredicate) (resp ListBySubscriptionCompleteResult, err error) { - items := make([]ManagedHsm, 0) - - page, err := c.ListBySubscription(ctx, id, options) - if err != nil { - err = fmt.Errorf("loading the initial page: %+v", err) - return - } - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - for page.HasMore() { - page, err = page.LoadMore(ctx) - if err != nil { - err = fmt.Errorf("loading the next page: %+v", err) - return - } - - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - } - - out := ListBySubscriptionCompleteResult{ - Items: items, - } - return out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/method_listdeleted_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/method_listdeleted_autorest.go deleted file mode 100644 index 72c2fcb6ecbd..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/method_listdeleted_autorest.go +++ /dev/null @@ -1,187 +0,0 @@ -package managedhsms - -import ( - "context" - "fmt" - "net/http" - "net/url" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ListDeletedOperationResponse struct { - HttpResponse *http.Response - Model *[]DeletedManagedHsm - - nextLink *string - nextPageFunc func(ctx context.Context, nextLink string) (ListDeletedOperationResponse, error) -} - -type ListDeletedCompleteResult struct { - Items []DeletedManagedHsm -} - -func (r ListDeletedOperationResponse) HasMore() bool { - return r.nextLink != nil -} - -func (r ListDeletedOperationResponse) LoadMore(ctx context.Context) (resp ListDeletedOperationResponse, err error) { - if !r.HasMore() { - err = fmt.Errorf("no more pages returned") - return - } - return r.nextPageFunc(ctx, *r.nextLink) -} - -// ListDeleted ... -func (c ManagedHsmsClient) ListDeleted(ctx context.Context, id commonids.SubscriptionId) (resp ListDeletedOperationResponse, err error) { - req, err := c.preparerForListDeleted(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "managedhsms.ManagedHsmsClient", "ListDeleted", nil, "Failure preparing request") - return - } - - resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "managedhsms.ManagedHsmsClient", "ListDeleted", resp.HttpResponse, "Failure sending request") - return - } - - resp, err = c.responderForListDeleted(resp.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "managedhsms.ManagedHsmsClient", "ListDeleted", resp.HttpResponse, "Failure responding to request") - return - } - return -} - -// preparerForListDeleted prepares the ListDeleted request. -func (c ManagedHsmsClient) preparerForListDeleted(ctx context.Context, id commonids.SubscriptionId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/providers/Microsoft.KeyVault/deletedManagedHSMs", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// preparerForListDeletedWithNextLink prepares the ListDeleted request with the given nextLink token. -func (c ManagedHsmsClient) preparerForListDeletedWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { - uri, err := url.Parse(nextLink) - if err != nil { - return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) - } - queryParameters := map[string]interface{}{} - for k, v := range uri.Query() { - if len(v) == 0 { - continue - } - val := v[0] - val = autorest.Encode("query", val) - queryParameters[k] = val - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(uri.Path), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForListDeleted handles the response to the ListDeleted request. The method always -// closes the http.Response Body. -func (c ManagedHsmsClient) responderForListDeleted(resp *http.Response) (result ListDeletedOperationResponse, err error) { - type page struct { - Values []DeletedManagedHsm `json:"value"` - NextLink *string `json:"nextLink"` - } - var respObj page - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&respObj), - autorest.ByClosing()) - result.HttpResponse = resp - result.Model = &respObj.Values - result.nextLink = respObj.NextLink - if respObj.NextLink != nil { - result.nextPageFunc = func(ctx context.Context, nextLink string) (result ListDeletedOperationResponse, err error) { - req, err := c.preparerForListDeletedWithNextLink(ctx, nextLink) - if err != nil { - err = autorest.NewErrorWithError(err, "managedhsms.ManagedHsmsClient", "ListDeleted", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "managedhsms.ManagedHsmsClient", "ListDeleted", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForListDeleted(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "managedhsms.ManagedHsmsClient", "ListDeleted", result.HttpResponse, "Failure responding to request") - return - } - - return - } - } - return -} - -// ListDeletedComplete retrieves all of the results into a single object -func (c ManagedHsmsClient) ListDeletedComplete(ctx context.Context, id commonids.SubscriptionId) (ListDeletedCompleteResult, error) { - return c.ListDeletedCompleteMatchingPredicate(ctx, id, DeletedManagedHsmOperationPredicate{}) -} - -// ListDeletedCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c ManagedHsmsClient) ListDeletedCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate DeletedManagedHsmOperationPredicate) (resp ListDeletedCompleteResult, err error) { - items := make([]DeletedManagedHsm, 0) - - page, err := c.ListDeleted(ctx, id) - if err != nil { - err = fmt.Errorf("loading the initial page: %+v", err) - return - } - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - for page.HasMore() { - page, err = page.LoadMore(ctx) - if err != nil { - err = fmt.Errorf("loading the next page: %+v", err) - return - } - - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - } - - out := ListDeletedCompleteResult{ - Items: items, - } - return out, nil -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/method_purgedeleted_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/method_purgedeleted_autorest.go deleted file mode 100644 index 25a1e6e26544..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/method_purgedeleted_autorest.go +++ /dev/null @@ -1,78 +0,0 @@ -package managedhsms - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PurgeDeletedOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// PurgeDeleted ... -func (c ManagedHsmsClient) PurgeDeleted(ctx context.Context, id DeletedManagedHSMId) (result PurgeDeletedOperationResponse, err error) { - req, err := c.preparerForPurgeDeleted(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "managedhsms.ManagedHsmsClient", "PurgeDeleted", nil, "Failure preparing request") - return - } - - result, err = c.senderForPurgeDeleted(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "managedhsms.ManagedHsmsClient", "PurgeDeleted", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// PurgeDeletedThenPoll performs PurgeDeleted then polls until it's completed -func (c ManagedHsmsClient) PurgeDeletedThenPoll(ctx context.Context, id DeletedManagedHSMId) error { - result, err := c.PurgeDeleted(ctx, id) - if err != nil { - return fmt.Errorf("performing PurgeDeleted: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after PurgeDeleted: %+v", err) - } - - return nil -} - -// preparerForPurgeDeleted prepares the PurgeDeleted request. -func (c ManagedHsmsClient) preparerForPurgeDeleted(ctx context.Context, id DeletedManagedHSMId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/purge", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForPurgeDeleted sends the PurgeDeleted request. The method will close the -// http.Response Body if it receives an error. -func (c ManagedHsmsClient) senderForPurgeDeleted(ctx context.Context, req *http.Request) (future PurgeDeletedOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/method_update_autorest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/method_update_autorest.go deleted file mode 100644 index f0ad60994cab..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/method_update_autorest.go +++ /dev/null @@ -1,80 +0,0 @@ -package managedhsms - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// 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 polling.LongRunningPoller - HttpResponse *http.Response - Model *ManagedHsm -} - -// Update ... -func (c ManagedHsmsClient) Update(ctx context.Context, id ManagedHSMId, input ManagedHsm) (result UpdateOperationResponse, err error) { - req, err := c.preparerForUpdate(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "managedhsms.ManagedHsmsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = c.senderForUpdate(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "managedhsms.ManagedHsmsClient", "Update", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// UpdateThenPoll performs Update then polls until it's completed -func (c ManagedHsmsClient) UpdateThenPoll(ctx context.Context, id ManagedHSMId, input ManagedHsm) error { - result, err := c.Update(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Update: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after Update: %+v", err) - } - - return nil -} - -// preparerForUpdate prepares the Update request. -func (c ManagedHsmsClient) preparerForUpdate(ctx context.Context, id ManagedHSMId, input ManagedHsm) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForUpdate sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (c ManagedHsmsClient) senderForUpdate(ctx context.Context, req *http.Request) (future UpdateOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/model_managedhsm.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/model_managedhsm.go deleted file mode 100644 index 15895c20ae0c..000000000000 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/model_managedhsm.go +++ /dev/null @@ -1,19 +0,0 @@ -package managedhsms - -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 ManagedHsm struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ManagedHsmProperties `json:"properties,omitempty"` - Sku *ManagedHsmSku `json:"sku,omitempty"` - 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/keyvault/2023-02-01/managedhsms/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/README.md similarity index 97% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/README.md rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/README.md index 7db306cb3fb9..7829fccab2f4 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/README.md +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/README.md @@ -1,7 +1,7 @@ -## `github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms` Documentation +## `github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms` Documentation -The `managedhsms` SDK allows for interaction with the Azure Resource Manager Service `keyvault` (API Version `2023-02-01`). +The `managedhsms` SDK allows for interaction with the Azure Resource Manager Service `keyvault` (API Version `2023-07-01`). This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). @@ -9,7 +9,7 @@ This readme covers example usages, but further information on [using this SDK ca ```go import "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms" +import "github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms" ``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/client.go new file mode 100644 index 000000000000..7d80c6b65a06 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/client.go @@ -0,0 +1,26 @@ +package managedhsms + +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 ManagedHsmsClient struct { + Client *resourcemanager.Client +} + +func NewManagedHsmsClientWithBaseURI(sdkApi sdkEnv.Api) (*ManagedHsmsClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "managedhsms", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating ManagedHsmsClient: %+v", err) + } + + return &ManagedHsmsClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/constants.go similarity index 75% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/constants.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/constants.go index d6d903bd50da..b12fff596a81 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/constants.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/constants.go @@ -1,6 +1,10 @@ package managedhsms -import "strings" +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. @@ -17,6 +21,19 @@ func PossibleValuesForActionsRequired() []string { } } +func (s *ActionsRequired) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseActionsRequired(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + func parseActionsRequired(input string) (*ActionsRequired, error) { vals := map[string]ActionsRequired{ "none": ActionsRequiredNone, @@ -48,6 +65,19 @@ func PossibleValuesForActivationStatus() []string { } } +func (s *ActivationStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseActivationStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + func parseActivationStatus(input string) (*ActivationStatus, error) { vals := map[string]ActivationStatus{ "active": ActivationStatusActive, @@ -78,6 +108,19 @@ func PossibleValuesForCreateMode() []string { } } +func (s *CreateMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCreateMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + func parseCreateMode(input string) (*CreateMode, error) { vals := map[string]CreateMode{ "default": CreateModeDefault, @@ -114,6 +157,19 @@ func PossibleValuesForGeoReplicationRegionProvisioningState() []string { } } +func (s *GeoReplicationRegionProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGeoReplicationRegionProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + func parseGeoReplicationRegionProvisioningState(input string) (*GeoReplicationRegionProvisioningState, error) { vals := map[string]GeoReplicationRegionProvisioningState{ "cleanup": GeoReplicationRegionProvisioningStateCleanup, @@ -144,6 +200,19 @@ func PossibleValuesForManagedHsmSkuFamily() []string { } } +func (s *ManagedHsmSkuFamily) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseManagedHsmSkuFamily(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + func parseManagedHsmSkuFamily(input string) (*ManagedHsmSkuFamily, error) { vals := map[string]ManagedHsmSkuFamily{ "b": ManagedHsmSkuFamilyB, @@ -173,6 +242,19 @@ func PossibleValuesForManagedHsmSkuName() []string { } } +func (s *ManagedHsmSkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseManagedHsmSkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + func parseManagedHsmSkuName(input string) (*ManagedHsmSkuName, error) { vals := map[string]ManagedHsmSkuName{ "custom_b6": ManagedHsmSkuNameCustomBSix, @@ -202,6 +284,19 @@ func PossibleValuesForNetworkRuleAction() []string { } } +func (s *NetworkRuleAction) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkRuleAction(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + func parseNetworkRuleAction(input string) (*NetworkRuleAction, error) { vals := map[string]NetworkRuleAction{ "allow": NetworkRuleActionAllow, @@ -230,6 +325,19 @@ func PossibleValuesForNetworkRuleBypassOptions() []string { } } +func (s *NetworkRuleBypassOptions) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkRuleBypassOptions(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + func parseNetworkRuleBypassOptions(input string) (*NetworkRuleBypassOptions, error) { vals := map[string]NetworkRuleBypassOptions{ "azureservices": NetworkRuleBypassOptionsAzureServices, @@ -266,6 +374,19 @@ func PossibleValuesForPrivateEndpointConnectionProvisioningState() []string { } } +func (s *PrivateEndpointConnectionProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePrivateEndpointConnectionProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + func parsePrivateEndpointConnectionProvisioningState(input string) (*PrivateEndpointConnectionProvisioningState, error) { vals := map[string]PrivateEndpointConnectionProvisioningState{ "creating": PrivateEndpointConnectionProvisioningStateCreating, @@ -302,6 +423,19 @@ func PossibleValuesForPrivateEndpointServiceConnectionStatus() []string { } } +func (s *PrivateEndpointServiceConnectionStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePrivateEndpointServiceConnectionStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + func parsePrivateEndpointServiceConnectionStatus(input string) (*PrivateEndpointServiceConnectionStatus, error) { vals := map[string]PrivateEndpointServiceConnectionStatus{ "approved": PrivateEndpointServiceConnectionStatusApproved, @@ -344,6 +478,19 @@ func PossibleValuesForProvisioningState() []string { } } +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{ "activated": ProvisioningStateActivated, @@ -378,6 +525,19 @@ func PossibleValuesForPublicNetworkAccess() []string { } } +func (s *PublicNetworkAccess) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicNetworkAccess(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + func parsePublicNetworkAccess(input string) (*PublicNetworkAccess, error) { vals := map[string]PublicNetworkAccess{ "disabled": PublicNetworkAccessDisabled, @@ -406,6 +566,19 @@ func PossibleValuesForReason() []string { } } +func (s *Reason) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseReason(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + func parseReason(input string) (*Reason, error) { vals := map[string]Reason{ "accountnameinvalid": ReasonAccountNameInvalid, diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/id_deletedmanagedhsm.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/id_deletedmanagedhsm.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/id_deletedmanagedhsm.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/id_deletedmanagedhsm.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/id_managedhsm.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/id_managedhsm.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/id_managedhsm.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/id_managedhsm.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/method_checkmhsmnameavailability.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/method_checkmhsmnameavailability.go new file mode 100644 index 000000000000..c5a17524779f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/method_checkmhsmnameavailability.go @@ -0,0 +1,57 @@ +package managedhsms + +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 CheckMhsmNameAvailabilityOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *CheckMhsmNameAvailabilityResult +} + +// CheckMhsmNameAvailability ... +func (c ManagedHsmsClient) CheckMhsmNameAvailability(ctx context.Context, id commonids.SubscriptionId, input CheckMhsmNameAvailabilityParameters) (result CheckMhsmNameAvailabilityOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/providers/Microsoft.KeyVault/checkMhsmNameAvailability", 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/keyvault/2023-07-01/managedhsms/method_createorupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/method_createorupdate.go new file mode 100644 index 000000000000..006c18214b97 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/method_createorupdate.go @@ -0,0 +1,75 @@ +package managedhsms + +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 + Model *ManagedHsm +} + +// CreateOrUpdate ... +func (c ManagedHsmsClient) CreateOrUpdate(ctx context.Context, id ManagedHSMId, input ManagedHsm) (result CreateOrUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed +func (c ManagedHsmsClient) CreateOrUpdateThenPoll(ctx context.Context, id ManagedHSMId, input ManagedHsm) 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/keyvault/2023-07-01/managedhsms/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/method_delete.go new file mode 100644 index 000000000000..6f16d6351893 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/method_delete.go @@ -0,0 +1,71 @@ +package managedhsms + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Delete ... +func (c ManagedHsmsClient) Delete(ctx context.Context, id ManagedHSMId) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + http.StatusOK, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// DeleteThenPoll performs Delete then polls until it's completed +func (c ManagedHsmsClient) DeleteThenPoll(ctx context.Context, id ManagedHSMId) error { + result, err := c.Delete(ctx, id) + if err != nil { + return fmt.Errorf("performing Delete: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Delete: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/method_get.go new file mode 100644 index 000000000000..1025e8d36c51 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/method_get.go @@ -0,0 +1,52 @@ +package managedhsms + +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 *ManagedHsm +} + +// Get ... +func (c ManagedHsmsClient) Get(ctx context.Context, id ManagedHSMId) (result GetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusNoContent, + 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/keyvault/2023-07-01/managedhsms/method_getdeleted.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/method_getdeleted.go new file mode 100644 index 000000000000..e2dbc231c3d3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/method_getdeleted.go @@ -0,0 +1,51 @@ +package managedhsms + +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 GetDeletedOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *DeletedManagedHsm +} + +// GetDeleted ... +func (c ManagedHsmsClient) GetDeleted(ctx context.Context, id DeletedManagedHSMId) (result GetDeletedOperationResponse, 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/keyvault/2023-07-01/managedhsms/method_listbyresourcegroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/method_listbyresourcegroup.go new file mode 100644 index 000000000000..3d678d2c8f52 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/method_listbyresourcegroup.go @@ -0,0 +1,120 @@ +package managedhsms + +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 *[]ManagedHsm +} + +type ListByResourceGroupCompleteResult struct { + LatestHttpResponse *http.Response + Items []ManagedHsm +} + +type ListByResourceGroupOperationOptions struct { + Top *int64 +} + +func DefaultListByResourceGroupOperationOptions() ListByResourceGroupOperationOptions { + return ListByResourceGroupOperationOptions{} +} + +func (o ListByResourceGroupOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + + return &out +} + +func (o ListByResourceGroupOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o ListByResourceGroupOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + if o.Top != nil { + out.Append("$top", fmt.Sprintf("%v", *o.Top)) + } + return &out +} + +// ListByResourceGroup ... +func (c ManagedHsmsClient) ListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId, options ListByResourceGroupOperationOptions) (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.KeyVault/managedHSMs", id.ID()), + OptionsObject: options, + } + + 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 *[]ManagedHsm `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 ManagedHsmsClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId, options ListByResourceGroupOperationOptions) (ListByResourceGroupCompleteResult, error) { + return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, options, ManagedHsmOperationPredicate{}) +} + +// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c ManagedHsmsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, options ListByResourceGroupOperationOptions, predicate ManagedHsmOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { + items := make([]ManagedHsm, 0) + + resp, err := c.ListByResourceGroup(ctx, id, options) + 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{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/method_listbysubscription.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/method_listbysubscription.go new file mode 100644 index 000000000000..c5cb4236b401 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/method_listbysubscription.go @@ -0,0 +1,120 @@ +package managedhsms + +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 *[]ManagedHsm +} + +type ListBySubscriptionCompleteResult struct { + LatestHttpResponse *http.Response + Items []ManagedHsm +} + +type ListBySubscriptionOperationOptions struct { + Top *int64 +} + +func DefaultListBySubscriptionOperationOptions() ListBySubscriptionOperationOptions { + return ListBySubscriptionOperationOptions{} +} + +func (o ListBySubscriptionOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + + return &out +} + +func (o ListBySubscriptionOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o ListBySubscriptionOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + if o.Top != nil { + out.Append("$top", fmt.Sprintf("%v", *o.Top)) + } + return &out +} + +// ListBySubscription ... +func (c ManagedHsmsClient) ListBySubscription(ctx context.Context, id commonids.SubscriptionId, options ListBySubscriptionOperationOptions) (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.KeyVault/managedHSMs", id.ID()), + OptionsObject: options, + } + + 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 *[]ManagedHsm `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 ManagedHsmsClient) ListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId, options ListBySubscriptionOperationOptions) (ListBySubscriptionCompleteResult, error) { + return c.ListBySubscriptionCompleteMatchingPredicate(ctx, id, options, ManagedHsmOperationPredicate{}) +} + +// ListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c ManagedHsmsClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, options ListBySubscriptionOperationOptions, predicate ManagedHsmOperationPredicate) (result ListBySubscriptionCompleteResult, err error) { + items := make([]ManagedHsm, 0) + + resp, err := c.ListBySubscription(ctx, id, options) + 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{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/method_listdeleted.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/method_listdeleted.go new file mode 100644 index 000000000000..93639db56ab4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/method_listdeleted.go @@ -0,0 +1,92 @@ +package managedhsms + +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 ListDeletedOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]DeletedManagedHsm +} + +type ListDeletedCompleteResult struct { + LatestHttpResponse *http.Response + Items []DeletedManagedHsm +} + +// ListDeleted ... +func (c ManagedHsmsClient) ListDeleted(ctx context.Context, id commonids.SubscriptionId) (result ListDeletedOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.KeyVault/deletedManagedHSMs", 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 *[]DeletedManagedHsm `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListDeletedComplete retrieves all the results into a single object +func (c ManagedHsmsClient) ListDeletedComplete(ctx context.Context, id commonids.SubscriptionId) (ListDeletedCompleteResult, error) { + return c.ListDeletedCompleteMatchingPredicate(ctx, id, DeletedManagedHsmOperationPredicate{}) +} + +// ListDeletedCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c ManagedHsmsClient) ListDeletedCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate DeletedManagedHsmOperationPredicate) (result ListDeletedCompleteResult, err error) { + items := make([]DeletedManagedHsm, 0) + + resp, err := c.ListDeleted(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 = ListDeletedCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/method_purgedeleted.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/method_purgedeleted.go new file mode 100644 index 000000000000..efe27946375d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/method_purgedeleted.go @@ -0,0 +1,69 @@ +package managedhsms + +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 PurgeDeletedOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// PurgeDeleted ... +func (c ManagedHsmsClient) PurgeDeleted(ctx context.Context, id DeletedManagedHSMId) (result PurgeDeletedOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/purge", 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 +} + +// PurgeDeletedThenPoll performs PurgeDeleted then polls until it's completed +func (c ManagedHsmsClient) PurgeDeletedThenPoll(ctx context.Context, id DeletedManagedHSMId) error { + result, err := c.PurgeDeleted(ctx, id) + if err != nil { + return fmt.Errorf("performing PurgeDeleted: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after PurgeDeleted: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/method_update.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/method_update.go new file mode 100644 index 000000000000..d9686ae4c4a5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/method_update.go @@ -0,0 +1,75 @@ +package managedhsms + +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 + Model *ManagedHsm +} + +// Update ... +func (c ManagedHsmsClient) Update(ctx context.Context, id ManagedHSMId, input ManagedHsm) (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 ManagedHsmsClient) UpdateThenPoll(ctx context.Context, id ManagedHSMId, input ManagedHsm) 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/keyvault/2023-02-01/managedhsms/model_checkmhsmnameavailabilityparameters.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/model_checkmhsmnameavailabilityparameters.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/model_checkmhsmnameavailabilityparameters.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/model_checkmhsmnameavailabilityparameters.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/model_checkmhsmnameavailabilityresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/model_checkmhsmnameavailabilityresult.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/model_checkmhsmnameavailabilityresult.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/model_checkmhsmnameavailabilityresult.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/model_deletedmanagedhsm.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/model_deletedmanagedhsm.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/model_deletedmanagedhsm.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/model_deletedmanagedhsm.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/model_deletedmanagedhsmproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/model_deletedmanagedhsmproperties.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/model_deletedmanagedhsmproperties.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/model_deletedmanagedhsmproperties.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/model_managedhsm.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/model_managedhsm.go new file mode 100644 index 000000000000..ba4900992151 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/model_managedhsm.go @@ -0,0 +1,21 @@ +package managedhsms + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" + "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 ManagedHsm struct { + Id *string `json:"id,omitempty"` + Identity *identity.LegacySystemAndUserAssignedMap `json:"identity,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *ManagedHsmProperties `json:"properties,omitempty"` + Sku *ManagedHsmSku `json:"sku,omitempty"` + 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/keyvault/2023-02-01/managedhsms/model_managedhsmproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/model_managedhsmproperties.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/model_managedhsmproperties.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/model_managedhsmproperties.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/model_managedhsmsecuritydomainproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/model_managedhsmsecuritydomainproperties.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/model_managedhsmsecuritydomainproperties.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/model_managedhsmsecuritydomainproperties.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/model_managedhsmsku.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/model_managedhsmsku.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/model_managedhsmsku.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/model_managedhsmsku.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/model_mhsmgeoreplicatedregion.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/model_mhsmgeoreplicatedregion.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/model_mhsmgeoreplicatedregion.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/model_mhsmgeoreplicatedregion.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/model_mhsmiprule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/model_mhsmiprule.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/model_mhsmiprule.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/model_mhsmiprule.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/model_mhsmnetworkruleset.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/model_mhsmnetworkruleset.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/model_mhsmnetworkruleset.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/model_mhsmnetworkruleset.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/model_mhsmprivateendpoint.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/model_mhsmprivateendpoint.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/model_mhsmprivateendpoint.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/model_mhsmprivateendpoint.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/model_mhsmprivateendpointconnectionitem.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/model_mhsmprivateendpointconnectionitem.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/model_mhsmprivateendpointconnectionitem.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/model_mhsmprivateendpointconnectionitem.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/model_mhsmprivateendpointconnectionproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/model_mhsmprivateendpointconnectionproperties.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/model_mhsmprivateendpointconnectionproperties.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/model_mhsmprivateendpointconnectionproperties.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/model_mhsmprivatelinkserviceconnectionstate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/model_mhsmprivatelinkserviceconnectionstate.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/model_mhsmprivatelinkserviceconnectionstate.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/model_mhsmprivatelinkserviceconnectionstate.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/model_mhsmvirtualnetworkrule.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/model_mhsmvirtualnetworkrule.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/model_mhsmvirtualnetworkrule.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/model_mhsmvirtualnetworkrule.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/predicates.go similarity index 100% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/predicates.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/predicates.go diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/version.go similarity index 88% rename from vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/version.go rename to vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/version.go index 09de4ecdb8d7..d434a9ba71d1 100644 --- a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms/version.go +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms/version.go @@ -5,7 +5,7 @@ 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-02-01" +const defaultApiVersion = "2023-07-01" func userAgent() string { return fmt.Sprintf("hashicorp/go-azure-sdk/managedhsms/%s", defaultApiVersion) diff --git a/vendor/modules.txt b/vendor/modules.txt index a9ba632b679b..ab2ccbdab406 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -551,8 +551,8 @@ github.com/hashicorp/go-azure-sdk/resource-manager/insights/2022-10-01/autoscale github.com/hashicorp/go-azure-sdk/resource-manager/insights/2023-01-01/actiongroupsapis github.com/hashicorp/go-azure-sdk/resource-manager/insights/2023-04-03/azuremonitorworkspaces github.com/hashicorp/go-azure-sdk/resource-manager/iotcentral/2021-11-01-preview/apps -github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/managedhsms github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-02-01/vaults +github.com/hashicorp/go-azure-sdk/resource-manager/keyvault/2023-07-01/managedhsms github.com/hashicorp/go-azure-sdk/resource-manager/kubernetesconfiguration/2022-11-01/extensions github.com/hashicorp/go-azure-sdk/resource-manager/kubernetesconfiguration/2022-11-01/fluxconfiguration github.com/hashicorp/go-azure-sdk/resource-manager/kusto/2023-08-15/attacheddatabaseconfigurations