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

New Resource: azurerm_cognitive_account_rai_policy #28013

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
10 changes: 10 additions & 0 deletions internal/services/cognitive/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ import (

"github.com/hashicorp/go-azure-sdk/resource-manager/cognitive/2024-10-01/cognitiveservicesaccounts"
"github.com/hashicorp/go-azure-sdk/resource-manager/cognitive/2024-10-01/deployments"
"github.com/hashicorp/go-azure-sdk/resource-manager/cognitive/2024-10-01/raipolicies"
"github.com/hashicorp/terraform-provider-azurerm/internal/common"
)

type Client struct {
AccountsClient *cognitiveservicesaccounts.CognitiveServicesAccountsClient
DeploymentsClient *deployments.DeploymentsClient
RaiPoliciesClient *raipolicies.RaiPoliciesClient
}

func NewClient(o *common.ClientOptions) (*Client, error) {
Expand All @@ -28,8 +30,16 @@ func NewClient(o *common.ClientOptions) (*Client, error) {
return nil, fmt.Errorf("building Deployments client: %+v", err)
}
o.Configure(deploymentsClient.Client, o.Authorizers.ResourceManager)

raiPoliciesClient, err := raipolicies.NewRaiPoliciesClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("building RaiPolicies client: %+v", err)
liuwuliuyun marked this conversation as resolved.
Show resolved Hide resolved
}
o.Configure(raiPoliciesClient.Client, o.Authorizers.ResourceManager)

return &Client{
AccountsClient: accountsClient,
DeploymentsClient: deploymentsClient,
RaiPoliciesClient: raiPoliciesClient,
}, nil
}
Loading
Loading