-
Notifications
You must be signed in to change notification settings - Fork 5k
Expand file tree
/
Copy pathclient.go
More file actions
33 lines (27 loc) · 1.15 KB
/
client.go
File metadata and controls
33 lines (27 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package client
import (
"fmt"
"github.com/hashicorp/go-azure-sdk/resource-manager/deviceregistry/2024-11-01/assetendpointprofiles"
"github.com/hashicorp/go-azure-sdk/resource-manager/deviceregistry/2024-11-01/assets"
"github.com/hashicorp/terraform-provider-azurerm/internal/common"
)
type Client struct {
AssetsClient *assets.AssetsClient
AssetEndpointProfilesClient *assetendpointprofiles.AssetEndpointProfilesClient
}
func NewClient(o *common.ClientOptions) (*Client, error) {
assetsClient, err := assets.NewAssetsClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("building Assets Client: %+v", err)
}
o.Configure(assetsClient.Client, o.Authorizers.ResourceManager)
assetEndpointProfilesClient, err := assetendpointprofiles.NewAssetEndpointProfilesClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("building Asset Endpoint Profiles Client: %+v", err)
}
o.Configure(assetEndpointProfilesClient.Client, o.Authorizers.ResourceManager)
return &Client{
AssetsClient: assetsClient,
AssetEndpointProfilesClient: assetEndpointProfilesClient,
}, nil
}