-
Notifications
You must be signed in to change notification settings - Fork 40
/
client.go
271 lines (238 loc) · 16.1 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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
package v2017_03_01_preview
// 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/sql/2017-03-01-preview/backuplongtermretentionpolicies"
"github.com/hashicorp/go-azure-sdk/resource-manager/sql/2017-03-01-preview/blobauditing"
"github.com/hashicorp/go-azure-sdk/resource-manager/sql/2017-03-01-preview/databases"
"github.com/hashicorp/go-azure-sdk/resource-manager/sql/2017-03-01-preview/databasevulnerabilityassesmentrulebaselines"
"github.com/hashicorp/go-azure-sdk/resource-manager/sql/2017-03-01-preview/databasevulnerabilityassessments"
"github.com/hashicorp/go-azure-sdk/resource-manager/sql/2017-03-01-preview/datawarehouseuseractivities"
"github.com/hashicorp/go-azure-sdk/resource-manager/sql/2017-03-01-preview/jobagents"
"github.com/hashicorp/go-azure-sdk/resource-manager/sql/2017-03-01-preview/jobcredentials"
"github.com/hashicorp/go-azure-sdk/resource-manager/sql/2017-03-01-preview/jobexecutions"
"github.com/hashicorp/go-azure-sdk/resource-manager/sql/2017-03-01-preview/jobs"
"github.com/hashicorp/go-azure-sdk/resource-manager/sql/2017-03-01-preview/jobstepexecutions"
"github.com/hashicorp/go-azure-sdk/resource-manager/sql/2017-03-01-preview/jobsteps"
"github.com/hashicorp/go-azure-sdk/resource-manager/sql/2017-03-01-preview/jobtargetexecutions"
"github.com/hashicorp/go-azure-sdk/resource-manager/sql/2017-03-01-preview/jobtargetgroups"
"github.com/hashicorp/go-azure-sdk/resource-manager/sql/2017-03-01-preview/jobversions"
"github.com/hashicorp/go-azure-sdk/resource-manager/sql/2017-03-01-preview/longtermretentionbackups"
"github.com/hashicorp/go-azure-sdk/resource-manager/sql/2017-03-01-preview/managedbackupshorttermretentionpolicies"
"github.com/hashicorp/go-azure-sdk/resource-manager/sql/2017-03-01-preview/manageddatabases"
"github.com/hashicorp/go-azure-sdk/resource-manager/sql/2017-03-01-preview/manageddatabasesecurityalertpolicies"
"github.com/hashicorp/go-azure-sdk/resource-manager/sql/2017-03-01-preview/managedinstanceadministrators"
"github.com/hashicorp/go-azure-sdk/resource-manager/sql/2017-03-01-preview/managedrestorabledroppeddatabasebackupshorttermretentionpolicies"
"github.com/hashicorp/go-azure-sdk/resource-manager/sql/2017-03-01-preview/managedserversecurityalertpolicies"
"github.com/hashicorp/go-azure-sdk/resource-manager/sql/2017-03-01-preview/restorabledroppedmanageddatabases"
"github.com/hashicorp/go-azure-sdk/resource-manager/sql/2017-03-01-preview/restorepoints"
"github.com/hashicorp/go-azure-sdk/resource-manager/sql/2017-03-01-preview/sensitivitylabels"
"github.com/hashicorp/go-azure-sdk/resource-manager/sql/2017-03-01-preview/serverautomatictuning"
"github.com/hashicorp/go-azure-sdk/resource-manager/sql/2017-03-01-preview/serverdnsaliases"
"github.com/hashicorp/go-azure-sdk/resource-manager/sql/2017-03-01-preview/serversecurityalertpolicies"
"github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager"
sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments"
)
type Client struct {
BackupLongTermRetentionPolicies *backuplongtermretentionpolicies.BackupLongTermRetentionPoliciesClient
BlobAuditing *blobauditing.BlobAuditingClient
DataWarehouseUserActivities *datawarehouseuseractivities.DataWarehouseUserActivitiesClient
DatabaseVulnerabilityAssesmentRuleBaselines *databasevulnerabilityassesmentrulebaselines.DatabaseVulnerabilityAssesmentRuleBaselinesClient
DatabaseVulnerabilityAssessments *databasevulnerabilityassessments.DatabaseVulnerabilityAssessmentsClient
Databases *databases.DatabasesClient
JobAgents *jobagents.JobAgentsClient
JobCredentials *jobcredentials.JobCredentialsClient
JobExecutions *jobexecutions.JobExecutionsClient
JobStepExecutions *jobstepexecutions.JobStepExecutionsClient
JobSteps *jobsteps.JobStepsClient
JobTargetExecutions *jobtargetexecutions.JobTargetExecutionsClient
JobTargetGroups *jobtargetgroups.JobTargetGroupsClient
JobVersions *jobversions.JobVersionsClient
Jobs *jobs.JobsClient
LongTermRetentionBackups *longtermretentionbackups.LongTermRetentionBackupsClient
ManagedBackupShortTermRetentionPolicies *managedbackupshorttermretentionpolicies.ManagedBackupShortTermRetentionPoliciesClient
ManagedDatabaseSecurityAlertPolicies *manageddatabasesecurityalertpolicies.ManagedDatabaseSecurityAlertPoliciesClient
ManagedDatabases *manageddatabases.ManagedDatabasesClient
ManagedInstanceAdministrators *managedinstanceadministrators.ManagedInstanceAdministratorsClient
ManagedRestorableDroppedDatabaseBackupShortTermRetentionPolicies *managedrestorabledroppeddatabasebackupshorttermretentionpolicies.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient
ManagedServerSecurityAlertPolicies *managedserversecurityalertpolicies.ManagedServerSecurityAlertPoliciesClient
RestorableDroppedManagedDatabases *restorabledroppedmanageddatabases.RestorableDroppedManagedDatabasesClient
RestorePoints *restorepoints.RestorePointsClient
SensitivityLabels *sensitivitylabels.SensitivityLabelsClient
ServerAutomaticTuning *serverautomatictuning.ServerAutomaticTuningClient
ServerDnsAliases *serverdnsaliases.ServerDnsAliasesClient
ServerSecurityAlertPolicies *serversecurityalertpolicies.ServerSecurityAlertPoliciesClient
}
func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) {
backupLongTermRetentionPoliciesClient, err := backuplongtermretentionpolicies.NewBackupLongTermRetentionPoliciesClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building BackupLongTermRetentionPolicies client: %+v", err)
}
configureFunc(backupLongTermRetentionPoliciesClient.Client)
blobAuditingClient, err := blobauditing.NewBlobAuditingClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building BlobAuditing client: %+v", err)
}
configureFunc(blobAuditingClient.Client)
dataWarehouseUserActivitiesClient, err := datawarehouseuseractivities.NewDataWarehouseUserActivitiesClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building DataWarehouseUserActivities client: %+v", err)
}
configureFunc(dataWarehouseUserActivitiesClient.Client)
databaseVulnerabilityAssesmentRuleBaselinesClient, err := databasevulnerabilityassesmentrulebaselines.NewDatabaseVulnerabilityAssesmentRuleBaselinesClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building DatabaseVulnerabilityAssesmentRuleBaselines client: %+v", err)
}
configureFunc(databaseVulnerabilityAssesmentRuleBaselinesClient.Client)
databaseVulnerabilityAssessmentsClient, err := databasevulnerabilityassessments.NewDatabaseVulnerabilityAssessmentsClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building DatabaseVulnerabilityAssessments client: %+v", err)
}
configureFunc(databaseVulnerabilityAssessmentsClient.Client)
databasesClient, err := databases.NewDatabasesClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building Databases client: %+v", err)
}
configureFunc(databasesClient.Client)
jobAgentsClient, err := jobagents.NewJobAgentsClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building JobAgents client: %+v", err)
}
configureFunc(jobAgentsClient.Client)
jobCredentialsClient, err := jobcredentials.NewJobCredentialsClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building JobCredentials client: %+v", err)
}
configureFunc(jobCredentialsClient.Client)
jobExecutionsClient, err := jobexecutions.NewJobExecutionsClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building JobExecutions client: %+v", err)
}
configureFunc(jobExecutionsClient.Client)
jobStepExecutionsClient, err := jobstepexecutions.NewJobStepExecutionsClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building JobStepExecutions client: %+v", err)
}
configureFunc(jobStepExecutionsClient.Client)
jobStepsClient, err := jobsteps.NewJobStepsClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building JobSteps client: %+v", err)
}
configureFunc(jobStepsClient.Client)
jobTargetExecutionsClient, err := jobtargetexecutions.NewJobTargetExecutionsClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building JobTargetExecutions client: %+v", err)
}
configureFunc(jobTargetExecutionsClient.Client)
jobTargetGroupsClient, err := jobtargetgroups.NewJobTargetGroupsClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building JobTargetGroups client: %+v", err)
}
configureFunc(jobTargetGroupsClient.Client)
jobVersionsClient, err := jobversions.NewJobVersionsClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building JobVersions client: %+v", err)
}
configureFunc(jobVersionsClient.Client)
jobsClient, err := jobs.NewJobsClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building Jobs client: %+v", err)
}
configureFunc(jobsClient.Client)
longTermRetentionBackupsClient, err := longtermretentionbackups.NewLongTermRetentionBackupsClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building LongTermRetentionBackups client: %+v", err)
}
configureFunc(longTermRetentionBackupsClient.Client)
managedBackupShortTermRetentionPoliciesClient, err := managedbackupshorttermretentionpolicies.NewManagedBackupShortTermRetentionPoliciesClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building ManagedBackupShortTermRetentionPolicies client: %+v", err)
}
configureFunc(managedBackupShortTermRetentionPoliciesClient.Client)
managedDatabaseSecurityAlertPoliciesClient, err := manageddatabasesecurityalertpolicies.NewManagedDatabaseSecurityAlertPoliciesClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building ManagedDatabaseSecurityAlertPolicies client: %+v", err)
}
configureFunc(managedDatabaseSecurityAlertPoliciesClient.Client)
managedDatabasesClient, err := manageddatabases.NewManagedDatabasesClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building ManagedDatabases client: %+v", err)
}
configureFunc(managedDatabasesClient.Client)
managedInstanceAdministratorsClient, err := managedinstanceadministrators.NewManagedInstanceAdministratorsClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building ManagedInstanceAdministrators client: %+v", err)
}
configureFunc(managedInstanceAdministratorsClient.Client)
managedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient, err := managedrestorabledroppeddatabasebackupshorttermretentionpolicies.NewManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building ManagedRestorableDroppedDatabaseBackupShortTermRetentionPolicies client: %+v", err)
}
configureFunc(managedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.Client)
managedServerSecurityAlertPoliciesClient, err := managedserversecurityalertpolicies.NewManagedServerSecurityAlertPoliciesClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building ManagedServerSecurityAlertPolicies client: %+v", err)
}
configureFunc(managedServerSecurityAlertPoliciesClient.Client)
restorableDroppedManagedDatabasesClient, err := restorabledroppedmanageddatabases.NewRestorableDroppedManagedDatabasesClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building RestorableDroppedManagedDatabases client: %+v", err)
}
configureFunc(restorableDroppedManagedDatabasesClient.Client)
restorePointsClient, err := restorepoints.NewRestorePointsClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building RestorePoints client: %+v", err)
}
configureFunc(restorePointsClient.Client)
sensitivityLabelsClient, err := sensitivitylabels.NewSensitivityLabelsClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building SensitivityLabels client: %+v", err)
}
configureFunc(sensitivityLabelsClient.Client)
serverAutomaticTuningClient, err := serverautomatictuning.NewServerAutomaticTuningClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building ServerAutomaticTuning client: %+v", err)
}
configureFunc(serverAutomaticTuningClient.Client)
serverDnsAliasesClient, err := serverdnsaliases.NewServerDnsAliasesClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building ServerDnsAliases client: %+v", err)
}
configureFunc(serverDnsAliasesClient.Client)
serverSecurityAlertPoliciesClient, err := serversecurityalertpolicies.NewServerSecurityAlertPoliciesClientWithBaseURI(sdkApi)
if err != nil {
return nil, fmt.Errorf("building ServerSecurityAlertPolicies client: %+v", err)
}
configureFunc(serverSecurityAlertPoliciesClient.Client)
return &Client{
BackupLongTermRetentionPolicies: backupLongTermRetentionPoliciesClient,
BlobAuditing: blobAuditingClient,
DataWarehouseUserActivities: dataWarehouseUserActivitiesClient,
DatabaseVulnerabilityAssesmentRuleBaselines: databaseVulnerabilityAssesmentRuleBaselinesClient,
DatabaseVulnerabilityAssessments: databaseVulnerabilityAssessmentsClient,
Databases: databasesClient,
JobAgents: jobAgentsClient,
JobCredentials: jobCredentialsClient,
JobExecutions: jobExecutionsClient,
JobStepExecutions: jobStepExecutionsClient,
JobSteps: jobStepsClient,
JobTargetExecutions: jobTargetExecutionsClient,
JobTargetGroups: jobTargetGroupsClient,
JobVersions: jobVersionsClient,
Jobs: jobsClient,
LongTermRetentionBackups: longTermRetentionBackupsClient,
ManagedBackupShortTermRetentionPolicies: managedBackupShortTermRetentionPoliciesClient,
ManagedDatabaseSecurityAlertPolicies: managedDatabaseSecurityAlertPoliciesClient,
ManagedDatabases: managedDatabasesClient,
ManagedInstanceAdministrators: managedInstanceAdministratorsClient,
ManagedRestorableDroppedDatabaseBackupShortTermRetentionPolicies: managedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient,
ManagedServerSecurityAlertPolicies: managedServerSecurityAlertPoliciesClient,
RestorableDroppedManagedDatabases: restorableDroppedManagedDatabasesClient,
RestorePoints: restorePointsClient,
SensitivityLabels: sensitivityLabelsClient,
ServerAutomaticTuning: serverAutomaticTuningClient,
ServerDnsAliases: serverDnsAliasesClient,
ServerSecurityAlertPolicies: serverSecurityAlertPoliciesClient,
}, nil
}