Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dependencies: updating to v0.20230427.1112058 of github.com/hashicorp/go-azure-sdk #21583

Merged
merged 9 commits into from
Apr 27, 2023
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ require (
github.com/google/go-cmp v0.5.9
github.com/google/uuid v1.1.2
github.com/hashicorp/go-azure-helpers v0.55.0
github.com/hashicorp/go-azure-sdk v0.20230412.1005112
github.com/hashicorp/go-azure-sdk v0.20230427.1112058
github.com/hashicorp/go-multierror v1.1.1
github.com/hashicorp/go-uuid v1.0.3
github.com/hashicorp/go-version v1.6.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brv
github.com/hashicorp/go-azure-helpers v0.12.0/go.mod h1:Zc3v4DNeX6PDdy7NljlYpnrdac1++qNW0I4U+ofGwpg=
github.com/hashicorp/go-azure-helpers v0.55.0 h1:2A2KWPiaDC5kQWr6tYHTD/P1k9bO0HvflEb/Nc1yLeU=
github.com/hashicorp/go-azure-helpers v0.55.0/go.mod h1:RQugkG8wEcNIjYmcBLHpuEI/u2mTJwO4r37rR/OKRpo=
github.com/hashicorp/go-azure-sdk v0.20230412.1005112 h1:7Y6Uud/GzA6F9gU12GzJQ/c4aFc9HlvQ5B1BuSK8S1M=
github.com/hashicorp/go-azure-sdk v0.20230412.1005112/go.mod h1:L9JXVUcnL0GjMizCnngYUlMp1lLhDBNgSTvn6Of/5O4=
github.com/hashicorp/go-azure-sdk v0.20230427.1112058 h1:8T6XtGLFTgcPWMiq+lrbQyf43/f6JfyDJ0gseQvQEec=
github.com/hashicorp/go-azure-sdk v0.20230427.1112058/go.mod h1:L9JXVUcnL0GjMizCnngYUlMp1lLhDBNgSTvn6Of/5O4=
github.com/hashicorp/go-checkpoint v0.5.0 h1:MFYpPZCnQqQTE18jFwSII6eUQrD/oxMFp3mlgcqk5mU=
github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg=
github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
Expand Down
24 changes: 18 additions & 6 deletions internal/clients/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,14 +325,26 @@ func (client *Client) Build(ctx context.Context, o *common.ClientOptions) error
if client.DataBricks, err = databricks.NewClient(o); err != nil {
return fmt.Errorf("building clients for DataBricks: %+v", err)
}
client.DataboxEdge = databoxedge.NewClient(o)
client.Datadog = datadog.NewClient(o)
if client.DataboxEdge, err = databoxedge.NewClient(o); err != nil {
return fmt.Errorf("building clients for DataboxEdge: %+v", err)
}
if client.Datadog, err = datadog.NewClient(o); err != nil {
return fmt.Errorf("building clients for Datadog: %+v", err)
}
client.DataFactory = datafactory.NewClient(o)
client.DataProtection = dataprotection.NewClient(o)
client.DataShare = datashare.NewClient(o)
client.DesktopVirtualization = desktopvirtualization.NewClient(o)
if client.DataProtection, err = dataprotection.NewClient(o); err != nil {
return fmt.Errorf("building clients for DataProtection: %+v", err)
}
if client.DataShare, err = datashare.NewClient(o); err != nil {
return fmt.Errorf("building clients for DataShare: %+v", err)
}
if client.DesktopVirtualization, err = desktopvirtualization.NewClient(o); err != nil {
return fmt.Errorf("building clients for DesktopVirtualization: %+v", err)
}
client.DevTestLabs = devtestlabs.NewClient(o)
client.DigitalTwins = digitaltwins.NewClient(o)
if client.DigitalTwins, err = digitaltwins.NewClient(o); err != nil {
return fmt.Errorf("building clients for DigitalTwins: %+v", err)
}
client.Disks = disks.NewClient(o)
if client.Dns, err = dns.NewClient(o); err != nil {
return fmt.Errorf("building clients for Dns: %+v", err)
Expand Down
28 changes: 18 additions & 10 deletions internal/services/databoxedge/client/client.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package client

import (
"github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices"
"github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/orders"
"fmt"

"github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2022-03-01/devices"
"github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2022-03-01/orders"
"github.com/hashicorp/terraform-provider-azurerm/internal/common"
)

Expand All @@ -11,15 +13,21 @@ type Client struct {
OrdersClient *orders.OrdersClient
}

func NewClient(o *common.ClientOptions) *Client {
deviceClient := devices.NewDevicesClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&deviceClient.Client, o.ResourceManagerAuthorizer)
func NewClient(o *common.ClientOptions) (*Client, error) {
deviceClient, err := devices.NewDevicesClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("building Devices client: %+v", err)
}
o.Configure(deviceClient.Client, o.Authorizers.ResourceManager)

ordersClient := orders.NewOrdersClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&ordersClient.Client, o.ResourceManagerAuthorizer)
ordersClient, err := orders.NewOrdersClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("building Orders client: %+v", err)
}
o.Configure(ordersClient.Client, o.Authorizers.ResourceManager)

