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

automat_dsc_configuration: update sdk to 2022-08-08 #22403

Merged
merged 2 commits into from
Jul 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion internal/clients/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,9 @@ func (client *Client) Build(ctx context.Context, o *common.ClientOptions) error
return fmt.Errorf("building clients for Authorization: %+v", err)
}
client.Automanage = automanage.NewClient(o)
client.Automation = automation.NewClient(o)
if client.Automation, err = automation.NewClient(o); err != nil {
return fmt.Errorf("building clients for Automation: %+v", err)
}
client.AzureStackHCI = azureStackHCI.NewClient(o)
if client.Batch, err = batch.NewClient(o); err != nil {
return fmt.Errorf("building clients for Batch: %+v", err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/hashicorp/go-azure-helpers/lang/pointer"
"github.com/hashicorp/go-azure-helpers/lang/response"
"github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema"
"github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/dscconfiguration"
"github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/dscconfiguration"
"github.com/hashicorp/terraform-provider-azurerm/helpers/azure"
"github.com/hashicorp/terraform-provider-azurerm/helpers/tf"
"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 (
"testing"

"github.com/hashicorp/go-azure-helpers/lang/pointer"
"github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/dscconfiguration"
"github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/dscconfiguration"
"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
17 changes: 11 additions & 6 deletions internal/services/automation/client/client.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package client

import (
"fmt"

"github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" // nolint: staticcheck
"github.com/hashicorp/go-azure-sdk/resource-manager/automation/2015-10-31/webhook"
"github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/dscconfiguration"
"github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/runbook"
"github.com/hashicorp/go-azure-sdk/resource-manager/automation/2019-06-01/softwareupdateconfiguration"
"github.com/hashicorp/go-azure-sdk/resource-manager/automation/2020-01-13-preview/certificate"
Expand All @@ -20,6 +21,7 @@ import (
"github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/automationaccount"
"github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworker"
"github.com/hashicorp/go-azure-sdk/resource-manager/automation/2021-06-22/hybridrunbookworkergroup"
"github.com/hashicorp/go-azure-sdk/resource-manager/automation/2022-08-08/dscconfiguration"
"github.com/hashicorp/terraform-provider-azurerm/internal/common"
)

Expand Down Expand Up @@ -47,7 +49,7 @@ type Client struct {
WebhookClient *webhook.WebhookClient
}

func NewClient(o *common.ClientOptions) *Client {
func NewClient(o *common.ClientOptions) (*Client, error) {
accountClient := automationaccount.NewAutomationAccountClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&accountClient.Client, o.ResourceManagerAuthorizer)

Expand All @@ -66,8 +68,11 @@ func NewClient(o *common.ClientOptions) *Client {
credentialClient := credential.NewCredentialClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&credentialClient.Client, o.ResourceManagerAuthorizer)

dscConfigurationClient := dscconfiguration.NewDscConfigurationClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&dscConfigurationClient.Client, o.ResourceManagerAuthorizer)
dscConfigurationClient, err := dscconfiguration.NewDscConfigurationClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("build dscConfigurationClient: %+v", err)
}
o.Configure(dscConfigurationClient.Client, o.Authorizers.ResourceManager)

dscNodeConfigurationClient := dscnodeconfiguration.NewDscNodeConfigurationClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&dscNodeConfigurationClient.Client, o.ResourceManagerAuthorizer)
Expand Down Expand Up @@ -118,7 +123,7 @@ func NewClient(o *common.ClientOptions) *Client {
ConnectionClient: &connectionClient,
ConnectionTypeClient: &connectionTypeClient,
CredentialClient: &credentialClient,
DscConfigurationClient: &dscConfigurationClient,
DscConfigurationClient: dscConfigurationClient,
DscNodeConfigurationClient: &dscNodeConfigurationClient,
JobScheduleClient: &jobScheduleClient,
ModuleClient: &moduleClient,
Expand All @@ -133,5 +138,5 @@ func NewClient(o *common.ClientOptions) *Client {
VariableClient: &variableClient,
WatcherClient: &watcherClient,
WebhookClient: &webhookClient,
}
}, nil
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading