-
Notifications
You must be signed in to change notification settings - Fork 46
/
client.go
100 lines (86 loc) · 4.49 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
package v2022_10_01
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.
import (
"fmt"
"github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2022-10-01/getprivatelinkresources"
"github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2022-10-01/listprivatelinkresources"
"github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2022-10-01/recoveryservices"
"github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2022-10-01/registeredidentities"
"github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2022-10-01/replicationusages"
"github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2022-10-01/vaultcertificates"
"github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2022-10-01/vaultextendedinfo"
"github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2022-10-01/vaults"
"github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2022-10-01/vaultusages"
"github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager"
sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments"
)
type Client struct {
GetPrivateLinkResources *getprivatelinkresources.GetPrivateLinkResourcesClient
ListPrivateLinkResources *listprivatelinkresources.ListPrivateLinkResourcesClient
RecoveryServices *recoveryservices.RecoveryServicesClient
RegisteredIdentities *registeredidentities.RegisteredIdentitiesClient
ReplicationUsages *replicationusages.ReplicationUsagesClient
VaultCertificates *vaultcertificates.VaultCertificatesClient
VaultExtendedInfo *vaultextendedinfo.VaultExtendedInfoClient
VaultUsages *vaultusages.VaultUsagesClient
Vaults *vaults.VaultsClient
}
func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) {
getPrivateLinkResourcesClient, err := getprivatelinkresources.NewGetPrivateLinkResourcesClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building GetPrivateLinkResources client: %+v", err)
}
configureFunc(getPrivateLinkResourcesClient.Client)
listPrivateLinkResourcesClient, err := listprivatelinkresources.NewListPrivateLinkResourcesClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building ListPrivateLinkResources client: %+v", err)
}
configureFunc(listPrivateLinkResourcesClient.Client)
recoveryServicesClient, err := recoveryservices.NewRecoveryServicesClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building RecoveryServices client: %+v", err)
}
configureFunc(recoveryServicesClient.Client)
registeredIdentitiesClient, err := registeredidentities.NewRegisteredIdentitiesClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building RegisteredIdentities client: %+v", err)
}
configureFunc(registeredIdentitiesClient.Client)
replicationUsagesClient, err := replicationusages.NewReplicationUsagesClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building ReplicationUsages client: %+v", err)
}
configureFunc(replicationUsagesClient.Client)
vaultCertificatesClient, err := vaultcertificates.NewVaultCertificatesClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building VaultCertificates client: %+v", err)
}
configureFunc(vaultCertificatesClient.Client)
vaultExtendedInfoClient, err := vaultextendedinfo.NewVaultExtendedInfoClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building VaultExtendedInfo client: %+v", err)
}
configureFunc(vaultExtendedInfoClient.Client)
vaultUsagesClient, err := vaultusages.NewVaultUsagesClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building VaultUsages client: %+v", err)
}
configureFunc(vaultUsagesClient.Client)
vaultsClient, err := vaults.NewVaultsClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building Vaults client: %+v", err)
}
configureFunc(vaultsClient.Client)
return &Client{
GetPrivateLinkResources: getPrivateLinkResourcesClient,
ListPrivateLinkResources: listPrivateLinkResourcesClient,
RecoveryServices: recoveryServicesClient,
RegisteredIdentities: registeredIdentitiesClient,
ReplicationUsages: replicationUsagesClient,
VaultCertificates: vaultCertificatesClient,
VaultExtendedInfo: vaultExtendedInfoClient,
VaultUsages: vaultUsagesClient,
Vaults: vaultsClient,
}, nil
}