return &Client{
DeviceClient: &deviceClient,
OrdersClient: &ordersClient,
}
DeviceClient: deviceClient,
OrdersClient: ordersClient,
}, nil
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/hashicorp/go-azure-helpers/lang/response"
"github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema"
"github.com/hashicorp/go-azure-helpers/resourcemanager/location"
"github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices"
"github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2022-03-01/devices"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-provider-azurerm/internal/sdk"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/databoxedge/validate"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/hashicorp/go-azure-helpers/lang/response"
"github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema"
"github.com/hashicorp/go-azure-helpers/resourcemanager/location"
"github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices"
"github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2022-03-01/devices"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-provider-azurerm/helpers/tf"
"github.com/hashicorp/terraform-provider-azurerm/internal/sdk"
Expand Down Expand Up @@ -164,7 +164,6 @@ func (r EdgeDeviceResource) Create() sdk.ResourceFunc {
}

id := devices.NewDataBoxEdgeDeviceID(subscriptionId, metaModel.ResourceGroupName, metaModel.Name)
// sdk method is Get(ctx context.Context, deviceName string, resourceGroupName string)
existing, err := client.Get(ctx, id)
if err != nil {
if !response.WasNotFound(existing.HttpResponse) {
Expand All @@ -181,12 +180,11 @@ func (r EdgeDeviceResource) Create() sdk.ResourceFunc {
Tags: &metaModel.Tags,
}

if err := client.CreateOrUpdateThenPoll(ctx, id, dataBoxEdgeDevice); err != nil {
if _, err := client.CreateOrUpdate(ctx, id, dataBoxEdgeDevice); err != nil {
return fmt.Errorf("creating %s: %+v", id, err)
}

metadata.SetID(id)

return nil
},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"testing"

"github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices"
"github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2022-03-01/devices"
"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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/hashicorp/go-azure-helpers/lang/response"
"github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema"
"github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/orders"
"github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2022-03-01/orders"
"github.com/hashicorp/terraform-provider-azurerm/helpers/tf"
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/databoxedge/migration"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"testing"

"github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/orders"
"github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2022-03-01/orders"
"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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"log"

"github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids"
"github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/orders"
"github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2022-03-01/orders"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"strings"

"github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices"
"github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2022-03-01/devices"
)

// DataboxEdgeDeviceSku type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"strings"

"github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2020-12-01/devices"
"github.com/hashicorp/go-azure-sdk/resource-manager/databoxedge/2022-03-01/devices"
"github.com/hashicorp/terraform-provider-azurerm/helpers/azure"
)

Expand Down
15 changes: 10 additions & 5 deletions internal/services/datadog/client/client.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
package client

import (
"github.com/Azure/go-autorest/autorest"
"fmt"

datadog_v2021_03_01 "github.com/hashicorp/go-azure-sdk/resource-manager/datadog/2021-03-01"
"github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager"
"github.com/hashicorp/terraform-provider-azurerm/internal/common"
)

