-
Notifications
You must be signed in to change notification settings - Fork 40
/
client.go
190 lines (166 loc) · 8.28 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
package v2023_05_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/netapp/2023-05-01/backuppolicy"
"github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-05-01/capacitypools"
"github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-05-01/filelocks"
"github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-05-01/groupidlistforldapuser"
"github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-05-01/netappaccounts"
"github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-05-01/netappresource"
"github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-05-01/poolchange"
"github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-05-01/resetcifspassword"
"github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-05-01/restore"
"github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-05-01/snapshotpolicy"
"github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-05-01/snapshotpolicylistvolumes"
"github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-05-01/snapshots"
"github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-05-01/subvolumes"
"github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-05-01/volumegroups"
"github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-05-01/volumequotarules"
"github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-05-01/volumes"
"github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-05-01/volumesrelocation"
"github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-05-01/volumesreplication"
"github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-05-01/volumesrevert"
"github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager"
sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments"
)
type Client struct {
BackupPolicy *backuppolicy.BackupPolicyClient
CapacityPools *capacitypools.CapacityPoolsClient
FileLocks *filelocks.FileLocksClient
GroupIdListForLDAPUser *groupidlistforldapuser.GroupIdListForLDAPUserClient
NetAppAccounts *netappaccounts.NetAppAccountsClient
NetAppResource *netappresource.NetAppResourceClient
PoolChange *poolchange.PoolChangeClient
ResetCifsPassword *resetcifspassword.ResetCifsPasswordClient
Restore *restore.RestoreClient
SnapshotPolicy *snapshotpolicy.SnapshotPolicyClient
SnapshotPolicyListVolumes *snapshotpolicylistvolumes.SnapshotPolicyListVolumesClient
Snapshots *snapshots.SnapshotsClient
SubVolumes *subvolumes.SubVolumesClient
VolumeGroups *volumegroups.VolumeGroupsClient
VolumeQuotaRules *volumequotarules.VolumeQuotaRulesClient
Volumes *volumes.VolumesClient
VolumesRelocation *volumesrelocation.VolumesRelocationClient
VolumesReplication *volumesreplication.VolumesReplicationClient
VolumesRevert *volumesrevert.VolumesRevertClient
}
func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) {
backupPolicyClient, err := backuppolicy.NewBackupPolicyClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building BackupPolicy client: %+v", err)
}
configureFunc(backupPolicyClient.Client)
capacityPoolsClient, err := capacitypools.NewCapacityPoolsClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building CapacityPools client: %+v", err)
}
configureFunc(capacityPoolsClient.Client)
fileLocksClient, err := filelocks.NewFileLocksClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building FileLocks client: %+v", err)
}
configureFunc(fileLocksClient.Client)
groupIdListForLDAPUserClient, err := groupidlistforldapuser.NewGroupIdListForLDAPUserClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building GroupIdListForLDAPUser client: %+v", err)
}
configureFunc(groupIdListForLDAPUserClient.Client)
netAppAccountsClient, err := netappaccounts.NewNetAppAccountsClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building NetAppAccounts client: %+v", err)
}
configureFunc(netAppAccountsClient.Client)
netAppResourceClient, err := netappresource.NewNetAppResourceClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building NetAppResource client: %+v", err)
}
configureFunc(netAppResourceClient.Client)
poolChangeClient, err := poolchange.NewPoolChangeClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building PoolChange client: %+v", err)
}
configureFunc(poolChangeClient.Client)
resetCifsPasswordClient, err := resetcifspassword.NewResetCifsPasswordClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building ResetCifsPassword client: %+v", err)
}
configureFunc(resetCifsPasswordClient.Client)
restoreClient, err := restore.NewRestoreClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building Restore client: %+v", err)
}
configureFunc(restoreClient.Client)
snapshotPolicyClient, err := snapshotpolicy.NewSnapshotPolicyClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building SnapshotPolicy client: %+v", err)
}
configureFunc(snapshotPolicyClient.Client)
snapshotPolicyListVolumesClient, err := snapshotpolicylistvolumes.NewSnapshotPolicyListVolumesClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building SnapshotPolicyListVolumes client: %+v", err)
}
configureFunc(snapshotPolicyListVolumesClient.Client)
snapshotsClient, err := snapshots.NewSnapshotsClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building Snapshots client: %+v", err)
}
configureFunc(snapshotsClient.Client)
subVolumesClient, err := subvolumes.NewSubVolumesClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building SubVolumes client: %+v", err)
}
configureFunc(subVolumesClient.Client)
volumeGroupsClient, err := volumegroups.NewVolumeGroupsClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building VolumeGroups client: %+v", err)
}
configureFunc(volumeGroupsClient.Client)
volumeQuotaRulesClient, err := volumequotarules.NewVolumeQuotaRulesClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building VolumeQuotaRules client: %+v", err)
}
configureFunc(volumeQuotaRulesClient.Client)
volumesClient, err := volumes.NewVolumesClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building Volumes client: %+v", err)
}
configureFunc(volumesClient.Client)
volumesRelocationClient, err := volumesrelocation.NewVolumesRelocationClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building VolumesRelocation client: %+v", err)
}
configureFunc(volumesRelocationClient.Client)
volumesReplicationClient, err := volumesreplication.NewVolumesReplicationClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building VolumesReplication client: %+v", err)
}
configureFunc(volumesReplicationClient.Client)
volumesRevertClient, err := volumesrevert.NewVolumesRevertClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building VolumesRevert client: %+v", err)
}
configureFunc(volumesRevertClient.Client)
return &Client{
BackupPolicy: backupPolicyClient,
CapacityPools: capacityPoolsClient,
FileLocks: fileLocksClient,
GroupIdListForLDAPUser: groupIdListForLDAPUserClient,
NetAppAccounts: netAppAccountsClient,
NetAppResource: netAppResourceClient,
PoolChange: poolChangeClient,
ResetCifsPassword: resetCifsPasswordClient,
Restore: restoreClient,
SnapshotPolicy: snapshotPolicyClient,
SnapshotPolicyListVolumes: snapshotPolicyListVolumesClient,
Snapshots: snapshotsClient,
SubVolumes: subVolumesClient,
VolumeGroups: volumeGroupsClient,
VolumeQuotaRules: volumeQuotaRulesClient,
Volumes: volumesClient,
VolumesRelocation: volumesRelocationClient,
VolumesReplication: volumesReplicationClient,
VolumesRevert: volumesRevertClient,
}, nil
}