-
Notifications
You must be signed in to change notification settings - Fork 43
/
client.go
47 lines (37 loc) · 1.88 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
40
41
42
43
44
45
46
47
package v2020_10_05_privatepreview
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.
import (
"github.com/Azure/go-autorest/autorest"
"github.com/hashicorp/go-azure-sdk/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations"
"github.com/hashicorp/go-azure-sdk/resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules"
"github.com/hashicorp/go-azure-sdk/resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles"
"github.com/hashicorp/go-azure-sdk/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups"
"github.com/hashicorp/go-azure-sdk/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers"
)
type Client struct {
Configurations *configurations.ConfigurationsClient
FirewallRules *firewallrules.FirewallRulesClient
Roles *roles.RolesClient
ServerGroups *servergroups.ServerGroupsClient
Servers *servers.ServersClient
}
func NewClientWithBaseURI(endpoint string, configureAuthFunc func(c *autorest.Client)) Client {
configurationsClient := configurations.NewConfigurationsClientWithBaseURI(endpoint)
configureAuthFunc(&configurationsClient.Client)
firewallRulesClient := firewallrules.NewFirewallRulesClientWithBaseURI(endpoint)
configureAuthFunc(&firewallRulesClient.Client)
rolesClient := roles.NewRolesClientWithBaseURI(endpoint)
configureAuthFunc(&rolesClient.Client)
serverGroupsClient := servergroups.NewServerGroupsClientWithBaseURI(endpoint)
configureAuthFunc(&serverGroupsClient.Client)
serversClient := servers.NewServersClientWithBaseURI(endpoint)
configureAuthFunc(&serversClient.Client)
return Client{
Configurations: &configurationsClient,
FirewallRules: &firewallRulesClient,
Roles: &rolesClient,
ServerGroups: &serverGroupsClient,
Servers: &serversClient,
}
}