func NewClient(o *common.ClientOptions) *datadog_v2021_03_01.Client {
client := datadog_v2021_03_01.NewClientWithBaseURI(o.ResourceManagerEndpoint, func(c *autorest.Client) {
c.Authorizer = o.ResourceManagerAuthorizer
func NewClient(o *common.ClientOptions) (*datadog_v2021_03_01.Client, error) {
client, err := datadog_v2021_03_01.NewClientWithBaseURI(o.Environment.ResourceManager, func(c *resourcemanager.Client) {
c.Authorizer = o.Authorizers.ResourceManager
})
return &client
if err != nil {
return nil, fmt.Errorf("building client: %+v", err)
}
return client, nil
}
42 changes: 28 additions & 14 deletions internal/services/dataprotection/client/client.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package client

import (
"fmt"

"github.com/hashicorp/go-azure-sdk/resource-manager/dataprotection/2022-04-01/backupinstances"
"github.com/hashicorp/go-azure-sdk/resource-manager/dataprotection/2022-04-01/backuppolicies"
"github.com/hashicorp/go-azure-sdk/resource-manager/dataprotection/2022-04-01/backupvaults"
Expand All @@ -15,23 +17,35 @@ type Client struct {
ResourceGuardClient *resourceguards.ResourceGuardsClient
}

func NewClient(o *common.ClientOptions) *Client {
backupVaultClient := backupvaults.NewBackupVaultsClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&backupVaultClient.Client, o.ResourceManagerAuthorizer)
func NewClient(o *common.ClientOptions) (*Client, error) {
backupVaultClient, err := backupvaults.NewBackupVaultsClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("building BackupVaults client: %+v", err)
}
o.Configure(backupVaultClient.Client, o.Authorizers.ResourceManager)

backupPolicyClient := backuppolicies.NewBackupPoliciesClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&backupPolicyClient.Client, o.ResourceManagerAuthorizer)
backupPolicyClient, err := backuppolicies.NewBackupPoliciesClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("building BackupPolicies client: %+v", err)
}
o.Configure(backupPolicyClient.Client, o.Authorizers.ResourceManager)

backupInstanceClient := backupinstances.NewBackupInstancesClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&backupInstanceClient.Client, o.ResourceManagerAuthorizer)
backupInstanceClient, err := backupinstances.NewBackupInstancesClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("building BackupInstances client: %+v", err)
}
o.Configure(backupInstanceClient.Client, o.Authorizers.ResourceManager)

resourceGuardClient := resourceguards.NewResourceGuardsClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&resourceGuardClient.Client, o.ResourceManagerAuthorizer)
resourceGuardClient, err := resourceguards.NewResourceGuardsClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("building ResourceGuards client: %+v", err)
}
o.Configure(resourceGuardClient.Client, o.Authorizers.ResourceManager)

return &Client{
BackupVaultClient: &backupVaultClient,
BackupPolicyClient: &backupPolicyClient,
BackupInstanceClient: &backupInstanceClient,
ResourceGuardClient: &resourceGuardClient,
}
BackupVaultClient: backupVaultClient,
BackupPolicyClient: backupPolicyClient,
BackupInstanceClient: backupInstanceClient,
ResourceGuardClient: resourceGuardClient,
}, nil
}
42 changes: 28 additions & 14 deletions internal/services/datashare/client/client.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package client

import (
"fmt"

"github.com/hashicorp/go-azure-sdk/resource-manager/datashare/2019-11-01/account"
"github.com/hashicorp/go-azure-sdk/resource-manager/datashare/2019-11-01/dataset"
"github.com/hashicorp/go-azure-sdk/resource-manager/datashare/2019-11-01/share"
Expand All @@ -15,23 +17,35 @@ type Client struct {
SynchronizationClient *synchronizationsetting.SynchronizationSettingClient
}

func NewClient(o *common.ClientOptions) *Client {
accountClient := account.NewAccountClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&accountClient.Client, o.ResourceManagerAuthorizer)
func NewClient(o *common.ClientOptions) (*Client, error) {
accountClient, err := account.NewAccountClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("building Accounts client: %+v", err)
}
o.Configure(accountClient.Client, o.Authorizers.ResourceManager)

dataSetClient := dataset.NewDataSetClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&dataSetClient.Client, o.ResourceManagerAuthorizer)
dataSetClient, err := dataset.NewDataSetClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("building DataSets client: %+v", err)
}
o.Configure(dataSetClient.Client, o.Authorizers.ResourceManager)

sharesClient := share.NewShareClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&sharesClient.Client, o.ResourceManagerAuthorizer)
sharesClient, err := share.NewShareClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("building Shares client: %+v", err)
}
o.Configure(sharesClient.Client, o.Authorizers.ResourceManager)

synchronizationSettingsClient := synchronizationsetting.NewSynchronizationSettingClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&synchronizationSettingsClient.Client, o.ResourceManagerAuthorizer)
synchronizationSettingsClient, err := synchronizationsetting.NewSynchronizationSettingClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("building SynchronizationSettings client: %+v", err)
}
o.Configure(synchronizationSettingsClient.Client, o.Authorizers.ResourceManager)

return &Client{
AccountClient: &accountClient,
DataSetClient: &dataSetClient,
SharesClient: &sharesClient,
SynchronizationClient: &synchronizationSettingsClient,
}
AccountClient: accountClient,
DataSetClient: dataSetClient,
SharesClient: sharesClient,
SynchronizationClient: synchronizationSettingsClient,
}, nil
}
Loading