forked from hashicorp/terraform-provider-azurerm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
client.go
35 lines (28 loc) · 1.35 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
package client
import (
"github.com/Azure/azure-sdk-for-go/services/botservice/mgmt/2021-03-01/botservice"
"github.com/Azure/azure-sdk-for-go/services/healthbot/mgmt/2020-12-08/healthbot"
"github.com/kevinklinger/terraform-provider-azurerm/v2/internal/common"
)
type Client struct {
BotClient *botservice.BotsClient
ConnectionClient *botservice.BotConnectionClient
ChannelClient *botservice.ChannelsClient
HealthbotClient *healthbot.BotsClient
}
func NewClient(o *common.ClientOptions) *Client {
botClient := botservice.NewBotsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
o.ConfigureClient(&botClient.Client, o.ResourceManagerAuthorizer)
connectionClient := botservice.NewBotConnectionClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
o.ConfigureClient(&connectionClient.Client, o.ResourceManagerAuthorizer)
channelClient := botservice.NewChannelsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
o.ConfigureClient(&channelClient.Client, o.ResourceManagerAuthorizer)
healthBotClient := healthbot.NewBotsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
o.ConfigureClient(&healthBotClient.Client, o.ResourceManagerAuthorizer)
return &Client{
BotClient: &botClient,
ChannelClient: &channelClient,
ConnectionClient: &connectionClient,
HealthbotClient: &healthBotClient,
}
}