-
Notifications
You must be signed in to change notification settings - Fork 5k
Expand file tree
/
Copy pathclient.go
More file actions
34 lines (27 loc) · 1.14 KB
/
client.go
File metadata and controls
34 lines (27 loc) · 1.14 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
34
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 {
AssetClient *assets.AssetsClient
AssetEndpointProfileClient *assetendpointprofiles.AssetEndpointProfilesClient
}
func NewClient(o *common.ClientOptions) (*Client, error) {
assetEndpointProfileClient, err := assetendpointprofiles.NewAssetEndpointProfilesClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("creating AssetEndpointProfiles Client: %+v", err)
}
o.Configure(assetEndpointProfileClient.Client, o.Authorizers.ResourceManager)
assetClient, err := assets.NewAssetsClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("creating Asset Client: %+v", err)
}
o.Configure(assetClient.Client, o.Authorizers.ResourceManager)
return &Client{
AssetClient: assetClient,
AssetEndpointProfileClient: assetEndpointProfileClient,
}, nil
}