forked from hashicorp/terraform-provider-azurerm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
client.go
39 lines (31 loc) · 1.67 KB
/
client.go
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
35
36
37
38
39
package client
import (
"github.com/Azure/azure-sdk-for-go/services/preview/servicefabricmesh/mgmt/2018-09-01-preview/servicefabricmesh"
"github.com/kevinklinger/terraform-provider-azurerm/v2/internal/common"
)
type Client struct {
ApplicationClient *servicefabricmesh.ApplicationClient
NetworkClient *servicefabricmesh.NetworkClient
SecretClient *servicefabricmesh.SecretClient
SecretValueClient *servicefabricmesh.SecretValueClient
ServiceClient *servicefabricmesh.ServiceClient
}
func NewClient(o *common.ClientOptions) *Client {
applicationsClient := servicefabricmesh.NewApplicationClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
o.ConfigureClient(&applicationsClient.Client, o.ResourceManagerAuthorizer)
networksClient := servicefabricmesh.NewNetworkClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
o.ConfigureClient(&networksClient.Client, o.ResourceManagerAuthorizer)
secretsClient := servicefabricmesh.NewSecretClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
o.ConfigureClient(&secretsClient.Client, o.ResourceManagerAuthorizer)
secretValuesClient := servicefabricmesh.NewSecretValueClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
o.ConfigureClient(&secretValuesClient.Client, o.ResourceManagerAuthorizer)
servicesClient := servicefabricmesh.NewServiceClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
o.ConfigureClient(&servicesClient.Client, o.ResourceManagerAuthorizer)
return &Client{
ApplicationClient: &applicationsClient,
NetworkClient: &networksClient,
SecretClient: &secretsClient,
SecretValueClient: &secretValuesClient,
ServiceClient: &servicesClient,
}
}