1package sql
2
3// Copyright (c) Microsoft and contributors.  All rights reserved.
4//
5// Licensed under the Apache License, Version 2.0 (the "License");
6// you may not use this file except in compliance with the License.
7// You may obtain a copy of the License at
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13//
14// See the License for the specific language governing permissions and
15// limitations under the License.
16//
17// Code generated by Microsoft (R) AutoRest Code Generator.
18// Changes may cause incorrect behavior and will be lost if the code is regenerated.
19
20import (
21	"encoding/json"
22	"github.com/Azure/go-autorest/autorest"
23	"github.com/Azure/go-autorest/autorest/azure"
24	"github.com/Azure/go-autorest/autorest/date"
25	"github.com/Azure/go-autorest/autorest/to"
26	"github.com/satori/go.uuid"
27	"net/http"
28)
29
30// AuthenticationType enumerates the values for authentication type.
31type AuthenticationType string
32
33const (
34	// ADPassword ...
35	ADPassword AuthenticationType = "ADPassword"
36	// SQL ...
37	SQL AuthenticationType = "SQL"
38)
39
40// PossibleAuthenticationTypeValues returns an array of possible values for the AuthenticationType const type.
41func PossibleAuthenticationTypeValues() []AuthenticationType {
42	return []AuthenticationType{ADPassword, SQL}
43}
44
45// AutomaticTuningDisabledReason enumerates the values for automatic tuning disabled reason.
46type AutomaticTuningDisabledReason string
47
48const (
49	// AutoConfigured ...
50	AutoConfigured AutomaticTuningDisabledReason = "AutoConfigured"
51	// Default ...
52	Default AutomaticTuningDisabledReason = "Default"
53	// Disabled ...
54	Disabled AutomaticTuningDisabledReason = "Disabled"
55	// InheritedFromServer ...
56	InheritedFromServer AutomaticTuningDisabledReason = "InheritedFromServer"
57	// NotSupported ...
58	NotSupported AutomaticTuningDisabledReason = "NotSupported"
59	// QueryStoreOff ...
60	QueryStoreOff AutomaticTuningDisabledReason = "QueryStoreOff"
61	// QueryStoreReadOnly ...
62	QueryStoreReadOnly AutomaticTuningDisabledReason = "QueryStoreReadOnly"
63)
64
65// PossibleAutomaticTuningDisabledReasonValues returns an array of possible values for the AutomaticTuningDisabledReason const type.
66func PossibleAutomaticTuningDisabledReasonValues() []AutomaticTuningDisabledReason {
67	return []AutomaticTuningDisabledReason{AutoConfigured, Default, Disabled, InheritedFromServer, NotSupported, QueryStoreOff, QueryStoreReadOnly}
68}
69
70// AutomaticTuningMode enumerates the values for automatic tuning mode.
71type AutomaticTuningMode string
72
73const (
74	// Auto ...
75	Auto AutomaticTuningMode = "Auto"
76	// Custom ...
77	Custom AutomaticTuningMode = "Custom"
78	// Inherit ...
79	Inherit AutomaticTuningMode = "Inherit"
80	// Unspecified ...
81	Unspecified AutomaticTuningMode = "Unspecified"
82)
83
84// PossibleAutomaticTuningModeValues returns an array of possible values for the AutomaticTuningMode const type.
85func PossibleAutomaticTuningModeValues() []AutomaticTuningMode {
86	return []AutomaticTuningMode{Auto, Custom, Inherit, Unspecified}
87}
88
89// AutomaticTuningOptionModeActual enumerates the values for automatic tuning option mode actual.
90type AutomaticTuningOptionModeActual string
91
92const (
93	// Off ...
94	Off AutomaticTuningOptionModeActual = "Off"
95	// On ...
96	On AutomaticTuningOptionModeActual = "On"
97)
98
99// PossibleAutomaticTuningOptionModeActualValues returns an array of possible values for the AutomaticTuningOptionModeActual const type.
100func PossibleAutomaticTuningOptionModeActualValues() []AutomaticTuningOptionModeActual {
101	return []AutomaticTuningOptionModeActual{Off, On}
102}
103
104// AutomaticTuningOptionModeDesired enumerates the values for automatic tuning option mode desired.
105type AutomaticTuningOptionModeDesired string
106
107const (
108	// AutomaticTuningOptionModeDesiredDefault ...
109	AutomaticTuningOptionModeDesiredDefault AutomaticTuningOptionModeDesired = "Default"
110	// AutomaticTuningOptionModeDesiredOff ...
111	AutomaticTuningOptionModeDesiredOff AutomaticTuningOptionModeDesired = "Off"
112	// AutomaticTuningOptionModeDesiredOn ...
113	AutomaticTuningOptionModeDesiredOn AutomaticTuningOptionModeDesired = "On"
114)
115
116// PossibleAutomaticTuningOptionModeDesiredValues returns an array of possible values for the AutomaticTuningOptionModeDesired const type.
117func PossibleAutomaticTuningOptionModeDesiredValues() []AutomaticTuningOptionModeDesired {
118	return []AutomaticTuningOptionModeDesired{AutomaticTuningOptionModeDesiredDefault, AutomaticTuningOptionModeDesiredOff, AutomaticTuningOptionModeDesiredOn}
119}
120
121// AutomaticTuningServerMode enumerates the values for automatic tuning server mode.
122type AutomaticTuningServerMode string
123
124const (
125	// AutomaticTuningServerModeAuto ...
126	AutomaticTuningServerModeAuto AutomaticTuningServerMode = "Auto"
127	// AutomaticTuningServerModeCustom ...
128	AutomaticTuningServerModeCustom AutomaticTuningServerMode = "Custom"
129	// AutomaticTuningServerModeUnspecified ...
130	AutomaticTuningServerModeUnspecified AutomaticTuningServerMode = "Unspecified"
131)
132
133// PossibleAutomaticTuningServerModeValues returns an array of possible values for the AutomaticTuningServerMode const type.
134func PossibleAutomaticTuningServerModeValues() []AutomaticTuningServerMode {
135	return []AutomaticTuningServerMode{AutomaticTuningServerModeAuto, AutomaticTuningServerModeCustom, AutomaticTuningServerModeUnspecified}
136}
137
138// AutomaticTuningServerReason enumerates the values for automatic tuning server reason.
139type AutomaticTuningServerReason string
140
141const (
142	// AutomaticTuningServerReasonAutoConfigured ...
143	AutomaticTuningServerReasonAutoConfigured AutomaticTuningServerReason = "AutoConfigured"
144	// AutomaticTuningServerReasonDefault ...
145	AutomaticTuningServerReasonDefault AutomaticTuningServerReason = "Default"
146	// AutomaticTuningServerReasonDisabled ...
147	AutomaticTuningServerReasonDisabled AutomaticTuningServerReason = "Disabled"
148)
149
150// PossibleAutomaticTuningServerReasonValues returns an array of possible values for the AutomaticTuningServerReason const type.
151func PossibleAutomaticTuningServerReasonValues() []AutomaticTuningServerReason {
152	return []AutomaticTuningServerReason{AutomaticTuningServerReasonAutoConfigured, AutomaticTuningServerReasonDefault, AutomaticTuningServerReasonDisabled}
153}
154
155// BackupLongTermRetentionPolicyState enumerates the values for backup long term retention policy state.
156type BackupLongTermRetentionPolicyState string
157
158const (
159	// BackupLongTermRetentionPolicyStateDisabled ...
160	BackupLongTermRetentionPolicyStateDisabled BackupLongTermRetentionPolicyState = "Disabled"
161	// BackupLongTermRetentionPolicyStateEnabled ...
162	BackupLongTermRetentionPolicyStateEnabled BackupLongTermRetentionPolicyState = "Enabled"
163)
164
165// PossibleBackupLongTermRetentionPolicyStateValues returns an array of possible values for the BackupLongTermRetentionPolicyState const type.
166func PossibleBackupLongTermRetentionPolicyStateValues() []BackupLongTermRetentionPolicyState {
167	return []BackupLongTermRetentionPolicyState{BackupLongTermRetentionPolicyStateDisabled, BackupLongTermRetentionPolicyStateEnabled}
168}
169
170// BlobAuditingPolicyState enumerates the values for blob auditing policy state.
171type BlobAuditingPolicyState string
172
173const (
174	// BlobAuditingPolicyStateDisabled ...
175	BlobAuditingPolicyStateDisabled BlobAuditingPolicyState = "Disabled"
176	// BlobAuditingPolicyStateEnabled ...
177	BlobAuditingPolicyStateEnabled BlobAuditingPolicyState = "Enabled"
178)
179
180// PossibleBlobAuditingPolicyStateValues returns an array of possible values for the BlobAuditingPolicyState const type.
181func PossibleBlobAuditingPolicyStateValues() []BlobAuditingPolicyState {
182	return []BlobAuditingPolicyState{BlobAuditingPolicyStateDisabled, BlobAuditingPolicyStateEnabled}
183}
184
185// CapabilityStatus enumerates the values for capability status.
186type CapabilityStatus string
187
188const (
189	// CapabilityStatusAvailable ...
190	CapabilityStatusAvailable CapabilityStatus = "Available"
191	// CapabilityStatusDefault ...
192	CapabilityStatusDefault CapabilityStatus = "Default"
193	// CapabilityStatusDisabled ...
194	CapabilityStatusDisabled CapabilityStatus = "Disabled"
195	// CapabilityStatusVisible ...
196	CapabilityStatusVisible CapabilityStatus = "Visible"
197)
198
199// PossibleCapabilityStatusValues returns an array of possible values for the CapabilityStatus const type.
200func PossibleCapabilityStatusValues() []CapabilityStatus {
201	return []CapabilityStatus{CapabilityStatusAvailable, CapabilityStatusDefault, CapabilityStatusDisabled, CapabilityStatusVisible}
202}
203
204// CatalogCollationType enumerates the values for catalog collation type.
205type CatalogCollationType string
206
207const (
208	// DATABASEDEFAULT ...
209	DATABASEDEFAULT CatalogCollationType = "DATABASE_DEFAULT"
210	// SQLLatin1GeneralCP1CIAS ...
211	SQLLatin1GeneralCP1CIAS CatalogCollationType = "SQL_Latin1_General_CP1_CI_AS"
212)
213
214// PossibleCatalogCollationTypeValues returns an array of possible values for the CatalogCollationType const type.
215func PossibleCatalogCollationTypeValues() []CatalogCollationType {
216	return []CatalogCollationType{DATABASEDEFAULT, SQLLatin1GeneralCP1CIAS}
217}
218
219// CheckNameAvailabilityReason enumerates the values for check name availability reason.
220type CheckNameAvailabilityReason string
221
222const (
223	// AlreadyExists ...
224	AlreadyExists CheckNameAvailabilityReason = "AlreadyExists"
225	// Invalid ...
226	Invalid CheckNameAvailabilityReason = "Invalid"
227)
228
229// PossibleCheckNameAvailabilityReasonValues returns an array of possible values for the CheckNameAvailabilityReason const type.
230func PossibleCheckNameAvailabilityReasonValues() []CheckNameAvailabilityReason {
231	return []CheckNameAvailabilityReason{AlreadyExists, Invalid}
232}
233
234// CreateMode enumerates the values for create mode.
235type CreateMode string
236
237const (
238	// CreateModeCopy ...
239	CreateModeCopy CreateMode = "Copy"
240	// CreateModeDefault ...
241	CreateModeDefault CreateMode = "Default"
242	// CreateModeNonReadableSecondary ...
243	CreateModeNonReadableSecondary CreateMode = "NonReadableSecondary"
244	// CreateModeOnlineSecondary ...
245	CreateModeOnlineSecondary CreateMode = "OnlineSecondary"
246	// CreateModePointInTimeRestore ...
247	CreateModePointInTimeRestore CreateMode = "PointInTimeRestore"
248	// CreateModeRecovery ...
249	CreateModeRecovery CreateMode = "Recovery"
250	// CreateModeRestore ...
251	CreateModeRestore CreateMode = "Restore"
252	// CreateModeRestoreLongTermRetentionBackup ...
253	CreateModeRestoreLongTermRetentionBackup CreateMode = "RestoreLongTermRetentionBackup"
254)
255
256// PossibleCreateModeValues returns an array of possible values for the CreateMode const type.
257func PossibleCreateModeValues() []CreateMode {
258	return []CreateMode{CreateModeCopy, CreateModeDefault, CreateModeNonReadableSecondary, CreateModeOnlineSecondary, CreateModePointInTimeRestore, CreateModeRecovery, CreateModeRestore, CreateModeRestoreLongTermRetentionBackup}
259}
260
261// DatabaseEdition enumerates the values for database edition.
262type DatabaseEdition string
263
264const (
265	// Basic ...
266	Basic DatabaseEdition = "Basic"
267	// Business ...
268	Business DatabaseEdition = "Business"
269	// DataWarehouse ...
270	DataWarehouse DatabaseEdition = "DataWarehouse"
271	// Free ...
272	Free DatabaseEdition = "Free"
273	// Premium ...
274	Premium DatabaseEdition = "Premium"
275	// PremiumRS ...
276	PremiumRS DatabaseEdition = "PremiumRS"
277	// Standard ...
278	Standard DatabaseEdition = "Standard"
279	// Stretch ...
280	Stretch DatabaseEdition = "Stretch"
281	// System ...
282	System DatabaseEdition = "System"
283	// System2 ...
284	System2 DatabaseEdition = "System2"
285	// Web ...
286	Web DatabaseEdition = "Web"
287)
288
289// PossibleDatabaseEditionValues returns an array of possible values for the DatabaseEdition const type.
290func PossibleDatabaseEditionValues() []DatabaseEdition {
291	return []DatabaseEdition{Basic, Business, DataWarehouse, Free, Premium, PremiumRS, Standard, Stretch, System, System2, Web}
292}
293
294// DataMaskingFunction enumerates the values for data masking function.
295type DataMaskingFunction string
296
297const (
298	// DataMaskingFunctionCCN ...
299	DataMaskingFunctionCCN DataMaskingFunction = "CCN"
300	// DataMaskingFunctionDefault ...
301	DataMaskingFunctionDefault DataMaskingFunction = "Default"
302	// DataMaskingFunctionEmail ...
303	DataMaskingFunctionEmail DataMaskingFunction = "Email"
304	// DataMaskingFunctionNumber ...
305	DataMaskingFunctionNumber DataMaskingFunction = "Number"
306	// DataMaskingFunctionSSN ...
307	DataMaskingFunctionSSN DataMaskingFunction = "SSN"
308	// DataMaskingFunctionText ...
309	DataMaskingFunctionText DataMaskingFunction = "Text"
310)
311
312// PossibleDataMaskingFunctionValues returns an array of possible values for the DataMaskingFunction const type.
313func PossibleDataMaskingFunctionValues() []DataMaskingFunction {
314	return []DataMaskingFunction{DataMaskingFunctionCCN, DataMaskingFunctionDefault, DataMaskingFunctionEmail, DataMaskingFunctionNumber, DataMaskingFunctionSSN, DataMaskingFunctionText}
315}
316
317// DataMaskingRuleState enumerates the values for data masking rule state.
318type DataMaskingRuleState string
319
320const (
321	// DataMaskingRuleStateDisabled ...
322	DataMaskingRuleStateDisabled DataMaskingRuleState = "Disabled"
323	// DataMaskingRuleStateEnabled ...
324	DataMaskingRuleStateEnabled DataMaskingRuleState = "Enabled"
325)
326
327// PossibleDataMaskingRuleStateValues returns an array of possible values for the DataMaskingRuleState const type.
328func PossibleDataMaskingRuleStateValues() []DataMaskingRuleState {
329	return []DataMaskingRuleState{DataMaskingRuleStateDisabled, DataMaskingRuleStateEnabled}
330}
331
332// DataMaskingState enumerates the values for data masking state.
333type DataMaskingState string
334
335const (
336	// DataMaskingStateDisabled ...
337	DataMaskingStateDisabled DataMaskingState = "Disabled"
338	// DataMaskingStateEnabled ...
339	DataMaskingStateEnabled DataMaskingState = "Enabled"
340)
341
342// PossibleDataMaskingStateValues returns an array of possible values for the DataMaskingState const type.
343func PossibleDataMaskingStateValues() []DataMaskingState {
344	return []DataMaskingState{DataMaskingStateDisabled, DataMaskingStateEnabled}
345}
346
347// ElasticPoolEdition enumerates the values for elastic pool edition.
348type ElasticPoolEdition string
349
350const (
351	// ElasticPoolEditionBasic ...
352	ElasticPoolEditionBasic ElasticPoolEdition = "Basic"
353	// ElasticPoolEditionPremium ...
354	ElasticPoolEditionPremium ElasticPoolEdition = "Premium"
355	// ElasticPoolEditionStandard ...
356	ElasticPoolEditionStandard ElasticPoolEdition = "Standard"
357)
358
359// PossibleElasticPoolEditionValues returns an array of possible values for the ElasticPoolEdition const type.
360func PossibleElasticPoolEditionValues() []ElasticPoolEdition {
361	return []ElasticPoolEdition{ElasticPoolEditionBasic, ElasticPoolEditionPremium, ElasticPoolEditionStandard}
362}
363
364// ElasticPoolState enumerates the values for elastic pool state.
365type ElasticPoolState string
366
367const (
368	// ElasticPoolStateCreating ...
369	ElasticPoolStateCreating ElasticPoolState = "Creating"
370	// ElasticPoolStateDisabled ...
371	ElasticPoolStateDisabled ElasticPoolState = "Disabled"
372	// ElasticPoolStateReady ...
373	ElasticPoolStateReady ElasticPoolState = "Ready"
374)
375
376// PossibleElasticPoolStateValues returns an array of possible values for the ElasticPoolState const type.
377func PossibleElasticPoolStateValues() []ElasticPoolState {
378	return []ElasticPoolState{ElasticPoolStateCreating, ElasticPoolStateDisabled, ElasticPoolStateReady}
379}
380
381// FailoverGroupReplicationRole enumerates the values for failover group replication role.
382type FailoverGroupReplicationRole string
383
384const (
385	// Primary ...
386	Primary FailoverGroupReplicationRole = "Primary"
387	// Secondary ...
388	Secondary FailoverGroupReplicationRole = "Secondary"
389)
390
391// PossibleFailoverGroupReplicationRoleValues returns an array of possible values for the FailoverGroupReplicationRole const type.
392func PossibleFailoverGroupReplicationRoleValues() []FailoverGroupReplicationRole {
393	return []FailoverGroupReplicationRole{Primary, Secondary}
394}
395
396// GeoBackupPolicyState enumerates the values for geo backup policy state.
397type GeoBackupPolicyState string
398
399const (
400	// GeoBackupPolicyStateDisabled ...
401	GeoBackupPolicyStateDisabled GeoBackupPolicyState = "Disabled"
402	// GeoBackupPolicyStateEnabled ...
403	GeoBackupPolicyStateEnabled GeoBackupPolicyState = "Enabled"
404)
405
406// PossibleGeoBackupPolicyStateValues returns an array of possible values for the GeoBackupPolicyState const type.
407func PossibleGeoBackupPolicyStateValues() []GeoBackupPolicyState {
408	return []GeoBackupPolicyState{GeoBackupPolicyStateDisabled, GeoBackupPolicyStateEnabled}
409}
410
411// IdentityType enumerates the values for identity type.
412type IdentityType string
413
414const (
415	// SystemAssigned ...
416	SystemAssigned IdentityType = "SystemAssigned"
417)
418
419// PossibleIdentityTypeValues returns an array of possible values for the IdentityType const type.
420func PossibleIdentityTypeValues() []IdentityType {
421	return []IdentityType{SystemAssigned}
422}
423
424// JobAgentState enumerates the values for job agent state.
425type JobAgentState string
426
427const (
428	// JobAgentStateCreating ...
429	JobAgentStateCreating JobAgentState = "Creating"
430	// JobAgentStateDeleting ...
431	JobAgentStateDeleting JobAgentState = "Deleting"
432	// JobAgentStateDisabled ...
433	JobAgentStateDisabled JobAgentState = "Disabled"
434	// JobAgentStateReady ...
435	JobAgentStateReady JobAgentState = "Ready"
436	// JobAgentStateUpdating ...
437	JobAgentStateUpdating JobAgentState = "Updating"
438)
439
440// PossibleJobAgentStateValues returns an array of possible values for the JobAgentState const type.
441func PossibleJobAgentStateValues() []JobAgentState {
442	return []JobAgentState{JobAgentStateCreating, JobAgentStateDeleting, JobAgentStateDisabled, JobAgentStateReady, JobAgentStateUpdating}
443}
444
445// JobExecutionLifecycle enumerates the values for job execution lifecycle.
446type JobExecutionLifecycle string
447
448const (
449	// Canceled ...
450	Canceled JobExecutionLifecycle = "Canceled"
451	// Created ...
452	Created JobExecutionLifecycle = "Created"
453	// Failed ...
454	Failed JobExecutionLifecycle = "Failed"
455	// InProgress ...
456	InProgress JobExecutionLifecycle = "InProgress"
457	// Skipped ...
458	Skipped JobExecutionLifecycle = "Skipped"
459	// Succeeded ...
460	Succeeded JobExecutionLifecycle = "Succeeded"
461	// SucceededWithSkipped ...
462	SucceededWithSkipped JobExecutionLifecycle = "SucceededWithSkipped"
463	// TimedOut ...
464	TimedOut JobExecutionLifecycle = "TimedOut"
465	// WaitingForChildJobExecutions ...
466	WaitingForChildJobExecutions JobExecutionLifecycle = "WaitingForChildJobExecutions"
467	// WaitingForRetry ...
468	WaitingForRetry JobExecutionLifecycle = "WaitingForRetry"
469)
470
471// PossibleJobExecutionLifecycleValues returns an array of possible values for the JobExecutionLifecycle const type.
472func PossibleJobExecutionLifecycleValues() []JobExecutionLifecycle {
473	return []JobExecutionLifecycle{Canceled, Created, Failed, InProgress, Skipped, Succeeded, SucceededWithSkipped, TimedOut, WaitingForChildJobExecutions, WaitingForRetry}
474}
475
476// JobScheduleType enumerates the values for job schedule type.
477type JobScheduleType string
478
479const (
480	// Once ...
481	Once JobScheduleType = "Once"
482	// Recurring ...
483	Recurring JobScheduleType = "Recurring"
484)
485
486// PossibleJobScheduleTypeValues returns an array of possible values for the JobScheduleType const type.
487func PossibleJobScheduleTypeValues() []JobScheduleType {
488	return []JobScheduleType{Once, Recurring}
489}
490
491// JobStepActionSource enumerates the values for job step action source.
492type JobStepActionSource string
493
494const (
495	// Inline ...
496	Inline JobStepActionSource = "Inline"
497)
498
499// PossibleJobStepActionSourceValues returns an array of possible values for the JobStepActionSource const type.
500func PossibleJobStepActionSourceValues() []JobStepActionSource {
501	return []JobStepActionSource{Inline}
502}
503
504// JobStepActionType enumerates the values for job step action type.
505type JobStepActionType string
506
507const (
508	// TSQL ...
509	TSQL JobStepActionType = "TSql"
510)
511
512// PossibleJobStepActionTypeValues returns an array of possible values for the JobStepActionType const type.
513func PossibleJobStepActionTypeValues() []JobStepActionType {
514	return []JobStepActionType{TSQL}
515}
516
517// JobStepOutputType enumerates the values for job step output type.
518type JobStepOutputType string
519
520const (
521	// SQLDatabase ...
522	SQLDatabase JobStepOutputType = "SqlDatabase"
523)
524
525// PossibleJobStepOutputTypeValues returns an array of possible values for the JobStepOutputType const type.
526func PossibleJobStepOutputTypeValues() []JobStepOutputType {
527	return []JobStepOutputType{SQLDatabase}
528}
529
530// JobTargetGroupMembershipType enumerates the values for job target group membership type.
531type JobTargetGroupMembershipType string
532
533const (
534	// Exclude ...
535	Exclude JobTargetGroupMembershipType = "Exclude"
536	// Include ...
537	Include JobTargetGroupMembershipType = "Include"
538)
539
540// PossibleJobTargetGroupMembershipTypeValues returns an array of possible values for the JobTargetGroupMembershipType const type.
541func PossibleJobTargetGroupMembershipTypeValues() []JobTargetGroupMembershipType {
542	return []JobTargetGroupMembershipType{Exclude, Include}
543}
544
545// JobTargetType enumerates the values for job target type.
546type JobTargetType string
547
548const (
549	// JobTargetTypeSQLDatabase ...
550	JobTargetTypeSQLDatabase JobTargetType = "SqlDatabase"
551	// JobTargetTypeSQLElasticPool ...
552	JobTargetTypeSQLElasticPool JobTargetType = "SqlElasticPool"
553	// JobTargetTypeSQLServer ...
554	JobTargetTypeSQLServer JobTargetType = "SqlServer"
555	// JobTargetTypeSQLShardMap ...
556	JobTargetTypeSQLShardMap JobTargetType = "SqlShardMap"
557	// JobTargetTypeTargetGroup ...
558	JobTargetTypeTargetGroup JobTargetType = "TargetGroup"
559)
560
561// PossibleJobTargetTypeValues returns an array of possible values for the JobTargetType const type.
562func PossibleJobTargetTypeValues() []JobTargetType {
563	return []JobTargetType{JobTargetTypeSQLDatabase, JobTargetTypeSQLElasticPool, JobTargetTypeSQLServer, JobTargetTypeSQLShardMap, JobTargetTypeTargetGroup}
564}
565
566// ManagedDatabaseCreateMode enumerates the values for managed database create mode.
567type ManagedDatabaseCreateMode string
568
569const (
570	// ManagedDatabaseCreateModeDefault ...
571	ManagedDatabaseCreateModeDefault ManagedDatabaseCreateMode = "Default"
572	// ManagedDatabaseCreateModePointInTimeRestore ...
573	ManagedDatabaseCreateModePointInTimeRestore ManagedDatabaseCreateMode = "PointInTimeRestore"
574	// ManagedDatabaseCreateModeRestoreExternalBackup ...
575	ManagedDatabaseCreateModeRestoreExternalBackup ManagedDatabaseCreateMode = "RestoreExternalBackup"
576)
577
578// PossibleManagedDatabaseCreateModeValues returns an array of possible values for the ManagedDatabaseCreateMode const type.
579func PossibleManagedDatabaseCreateModeValues() []ManagedDatabaseCreateMode {
580	return []ManagedDatabaseCreateMode{ManagedDatabaseCreateModeDefault, ManagedDatabaseCreateModePointInTimeRestore, ManagedDatabaseCreateModeRestoreExternalBackup}
581}
582
583// ManagedDatabaseStatus enumerates the values for managed database status.
584type ManagedDatabaseStatus string
585
586const (
587	// Creating ...
588	Creating ManagedDatabaseStatus = "Creating"
589	// Inaccessible ...
590	Inaccessible ManagedDatabaseStatus = "Inaccessible"
591	// Offline ...
592	Offline ManagedDatabaseStatus = "Offline"
593	// Online ...
594	Online ManagedDatabaseStatus = "Online"
595	// Shutdown ...
596	Shutdown ManagedDatabaseStatus = "Shutdown"
597)
598
599// PossibleManagedDatabaseStatusValues returns an array of possible values for the ManagedDatabaseStatus const type.
600func PossibleManagedDatabaseStatusValues() []ManagedDatabaseStatus {
601	return []ManagedDatabaseStatus{Creating, Inaccessible, Offline, Online, Shutdown}
602}
603
604// ManagementOperationState enumerates the values for management operation state.
605type ManagementOperationState string
606
607const (
608	// ManagementOperationStateCancelInProgress ...
609	ManagementOperationStateCancelInProgress ManagementOperationState = "CancelInProgress"
610	// ManagementOperationStateCancelled ...
611	ManagementOperationStateCancelled ManagementOperationState = "Cancelled"
612	// ManagementOperationStateFailed ...
613	ManagementOperationStateFailed ManagementOperationState = "Failed"
614	// ManagementOperationStateInProgress ...
615	ManagementOperationStateInProgress ManagementOperationState = "InProgress"
616	// ManagementOperationStatePending ...
617	ManagementOperationStatePending ManagementOperationState = "Pending"
618	// ManagementOperationStateSucceeded ...
619	ManagementOperationStateSucceeded ManagementOperationState = "Succeeded"
620)
621
622// PossibleManagementOperationStateValues returns an array of possible values for the ManagementOperationState const type.
623func PossibleManagementOperationStateValues() []ManagementOperationState {
624	return []ManagementOperationState{ManagementOperationStateCancelInProgress, ManagementOperationStateCancelled, ManagementOperationStateFailed, ManagementOperationStateInProgress, ManagementOperationStatePending, ManagementOperationStateSucceeded}
625}
626
627// MaxSizeUnits enumerates the values for max size units.
628type MaxSizeUnits string
629
630const (
631	// Gigabytes ...
632	Gigabytes MaxSizeUnits = "Gigabytes"
633	// Megabytes ...
634	Megabytes MaxSizeUnits = "Megabytes"
635	// Petabytes ...
636	Petabytes MaxSizeUnits = "Petabytes"
637	// Terabytes ...
638	Terabytes MaxSizeUnits = "Terabytes"
639)
640
641// PossibleMaxSizeUnitsValues returns an array of possible values for the MaxSizeUnits const type.
642func PossibleMaxSizeUnitsValues() []MaxSizeUnits {
643	return []MaxSizeUnits{Gigabytes, Megabytes, Petabytes, Terabytes}
644}
645
646// OperationOrigin enumerates the values for operation origin.
647type OperationOrigin string
648
649const (
650	// OperationOriginSystem ...
651	OperationOriginSystem OperationOrigin = "system"
652	// OperationOriginUser ...
653	OperationOriginUser OperationOrigin = "user"
654)
655
656// PossibleOperationOriginValues returns an array of possible values for the OperationOrigin const type.
657func PossibleOperationOriginValues() []OperationOrigin {
658	return []OperationOrigin{OperationOriginSystem, OperationOriginUser}
659}
660
661// PerformanceLevelUnit enumerates the values for performance level unit.
662type PerformanceLevelUnit string
663
664const (
665	// DTU ...
666	DTU PerformanceLevelUnit = "DTU"
667)
668
669// PossiblePerformanceLevelUnitValues returns an array of possible values for the PerformanceLevelUnit const type.
670func PossiblePerformanceLevelUnitValues() []PerformanceLevelUnit {
671	return []PerformanceLevelUnit{DTU}
672}
673
674// PrimaryAggregationType enumerates the values for primary aggregation type.
675type PrimaryAggregationType string
676
677const (
678	// Average ...
679	Average PrimaryAggregationType = "Average"
680	// Count ...
681	Count PrimaryAggregationType = "Count"
682	// Maximum ...
683	Maximum PrimaryAggregationType = "Maximum"
684	// Minimum ...
685	Minimum PrimaryAggregationType = "Minimum"
686	// None ...
687	None PrimaryAggregationType = "None"
688	// Total ...
689	Total PrimaryAggregationType = "Total"
690)
691
692// PossiblePrimaryAggregationTypeValues returns an array of possible values for the PrimaryAggregationType const type.
693func PossiblePrimaryAggregationTypeValues() []PrimaryAggregationType {
694	return []PrimaryAggregationType{Average, Count, Maximum, Minimum, None, Total}
695}
696
697// ProvisioningState enumerates the values for provisioning state.
698type ProvisioningState string
699
700const (
701	// ProvisioningStateCanceled ...
702	ProvisioningStateCanceled ProvisioningState = "Canceled"
703	// ProvisioningStateCreated ...
704	ProvisioningStateCreated ProvisioningState = "Created"
705	// ProvisioningStateFailed ...
706	ProvisioningStateFailed ProvisioningState = "Failed"
707	// ProvisioningStateInProgress ...
708	ProvisioningStateInProgress ProvisioningState = "InProgress"
709	// ProvisioningStateSucceeded ...
710	ProvisioningStateSucceeded ProvisioningState = "Succeeded"
711)
712
713// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type.
714func PossibleProvisioningStateValues() []ProvisioningState {
715	return []ProvisioningState{ProvisioningStateCanceled, ProvisioningStateCreated, ProvisioningStateFailed, ProvisioningStateInProgress, ProvisioningStateSucceeded}
716}
717
718// ReadOnlyEndpointFailoverPolicy enumerates the values for read only endpoint failover policy.
719type ReadOnlyEndpointFailoverPolicy string
720
721const (
722	// ReadOnlyEndpointFailoverPolicyDisabled ...
723	ReadOnlyEndpointFailoverPolicyDisabled ReadOnlyEndpointFailoverPolicy = "Disabled"
724	// ReadOnlyEndpointFailoverPolicyEnabled ...
725	ReadOnlyEndpointFailoverPolicyEnabled ReadOnlyEndpointFailoverPolicy = "Enabled"
726)
727
728// PossibleReadOnlyEndpointFailoverPolicyValues returns an array of possible values for the ReadOnlyEndpointFailoverPolicy const type.
729func PossibleReadOnlyEndpointFailoverPolicyValues() []ReadOnlyEndpointFailoverPolicy {
730	return []ReadOnlyEndpointFailoverPolicy{ReadOnlyEndpointFailoverPolicyDisabled, ReadOnlyEndpointFailoverPolicyEnabled}
731}
732
733// ReadScale enumerates the values for read scale.
734type ReadScale string
735
736const (
737	// ReadScaleDisabled ...
738	ReadScaleDisabled ReadScale = "Disabled"
739	// ReadScaleEnabled ...
740	ReadScaleEnabled ReadScale = "Enabled"
741)
742
743// PossibleReadScaleValues returns an array of possible values for the ReadScale const type.
744func PossibleReadScaleValues() []ReadScale {
745	return []ReadScale{ReadScaleDisabled, ReadScaleEnabled}
746}
747
748// ReadWriteEndpointFailoverPolicy enumerates the values for read write endpoint failover policy.
749type ReadWriteEndpointFailoverPolicy string
750
751const (
752	// Automatic ...
753	Automatic ReadWriteEndpointFailoverPolicy = "Automatic"
754	// Manual ...
755	Manual ReadWriteEndpointFailoverPolicy = "Manual"
756)
757
758// PossibleReadWriteEndpointFailoverPolicyValues returns an array of possible values for the ReadWriteEndpointFailoverPolicy const type.
759func PossibleReadWriteEndpointFailoverPolicyValues() []ReadWriteEndpointFailoverPolicy {
760	return []ReadWriteEndpointFailoverPolicy{Automatic, Manual}
761}
762
763// RecommendedIndexAction enumerates the values for recommended index action.
764type RecommendedIndexAction string
765
766const (
767	// Create ...
768	Create RecommendedIndexAction = "Create"
769	// Drop ...
770	Drop RecommendedIndexAction = "Drop"
771	// Rebuild ...
772	Rebuild RecommendedIndexAction = "Rebuild"
773)
774
775// PossibleRecommendedIndexActionValues returns an array of possible values for the RecommendedIndexAction const type.
776func PossibleRecommendedIndexActionValues() []RecommendedIndexAction {
777	return []RecommendedIndexAction{Create, Drop, Rebuild}
778}
779
780// RecommendedIndexState enumerates the values for recommended index state.
781type RecommendedIndexState string
782
783const (
784	// Active ...
785	Active RecommendedIndexState = "Active"
786	// Blocked ...
787	Blocked RecommendedIndexState = "Blocked"
788	// Executing ...
789	Executing RecommendedIndexState = "Executing"
790	// Expired ...
791	Expired RecommendedIndexState = "Expired"
792	// Ignored ...
793	Ignored RecommendedIndexState = "Ignored"
794	// Pending ...
795	Pending RecommendedIndexState = "Pending"
796	// PendingRevert ...
797	PendingRevert RecommendedIndexState = "Pending Revert"
798	// Reverted ...
799	Reverted RecommendedIndexState = "Reverted"
800	// Reverting ...
801	Reverting RecommendedIndexState = "Reverting"
802	// Success ...
803	Success RecommendedIndexState = "Success"
804	// Verifying ...
805	Verifying RecommendedIndexState = "Verifying"
806)
807
808// PossibleRecommendedIndexStateValues returns an array of possible values for the RecommendedIndexState const type.
809func PossibleRecommendedIndexStateValues() []RecommendedIndexState {
810	return []RecommendedIndexState{Active, Blocked, Executing, Expired, Ignored, Pending, PendingRevert, Reverted, Reverting, Success, Verifying}
811}
812
813// RecommendedIndexType enumerates the values for recommended index type.
814type RecommendedIndexType string
815
816const (
817	// CLUSTERED ...
818	CLUSTERED RecommendedIndexType = "CLUSTERED"
819	// CLUSTEREDCOLUMNSTORE ...
820	CLUSTEREDCOLUMNSTORE RecommendedIndexType = "CLUSTERED COLUMNSTORE"
821	// COLUMNSTORE ...
822	COLUMNSTORE RecommendedIndexType = "COLUMNSTORE"
823	// NONCLUSTERED ...
824	NONCLUSTERED RecommendedIndexType = "NONCLUSTERED"
825)
826
827// PossibleRecommendedIndexTypeValues returns an array of possible values for the RecommendedIndexType const type.
828func PossibleRecommendedIndexTypeValues() []RecommendedIndexType {
829	return []RecommendedIndexType{CLUSTERED, CLUSTEREDCOLUMNSTORE, COLUMNSTORE, NONCLUSTERED}
830}
831
832// ReplicationRole enumerates the values for replication role.
833type ReplicationRole string
834
835const (
836	// ReplicationRoleCopy ...
837	ReplicationRoleCopy ReplicationRole = "Copy"
838	// ReplicationRoleNonReadableSecondary ...
839	ReplicationRoleNonReadableSecondary ReplicationRole = "NonReadableSecondary"
840	// ReplicationRolePrimary ...
841	ReplicationRolePrimary ReplicationRole = "Primary"
842	// ReplicationRoleSecondary ...
843	ReplicationRoleSecondary ReplicationRole = "Secondary"
844	// ReplicationRoleSource ...
845	ReplicationRoleSource ReplicationRole = "Source"
846)
847
848// PossibleReplicationRoleValues returns an array of possible values for the ReplicationRole const type.
849func PossibleReplicationRoleValues() []ReplicationRole {
850	return []ReplicationRole{ReplicationRoleCopy, ReplicationRoleNonReadableSecondary, ReplicationRolePrimary, ReplicationRoleSecondary, ReplicationRoleSource}
851}
852
853// ReplicationState enumerates the values for replication state.
854type ReplicationState string
855
856const (
857	// CATCHUP ...
858	CATCHUP ReplicationState = "CATCH_UP"
859	// PENDING ...
860	PENDING ReplicationState = "PENDING"
861	// SEEDING ...
862	SEEDING ReplicationState = "SEEDING"
863	// SUSPENDED ...
864	SUSPENDED ReplicationState = "SUSPENDED"
865)
866
867// PossibleReplicationStateValues returns an array of possible values for the ReplicationState const type.
868func PossibleReplicationStateValues() []ReplicationState {
869	return []ReplicationState{CATCHUP, PENDING, SEEDING, SUSPENDED}
870}
871
872// RestorePointType enumerates the values for restore point type.
873type RestorePointType string
874
875const (
876	// CONTINUOUS ...
877	CONTINUOUS RestorePointType = "CONTINUOUS"
878	// DISCRETE ...
879	DISCRETE RestorePointType = "DISCRETE"
880)
881
882// PossibleRestorePointTypeValues returns an array of possible values for the RestorePointType const type.
883func PossibleRestorePointTypeValues() []RestorePointType {
884	return []RestorePointType{CONTINUOUS, DISCRETE}
885}
886
887// SampleName enumerates the values for sample name.
888type SampleName string
889
890const (
891	// AdventureWorksLT ...
892	AdventureWorksLT SampleName = "AdventureWorksLT"
893)
894
895// PossibleSampleNameValues returns an array of possible values for the SampleName const type.
896func PossibleSampleNameValues() []SampleName {
897	return []SampleName{AdventureWorksLT}
898}
899
900// SecurityAlertPolicyEmailAccountAdmins enumerates the values for security alert policy email account admins.
901type SecurityAlertPolicyEmailAccountAdmins string
902
903const (
904	// SecurityAlertPolicyEmailAccountAdminsDisabled ...
905	SecurityAlertPolicyEmailAccountAdminsDisabled SecurityAlertPolicyEmailAccountAdmins = "Disabled"
906	// SecurityAlertPolicyEmailAccountAdminsEnabled ...
907	SecurityAlertPolicyEmailAccountAdminsEnabled SecurityAlertPolicyEmailAccountAdmins = "Enabled"
908)
909
910// PossibleSecurityAlertPolicyEmailAccountAdminsValues returns an array of possible values for the SecurityAlertPolicyEmailAccountAdmins const type.
911func PossibleSecurityAlertPolicyEmailAccountAdminsValues() []SecurityAlertPolicyEmailAccountAdmins {
912	return []SecurityAlertPolicyEmailAccountAdmins{SecurityAlertPolicyEmailAccountAdminsDisabled, SecurityAlertPolicyEmailAccountAdminsEnabled}
913}
914
915// SecurityAlertPolicyState enumerates the values for security alert policy state.
916type SecurityAlertPolicyState string
917
918const (
919	// SecurityAlertPolicyStateDisabled ...
920	SecurityAlertPolicyStateDisabled SecurityAlertPolicyState = "Disabled"
921	// SecurityAlertPolicyStateEnabled ...
922	SecurityAlertPolicyStateEnabled SecurityAlertPolicyState = "Enabled"
923	// SecurityAlertPolicyStateNew ...
924	SecurityAlertPolicyStateNew SecurityAlertPolicyState = "New"
925)
926
927// PossibleSecurityAlertPolicyStateValues returns an array of possible values for the SecurityAlertPolicyState const type.
928func PossibleSecurityAlertPolicyStateValues() []SecurityAlertPolicyState {
929	return []SecurityAlertPolicyState{SecurityAlertPolicyStateDisabled, SecurityAlertPolicyStateEnabled, SecurityAlertPolicyStateNew}
930}
931
932// SecurityAlertPolicyUseServerDefault enumerates the values for security alert policy use server default.
933type SecurityAlertPolicyUseServerDefault string
934
935const (
936	// SecurityAlertPolicyUseServerDefaultDisabled ...
937	SecurityAlertPolicyUseServerDefaultDisabled SecurityAlertPolicyUseServerDefault = "Disabled"
938	// SecurityAlertPolicyUseServerDefaultEnabled ...
939	SecurityAlertPolicyUseServerDefaultEnabled SecurityAlertPolicyUseServerDefault = "Enabled"
940)
941
942// PossibleSecurityAlertPolicyUseServerDefaultValues returns an array of possible values for the SecurityAlertPolicyUseServerDefault const type.
943func PossibleSecurityAlertPolicyUseServerDefaultValues() []SecurityAlertPolicyUseServerDefault {
944	return []SecurityAlertPolicyUseServerDefault{SecurityAlertPolicyUseServerDefaultDisabled, SecurityAlertPolicyUseServerDefaultEnabled}
945}
946
947// ServerConnectionType enumerates the values for server connection type.
948type ServerConnectionType string
949
950const (
951	// ServerConnectionTypeDefault ...
952	ServerConnectionTypeDefault ServerConnectionType = "Default"
953	// ServerConnectionTypeProxy ...
954	ServerConnectionTypeProxy ServerConnectionType = "Proxy"
955	// ServerConnectionTypeRedirect ...
956	ServerConnectionTypeRedirect ServerConnectionType = "Redirect"
957)
958
959// PossibleServerConnectionTypeValues returns an array of possible values for the ServerConnectionType const type.
960func PossibleServerConnectionTypeValues() []ServerConnectionType {
961	return []ServerConnectionType{ServerConnectionTypeDefault, ServerConnectionTypeProxy, ServerConnectionTypeRedirect}
962}
963
964// ServerKeyType enumerates the values for server key type.
965type ServerKeyType string
966
967const (
968	// AzureKeyVault ...
969	AzureKeyVault ServerKeyType = "AzureKeyVault"
970	// ServiceManaged ...
971	ServiceManaged ServerKeyType = "ServiceManaged"
972)
973
974// PossibleServerKeyTypeValues returns an array of possible values for the ServerKeyType const type.
975func PossibleServerKeyTypeValues() []ServerKeyType {
976	return []ServerKeyType{AzureKeyVault, ServiceManaged}
977}
978
979// ServiceObjectiveName enumerates the values for service objective name.
980type ServiceObjectiveName string
981
982const (
983	// ServiceObjectiveNameBasic ...
984	ServiceObjectiveNameBasic ServiceObjectiveName = "Basic"
985	// ServiceObjectiveNameDS100 ...
986	ServiceObjectiveNameDS100 ServiceObjectiveName = "DS100"
987	// ServiceObjectiveNameDS1000 ...
988	ServiceObjectiveNameDS1000 ServiceObjectiveName = "DS1000"
989	// ServiceObjectiveNameDS1200 ...
990	ServiceObjectiveNameDS1200 ServiceObjectiveName = "DS1200"
991	// ServiceObjectiveNameDS1500 ...
992	ServiceObjectiveNameDS1500 ServiceObjectiveName = "DS1500"
993	// ServiceObjectiveNameDS200 ...
994	ServiceObjectiveNameDS200 ServiceObjectiveName = "DS200"
995	// ServiceObjectiveNameDS2000 ...
996	ServiceObjectiveNameDS2000 ServiceObjectiveName = "DS2000"
997	// ServiceObjectiveNameDS300 ...
998	ServiceObjectiveNameDS300 ServiceObjectiveName = "DS300"
999	// ServiceObjectiveNameDS400 ...
1000	ServiceObjectiveNameDS400 ServiceObjectiveName = "DS400"
1001	// ServiceObjectiveNameDS500 ...
1002	ServiceObjectiveNameDS500 ServiceObjectiveName = "DS500"
1003	// ServiceObjectiveNameDS600 ...
1004	ServiceObjectiveNameDS600 ServiceObjectiveName = "DS600"
1005	// ServiceObjectiveNameDW100 ...
1006	ServiceObjectiveNameDW100 ServiceObjectiveName = "DW100"
1007	// ServiceObjectiveNameDW1000 ...
1008	ServiceObjectiveNameDW1000 ServiceObjectiveName = "DW1000"
1009	// ServiceObjectiveNameDW10000c ...
1010	ServiceObjectiveNameDW10000c ServiceObjectiveName = "DW10000c"
1011	// ServiceObjectiveNameDW1000c ...
1012	ServiceObjectiveNameDW1000c ServiceObjectiveName = "DW1000c"
1013	// ServiceObjectiveNameDW1200 ...
1014	ServiceObjectiveNameDW1200 ServiceObjectiveName = "DW1200"
1015	// ServiceObjectiveNameDW1500 ...
1016	ServiceObjectiveNameDW1500 ServiceObjectiveName = "DW1500"
1017	// ServiceObjectiveNameDW15000c ...
1018	ServiceObjectiveNameDW15000c ServiceObjectiveName = "DW15000c"
1019	// ServiceObjectiveNameDW1500c ...
1020	ServiceObjectiveNameDW1500c ServiceObjectiveName = "DW1500c"
1021	// ServiceObjectiveNameDW200 ...
1022	ServiceObjectiveNameDW200 ServiceObjectiveName = "DW200"
1023	// ServiceObjectiveNameDW2000 ...
1024	ServiceObjectiveNameDW2000 ServiceObjectiveName = "DW2000"
1025	// ServiceObjectiveNameDW2000c ...
1026	ServiceObjectiveNameDW2000c ServiceObjectiveName = "DW2000c"
1027	// ServiceObjectiveNameDW2500c ...
1028	ServiceObjectiveNameDW2500c ServiceObjectiveName = "DW2500c"
1029	// ServiceObjectiveNameDW300 ...
1030	ServiceObjectiveNameDW300 ServiceObjectiveName = "DW300"
1031	// ServiceObjectiveNameDW3000 ...
1032	ServiceObjectiveNameDW3000 ServiceObjectiveName = "DW3000"
1033	// ServiceObjectiveNameDW30000c ...
1034	ServiceObjectiveNameDW30000c ServiceObjectiveName = "DW30000c"
1035	// ServiceObjectiveNameDW3000c ...
1036	ServiceObjectiveNameDW3000c ServiceObjectiveName = "DW3000c"
1037	// ServiceObjectiveNameDW400 ...
1038	ServiceObjectiveNameDW400 ServiceObjectiveName = "DW400"
1039	// ServiceObjectiveNameDW500 ...
1040	ServiceObjectiveNameDW500 ServiceObjectiveName = "DW500"
1041	// ServiceObjectiveNameDW5000c ...
1042	ServiceObjectiveNameDW5000c ServiceObjectiveName = "DW5000c"
1043	// ServiceObjectiveNameDW600 ...
1044	ServiceObjectiveNameDW600 ServiceObjectiveName = "DW600"
1045	// ServiceObjectiveNameDW6000 ...
1046	ServiceObjectiveNameDW6000 ServiceObjectiveName = "DW6000"
1047	// ServiceObjectiveNameDW6000c ...
1048	ServiceObjectiveNameDW6000c ServiceObjectiveName = "DW6000c"
1049	// ServiceObjectiveNameDW7500c ...
1050	ServiceObjectiveNameDW7500c ServiceObjectiveName = "DW7500c"
1051	// ServiceObjectiveNameElasticPool ...
1052	ServiceObjectiveNameElasticPool ServiceObjectiveName = "ElasticPool"
1053	// ServiceObjectiveNameFree ...
1054	ServiceObjectiveNameFree ServiceObjectiveName = "Free"
1055	// ServiceObjectiveNameP1 ...
1056	ServiceObjectiveNameP1 ServiceObjectiveName = "P1"
1057	// ServiceObjectiveNameP11 ...
1058	ServiceObjectiveNameP11 ServiceObjectiveName = "P11"
1059	// ServiceObjectiveNameP15 ...
1060	ServiceObjectiveNameP15 ServiceObjectiveName = "P15"
1061	// ServiceObjectiveNameP2 ...
1062	ServiceObjectiveNameP2 ServiceObjectiveName = "P2"
1063	// ServiceObjectiveNameP3 ...
1064	ServiceObjectiveNameP3 ServiceObjectiveName = "P3"
1065	// ServiceObjectiveNameP4 ...
1066	ServiceObjectiveNameP4 ServiceObjectiveName = "P4"
1067	// ServiceObjectiveNameP6 ...
1068	ServiceObjectiveNameP6 ServiceObjectiveName = "P6"
1069	// ServiceObjectiveNamePRS1 ...
1070	ServiceObjectiveNamePRS1 ServiceObjectiveName = "PRS1"
1071	// ServiceObjectiveNamePRS2 ...
1072	ServiceObjectiveNamePRS2 ServiceObjectiveName = "PRS2"
1073	// ServiceObjectiveNamePRS4 ...
1074	ServiceObjectiveNamePRS4 ServiceObjectiveName = "PRS4"
1075	// ServiceObjectiveNamePRS6 ...
1076	ServiceObjectiveNamePRS6 ServiceObjectiveName = "PRS6"
1077	// ServiceObjectiveNameS0 ...
1078	ServiceObjectiveNameS0 ServiceObjectiveName = "S0"
1079	// ServiceObjectiveNameS1 ...
1080	ServiceObjectiveNameS1 ServiceObjectiveName = "S1"
1081	// ServiceObjectiveNameS12 ...
1082	ServiceObjectiveNameS12 ServiceObjectiveName = "S12"
1083	// ServiceObjectiveNameS2 ...
1084	ServiceObjectiveNameS2 ServiceObjectiveName = "S2"
1085	// ServiceObjectiveNameS3 ...
1086	ServiceObjectiveNameS3 ServiceObjectiveName = "S3"
1087	// ServiceObjectiveNameS4 ...
1088	ServiceObjectiveNameS4 ServiceObjectiveName = "S4"
1089	// ServiceObjectiveNameS6 ...
1090	ServiceObjectiveNameS6 ServiceObjectiveName = "S6"
1091	// ServiceObjectiveNameS7 ...
1092	ServiceObjectiveNameS7 ServiceObjectiveName = "S7"
1093	// ServiceObjectiveNameS9 ...
1094	ServiceObjectiveNameS9 ServiceObjectiveName = "S9"
1095	// ServiceObjectiveNameSystem ...
1096	ServiceObjectiveNameSystem ServiceObjectiveName = "System"
1097	// ServiceObjectiveNameSystem0 ...
1098	ServiceObjectiveNameSystem0 ServiceObjectiveName = "System0"
1099	// ServiceObjectiveNameSystem1 ...
1100	ServiceObjectiveNameSystem1 ServiceObjectiveName = "System1"
1101	// ServiceObjectiveNameSystem2 ...
1102	ServiceObjectiveNameSystem2 ServiceObjectiveName = "System2"
1103	// ServiceObjectiveNameSystem2L ...
1104	ServiceObjectiveNameSystem2L ServiceObjectiveName = "System2L"
1105	// ServiceObjectiveNameSystem3 ...
1106	ServiceObjectiveNameSystem3 ServiceObjectiveName = "System3"
1107	// ServiceObjectiveNameSystem3L ...
1108	ServiceObjectiveNameSystem3L ServiceObjectiveName = "System3L"
1109	// ServiceObjectiveNameSystem4 ...
1110	ServiceObjectiveNameSystem4 ServiceObjectiveName = "System4"
1111	// ServiceObjectiveNameSystem4L ...
1112	ServiceObjectiveNameSystem4L ServiceObjectiveName = "System4L"
1113)
1114
1115// PossibleServiceObjectiveNameValues returns an array of possible values for the ServiceObjectiveName const type.
1116func PossibleServiceObjectiveNameValues() []ServiceObjectiveName {
1117	return []ServiceObjectiveName{ServiceObjectiveNameBasic, ServiceObjectiveNameDS100, ServiceObjectiveNameDS1000, ServiceObjectiveNameDS1200, ServiceObjectiveNameDS1500, ServiceObjectiveNameDS200, ServiceObjectiveNameDS2000, ServiceObjectiveNameDS300, ServiceObjectiveNameDS400, ServiceObjectiveNameDS500, ServiceObjectiveNameDS600, ServiceObjectiveNameDW100, ServiceObjectiveNameDW1000, ServiceObjectiveNameDW10000c, ServiceObjectiveNameDW1000c, ServiceObjectiveNameDW1200, ServiceObjectiveNameDW1500, ServiceObjectiveNameDW15000c, ServiceObjectiveNameDW1500c, ServiceObjectiveNameDW200, ServiceObjectiveNameDW2000, ServiceObjectiveNameDW2000c, ServiceObjectiveNameDW2500c, ServiceObjectiveNameDW300, ServiceObjectiveNameDW3000, ServiceObjectiveNameDW30000c, ServiceObjectiveNameDW3000c, ServiceObjectiveNameDW400, ServiceObjectiveNameDW500, ServiceObjectiveNameDW5000c, ServiceObjectiveNameDW600, ServiceObjectiveNameDW6000, ServiceObjectiveNameDW6000c, ServiceObjectiveNameDW7500c, ServiceObjectiveNameElasticPool, ServiceObjectiveNameFree, ServiceObjectiveNameP1, ServiceObjectiveNameP11, ServiceObjectiveNameP15, ServiceObjectiveNameP2, ServiceObjectiveNameP3, ServiceObjectiveNameP4, ServiceObjectiveNameP6, ServiceObjectiveNamePRS1, ServiceObjectiveNamePRS2, ServiceObjectiveNamePRS4, ServiceObjectiveNamePRS6, ServiceObjectiveNameS0, ServiceObjectiveNameS1, ServiceObjectiveNameS12, ServiceObjectiveNameS2, ServiceObjectiveNameS3, ServiceObjectiveNameS4, ServiceObjectiveNameS6, ServiceObjectiveNameS7, ServiceObjectiveNameS9, ServiceObjectiveNameSystem, ServiceObjectiveNameSystem0, ServiceObjectiveNameSystem1, ServiceObjectiveNameSystem2, ServiceObjectiveNameSystem2L, ServiceObjectiveNameSystem3, ServiceObjectiveNameSystem3L, ServiceObjectiveNameSystem4, ServiceObjectiveNameSystem4L}
1118}
1119
1120// StorageKeyType enumerates the values for storage key type.
1121type StorageKeyType string
1122
1123const (
1124	// SharedAccessKey ...
1125	SharedAccessKey StorageKeyType = "SharedAccessKey"
1126	// StorageAccessKey ...
1127	StorageAccessKey StorageKeyType = "StorageAccessKey"
1128)
1129
1130// PossibleStorageKeyTypeValues returns an array of possible values for the StorageKeyType const type.
1131func PossibleStorageKeyTypeValues() []StorageKeyType {
1132	return []StorageKeyType{SharedAccessKey, StorageAccessKey}
1133}
1134
1135// SyncAgentState enumerates the values for sync agent state.
1136type SyncAgentState string
1137
1138const (
1139	// SyncAgentStateNeverConnected ...
1140	SyncAgentStateNeverConnected SyncAgentState = "NeverConnected"
1141	// SyncAgentStateOffline ...
1142	SyncAgentStateOffline SyncAgentState = "Offline"
1143	// SyncAgentStateOnline ...
1144	SyncAgentStateOnline SyncAgentState = "Online"
1145)
1146
1147// PossibleSyncAgentStateValues returns an array of possible values for the SyncAgentState const type.
1148func PossibleSyncAgentStateValues() []SyncAgentState {
1149	return []SyncAgentState{SyncAgentStateNeverConnected, SyncAgentStateOffline, SyncAgentStateOnline}
1150}
1151
1152// SyncConflictResolutionPolicy enumerates the values for sync conflict resolution policy.
1153type SyncConflictResolutionPolicy string
1154
1155const (
1156	// HubWin ...
1157	HubWin SyncConflictResolutionPolicy = "HubWin"
1158	// MemberWin ...
1159	MemberWin SyncConflictResolutionPolicy = "MemberWin"
1160)
1161
1162// PossibleSyncConflictResolutionPolicyValues returns an array of possible values for the SyncConflictResolutionPolicy const type.
1163func PossibleSyncConflictResolutionPolicyValues() []SyncConflictResolutionPolicy {
1164	return []SyncConflictResolutionPolicy{HubWin, MemberWin}
1165}
1166
1167// SyncDirection enumerates the values for sync direction.
1168type SyncDirection string
1169
1170const (
1171	// Bidirectional ...
1172	Bidirectional SyncDirection = "Bidirectional"
1173	// OneWayHubToMember ...
1174	OneWayHubToMember SyncDirection = "OneWayHubToMember"
1175	// OneWayMemberToHub ...
1176	OneWayMemberToHub SyncDirection = "OneWayMemberToHub"
1177)
1178
1179// PossibleSyncDirectionValues returns an array of possible values for the SyncDirection const type.
1180func PossibleSyncDirectionValues() []SyncDirection {
1181	return []SyncDirection{Bidirectional, OneWayHubToMember, OneWayMemberToHub}
1182}
1183
1184// SyncGroupLogType enumerates the values for sync group log type.
1185type SyncGroupLogType string
1186
1187const (
1188	// SyncGroupLogTypeAll ...
1189	SyncGroupLogTypeAll SyncGroupLogType = "All"
1190	// SyncGroupLogTypeError ...
1191	SyncGroupLogTypeError SyncGroupLogType = "Error"
1192	// SyncGroupLogTypeSuccess ...
1193	SyncGroupLogTypeSuccess SyncGroupLogType = "Success"
1194	// SyncGroupLogTypeWarning ...
1195	SyncGroupLogTypeWarning SyncGroupLogType = "Warning"
1196)
1197
1198// PossibleSyncGroupLogTypeValues returns an array of possible values for the SyncGroupLogType const type.
1199func PossibleSyncGroupLogTypeValues() []SyncGroupLogType {
1200	return []SyncGroupLogType{SyncGroupLogTypeAll, SyncGroupLogTypeError, SyncGroupLogTypeSuccess, SyncGroupLogTypeWarning}
1201}
1202
1203// SyncGroupState enumerates the values for sync group state.
1204type SyncGroupState string
1205
1206const (
1207	// Error ...
1208	Error SyncGroupState = "Error"
1209	// Good ...
1210	Good SyncGroupState = "Good"
1211	// NotReady ...
1212	NotReady SyncGroupState = "NotReady"
1213	// Progressing ...
1214	Progressing SyncGroupState = "Progressing"
1215	// Warning ...
1216	Warning SyncGroupState = "Warning"
1217)
1218
1219// PossibleSyncGroupStateValues returns an array of possible values for the SyncGroupState const type.
1220func PossibleSyncGroupStateValues() []SyncGroupState {
1221	return []SyncGroupState{Error, Good, NotReady, Progressing, Warning}
1222}
1223
1224// SyncMemberDbType enumerates the values for sync member db type.
1225type SyncMemberDbType string
1226
1227const (
1228	// AzureSQLDatabase ...
1229	AzureSQLDatabase SyncMemberDbType = "AzureSqlDatabase"
1230	// SQLServerDatabase ...
1231	SQLServerDatabase SyncMemberDbType = "SqlServerDatabase"
1232)
1233
1234// PossibleSyncMemberDbTypeValues returns an array of possible values for the SyncMemberDbType const type.
1235func PossibleSyncMemberDbTypeValues() []SyncMemberDbType {
1236	return []SyncMemberDbType{AzureSQLDatabase, SQLServerDatabase}
1237}
1238
1239// SyncMemberState enumerates the values for sync member state.
1240type SyncMemberState string
1241
1242const (
1243	// DeProvisioned ...
1244	DeProvisioned SyncMemberState = "DeProvisioned"
1245	// DeProvisionFailed ...
1246	DeProvisionFailed SyncMemberState = "DeProvisionFailed"
1247	// DeProvisioning ...
1248	DeProvisioning SyncMemberState = "DeProvisioning"
1249	// DisabledBackupRestore ...
1250	DisabledBackupRestore SyncMemberState = "DisabledBackupRestore"
1251	// DisabledTombstoneCleanup ...
1252	DisabledTombstoneCleanup SyncMemberState = "DisabledTombstoneCleanup"
1253	// Provisioned ...
1254	Provisioned SyncMemberState = "Provisioned"
1255	// ProvisionFailed ...
1256	ProvisionFailed SyncMemberState = "ProvisionFailed"
1257	// Provisioning ...
1258	Provisioning SyncMemberState = "Provisioning"
1259	// ReprovisionFailed ...
1260	ReprovisionFailed SyncMemberState = "ReprovisionFailed"
1261	// Reprovisioning ...
1262	Reprovisioning SyncMemberState = "Reprovisioning"
1263	// SyncCancelled ...
1264	SyncCancelled SyncMemberState = "SyncCancelled"
1265	// SyncCancelling ...
1266	SyncCancelling SyncMemberState = "SyncCancelling"
1267	// SyncFailed ...
1268	SyncFailed SyncMemberState = "SyncFailed"
1269	// SyncInProgress ...
1270	SyncInProgress SyncMemberState = "SyncInProgress"
1271	// SyncSucceeded ...
1272	SyncSucceeded SyncMemberState = "SyncSucceeded"
1273	// SyncSucceededWithWarnings ...
1274	SyncSucceededWithWarnings SyncMemberState = "SyncSucceededWithWarnings"
1275	// UnProvisioned ...
1276	UnProvisioned SyncMemberState = "UnProvisioned"
1277	// UnReprovisioned ...
1278	UnReprovisioned SyncMemberState = "UnReprovisioned"
1279)
1280
1281// PossibleSyncMemberStateValues returns an array of possible values for the SyncMemberState const type.
1282func PossibleSyncMemberStateValues() []SyncMemberState {
1283	return []SyncMemberState{DeProvisioned, DeProvisionFailed, DeProvisioning, DisabledBackupRestore, DisabledTombstoneCleanup, Provisioned, ProvisionFailed, Provisioning, ReprovisionFailed, Reprovisioning, SyncCancelled, SyncCancelling, SyncFailed, SyncInProgress, SyncSucceeded, SyncSucceededWithWarnings, UnProvisioned, UnReprovisioned}
1284}
1285
1286// TransparentDataEncryptionActivityStatus enumerates the values for transparent data encryption activity
1287// status.
1288type TransparentDataEncryptionActivityStatus string
1289
1290const (
1291	// Decrypting ...
1292	Decrypting TransparentDataEncryptionActivityStatus = "Decrypting"
1293	// Encrypting ...
1294	Encrypting TransparentDataEncryptionActivityStatus = "Encrypting"
1295)
1296
1297// PossibleTransparentDataEncryptionActivityStatusValues returns an array of possible values for the TransparentDataEncryptionActivityStatus const type.
1298func PossibleTransparentDataEncryptionActivityStatusValues() []TransparentDataEncryptionActivityStatus {
1299	return []TransparentDataEncryptionActivityStatus{Decrypting, Encrypting}
1300}
1301
1302// TransparentDataEncryptionStatus enumerates the values for transparent data encryption status.
1303type TransparentDataEncryptionStatus string
1304
1305const (
1306	// TransparentDataEncryptionStatusDisabled ...
1307	TransparentDataEncryptionStatusDisabled TransparentDataEncryptionStatus = "Disabled"
1308	// TransparentDataEncryptionStatusEnabled ...
1309	TransparentDataEncryptionStatusEnabled TransparentDataEncryptionStatus = "Enabled"
1310)
1311
1312// PossibleTransparentDataEncryptionStatusValues returns an array of possible values for the TransparentDataEncryptionStatus const type.
1313func PossibleTransparentDataEncryptionStatusValues() []TransparentDataEncryptionStatus {
1314	return []TransparentDataEncryptionStatus{TransparentDataEncryptionStatusDisabled, TransparentDataEncryptionStatusEnabled}
1315}
1316
1317// UnitDefinitionType enumerates the values for unit definition type.
1318type UnitDefinitionType string
1319
1320const (
1321	// UnitDefinitionTypeBytes ...
1322	UnitDefinitionTypeBytes UnitDefinitionType = "Bytes"
1323	// UnitDefinitionTypeBytesPerSecond ...
1324	UnitDefinitionTypeBytesPerSecond UnitDefinitionType = "BytesPerSecond"
1325	// UnitDefinitionTypeCount ...
1326	UnitDefinitionTypeCount UnitDefinitionType = "Count"
1327	// UnitDefinitionTypeCountPerSecond ...
1328	UnitDefinitionTypeCountPerSecond UnitDefinitionType = "CountPerSecond"
1329	// UnitDefinitionTypePercent ...
1330	UnitDefinitionTypePercent UnitDefinitionType = "Percent"
1331	// UnitDefinitionTypeSeconds ...
1332	UnitDefinitionTypeSeconds UnitDefinitionType = "Seconds"
1333)
1334
1335// PossibleUnitDefinitionTypeValues returns an array of possible values for the UnitDefinitionType const type.
1336func PossibleUnitDefinitionTypeValues() []UnitDefinitionType {
1337	return []UnitDefinitionType{UnitDefinitionTypeBytes, UnitDefinitionTypeBytesPerSecond, UnitDefinitionTypeCount, UnitDefinitionTypeCountPerSecond, UnitDefinitionTypePercent, UnitDefinitionTypeSeconds}
1338}
1339
1340// UnitType enumerates the values for unit type.
1341type UnitType string
1342
1343const (
1344	// UnitTypeBytes ...
1345	UnitTypeBytes UnitType = "bytes"
1346	// UnitTypeBytesPerSecond ...
1347	UnitTypeBytesPerSecond UnitType = "bytesPerSecond"
1348	// UnitTypeCount ...
1349	UnitTypeCount UnitType = "count"
1350	// UnitTypeCountPerSecond ...
1351	UnitTypeCountPerSecond UnitType = "countPerSecond"
1352	// UnitTypePercent ...
1353	UnitTypePercent UnitType = "percent"
1354	// UnitTypeSeconds ...
1355	UnitTypeSeconds UnitType = "seconds"
1356)
1357
1358// PossibleUnitTypeValues returns an array of possible values for the UnitType const type.
1359func PossibleUnitTypeValues() []UnitType {
1360	return []UnitType{UnitTypeBytes, UnitTypeBytesPerSecond, UnitTypeCount, UnitTypeCountPerSecond, UnitTypePercent, UnitTypeSeconds}
1361}
1362
1363// VirtualNetworkRuleState enumerates the values for virtual network rule state.
1364type VirtualNetworkRuleState string
1365
1366const (
1367	// VirtualNetworkRuleStateDeleting ...
1368	VirtualNetworkRuleStateDeleting VirtualNetworkRuleState = "Deleting"
1369	// VirtualNetworkRuleStateInitializing ...
1370	VirtualNetworkRuleStateInitializing VirtualNetworkRuleState = "Initializing"
1371	// VirtualNetworkRuleStateInProgress ...
1372	VirtualNetworkRuleStateInProgress VirtualNetworkRuleState = "InProgress"
1373	// VirtualNetworkRuleStateReady ...
1374	VirtualNetworkRuleStateReady VirtualNetworkRuleState = "Ready"
1375	// VirtualNetworkRuleStateUnknown ...
1376	VirtualNetworkRuleStateUnknown VirtualNetworkRuleState = "Unknown"
1377)
1378
1379// PossibleVirtualNetworkRuleStateValues returns an array of possible values for the VirtualNetworkRuleState const type.
1380func PossibleVirtualNetworkRuleStateValues() []VirtualNetworkRuleState {
1381	return []VirtualNetworkRuleState{VirtualNetworkRuleStateDeleting, VirtualNetworkRuleStateInitializing, VirtualNetworkRuleStateInProgress, VirtualNetworkRuleStateReady, VirtualNetworkRuleStateUnknown}
1382}
1383
1384// VulnerabilityAssessmentPolicyBaselineName enumerates the values for vulnerability assessment policy baseline
1385// name.
1386type VulnerabilityAssessmentPolicyBaselineName string
1387
1388const (
1389	// VulnerabilityAssessmentPolicyBaselineNameDefault ...
1390	VulnerabilityAssessmentPolicyBaselineNameDefault VulnerabilityAssessmentPolicyBaselineName = "default"
1391	// VulnerabilityAssessmentPolicyBaselineNameMaster ...
1392	VulnerabilityAssessmentPolicyBaselineNameMaster VulnerabilityAssessmentPolicyBaselineName = "master"
1393)
1394
1395// PossibleVulnerabilityAssessmentPolicyBaselineNameValues returns an array of possible values for the VulnerabilityAssessmentPolicyBaselineName const type.
1396func PossibleVulnerabilityAssessmentPolicyBaselineNameValues() []VulnerabilityAssessmentPolicyBaselineName {
1397	return []VulnerabilityAssessmentPolicyBaselineName{VulnerabilityAssessmentPolicyBaselineNameDefault, VulnerabilityAssessmentPolicyBaselineNameMaster}
1398}
1399
1400// AutomaticTuningOptions automatic tuning properties for individual advisors.
1401type AutomaticTuningOptions struct {
1402	// DesiredState - Automatic tuning option desired state. Possible values include: 'AutomaticTuningOptionModeDesiredOff', 'AutomaticTuningOptionModeDesiredOn', 'AutomaticTuningOptionModeDesiredDefault'
1403	DesiredState AutomaticTuningOptionModeDesired `json:"desiredState,omitempty"`
1404	// ActualState - Automatic tuning option actual state. Possible values include: 'Off', 'On'
1405	ActualState AutomaticTuningOptionModeActual `json:"actualState,omitempty"`
1406	// ReasonCode - Reason code if desired and actual state are different.
1407	ReasonCode *int32 `json:"reasonCode,omitempty"`
1408	// ReasonDesc - Reason description if desired and actual state are different. Possible values include: 'Default', 'Disabled', 'AutoConfigured', 'InheritedFromServer', 'QueryStoreOff', 'QueryStoreReadOnly', 'NotSupported'
1409	ReasonDesc AutomaticTuningDisabledReason `json:"reasonDesc,omitempty"`
1410}
1411
1412// AutomaticTuningServerOptions automatic tuning properties for individual advisors.
1413type AutomaticTuningServerOptions struct {
1414	// DesiredState - Automatic tuning option desired state. Possible values include: 'AutomaticTuningOptionModeDesiredOff', 'AutomaticTuningOptionModeDesiredOn', 'AutomaticTuningOptionModeDesiredDefault'
1415	DesiredState AutomaticTuningOptionModeDesired `json:"desiredState,omitempty"`
1416	// ActualState - Automatic tuning option actual state. Possible values include: 'Off', 'On'
1417	ActualState AutomaticTuningOptionModeActual `json:"actualState,omitempty"`
1418	// ReasonCode - Reason code if desired and actual state are different.
1419	ReasonCode *int32 `json:"reasonCode,omitempty"`
1420	// ReasonDesc - Reason description if desired and actual state are different. Possible values include: 'AutomaticTuningServerReasonDefault', 'AutomaticTuningServerReasonDisabled', 'AutomaticTuningServerReasonAutoConfigured'
1421	ReasonDesc AutomaticTuningServerReason `json:"reasonDesc,omitempty"`
1422}
1423
1424// AutomaticTuningServerProperties server-level Automatic Tuning properties.
1425type AutomaticTuningServerProperties struct {
1426	// DesiredState - Automatic tuning desired state. Possible values include: 'AutomaticTuningServerModeCustom', 'AutomaticTuningServerModeAuto', 'AutomaticTuningServerModeUnspecified'
1427	DesiredState AutomaticTuningServerMode `json:"desiredState,omitempty"`
1428	// ActualState - Automatic tuning actual state. Possible values include: 'AutomaticTuningServerModeCustom', 'AutomaticTuningServerModeAuto', 'AutomaticTuningServerModeUnspecified'
1429	ActualState AutomaticTuningServerMode `json:"actualState,omitempty"`
1430	// Options - Automatic tuning options definition.
1431	Options map[string]*AutomaticTuningServerOptions `json:"options"`
1432}
1433
1434// MarshalJSON is the custom marshaler for AutomaticTuningServerProperties.
1435func (atsp AutomaticTuningServerProperties) MarshalJSON() ([]byte, error) {
1436	objectMap := make(map[string]interface{})
1437	if atsp.DesiredState != "" {
1438		objectMap["desiredState"] = atsp.DesiredState
1439	}
1440	if atsp.ActualState != "" {
1441		objectMap["actualState"] = atsp.ActualState
1442	}
1443	if atsp.Options != nil {
1444		objectMap["options"] = atsp.Options
1445	}
1446	return json.Marshal(objectMap)
1447}
1448
1449// BackupLongTermRetentionPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of
1450// a long-running operation.
1451type BackupLongTermRetentionPoliciesCreateOrUpdateFuture struct {
1452	azure.Future
1453}
1454
1455// Result returns the result of the asynchronous operation.
1456// If the operation has not completed it will return an error.
1457func (future *BackupLongTermRetentionPoliciesCreateOrUpdateFuture) Result(client BackupLongTermRetentionPoliciesClient) (bltrp BackupLongTermRetentionPolicy, err error) {
1458	var done bool
1459	done, err = future.Done(client)
1460	if err != nil {
1461		err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
1462		return
1463	}
1464	if !done {
1465		err = azure.NewAsyncOpIncompleteError("sql.BackupLongTermRetentionPoliciesCreateOrUpdateFuture")
1466		return
1467	}
1468	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1469	if bltrp.Response.Response, err = future.GetResult(sender); err == nil && bltrp.Response.Response.StatusCode != http.StatusNoContent {
1470		bltrp, err = client.CreateOrUpdateResponder(bltrp.Response.Response)
1471		if err != nil {
1472			err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionPoliciesCreateOrUpdateFuture", "Result", bltrp.Response.Response, "Failure responding to request")
1473		}
1474	}
1475	return
1476}
1477
1478// BackupLongTermRetentionPolicy a backup long term retention policy
1479type BackupLongTermRetentionPolicy struct {
1480	autorest.Response `json:"-"`
1481	// Location - The geo-location where the resource lives
1482	Location *string `json:"location,omitempty"`
1483	// BackupLongTermRetentionPolicyProperties - The properties of the backup long term retention policy
1484	*BackupLongTermRetentionPolicyProperties `json:"properties,omitempty"`
1485	// ID - Resource ID.
1486	ID *string `json:"id,omitempty"`
1487	// Name - Resource name.
1488	Name *string `json:"name,omitempty"`
1489	// Type - Resource type.
1490	Type *string `json:"type,omitempty"`
1491}
1492
1493// MarshalJSON is the custom marshaler for BackupLongTermRetentionPolicy.
1494func (bltrp BackupLongTermRetentionPolicy) MarshalJSON() ([]byte, error) {
1495	objectMap := make(map[string]interface{})
1496	if bltrp.Location != nil {
1497		objectMap["location"] = bltrp.Location
1498	}
1499	if bltrp.BackupLongTermRetentionPolicyProperties != nil {
1500		objectMap["properties"] = bltrp.BackupLongTermRetentionPolicyProperties
1501	}
1502	if bltrp.ID != nil {
1503		objectMap["id"] = bltrp.ID
1504	}
1505	if bltrp.Name != nil {
1506		objectMap["name"] = bltrp.Name
1507	}
1508	if bltrp.Type != nil {
1509		objectMap["type"] = bltrp.Type
1510	}
1511	return json.Marshal(objectMap)
1512}
1513
1514// UnmarshalJSON is the custom unmarshaler for BackupLongTermRetentionPolicy struct.
1515func (bltrp *BackupLongTermRetentionPolicy) UnmarshalJSON(body []byte) error {
1516	var m map[string]*json.RawMessage
1517	err := json.Unmarshal(body, &m)
1518	if err != nil {
1519		return err
1520	}
1521	for k, v := range m {
1522		switch k {
1523		case "location":
1524			if v != nil {
1525				var location string
1526				err = json.Unmarshal(*v, &location)
1527				if err != nil {
1528					return err
1529				}
1530				bltrp.Location = &location
1531			}
1532		case "properties":
1533			if v != nil {
1534				var backupLongTermRetentionPolicyProperties BackupLongTermRetentionPolicyProperties
1535				err = json.Unmarshal(*v, &backupLongTermRetentionPolicyProperties)
1536				if err != nil {
1537					return err
1538				}
1539				bltrp.BackupLongTermRetentionPolicyProperties = &backupLongTermRetentionPolicyProperties
1540			}
1541		case "id":
1542			if v != nil {
1543				var ID string
1544				err = json.Unmarshal(*v, &ID)
1545				if err != nil {
1546					return err
1547				}
1548				bltrp.ID = &ID
1549			}
1550		case "name":
1551			if v != nil {
1552				var name string
1553				err = json.Unmarshal(*v, &name)
1554				if err != nil {
1555					return err
1556				}
1557				bltrp.Name = &name
1558			}
1559		case "type":
1560			if v != nil {
1561				var typeVar string
1562				err = json.Unmarshal(*v, &typeVar)
1563				if err != nil {
1564					return err
1565				}
1566				bltrp.Type = &typeVar
1567			}
1568		}
1569	}
1570
1571	return nil
1572}
1573
1574// BackupLongTermRetentionPolicyListResult represents the response to a list long-term retention policies request.
1575type BackupLongTermRetentionPolicyListResult struct {
1576	autorest.Response `json:"-"`
1577	// Value - The list of long-term retention policies in the database.
1578	Value *[]BackupLongTermRetentionPolicy `json:"value,omitempty"`
1579}
1580
1581// BackupLongTermRetentionPolicyProperties the properties of a backup long term retention policy
1582type BackupLongTermRetentionPolicyProperties struct {
1583	// State - The status of the backup long term retention policy. Possible values include: 'BackupLongTermRetentionPolicyStateDisabled', 'BackupLongTermRetentionPolicyStateEnabled'
1584	State BackupLongTermRetentionPolicyState `json:"state,omitempty"`
1585	// RecoveryServicesBackupPolicyResourceID - The azure recovery services backup protection policy resource id
1586	RecoveryServicesBackupPolicyResourceID *string `json:"recoveryServicesBackupPolicyResourceId,omitempty"`
1587}
1588
1589// BackupLongTermRetentionVault a backup long term retention vault
1590type BackupLongTermRetentionVault struct {
1591	autorest.Response `json:"-"`
1592	// Location - The geo-location where the resource lives
1593	Location *string `json:"location,omitempty"`
1594	// BackupLongTermRetentionVaultProperties - The properties of the backup long term retention vault
1595	*BackupLongTermRetentionVaultProperties `json:"properties,omitempty"`
1596	// ID - Resource ID.
1597	ID *string `json:"id,omitempty"`
1598	// Name - Resource name.
1599	Name *string `json:"name,omitempty"`
1600	// Type - Resource type.
1601	Type *string `json:"type,omitempty"`
1602}
1603
1604// MarshalJSON is the custom marshaler for BackupLongTermRetentionVault.
1605func (bltrv BackupLongTermRetentionVault) MarshalJSON() ([]byte, error) {
1606	objectMap := make(map[string]interface{})
1607	if bltrv.Location != nil {
1608		objectMap["location"] = bltrv.Location
1609	}
1610	if bltrv.BackupLongTermRetentionVaultProperties != nil {
1611		objectMap["properties"] = bltrv.BackupLongTermRetentionVaultProperties
1612	}
1613	if bltrv.ID != nil {
1614		objectMap["id"] = bltrv.ID
1615	}
1616	if bltrv.Name != nil {
1617		objectMap["name"] = bltrv.Name
1618	}
1619	if bltrv.Type != nil {
1620		objectMap["type"] = bltrv.Type
1621	}
1622	return json.Marshal(objectMap)
1623}
1624
1625// UnmarshalJSON is the custom unmarshaler for BackupLongTermRetentionVault struct.
1626func (bltrv *BackupLongTermRetentionVault) UnmarshalJSON(body []byte) error {
1627	var m map[string]*json.RawMessage
1628	err := json.Unmarshal(body, &m)
1629	if err != nil {
1630		return err
1631	}
1632	for k, v := range m {
1633		switch k {
1634		case "location":
1635			if v != nil {
1636				var location string
1637				err = json.Unmarshal(*v, &location)
1638				if err != nil {
1639					return err
1640				}
1641				bltrv.Location = &location
1642			}
1643		case "properties":
1644			if v != nil {
1645				var backupLongTermRetentionVaultProperties BackupLongTermRetentionVaultProperties
1646				err = json.Unmarshal(*v, &backupLongTermRetentionVaultProperties)
1647				if err != nil {
1648					return err
1649				}
1650				bltrv.BackupLongTermRetentionVaultProperties = &backupLongTermRetentionVaultProperties
1651			}
1652		case "id":
1653			if v != nil {
1654				var ID string
1655				err = json.Unmarshal(*v, &ID)
1656				if err != nil {
1657					return err
1658				}
1659				bltrv.ID = &ID
1660			}
1661		case "name":
1662			if v != nil {
1663				var name string
1664				err = json.Unmarshal(*v, &name)
1665				if err != nil {
1666					return err
1667				}
1668				bltrv.Name = &name
1669			}
1670		case "type":
1671			if v != nil {
1672				var typeVar string
1673				err = json.Unmarshal(*v, &typeVar)
1674				if err != nil {
1675					return err
1676				}
1677				bltrv.Type = &typeVar
1678			}
1679		}
1680	}
1681
1682	return nil
1683}
1684
1685// BackupLongTermRetentionVaultListResult represents the response to a list vaults request.
1686type BackupLongTermRetentionVaultListResult struct {
1687	autorest.Response `json:"-"`
1688	// Value - The list of vaults in the server.
1689	Value *[]BackupLongTermRetentionVault `json:"value,omitempty"`
1690}
1691
1692// BackupLongTermRetentionVaultProperties the properties of a backup long term retention vault.
1693type BackupLongTermRetentionVaultProperties struct {
1694	// RecoveryServicesVaultResourceID - The azure recovery services vault resource id
1695	RecoveryServicesVaultResourceID *string `json:"recoveryServicesVaultResourceId,omitempty"`
1696}
1697
1698// BackupLongTermRetentionVaultsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
1699// long-running operation.
1700type BackupLongTermRetentionVaultsCreateOrUpdateFuture struct {
1701	azure.Future
1702}
1703
1704// Result returns the result of the asynchronous operation.
1705// If the operation has not completed it will return an error.
1706func (future *BackupLongTermRetentionVaultsCreateOrUpdateFuture) Result(client BackupLongTermRetentionVaultsClient) (bltrv BackupLongTermRetentionVault, err error) {
1707	var done bool
1708	done, err = future.Done(client)
1709	if err != nil {
1710		err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionVaultsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
1711		return
1712	}
1713	if !done {
1714		err = azure.NewAsyncOpIncompleteError("sql.BackupLongTermRetentionVaultsCreateOrUpdateFuture")
1715		return
1716	}
1717	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1718	if bltrv.Response.Response, err = future.GetResult(sender); err == nil && bltrv.Response.Response.StatusCode != http.StatusNoContent {
1719		bltrv, err = client.CreateOrUpdateResponder(bltrv.Response.Response)
1720		if err != nil {
1721			err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionVaultsCreateOrUpdateFuture", "Result", bltrv.Response.Response, "Failure responding to request")
1722		}
1723	}
1724	return
1725}
1726
1727// CheckNameAvailabilityRequest a request to check whether the specified name for a resource is available.
1728type CheckNameAvailabilityRequest struct {
1729	// Name - The name whose availability is to be checked.
1730	Name *string `json:"name,omitempty"`
1731	// Type - The type of resource that is used as the scope of the availability check.
1732	Type *string `json:"type,omitempty"`
1733}
1734
1735// CheckNameAvailabilityResponse a response indicating whether the specified name for a resource is available.
1736type CheckNameAvailabilityResponse struct {
1737	autorest.Response `json:"-"`
1738	// Available - True if the name is available, otherwise false.
1739	Available *bool `json:"available,omitempty"`
1740	// Message - A message explaining why the name is unavailable. Will be null if the name is available.
1741	Message *string `json:"message,omitempty"`
1742	// Name - The name whose availability was checked.
1743	Name *string `json:"name,omitempty"`
1744	// Reason - The reason code explaining why the name is unavailable. Will be null if the name is available. Possible values include: 'Invalid', 'AlreadyExists'
1745	Reason CheckNameAvailabilityReason `json:"reason,omitempty"`
1746}
1747
1748// CompleteDatabaseRestoreDefinition contains the information necessary to perform a complete database restore
1749// operation.
1750type CompleteDatabaseRestoreDefinition struct {
1751	// LastBackupName - The last backup name to apply
1752	LastBackupName *string `json:"lastBackupName,omitempty"`
1753}
1754
1755// CreateDatabaseRestorePointDefinition contains the information necessary to perform a create database restore
1756// point operation.
1757type CreateDatabaseRestorePointDefinition struct {
1758	// RestorePointLabel - The restore point label to apply
1759	RestorePointLabel *string `json:"restorePointLabel,omitempty"`
1760}
1761
1762// Database represents a database.
1763type Database struct {
1764	autorest.Response `json:"-"`
1765	// Kind - Kind of database.  This is metadata used for the Azure portal experience.
1766	Kind *string `json:"kind,omitempty"`
1767	// DatabaseProperties - The properties representing the resource.
1768	*DatabaseProperties `json:"properties,omitempty"`
1769	// Location - Resource location.
1770	Location *string `json:"location,omitempty"`
1771	// Tags - Resource tags.
1772	Tags map[string]*string `json:"tags"`
1773	// ID - Resource ID.
1774	ID *string `json:"id,omitempty"`
1775	// Name - Resource name.
1776	Name *string `json:"name,omitempty"`
1777	// Type - Resource type.
1778	Type *string `json:"type,omitempty"`
1779}
1780
1781// MarshalJSON is the custom marshaler for Database.
1782func (d Database) MarshalJSON() ([]byte, error) {
1783	objectMap := make(map[string]interface{})
1784	if d.Kind != nil {
1785		objectMap["kind"] = d.Kind
1786	}
1787	if d.DatabaseProperties != nil {
1788		objectMap["properties"] = d.DatabaseProperties
1789	}
1790	if d.Location != nil {
1791		objectMap["location"] = d.Location
1792	}
1793	if d.Tags != nil {
1794		objectMap["tags"] = d.Tags
1795	}
1796	if d.ID != nil {
1797		objectMap["id"] = d.ID
1798	}
1799	if d.Name != nil {
1800		objectMap["name"] = d.Name
1801	}
1802	if d.Type != nil {
1803		objectMap["type"] = d.Type
1804	}
1805	return json.Marshal(objectMap)
1806}
1807
1808// UnmarshalJSON is the custom unmarshaler for Database struct.
1809func (d *Database) UnmarshalJSON(body []byte) error {
1810	var m map[string]*json.RawMessage
1811	err := json.Unmarshal(body, &m)
1812	if err != nil {
1813		return err
1814	}
1815	for k, v := range m {
1816		switch k {
1817		case "kind":
1818			if v != nil {
1819				var kind string
1820				err = json.Unmarshal(*v, &kind)
1821				if err != nil {
1822					return err
1823				}
1824				d.Kind = &kind
1825			}
1826		case "properties":
1827			if v != nil {
1828				var databaseProperties DatabaseProperties
1829				err = json.Unmarshal(*v, &databaseProperties)
1830				if err != nil {
1831					return err
1832				}
1833				d.DatabaseProperties = &databaseProperties
1834			}
1835		case "location":
1836			if v != nil {
1837				var location string
1838				err = json.Unmarshal(*v, &location)
1839				if err != nil {
1840					return err
1841				}
1842				d.Location = &location
1843			}
1844		case "tags":
1845			if v != nil {
1846				var tags map[string]*string
1847				err = json.Unmarshal(*v, &tags)
1848				if err != nil {
1849					return err
1850				}
1851				d.Tags = tags
1852			}
1853		case "id":
1854			if v != nil {
1855				var ID string
1856				err = json.Unmarshal(*v, &ID)
1857				if err != nil {
1858					return err
1859				}
1860				d.ID = &ID
1861			}
1862		case "name":
1863			if v != nil {
1864				var name string
1865				err = json.Unmarshal(*v, &name)
1866				if err != nil {
1867					return err
1868				}
1869				d.Name = &name
1870			}
1871		case "type":
1872			if v != nil {
1873				var typeVar string
1874				err = json.Unmarshal(*v, &typeVar)
1875				if err != nil {
1876					return err
1877				}
1878				d.Type = &typeVar
1879			}
1880		}
1881	}
1882
1883	return nil
1884}
1885
1886// DatabaseAutomaticTuning database-level Automatic Tuning.
1887type DatabaseAutomaticTuning struct {
1888	autorest.Response `json:"-"`
1889	// DatabaseAutomaticTuningProperties - Resource properties.
1890	*DatabaseAutomaticTuningProperties `json:"properties,omitempty"`
1891	// ID - Resource ID.
1892	ID *string `json:"id,omitempty"`
1893	// Name - Resource name.
1894	Name *string `json:"name,omitempty"`
1895	// Type - Resource type.
1896	Type *string `json:"type,omitempty"`
1897}
1898
1899// MarshalJSON is the custom marshaler for DatabaseAutomaticTuning.
1900func (dat DatabaseAutomaticTuning) MarshalJSON() ([]byte, error) {
1901	objectMap := make(map[string]interface{})
1902	if dat.DatabaseAutomaticTuningProperties != nil {
1903		objectMap["properties"] = dat.DatabaseAutomaticTuningProperties
1904	}
1905	if dat.ID != nil {
1906		objectMap["id"] = dat.ID
1907	}
1908	if dat.Name != nil {
1909		objectMap["name"] = dat.Name
1910	}
1911	if dat.Type != nil {
1912		objectMap["type"] = dat.Type
1913	}
1914	return json.Marshal(objectMap)
1915}
1916
1917// UnmarshalJSON is the custom unmarshaler for DatabaseAutomaticTuning struct.
1918func (dat *DatabaseAutomaticTuning) UnmarshalJSON(body []byte) error {
1919	var m map[string]*json.RawMessage
1920	err := json.Unmarshal(body, &m)
1921	if err != nil {
1922		return err
1923	}
1924	for k, v := range m {
1925		switch k {
1926		case "properties":
1927			if v != nil {
1928				var databaseAutomaticTuningProperties DatabaseAutomaticTuningProperties
1929				err = json.Unmarshal(*v, &databaseAutomaticTuningProperties)
1930				if err != nil {
1931					return err
1932				}
1933				dat.DatabaseAutomaticTuningProperties = &databaseAutomaticTuningProperties
1934			}
1935		case "id":
1936			if v != nil {
1937				var ID string
1938				err = json.Unmarshal(*v, &ID)
1939				if err != nil {
1940					return err
1941				}
1942				dat.ID = &ID
1943			}
1944		case "name":
1945			if v != nil {
1946				var name string
1947				err = json.Unmarshal(*v, &name)
1948				if err != nil {
1949					return err
1950				}
1951				dat.Name = &name
1952			}
1953		case "type":
1954			if v != nil {
1955				var typeVar string
1956				err = json.Unmarshal(*v, &typeVar)
1957				if err != nil {
1958					return err
1959				}
1960				dat.Type = &typeVar
1961			}
1962		}
1963	}
1964
1965	return nil
1966}
1967
1968// DatabaseAutomaticTuningProperties database-level Automatic Tuning properties.
1969type DatabaseAutomaticTuningProperties struct {
1970	// DesiredState - Automatic tuning desired state. Possible values include: 'Inherit', 'Custom', 'Auto', 'Unspecified'
1971	DesiredState AutomaticTuningMode `json:"desiredState,omitempty"`
1972	// ActualState - Automatic tuning actual state. Possible values include: 'Inherit', 'Custom', 'Auto', 'Unspecified'
1973	ActualState AutomaticTuningMode `json:"actualState,omitempty"`
1974	// Options - Automatic tuning options definition.
1975	Options map[string]*AutomaticTuningOptions `json:"options"`
1976}
1977
1978// MarshalJSON is the custom marshaler for DatabaseAutomaticTuningProperties.
1979func (datp DatabaseAutomaticTuningProperties) MarshalJSON() ([]byte, error) {
1980	objectMap := make(map[string]interface{})
1981	if datp.DesiredState != "" {
1982		objectMap["desiredState"] = datp.DesiredState
1983	}
1984	if datp.ActualState != "" {
1985		objectMap["actualState"] = datp.ActualState
1986	}
1987	if datp.Options != nil {
1988		objectMap["options"] = datp.Options
1989	}
1990	return json.Marshal(objectMap)
1991}
1992
1993// DatabaseBlobAuditingPolicy a database blob auditing policy.
1994type DatabaseBlobAuditingPolicy struct {
1995	autorest.Response `json:"-"`
1996	// Kind - Resource kind.
1997	Kind *string `json:"kind,omitempty"`
1998	// DatabaseBlobAuditingPolicyProperties - Resource properties.
1999	*DatabaseBlobAuditingPolicyProperties `json:"properties,omitempty"`
2000	// ID - Resource ID.
2001	ID *string `json:"id,omitempty"`
2002	// Name - Resource name.
2003	Name *string `json:"name,omitempty"`
2004	// Type - Resource type.
2005	Type *string `json:"type,omitempty"`
2006}
2007
2008// MarshalJSON is the custom marshaler for DatabaseBlobAuditingPolicy.
2009func (dbap DatabaseBlobAuditingPolicy) MarshalJSON() ([]byte, error) {
2010	objectMap := make(map[string]interface{})
2011	if dbap.Kind != nil {
2012		objectMap["kind"] = dbap.Kind
2013	}
2014	if dbap.DatabaseBlobAuditingPolicyProperties != nil {
2015		objectMap["properties"] = dbap.DatabaseBlobAuditingPolicyProperties
2016	}
2017	if dbap.ID != nil {
2018		objectMap["id"] = dbap.ID
2019	}
2020	if dbap.Name != nil {
2021		objectMap["name"] = dbap.Name
2022	}
2023	if dbap.Type != nil {
2024		objectMap["type"] = dbap.Type
2025	}
2026	return json.Marshal(objectMap)
2027}
2028
2029// UnmarshalJSON is the custom unmarshaler for DatabaseBlobAuditingPolicy struct.
2030func (dbap *DatabaseBlobAuditingPolicy) UnmarshalJSON(body []byte) error {
2031	var m map[string]*json.RawMessage
2032	err := json.Unmarshal(body, &m)
2033	if err != nil {
2034		return err
2035	}
2036	for k, v := range m {
2037		switch k {
2038		case "kind":
2039			if v != nil {
2040				var kind string
2041				err = json.Unmarshal(*v, &kind)
2042				if err != nil {
2043					return err
2044				}
2045				dbap.Kind = &kind
2046			}
2047		case "properties":
2048			if v != nil {
2049				var databaseBlobAuditingPolicyProperties DatabaseBlobAuditingPolicyProperties
2050				err = json.Unmarshal(*v, &databaseBlobAuditingPolicyProperties)
2051				if err != nil {
2052					return err
2053				}
2054				dbap.DatabaseBlobAuditingPolicyProperties = &databaseBlobAuditingPolicyProperties
2055			}
2056		case "id":
2057			if v != nil {
2058				var ID string
2059				err = json.Unmarshal(*v, &ID)
2060				if err != nil {
2061					return err
2062				}
2063				dbap.ID = &ID
2064			}
2065		case "name":
2066			if v != nil {
2067				var name string
2068				err = json.Unmarshal(*v, &name)
2069				if err != nil {
2070					return err
2071				}
2072				dbap.Name = &name
2073			}
2074		case "type":
2075			if v != nil {
2076				var typeVar string
2077				err = json.Unmarshal(*v, &typeVar)
2078				if err != nil {
2079					return err
2080				}
2081				dbap.Type = &typeVar
2082			}
2083		}
2084	}
2085
2086	return nil
2087}
2088
2089// DatabaseBlobAuditingPolicyProperties properties of a database blob auditing policy.
2090type DatabaseBlobAuditingPolicyProperties struct {
2091	// State - Specifies the state of the policy. If state is Enabled, storageEndpoint and storageAccountAccessKey are required. Possible values include: 'BlobAuditingPolicyStateEnabled', 'BlobAuditingPolicyStateDisabled'
2092	State BlobAuditingPolicyState `json:"state,omitempty"`
2093	// StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint is required.
2094	StorageEndpoint *string `json:"storageEndpoint,omitempty"`
2095	// StorageAccountAccessKey - Specifies the identifier key of the auditing storage account. If state is Enabled, storageAccountAccessKey is required.
2096	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
2097	// RetentionDays - Specifies the number of days to keep in the audit logs.
2098	RetentionDays *int32 `json:"retentionDays,omitempty"`
2099	// AuditActionsAndGroups - Specifies the Actions-Groups and Actions to audit.
2100	//
2101	// The recommended set of action groups to use is the following combination - this will audit all the queries and stored procedures executed against the database, as well as successful and failed logins:
2102	//
2103	// BATCH_COMPLETED_GROUP,
2104	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP,
2105	// FAILED_DATABASE_AUTHENTICATION_GROUP.
2106	//
2107	// This above combination is also the set that is configured by default when enabling auditing from the Azure portal.
2108	//
2109	// The supported action groups to audit are (note: choose only specific groups that cover your auditing needs. Using unnecessary groups could lead to very large quantities of audit records):
2110	//
2111	// APPLICATION_ROLE_CHANGE_PASSWORD_GROUP
2112	// BACKUP_RESTORE_GROUP
2113	// DATABASE_LOGOUT_GROUP
2114	// DATABASE_OBJECT_CHANGE_GROUP
2115	// DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP
2116	// DATABASE_OBJECT_PERMISSION_CHANGE_GROUP
2117	// DATABASE_OPERATION_GROUP
2118	// DATABASE_PERMISSION_CHANGE_GROUP
2119	// DATABASE_PRINCIPAL_CHANGE_GROUP
2120	// DATABASE_PRINCIPAL_IMPERSONATION_GROUP
2121	// DATABASE_ROLE_MEMBER_CHANGE_GROUP
2122	// FAILED_DATABASE_AUTHENTICATION_GROUP
2123	// SCHEMA_OBJECT_ACCESS_GROUP
2124	// SCHEMA_OBJECT_CHANGE_GROUP
2125	// SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP
2126	// SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP
2127	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP
2128	// USER_CHANGE_PASSWORD_GROUP
2129	// BATCH_STARTED_GROUP
2130	// BATCH_COMPLETED_GROUP
2131	//
2132	// These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs.
2133	//
2134	// For more information, see [Database-Level Audit Action Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups).
2135	//
2136	// For Database auditing policy, specific Actions can also be specified (note that Actions cannot be specified for Server auditing policy). The supported actions to audit are:
2137	// SELECT
2138	// UPDATE
2139	// INSERT
2140	// DELETE
2141	// EXECUTE
2142	// RECEIVE
2143	// REFERENCES
2144	//
2145	// The general form for defining an action to be audited is:
2146	// <action> ON <object> BY <principal>
2147	//
2148	// Note that <object> in the above format can refer to an object like a table, view, or stored procedure, or an entire database or schema. For the latter cases, the forms DATABASE::<db_name> and SCHEMA::<schema_name> are used, respectively.
2149	//
2150	// For example:
2151	// SELECT on dbo.myTable by public
2152	// SELECT on DATABASE::myDatabase by public
2153	// SELECT on SCHEMA::mySchema by public
2154	//
2155	// For more information, see [Database-Level Audit Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions)
2156	AuditActionsAndGroups *[]string `json:"auditActionsAndGroups,omitempty"`
2157	// StorageAccountSubscriptionID - Specifies the blob storage subscription Id.
2158	StorageAccountSubscriptionID *uuid.UUID `json:"storageAccountSubscriptionId,omitempty"`
2159	// IsStorageSecondaryKeyInUse - Specifies whether storageAccountAccessKey value is the storage's secondary key.
2160	IsStorageSecondaryKeyInUse *bool `json:"isStorageSecondaryKeyInUse,omitempty"`
2161}
2162
2163// DatabaseListResult represents the response to a list database request.
2164type DatabaseListResult struct {
2165	autorest.Response `json:"-"`
2166	// Value - The list of databases housed in the server.
2167	Value *[]Database `json:"value,omitempty"`
2168}
2169
2170// DatabaseOperation a database operation.
2171type DatabaseOperation struct {
2172	// DatabaseOperationProperties - Resource properties.
2173	*DatabaseOperationProperties `json:"properties,omitempty"`
2174	// ID - Resource ID.
2175	ID *string `json:"id,omitempty"`
2176	// Name - Resource name.
2177	Name *string `json:"name,omitempty"`
2178	// Type - Resource type.
2179	Type *string `json:"type,omitempty"`
2180}
2181
2182// MarshalJSON is the custom marshaler for DatabaseOperation.
2183func (do DatabaseOperation) MarshalJSON() ([]byte, error) {
2184	objectMap := make(map[string]interface{})
2185	if do.DatabaseOperationProperties != nil {
2186		objectMap["properties"] = do.DatabaseOperationProperties
2187	}
2188	if do.ID != nil {
2189		objectMap["id"] = do.ID
2190	}
2191	if do.Name != nil {
2192		objectMap["name"] = do.Name
2193	}
2194	if do.Type != nil {
2195		objectMap["type"] = do.Type
2196	}
2197	return json.Marshal(objectMap)
2198}
2199
2200// UnmarshalJSON is the custom unmarshaler for DatabaseOperation struct.
2201func (do *DatabaseOperation) UnmarshalJSON(body []byte) error {
2202	var m map[string]*json.RawMessage
2203	err := json.Unmarshal(body, &m)
2204	if err != nil {
2205		return err
2206	}
2207	for k, v := range m {
2208		switch k {
2209		case "properties":
2210			if v != nil {
2211				var databaseOperationProperties DatabaseOperationProperties
2212				err = json.Unmarshal(*v, &databaseOperationProperties)
2213				if err != nil {
2214					return err
2215				}
2216				do.DatabaseOperationProperties = &databaseOperationProperties
2217			}
2218		case "id":
2219			if v != nil {
2220				var ID string
2221				err = json.Unmarshal(*v, &ID)
2222				if err != nil {
2223					return err
2224				}
2225				do.ID = &ID
2226			}
2227		case "name":
2228			if v != nil {
2229				var name string
2230				err = json.Unmarshal(*v, &name)
2231				if err != nil {
2232					return err
2233				}
2234				do.Name = &name
2235			}
2236		case "type":
2237			if v != nil {
2238				var typeVar string
2239				err = json.Unmarshal(*v, &typeVar)
2240				if err != nil {
2241					return err
2242				}
2243				do.Type = &typeVar
2244			}
2245		}
2246	}
2247
2248	return nil
2249}
2250
2251// DatabaseOperationListResult the response to a list database operations request
2252type DatabaseOperationListResult struct {
2253	autorest.Response `json:"-"`
2254	// Value - Array of results.
2255	Value *[]DatabaseOperation `json:"value,omitempty"`
2256	// NextLink - Link to retrieve next page of results.
2257	NextLink *string `json:"nextLink,omitempty"`
2258}
2259
2260// DatabaseOperationListResultIterator provides access to a complete listing of DatabaseOperation values.
2261type DatabaseOperationListResultIterator struct {
2262	i    int
2263	page DatabaseOperationListResultPage
2264}
2265
2266// Next advances to the next value.  If there was an error making
2267// the request the iterator does not advance and the error is returned.
2268func (iter *DatabaseOperationListResultIterator) Next() error {
2269	iter.i++
2270	if iter.i < len(iter.page.Values()) {
2271		return nil
2272	}
2273	err := iter.page.Next()
2274	if err != nil {
2275		iter.i--
2276		return err
2277	}
2278	iter.i = 0
2279	return nil
2280}
2281
2282// NotDone returns true if the enumeration should be started or is not yet complete.
2283func (iter DatabaseOperationListResultIterator) NotDone() bool {
2284	return iter.page.NotDone() && iter.i < len(iter.page.Values())
2285}
2286
2287// Response returns the raw server response from the last page request.
2288func (iter DatabaseOperationListResultIterator) Response() DatabaseOperationListResult {
2289	return iter.page.Response()
2290}
2291
2292// Value returns the current value or a zero-initialized value if the
2293// iterator has advanced beyond the end of the collection.
2294func (iter DatabaseOperationListResultIterator) Value() DatabaseOperation {
2295	if !iter.page.NotDone() {
2296		return DatabaseOperation{}
2297	}
2298	return iter.page.Values()[iter.i]
2299}
2300
2301// IsEmpty returns true if the ListResult contains no values.
2302func (dolr DatabaseOperationListResult) IsEmpty() bool {
2303	return dolr.Value == nil || len(*dolr.Value) == 0
2304}
2305
2306// databaseOperationListResultPreparer prepares a request to retrieve the next set of results.
2307// It returns nil if no more results exist.
2308func (dolr DatabaseOperationListResult) databaseOperationListResultPreparer() (*http.Request, error) {
2309	if dolr.NextLink == nil || len(to.String(dolr.NextLink)) < 1 {
2310		return nil, nil
2311	}
2312	return autorest.Prepare(&http.Request{},
2313		autorest.AsJSON(),
2314		autorest.AsGet(),
2315		autorest.WithBaseURL(to.String(dolr.NextLink)))
2316}
2317
2318// DatabaseOperationListResultPage contains a page of DatabaseOperation values.
2319type DatabaseOperationListResultPage struct {
2320	fn   func(DatabaseOperationListResult) (DatabaseOperationListResult, error)
2321	dolr DatabaseOperationListResult
2322}
2323
2324// Next advances to the next page of values.  If there was an error making
2325// the request the page does not advance and the error is returned.
2326func (page *DatabaseOperationListResultPage) Next() error {
2327	next, err := page.fn(page.dolr)
2328	if err != nil {
2329		return err
2330	}
2331	page.dolr = next
2332	return nil
2333}
2334
2335// NotDone returns true if the page enumeration should be started or is not yet complete.
2336func (page DatabaseOperationListResultPage) NotDone() bool {
2337	return !page.dolr.IsEmpty()
2338}
2339
2340// Response returns the raw server response from the last page request.
2341func (page DatabaseOperationListResultPage) Response() DatabaseOperationListResult {
2342	return page.dolr
2343}
2344
2345// Values returns the slice of values for the current page or nil if there are no values.
2346func (page DatabaseOperationListResultPage) Values() []DatabaseOperation {
2347	if page.dolr.IsEmpty() {
2348		return nil
2349	}
2350	return *page.dolr.Value
2351}
2352
2353// DatabaseOperationProperties the properties of a database operation.
2354type DatabaseOperationProperties struct {
2355	// DatabaseName - The name of the database the operation is being performed on.
2356	DatabaseName *string `json:"databaseName,omitempty"`
2357	// Operation - The name of operation.
2358	Operation *string `json:"operation,omitempty"`
2359	// OperationFriendlyName - The friendly name of operation.
2360	OperationFriendlyName *string `json:"operationFriendlyName,omitempty"`
2361	// PercentComplete - The percentage of the operation completed.
2362	PercentComplete *int32 `json:"percentComplete,omitempty"`
2363	// ServerName - The name of the server.
2364	ServerName *string `json:"serverName,omitempty"`
2365	// StartTime - The operation start time.
2366	StartTime *date.Time `json:"startTime,omitempty"`
2367	// State - The operation state. Possible values include: 'ManagementOperationStatePending', 'ManagementOperationStateInProgress', 'ManagementOperationStateSucceeded', 'ManagementOperationStateFailed', 'ManagementOperationStateCancelInProgress', 'ManagementOperationStateCancelled'
2368	State ManagementOperationState `json:"state,omitempty"`
2369	// ErrorCode - The operation error code.
2370	ErrorCode *int32 `json:"errorCode,omitempty"`
2371	// ErrorDescription - The operation error description.
2372	ErrorDescription *string `json:"errorDescription,omitempty"`
2373	// ErrorSeverity - The operation error severity.
2374	ErrorSeverity *int32 `json:"errorSeverity,omitempty"`
2375	// IsUserError - Whether or not the error is a user error.
2376	IsUserError *bool `json:"isUserError,omitempty"`
2377	// EstimatedCompletionTime - The estimated completion time of the operation.
2378	EstimatedCompletionTime *date.Time `json:"estimatedCompletionTime,omitempty"`
2379	// Description - The operation description.
2380	Description *string `json:"description,omitempty"`
2381	// IsCancellable - Whether the operation can be cancelled.
2382	IsCancellable *bool `json:"isCancellable,omitempty"`
2383}
2384
2385// DatabaseProperties represents the properties of a database.
2386type DatabaseProperties struct {
2387	// Collation - The collation of the database. If createMode is not Default, this value is ignored.
2388	Collation *string `json:"collation,omitempty"`
2389	// CreationDate - The creation date of the database (ISO8601 format).
2390	CreationDate *date.Time `json:"creationDate,omitempty"`
2391	// ContainmentState - The containment state of the database.
2392	ContainmentState *int64 `json:"containmentState,omitempty"`
2393	// CurrentServiceObjectiveID - The current service level objective ID of the database. This is the ID of the service level objective that is currently active.
2394	CurrentServiceObjectiveID *uuid.UUID `json:"currentServiceObjectiveId,omitempty"`
2395	// DatabaseID - The ID of the database.
2396	DatabaseID *uuid.UUID `json:"databaseId,omitempty"`
2397	// EarliestRestoreDate - This records the earliest start date and time that restore is available for this database (ISO8601 format).
2398	EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"`
2399	// CreateMode - Specifies the mode of database creation.
2400	// Default: regular database creation.
2401	// Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified as the resource ID of the source database.
2402	// OnlineSecondary/NonReadableSecondary: creates a database as a (readable or nonreadable) secondary replica of an existing database. sourceDatabaseId must be specified as the resource ID of the existing primary database.
2403	// PointInTimeRestore: Creates a database by restoring a point in time backup of an existing database. sourceDatabaseId must be specified as the resource ID of the existing database, and restorePointInTime must be specified.
2404	// Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be specified as the recoverable database resource ID to restore.
2405	// Restore: Creates a database by restoring a backup of a deleted database. sourceDatabaseId must be specified. If sourceDatabaseId is the database's original resource ID, then sourceDatabaseDeletionDate must be specified. Otherwise sourceDatabaseId must be the restorable dropped database resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be specified to restore from an earlier point in time.
2406	// RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention vault. recoveryServicesRecoveryPointResourceId must be specified as the recovery point resource ID.
2407	// Copy, NonReadableSecondary, OnlineSecondary and RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. Possible values include: 'CreateModeCopy', 'CreateModeDefault', 'CreateModeNonReadableSecondary', 'CreateModeOnlineSecondary', 'CreateModePointInTimeRestore', 'CreateModeRecovery', 'CreateModeRestore', 'CreateModeRestoreLongTermRetentionBackup'
2408	CreateMode CreateMode `json:"createMode,omitempty"`
2409	// SourceDatabaseID - Conditional. If createMode is Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, or Restore, then this value is required. Specifies the resource ID of the source database. If createMode is NonReadableSecondary or OnlineSecondary, the name of the source database must be the same as the new database being created.
2410	SourceDatabaseID *string `json:"sourceDatabaseId,omitempty"`
2411	// SourceDatabaseDeletionDate - Conditional. If createMode is Restore and sourceDatabaseId is the deleted database's original resource id when it existed (as opposed to its current restorable dropped database id), then this value is required. Specifies the time that the database was deleted.
2412	SourceDatabaseDeletionDate *date.Time `json:"sourceDatabaseDeletionDate,omitempty"`
2413	// RestorePointInTime - Conditional. If createMode is PointInTimeRestore, this value is required. If createMode is Restore, this value is optional. Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. Must be greater than or equal to the source database's earliestRestoreDate value.
2414	RestorePointInTime *date.Time `json:"restorePointInTime,omitempty"`
2415	// RecoveryServicesRecoveryPointResourceID - Conditional. If createMode is RestoreLongTermRetentionBackup, then this value is required. Specifies the resource ID of the recovery point to restore from.
2416	RecoveryServicesRecoveryPointResourceID *string `json:"recoveryServicesRecoveryPointResourceId,omitempty"`
2417	// Edition - The edition of the database. The DatabaseEditions enumeration contains all the valid editions. If createMode is NonReadableSecondary or OnlineSecondary, this value is ignored. To see possible values, query the capabilities API (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) referred to by operationId: "Capabilities_ListByLocation." or use the Azure CLI command `az sql db list-editions -l westus --query [].name`. Possible values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2'
2418	Edition DatabaseEdition `json:"edition,omitempty"`
2419	// MaxSizeBytes - The max size of the database expressed in bytes. If createMode is not Default, this value is ignored. To see possible values, query the capabilities API (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) referred to by operationId: "Capabilities_ListByLocation."
2420	MaxSizeBytes *string `json:"maxSizeBytes,omitempty"`
2421	// RequestedServiceObjectiveID - The configured service level objective ID of the database. This is the service level objective that is in the process of being applied to the database. Once successfully updated, it will match the value of currentServiceObjectiveId property. If requestedServiceObjectiveId and requestedServiceObjectiveName are both updated, the value of requestedServiceObjectiveId overrides the value of requestedServiceObjectiveName. To see possible values, query the capabilities API (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) referred to by operationId: "Capabilities_ListByLocation." or use the Azure CLI command `az sql db list-editions --location <location> --query [].supportedServiceLevelObjectives[].name` .
2422	RequestedServiceObjectiveID *uuid.UUID `json:"requestedServiceObjectiveId,omitempty"`
2423	// RequestedServiceObjectiveName - The name of the configured service level objective of the database. This is the service level objective that is in the process of being applied to the database. Once successfully updated, it will match the value of serviceLevelObjective property. To see possible values, query the capabilities API (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) referred to by operationId: "Capabilities_ListByLocation." or use the Azure CLI command `az sql db list-editions --location <location> --query [].supportedServiceLevelObjectives[].name`. Possible values include: 'ServiceObjectiveNameSystem', 'ServiceObjectiveNameSystem0', 'ServiceObjectiveNameSystem1', 'ServiceObjectiveNameSystem2', 'ServiceObjectiveNameSystem3', 'ServiceObjectiveNameSystem4', 'ServiceObjectiveNameSystem2L', 'ServiceObjectiveNameSystem3L', 'ServiceObjectiveNameSystem4L', 'ServiceObjectiveNameFree', 'ServiceObjectiveNameBasic', 'ServiceObjectiveNameS0', 'ServiceObjectiveNameS1', 'ServiceObjectiveNameS2', 'ServiceObjectiveNameS3', 'ServiceObjectiveNameS4', 'ServiceObjectiveNameS6', 'ServiceObjectiveNameS7', 'ServiceObjectiveNameS9', 'ServiceObjectiveNameS12', 'ServiceObjectiveNameP1', 'ServiceObjectiveNameP2', 'ServiceObjectiveNameP3', 'ServiceObjectiveNameP4', 'ServiceObjectiveNameP6', 'ServiceObjectiveNameP11', 'ServiceObjectiveNameP15', 'ServiceObjectiveNamePRS1', 'ServiceObjectiveNamePRS2', 'ServiceObjectiveNamePRS4', 'ServiceObjectiveNamePRS6', 'ServiceObjectiveNameDW100', 'ServiceObjectiveNameDW200', 'ServiceObjectiveNameDW300', 'ServiceObjectiveNameDW400', 'ServiceObjectiveNameDW500', 'ServiceObjectiveNameDW600', 'ServiceObjectiveNameDW1000', 'ServiceObjectiveNameDW1200', 'ServiceObjectiveNameDW1000c', 'ServiceObjectiveNameDW1500', 'ServiceObjectiveNameDW1500c', 'ServiceObjectiveNameDW2000', 'ServiceObjectiveNameDW2000c', 'ServiceObjectiveNameDW3000', 'ServiceObjectiveNameDW2500c', 'ServiceObjectiveNameDW3000c', 'ServiceObjectiveNameDW6000', 'ServiceObjectiveNameDW5000c', 'ServiceObjectiveNameDW6000c', 'ServiceObjectiveNameDW7500c', 'ServiceObjectiveNameDW10000c', 'ServiceObjectiveNameDW15000c', 'ServiceObjectiveNameDW30000c', 'ServiceObjectiveNameDS100', 'ServiceObjectiveNameDS200', 'ServiceObjectiveNameDS300', 'ServiceObjectiveNameDS400', 'ServiceObjectiveNameDS500', 'ServiceObjectiveNameDS600', 'ServiceObjectiveNameDS1000', 'ServiceObjectiveNameDS1200', 'ServiceObjectiveNameDS1500', 'ServiceObjectiveNameDS2000', 'ServiceObjectiveNameElasticPool'
2424	RequestedServiceObjectiveName ServiceObjectiveName `json:"requestedServiceObjectiveName,omitempty"`
2425	// ServiceLevelObjective - The current service level objective of the database. Possible values include: 'ServiceObjectiveNameSystem', 'ServiceObjectiveNameSystem0', 'ServiceObjectiveNameSystem1', 'ServiceObjectiveNameSystem2', 'ServiceObjectiveNameSystem3', 'ServiceObjectiveNameSystem4', 'ServiceObjectiveNameSystem2L', 'ServiceObjectiveNameSystem3L', 'ServiceObjectiveNameSystem4L', 'ServiceObjectiveNameFree', 'ServiceObjectiveNameBasic', 'ServiceObjectiveNameS0', 'ServiceObjectiveNameS1', 'ServiceObjectiveNameS2', 'ServiceObjectiveNameS3', 'ServiceObjectiveNameS4', 'ServiceObjectiveNameS6', 'ServiceObjectiveNameS7', 'ServiceObjectiveNameS9', 'ServiceObjectiveNameS12', 'ServiceObjectiveNameP1', 'ServiceObjectiveNameP2', 'ServiceObjectiveNameP3', 'ServiceObjectiveNameP4', 'ServiceObjectiveNameP6', 'ServiceObjectiveNameP11', 'ServiceObjectiveNameP15', 'ServiceObjectiveNamePRS1', 'ServiceObjectiveNamePRS2', 'ServiceObjectiveNamePRS4', 'ServiceObjectiveNamePRS6', 'ServiceObjectiveNameDW100', 'ServiceObjectiveNameDW200', 'ServiceObjectiveNameDW300', 'ServiceObjectiveNameDW400', 'ServiceObjectiveNameDW500', 'ServiceObjectiveNameDW600', 'ServiceObjectiveNameDW1000', 'ServiceObjectiveNameDW1200', 'ServiceObjectiveNameDW1000c', 'ServiceObjectiveNameDW1500', 'ServiceObjectiveNameDW1500c', 'ServiceObjectiveNameDW2000', 'ServiceObjectiveNameDW2000c', 'ServiceObjectiveNameDW3000', 'ServiceObjectiveNameDW2500c', 'ServiceObjectiveNameDW3000c', 'ServiceObjectiveNameDW6000', 'ServiceObjectiveNameDW5000c', 'ServiceObjectiveNameDW6000c', 'ServiceObjectiveNameDW7500c', 'ServiceObjectiveNameDW10000c', 'ServiceObjectiveNameDW15000c', 'ServiceObjectiveNameDW30000c', 'ServiceObjectiveNameDS100', 'ServiceObjectiveNameDS200', 'ServiceObjectiveNameDS300', 'ServiceObjectiveNameDS400', 'ServiceObjectiveNameDS500', 'ServiceObjectiveNameDS600', 'ServiceObjectiveNameDS1000', 'ServiceObjectiveNameDS1200', 'ServiceObjectiveNameDS1500', 'ServiceObjectiveNameDS2000', 'ServiceObjectiveNameElasticPool'
2426	ServiceLevelObjective ServiceObjectiveName `json:"serviceLevelObjective,omitempty"`
2427	// Status - The status of the database.
2428	Status *string `json:"status,omitempty"`
2429	// ElasticPoolName - The name of the elastic pool the database is in. If elasticPoolName and requestedServiceObjectiveName are both updated, the value of requestedServiceObjectiveName is ignored. Not supported for DataWarehouse edition.
2430	ElasticPoolName *string `json:"elasticPoolName,omitempty"`
2431	// DefaultSecondaryLocation - The default secondary region for this database.
2432	DefaultSecondaryLocation *string `json:"defaultSecondaryLocation,omitempty"`
2433	// ServiceTierAdvisors - The list of service tier advisors for this database. Expanded property
2434	ServiceTierAdvisors *[]ServiceTierAdvisor `json:"serviceTierAdvisors,omitempty"`
2435	// TransparentDataEncryption - The transparent data encryption info for this database.
2436	TransparentDataEncryption *[]TransparentDataEncryption `json:"transparentDataEncryption,omitempty"`
2437	// RecommendedIndex - The recommended indices for this database.
2438	RecommendedIndex *[]RecommendedIndex `json:"recommendedIndex,omitempty"`
2439	// FailoverGroupID - The resource identifier of the failover group containing this database.
2440	FailoverGroupID *string `json:"failoverGroupId,omitempty"`
2441	// ReadScale - Conditional. If the database is a geo-secondary, readScale indicates whether read-only connections are allowed to this database or not. Not supported for DataWarehouse edition. Possible values include: 'ReadScaleEnabled', 'ReadScaleDisabled'
2442	ReadScale ReadScale `json:"readScale,omitempty"`
2443	// SampleName - Indicates the name of the sample schema to apply when creating this database. If createMode is not Default, this value is ignored. Not supported for DataWarehouse edition. Possible values include: 'AdventureWorksLT'
2444	SampleName SampleName `json:"sampleName,omitempty"`
2445	// ZoneRedundant - Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones.
2446	ZoneRedundant *bool `json:"zoneRedundant,omitempty"`
2447}
2448
2449// DatabasesCreateImportOperationFuture an abstraction for monitoring and retrieving the results of a long-running
2450// operation.
2451type DatabasesCreateImportOperationFuture struct {
2452	azure.Future
2453}
2454
2455// Result returns the result of the asynchronous operation.
2456// If the operation has not completed it will return an error.
2457func (future *DatabasesCreateImportOperationFuture) Result(client DatabasesClient) (ier ImportExportResponse, err error) {
2458	var done bool
2459	done, err = future.Done(client)
2460	if err != nil {
2461		err = autorest.NewErrorWithError(err, "sql.DatabasesCreateImportOperationFuture", "Result", future.Response(), "Polling failure")
2462		return
2463	}
2464	if !done {
2465		err = azure.NewAsyncOpIncompleteError("sql.DatabasesCreateImportOperationFuture")
2466		return
2467	}
2468	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2469	if ier.Response.Response, err = future.GetResult(sender); err == nil && ier.Response.Response.StatusCode != http.StatusNoContent {
2470		ier, err = client.CreateImportOperationResponder(ier.Response.Response)
2471		if err != nil {
2472			err = autorest.NewErrorWithError(err, "sql.DatabasesCreateImportOperationFuture", "Result", ier.Response.Response, "Failure responding to request")
2473		}
2474	}
2475	return
2476}
2477
2478// DatabasesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
2479// operation.
2480type DatabasesCreateOrUpdateFuture struct {
2481	azure.Future
2482}
2483
2484// Result returns the result of the asynchronous operation.
2485// If the operation has not completed it will return an error.
2486func (future *DatabasesCreateOrUpdateFuture) Result(client DatabasesClient) (d Database, err error) {
2487	var done bool
2488	done, err = future.Done(client)
2489	if err != nil {
2490		err = autorest.NewErrorWithError(err, "sql.DatabasesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
2491		return
2492	}
2493	if !done {
2494		err = azure.NewAsyncOpIncompleteError("sql.DatabasesCreateOrUpdateFuture")
2495		return
2496	}
2497	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2498	if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent {
2499		d, err = client.CreateOrUpdateResponder(d.Response.Response)
2500		if err != nil {
2501			err = autorest.NewErrorWithError(err, "sql.DatabasesCreateOrUpdateFuture", "Result", d.Response.Response, "Failure responding to request")
2502		}
2503	}
2504	return
2505}
2506
2507// DatabaseSecurityAlertPolicy contains information about a database Threat Detection policy.
2508type DatabaseSecurityAlertPolicy struct {
2509	autorest.Response `json:"-"`
2510	// Location - The geo-location where the resource lives
2511	Location *string `json:"location,omitempty"`
2512	// Kind - Resource kind.
2513	Kind *string `json:"kind,omitempty"`
2514	// DatabaseSecurityAlertPolicyProperties - Properties of the security alert policy.
2515	*DatabaseSecurityAlertPolicyProperties `json:"properties,omitempty"`
2516	// ID - Resource ID.
2517	ID *string `json:"id,omitempty"`
2518	// Name - Resource name.
2519	Name *string `json:"name,omitempty"`
2520	// Type - Resource type.
2521	Type *string `json:"type,omitempty"`
2522}
2523
2524// MarshalJSON is the custom marshaler for DatabaseSecurityAlertPolicy.
2525func (dsap DatabaseSecurityAlertPolicy) MarshalJSON() ([]byte, error) {
2526	objectMap := make(map[string]interface{})
2527	if dsap.Location != nil {
2528		objectMap["location"] = dsap.Location
2529	}
2530	if dsap.Kind != nil {
2531		objectMap["kind"] = dsap.Kind
2532	}
2533	if dsap.DatabaseSecurityAlertPolicyProperties != nil {
2534		objectMap["properties"] = dsap.DatabaseSecurityAlertPolicyProperties
2535	}
2536	if dsap.ID != nil {
2537		objectMap["id"] = dsap.ID
2538	}
2539	if dsap.Name != nil {
2540		objectMap["name"] = dsap.Name
2541	}
2542	if dsap.Type != nil {
2543		objectMap["type"] = dsap.Type
2544	}
2545	return json.Marshal(objectMap)
2546}
2547
2548// UnmarshalJSON is the custom unmarshaler for DatabaseSecurityAlertPolicy struct.
2549func (dsap *DatabaseSecurityAlertPolicy) UnmarshalJSON(body []byte) error {
2550	var m map[string]*json.RawMessage
2551	err := json.Unmarshal(body, &m)
2552	if err != nil {
2553		return err
2554	}
2555	for k, v := range m {
2556		switch k {
2557		case "location":
2558			if v != nil {
2559				var location string
2560				err = json.Unmarshal(*v, &location)
2561				if err != nil {
2562					return err
2563				}
2564				dsap.Location = &location
2565			}
2566		case "kind":
2567			if v != nil {
2568				var kind string
2569				err = json.Unmarshal(*v, &kind)
2570				if err != nil {
2571					return err
2572				}
2573				dsap.Kind = &kind
2574			}
2575		case "properties":
2576			if v != nil {
2577				var databaseSecurityAlertPolicyProperties DatabaseSecurityAlertPolicyProperties
2578				err = json.Unmarshal(*v, &databaseSecurityAlertPolicyProperties)
2579				if err != nil {
2580					return err
2581				}
2582				dsap.DatabaseSecurityAlertPolicyProperties = &databaseSecurityAlertPolicyProperties
2583			}
2584		case "id":
2585			if v != nil {
2586				var ID string
2587				err = json.Unmarshal(*v, &ID)
2588				if err != nil {
2589					return err
2590				}
2591				dsap.ID = &ID
2592			}
2593		case "name":
2594			if v != nil {
2595				var name string
2596				err = json.Unmarshal(*v, &name)
2597				if err != nil {
2598					return err
2599				}
2600				dsap.Name = &name
2601			}
2602		case "type":
2603			if v != nil {
2604				var typeVar string
2605				err = json.Unmarshal(*v, &typeVar)
2606				if err != nil {
2607					return err
2608				}
2609				dsap.Type = &typeVar
2610			}
2611		}
2612	}
2613
2614	return nil
2615}
2616
2617// DatabaseSecurityAlertPolicyProperties properties for a database Threat Detection policy.
2618type DatabaseSecurityAlertPolicyProperties struct {
2619	// State - Specifies the state of the policy. If state is Enabled, storageEndpoint and storageAccountAccessKey are required. Possible values include: 'SecurityAlertPolicyStateNew', 'SecurityAlertPolicyStateEnabled', 'SecurityAlertPolicyStateDisabled'
2620	State SecurityAlertPolicyState `json:"state,omitempty"`
2621	// DisabledAlerts - Specifies the semicolon-separated list of alerts that are disabled, or empty string to disable no alerts. Possible values: Sql_Injection; Sql_Injection_Vulnerability; Access_Anomaly; Data_Exfiltration; Unsafe_Action.
2622	DisabledAlerts *string `json:"disabledAlerts,omitempty"`
2623	// EmailAddresses - Specifies the semicolon-separated list of e-mail addresses to which the alert is sent.
2624	EmailAddresses *string `json:"emailAddresses,omitempty"`
2625	// EmailAccountAdmins - Specifies that the alert is sent to the account administrators. Possible values include: 'SecurityAlertPolicyEmailAccountAdminsEnabled', 'SecurityAlertPolicyEmailAccountAdminsDisabled'
2626	EmailAccountAdmins SecurityAlertPolicyEmailAccountAdmins `json:"emailAccountAdmins,omitempty"`
2627	// StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs. If state is Enabled, storageEndpoint is required.
2628	StorageEndpoint *string `json:"storageEndpoint,omitempty"`
2629	// StorageAccountAccessKey - Specifies the identifier key of the Threat Detection audit storage account. If state is Enabled, storageAccountAccessKey is required.
2630	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
2631	// RetentionDays - Specifies the number of days to keep in the Threat Detection audit logs.
2632	RetentionDays *int32 `json:"retentionDays,omitempty"`
2633	// UseServerDefault - Specifies whether to use the default server policy. Possible values include: 'SecurityAlertPolicyUseServerDefaultEnabled', 'SecurityAlertPolicyUseServerDefaultDisabled'
2634	UseServerDefault SecurityAlertPolicyUseServerDefault `json:"useServerDefault,omitempty"`
2635}
2636
2637// DatabasesExportFuture an abstraction for monitoring and retrieving the results of a long-running operation.
2638type DatabasesExportFuture struct {
2639	azure.Future
2640}
2641
2642// Result returns the result of the asynchronous operation.
2643// If the operation has not completed it will return an error.
2644func (future *DatabasesExportFuture) Result(client DatabasesClient) (ier ImportExportResponse, err error) {
2645	var done bool
2646	done, err = future.Done(client)
2647	if err != nil {
2648		err = autorest.NewErrorWithError(err, "sql.DatabasesExportFuture", "Result", future.Response(), "Polling failure")
2649		return
2650	}
2651	if !done {
2652		err = azure.NewAsyncOpIncompleteError("sql.DatabasesExportFuture")
2653		return
2654	}
2655	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2656	if ier.Response.Response, err = future.GetResult(sender); err == nil && ier.Response.Response.StatusCode != http.StatusNoContent {
2657		ier, err = client.ExportResponder(ier.Response.Response)
2658		if err != nil {
2659			err = autorest.NewErrorWithError(err, "sql.DatabasesExportFuture", "Result", ier.Response.Response, "Failure responding to request")
2660		}
2661	}
2662	return
2663}
2664
2665// DatabasesImportFuture an abstraction for monitoring and retrieving the results of a long-running operation.
2666type DatabasesImportFuture struct {
2667	azure.Future
2668}
2669
2670// Result returns the result of the asynchronous operation.
2671// If the operation has not completed it will return an error.
2672func (future *DatabasesImportFuture) Result(client DatabasesClient) (ier ImportExportResponse, err error) {
2673	var done bool
2674	done, err = future.Done(client)
2675	if err != nil {
2676		err = autorest.NewErrorWithError(err, "sql.DatabasesImportFuture", "Result", future.Response(), "Polling failure")
2677		return
2678	}
2679	if !done {
2680		err = azure.NewAsyncOpIncompleteError("sql.DatabasesImportFuture")
2681		return
2682	}
2683	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2684	if ier.Response.Response, err = future.GetResult(sender); err == nil && ier.Response.Response.StatusCode != http.StatusNoContent {
2685		ier, err = client.ImportResponder(ier.Response.Response)
2686		if err != nil {
2687			err = autorest.NewErrorWithError(err, "sql.DatabasesImportFuture", "Result", ier.Response.Response, "Failure responding to request")
2688		}
2689	}
2690	return
2691}
2692
2693// DatabasesPauseFuture an abstraction for monitoring and retrieving the results of a long-running operation.
2694type DatabasesPauseFuture struct {
2695	azure.Future
2696}
2697
2698// Result returns the result of the asynchronous operation.
2699// If the operation has not completed it will return an error.
2700func (future *DatabasesPauseFuture) Result(client DatabasesClient) (ar autorest.Response, err error) {
2701	var done bool
2702	done, err = future.Done(client)
2703	if err != nil {
2704		err = autorest.NewErrorWithError(err, "sql.DatabasesPauseFuture", "Result", future.Response(), "Polling failure")
2705		return
2706	}
2707	if !done {
2708		err = azure.NewAsyncOpIncompleteError("sql.DatabasesPauseFuture")
2709		return
2710	}
2711	ar.Response = future.Response()
2712	return
2713}
2714
2715// DatabasesResumeFuture an abstraction for monitoring and retrieving the results of a long-running operation.
2716type DatabasesResumeFuture struct {
2717	azure.Future
2718}
2719
2720// Result returns the result of the asynchronous operation.
2721// If the operation has not completed it will return an error.
2722func (future *DatabasesResumeFuture) Result(client DatabasesClient) (ar autorest.Response, err error) {
2723	var done bool
2724	done, err = future.Done(client)
2725	if err != nil {
2726		err = autorest.NewErrorWithError(err, "sql.DatabasesResumeFuture", "Result", future.Response(), "Polling failure")
2727		return
2728	}
2729	if !done {
2730		err = azure.NewAsyncOpIncompleteError("sql.DatabasesResumeFuture")
2731		return
2732	}
2733	ar.Response = future.Response()
2734	return
2735}
2736
2737// DatabasesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
2738type DatabasesUpdateFuture struct {
2739	azure.Future
2740}
2741
2742// Result returns the result of the asynchronous operation.
2743// If the operation has not completed it will return an error.
2744func (future *DatabasesUpdateFuture) Result(client DatabasesClient) (d Database, err error) {
2745	var done bool
2746	done, err = future.Done(client)
2747	if err != nil {
2748		err = autorest.NewErrorWithError(err, "sql.DatabasesUpdateFuture", "Result", future.Response(), "Polling failure")
2749		return
2750	}
2751	if !done {
2752		err = azure.NewAsyncOpIncompleteError("sql.DatabasesUpdateFuture")
2753		return
2754	}
2755	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2756	if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent {
2757		d, err = client.UpdateResponder(d.Response.Response)
2758		if err != nil {
2759			err = autorest.NewErrorWithError(err, "sql.DatabasesUpdateFuture", "Result", d.Response.Response, "Failure responding to request")
2760		}
2761	}
2762	return
2763}
2764
2765// DatabaseUpdate represents a database update.
2766type DatabaseUpdate struct {
2767	// Tags - Resource tags.
2768	Tags map[string]*string `json:"tags"`
2769	// DatabaseProperties - The properties representing the resource.
2770	*DatabaseProperties `json:"properties,omitempty"`
2771	// ID - Resource ID.
2772	ID *string `json:"id,omitempty"`
2773	// Name - Resource name.
2774	Name *string `json:"name,omitempty"`
2775	// Type - Resource type.
2776	Type *string `json:"type,omitempty"`
2777}
2778
2779// MarshalJSON is the custom marshaler for DatabaseUpdate.
2780func (du DatabaseUpdate) MarshalJSON() ([]byte, error) {
2781	objectMap := make(map[string]interface{})
2782	if du.Tags != nil {
2783		objectMap["tags"] = du.Tags
2784	}
2785	if du.DatabaseProperties != nil {
2786		objectMap["properties"] = du.DatabaseProperties
2787	}
2788	if du.ID != nil {
2789		objectMap["id"] = du.ID
2790	}
2791	if du.Name != nil {
2792		objectMap["name"] = du.Name
2793	}
2794	if du.Type != nil {
2795		objectMap["type"] = du.Type
2796	}
2797	return json.Marshal(objectMap)
2798}
2799
2800// UnmarshalJSON is the custom unmarshaler for DatabaseUpdate struct.
2801func (du *DatabaseUpdate) UnmarshalJSON(body []byte) error {
2802	var m map[string]*json.RawMessage
2803	err := json.Unmarshal(body, &m)
2804	if err != nil {
2805		return err
2806	}
2807	for k, v := range m {
2808		switch k {
2809		case "tags":
2810			if v != nil {
2811				var tags map[string]*string
2812				err = json.Unmarshal(*v, &tags)
2813				if err != nil {
2814					return err
2815				}
2816				du.Tags = tags
2817			}
2818		case "properties":
2819			if v != nil {
2820				var databaseProperties DatabaseProperties
2821				err = json.Unmarshal(*v, &databaseProperties)
2822				if err != nil {
2823					return err
2824				}
2825				du.DatabaseProperties = &databaseProperties
2826			}
2827		case "id":
2828			if v != nil {
2829				var ID string
2830				err = json.Unmarshal(*v, &ID)
2831				if err != nil {
2832					return err
2833				}
2834				du.ID = &ID
2835			}
2836		case "name":
2837			if v != nil {
2838				var name string
2839				err = json.Unmarshal(*v, &name)
2840				if err != nil {
2841					return err
2842				}
2843				du.Name = &name
2844			}
2845		case "type":
2846			if v != nil {
2847				var typeVar string
2848				err = json.Unmarshal(*v, &typeVar)
2849				if err != nil {
2850					return err
2851				}
2852				du.Type = &typeVar
2853			}
2854		}
2855	}
2856
2857	return nil
2858}
2859
2860// DatabaseUsage the database usages.
2861type DatabaseUsage struct {
2862	// Name - The name of the usage metric.
2863	Name *string `json:"name,omitempty"`
2864	// ResourceName - The name of the resource.
2865	ResourceName *string `json:"resourceName,omitempty"`
2866	// DisplayName - The usage metric display name.
2867	DisplayName *string `json:"displayName,omitempty"`
2868	// CurrentValue - The current value of the usage metric.
2869	CurrentValue *float64 `json:"currentValue,omitempty"`
2870	// Limit - The current limit of the usage metric.
2871	Limit *float64 `json:"limit,omitempty"`
2872	// Unit - The units of the usage metric.
2873	Unit *string `json:"unit,omitempty"`
2874	// NextResetTime - The next reset time for the usage metric (ISO8601 format).
2875	NextResetTime *date.Time `json:"nextResetTime,omitempty"`
2876}
2877
2878// DatabaseUsageListResult the response to a list database metrics request.
2879type DatabaseUsageListResult struct {
2880	autorest.Response `json:"-"`
2881	// Value - The list of database usages for the database.
2882	Value *[]DatabaseUsage `json:"value,omitempty"`
2883}
2884
2885// DatabaseVulnerabilityAssessment a database vulnerability assessment.
2886type DatabaseVulnerabilityAssessment struct {
2887	autorest.Response `json:"-"`
2888	// DatabaseVulnerabilityAssessmentProperties - Resource properties.
2889	*DatabaseVulnerabilityAssessmentProperties `json:"properties,omitempty"`
2890	// ID - Resource ID.
2891	ID *string `json:"id,omitempty"`
2892	// Name - Resource name.
2893	Name *string `json:"name,omitempty"`
2894	// Type - Resource type.
2895	Type *string `json:"type,omitempty"`
2896}
2897
2898// MarshalJSON is the custom marshaler for DatabaseVulnerabilityAssessment.
2899func (dva DatabaseVulnerabilityAssessment) MarshalJSON() ([]byte, error) {
2900	objectMap := make(map[string]interface{})
2901	if dva.DatabaseVulnerabilityAssessmentProperties != nil {
2902		objectMap["properties"] = dva.DatabaseVulnerabilityAssessmentProperties
2903	}
2904	if dva.ID != nil {
2905		objectMap["id"] = dva.ID
2906	}
2907	if dva.Name != nil {
2908		objectMap["name"] = dva.Name
2909	}
2910	if dva.Type != nil {
2911		objectMap["type"] = dva.Type
2912	}
2913	return json.Marshal(objectMap)
2914}
2915
2916// UnmarshalJSON is the custom unmarshaler for DatabaseVulnerabilityAssessment struct.
2917func (dva *DatabaseVulnerabilityAssessment) UnmarshalJSON(body []byte) error {
2918	var m map[string]*json.RawMessage
2919	err := json.Unmarshal(body, &m)
2920	if err != nil {
2921		return err
2922	}
2923	for k, v := range m {
2924		switch k {
2925		case "properties":
2926			if v != nil {
2927				var databaseVulnerabilityAssessmentProperties DatabaseVulnerabilityAssessmentProperties
2928				err = json.Unmarshal(*v, &databaseVulnerabilityAssessmentProperties)
2929				if err != nil {
2930					return err
2931				}
2932				dva.DatabaseVulnerabilityAssessmentProperties = &databaseVulnerabilityAssessmentProperties
2933			}
2934		case "id":
2935			if v != nil {
2936				var ID string
2937				err = json.Unmarshal(*v, &ID)
2938				if err != nil {
2939					return err
2940				}
2941				dva.ID = &ID
2942			}
2943		case "name":
2944			if v != nil {
2945				var name string
2946				err = json.Unmarshal(*v, &name)
2947				if err != nil {
2948					return err
2949				}
2950				dva.Name = &name
2951			}
2952		case "type":
2953			if v != nil {
2954				var typeVar string
2955				err = json.Unmarshal(*v, &typeVar)
2956				if err != nil {
2957					return err
2958				}
2959				dva.Type = &typeVar
2960			}
2961		}
2962	}
2963
2964	return nil
2965}
2966
2967// DatabaseVulnerabilityAssessmentProperties properties of a database Vulnerability Assessment.
2968type DatabaseVulnerabilityAssessmentProperties struct {
2969	// StorageContainerPath - A blob storage container path to hold the scan results (e.g. https://myStorage.blob.core.windows.net/VaScans/).
2970	StorageContainerPath *string `json:"storageContainerPath,omitempty"`
2971	// StorageContainerSasKey - A shared access signature (SAS Key) that has write access to the blob container specified in 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't specified, StorageContainerSasKey is required.
2972	StorageContainerSasKey *string `json:"storageContainerSasKey,omitempty"`
2973	// StorageAccountAccessKey - Specifies the identifier key of the vulnerability assessment storage account. If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is required.
2974	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
2975	// RecurringScans - The recurring scans settings
2976	RecurringScans *VulnerabilityAssessmentRecurringScansProperties `json:"recurringScans,omitempty"`
2977}
2978
2979// DatabaseVulnerabilityAssessmentRuleBaseline a database vulnerability assessment rule baseline.
2980type DatabaseVulnerabilityAssessmentRuleBaseline struct {
2981	autorest.Response `json:"-"`
2982	// DatabaseVulnerabilityAssessmentRuleBaselineProperties - Resource properties.
2983	*DatabaseVulnerabilityAssessmentRuleBaselineProperties `json:"properties,omitempty"`
2984	// ID - Resource ID.
2985	ID *string `json:"id,omitempty"`
2986	// Name - Resource name.
2987	Name *string `json:"name,omitempty"`
2988	// Type - Resource type.
2989	Type *string `json:"type,omitempty"`
2990}
2991
2992// MarshalJSON is the custom marshaler for DatabaseVulnerabilityAssessmentRuleBaseline.
2993func (dvarb DatabaseVulnerabilityAssessmentRuleBaseline) MarshalJSON() ([]byte, error) {
2994	objectMap := make(map[string]interface{})
2995	if dvarb.DatabaseVulnerabilityAssessmentRuleBaselineProperties != nil {
2996		objectMap["properties"] = dvarb.DatabaseVulnerabilityAssessmentRuleBaselineProperties
2997	}
2998	if dvarb.ID != nil {
2999		objectMap["id"] = dvarb.ID
3000	}
3001	if dvarb.Name != nil {
3002		objectMap["name"] = dvarb.Name
3003	}
3004	if dvarb.Type != nil {
3005		objectMap["type"] = dvarb.Type
3006	}
3007	return json.Marshal(objectMap)
3008}
3009
3010// UnmarshalJSON is the custom unmarshaler for DatabaseVulnerabilityAssessmentRuleBaseline struct.
3011func (dvarb *DatabaseVulnerabilityAssessmentRuleBaseline) UnmarshalJSON(body []byte) error {
3012	var m map[string]*json.RawMessage
3013	err := json.Unmarshal(body, &m)
3014	if err != nil {
3015		return err
3016	}
3017	for k, v := range m {
3018		switch k {
3019		case "properties":
3020			if v != nil {
3021				var databaseVulnerabilityAssessmentRuleBaselineProperties DatabaseVulnerabilityAssessmentRuleBaselineProperties
3022				err = json.Unmarshal(*v, &databaseVulnerabilityAssessmentRuleBaselineProperties)
3023				if err != nil {
3024					return err
3025				}
3026				dvarb.DatabaseVulnerabilityAssessmentRuleBaselineProperties = &databaseVulnerabilityAssessmentRuleBaselineProperties
3027			}
3028		case "id":
3029			if v != nil {
3030				var ID string
3031				err = json.Unmarshal(*v, &ID)
3032				if err != nil {
3033					return err
3034				}
3035				dvarb.ID = &ID
3036			}
3037		case "name":
3038			if v != nil {
3039				var name string
3040				err = json.Unmarshal(*v, &name)
3041				if err != nil {
3042					return err
3043				}
3044				dvarb.Name = &name
3045			}
3046		case "type":
3047			if v != nil {
3048				var typeVar string
3049				err = json.Unmarshal(*v, &typeVar)
3050				if err != nil {
3051					return err
3052				}
3053				dvarb.Type = &typeVar
3054			}
3055		}
3056	}
3057
3058	return nil
3059}
3060
3061// DatabaseVulnerabilityAssessmentRuleBaselineItem properties for an Azure SQL Database Vulnerability Assessment
3062// rule baseline's result.
3063type DatabaseVulnerabilityAssessmentRuleBaselineItem struct {
3064	// Result - The rule baseline result
3065	Result *[]string `json:"result,omitempty"`
3066}
3067
3068// DatabaseVulnerabilityAssessmentRuleBaselineProperties properties of a database Vulnerability Assessment rule
3069// baseline.
3070type DatabaseVulnerabilityAssessmentRuleBaselineProperties struct {
3071	// BaselineResults - The rule baseline result
3072	BaselineResults *[]DatabaseVulnerabilityAssessmentRuleBaselineItem `json:"baselineResults,omitempty"`
3073}
3074
3075// DataMaskingPolicy represents a database data masking policy.
3076type DataMaskingPolicy struct {
3077	autorest.Response `json:"-"`
3078	// DataMaskingPolicyProperties - The properties of the data masking policy.
3079	*DataMaskingPolicyProperties `json:"properties,omitempty"`
3080	// Location - The location of the data masking policy.
3081	Location *string `json:"location,omitempty"`
3082	// Kind - The kind of data masking policy. Metadata, used for Azure portal.
3083	Kind *string `json:"kind,omitempty"`
3084	// ID - Resource ID.
3085	ID *string `json:"id,omitempty"`
3086	// Name - Resource name.
3087	Name *string `json:"name,omitempty"`
3088	// Type - Resource type.
3089	Type *string `json:"type,omitempty"`
3090}
3091
3092// MarshalJSON is the custom marshaler for DataMaskingPolicy.
3093func (dmp DataMaskingPolicy) MarshalJSON() ([]byte, error) {
3094	objectMap := make(map[string]interface{})
3095	if dmp.DataMaskingPolicyProperties != nil {
3096		objectMap["properties"] = dmp.DataMaskingPolicyProperties
3097	}
3098	if dmp.Location != nil {
3099		objectMap["location"] = dmp.Location
3100	}
3101	if dmp.Kind != nil {
3102		objectMap["kind"] = dmp.Kind
3103	}
3104	if dmp.ID != nil {
3105		objectMap["id"] = dmp.ID
3106	}
3107	if dmp.Name != nil {
3108		objectMap["name"] = dmp.Name
3109	}
3110	if dmp.Type != nil {
3111		objectMap["type"] = dmp.Type
3112	}
3113	return json.Marshal(objectMap)
3114}
3115
3116// UnmarshalJSON is the custom unmarshaler for DataMaskingPolicy struct.
3117func (dmp *DataMaskingPolicy) UnmarshalJSON(body []byte) error {
3118	var m map[string]*json.RawMessage
3119	err := json.Unmarshal(body, &m)
3120	if err != nil {
3121		return err
3122	}
3123	for k, v := range m {
3124		switch k {
3125		case "properties":
3126			if v != nil {
3127				var dataMaskingPolicyProperties DataMaskingPolicyProperties
3128				err = json.Unmarshal(*v, &dataMaskingPolicyProperties)
3129				if err != nil {
3130					return err
3131				}
3132				dmp.DataMaskingPolicyProperties = &dataMaskingPolicyProperties
3133			}
3134		case "location":
3135			if v != nil {
3136				var location string
3137				err = json.Unmarshal(*v, &location)
3138				if err != nil {
3139					return err
3140				}
3141				dmp.Location = &location
3142			}
3143		case "kind":
3144			if v != nil {
3145				var kind string
3146				err = json.Unmarshal(*v, &kind)
3147				if err != nil {
3148					return err
3149				}
3150				dmp.Kind = &kind
3151			}
3152		case "id":
3153			if v != nil {
3154				var ID string
3155				err = json.Unmarshal(*v, &ID)
3156				if err != nil {
3157					return err
3158				}
3159				dmp.ID = &ID
3160			}
3161		case "name":
3162			if v != nil {
3163				var name string
3164				err = json.Unmarshal(*v, &name)
3165				if err != nil {
3166					return err
3167				}
3168				dmp.Name = &name
3169			}
3170		case "type":
3171			if v != nil {
3172				var typeVar string
3173				err = json.Unmarshal(*v, &typeVar)
3174				if err != nil {
3175					return err
3176				}
3177				dmp.Type = &typeVar
3178			}
3179		}
3180	}
3181
3182	return nil
3183}
3184
3185// DataMaskingPolicyProperties the properties of a database data masking policy.
3186type DataMaskingPolicyProperties struct {
3187	// DataMaskingState - The state of the data masking policy. Possible values include: 'DataMaskingStateDisabled', 'DataMaskingStateEnabled'
3188	DataMaskingState DataMaskingState `json:"dataMaskingState,omitempty"`
3189	// ExemptPrincipals - The list of the exempt principals. Specifies the semicolon-separated list of database users for which the data masking policy does not apply. The specified users receive data results without masking for all of the database queries.
3190	ExemptPrincipals *string `json:"exemptPrincipals,omitempty"`
3191	// ApplicationPrincipals - The list of the application principals. This is a legacy parameter and is no longer used.
3192	ApplicationPrincipals *string `json:"applicationPrincipals,omitempty"`
3193	// MaskingLevel - The masking level. This is a legacy parameter and is no longer used.
3194	MaskingLevel *string `json:"maskingLevel,omitempty"`
3195}
3196
3197// DataMaskingRule represents a database data masking rule.
3198type DataMaskingRule struct {
3199	autorest.Response `json:"-"`
3200	// DataMaskingRuleProperties - The properties of the resource.
3201	*DataMaskingRuleProperties `json:"properties,omitempty"`
3202	// Location - The location of the data masking rule.
3203	Location *string `json:"location,omitempty"`
3204	// Kind - The kind of Data Masking Rule. Metadata, used for Azure portal.
3205	Kind *string `json:"kind,omitempty"`
3206	// ID - Resource ID.
3207	ID *string `json:"id,omitempty"`
3208	// Name - Resource name.
3209	Name *string `json:"name,omitempty"`
3210	// Type - Resource type.
3211	Type *string `json:"type,omitempty"`
3212}
3213
3214// MarshalJSON is the custom marshaler for DataMaskingRule.
3215func (dmr DataMaskingRule) MarshalJSON() ([]byte, error) {
3216	objectMap := make(map[string]interface{})
3217	if dmr.DataMaskingRuleProperties != nil {
3218		objectMap["properties"] = dmr.DataMaskingRuleProperties
3219	}
3220	if dmr.Location != nil {
3221		objectMap["location"] = dmr.Location
3222	}
3223	if dmr.Kind != nil {
3224		objectMap["kind"] = dmr.Kind
3225	}
3226	if dmr.ID != nil {
3227		objectMap["id"] = dmr.ID
3228	}
3229	if dmr.Name != nil {
3230		objectMap["name"] = dmr.Name
3231	}
3232	if dmr.Type != nil {
3233		objectMap["type"] = dmr.Type
3234	}
3235	return json.Marshal(objectMap)
3236}
3237
3238// UnmarshalJSON is the custom unmarshaler for DataMaskingRule struct.
3239func (dmr *DataMaskingRule) UnmarshalJSON(body []byte) error {
3240	var m map[string]*json.RawMessage
3241	err := json.Unmarshal(body, &m)
3242	if err != nil {
3243		return err
3244	}
3245	for k, v := range m {
3246		switch k {
3247		case "properties":
3248			if v != nil {
3249				var dataMaskingRuleProperties DataMaskingRuleProperties
3250				err = json.Unmarshal(*v, &dataMaskingRuleProperties)
3251				if err != nil {
3252					return err
3253				}
3254				dmr.DataMaskingRuleProperties = &dataMaskingRuleProperties
3255			}
3256		case "location":
3257			if v != nil {
3258				var location string
3259				err = json.Unmarshal(*v, &location)
3260				if err != nil {
3261					return err
3262				}
3263				dmr.Location = &location
3264			}
3265		case "kind":
3266			if v != nil {
3267				var kind string
3268				err = json.Unmarshal(*v, &kind)
3269				if err != nil {
3270					return err
3271				}
3272				dmr.Kind = &kind
3273			}
3274		case "id":
3275			if v != nil {
3276				var ID string
3277				err = json.Unmarshal(*v, &ID)
3278				if err != nil {
3279					return err
3280				}
3281				dmr.ID = &ID
3282			}
3283		case "name":
3284			if v != nil {
3285				var name string
3286				err = json.Unmarshal(*v, &name)
3287				if err != nil {
3288					return err
3289				}
3290				dmr.Name = &name
3291			}
3292		case "type":
3293			if v != nil {
3294				var typeVar string
3295				err = json.Unmarshal(*v, &typeVar)
3296				if err != nil {
3297					return err
3298				}
3299				dmr.Type = &typeVar
3300			}
3301		}
3302	}
3303
3304	return nil
3305}
3306
3307// DataMaskingRuleListResult the response to a list data masking rules request.
3308type DataMaskingRuleListResult struct {
3309	autorest.Response `json:"-"`
3310	// Value - The list of database data masking rules.
3311	Value *[]DataMaskingRule `json:"value,omitempty"`
3312}
3313
3314// DataMaskingRuleProperties the properties of a database data masking rule.
3315type DataMaskingRuleProperties struct {
3316	// ID - The rule Id.
3317	ID *string `json:"id,omitempty"`
3318	// AliasName - The alias name. This is a legacy parameter and is no longer used.
3319	AliasName *string `json:"aliasName,omitempty"`
3320	// RuleState - The rule state. Used to delete a rule. To delete an existing rule, specify the schemaName, tableName, columnName, maskingFunction, and specify ruleState as disabled. However, if the rule doesn't already exist, the rule will be created with ruleState set to enabled, regardless of the provided value of ruleState. Possible values include: 'DataMaskingRuleStateDisabled', 'DataMaskingRuleStateEnabled'
3321	RuleState DataMaskingRuleState `json:"ruleState,omitempty"`
3322	// SchemaName - The schema name on which the data masking rule is applied.
3323	SchemaName *string `json:"schemaName,omitempty"`
3324	// TableName - The table name on which the data masking rule is applied.
3325	TableName *string `json:"tableName,omitempty"`
3326	// ColumnName - The column name on which the data masking rule is applied.
3327	ColumnName *string `json:"columnName,omitempty"`
3328	// MaskingFunction - The masking function that is used for the data masking rule. Possible values include: 'DataMaskingFunctionDefault', 'DataMaskingFunctionCCN', 'DataMaskingFunctionEmail', 'DataMaskingFunctionNumber', 'DataMaskingFunctionSSN', 'DataMaskingFunctionText'
3329	MaskingFunction DataMaskingFunction `json:"maskingFunction,omitempty"`
3330	// NumberFrom - The numberFrom property of the masking rule. Required if maskingFunction is set to Number, otherwise this parameter will be ignored.
3331	NumberFrom *string `json:"numberFrom,omitempty"`
3332	// NumberTo - The numberTo property of the data masking rule. Required if maskingFunction is set to Number, otherwise this parameter will be ignored.
3333	NumberTo *string `json:"numberTo,omitempty"`
3334	// PrefixSize - If maskingFunction is set to Text, the number of characters to show unmasked in the beginning of the string. Otherwise, this parameter will be ignored.
3335	PrefixSize *string `json:"prefixSize,omitempty"`
3336	// SuffixSize - If maskingFunction is set to Text, the number of characters to show unmasked at the end of the string. Otherwise, this parameter will be ignored.
3337	SuffixSize *string `json:"suffixSize,omitempty"`
3338	// ReplacementString - If maskingFunction is set to Text, the character to use for masking the unexposed part of the string. Otherwise, this parameter will be ignored.
3339	ReplacementString *string `json:"replacementString,omitempty"`
3340}
3341
3342// DataWarehouseUserActivities user activities of a data warehouse
3343type DataWarehouseUserActivities struct {
3344	autorest.Response `json:"-"`
3345	// DataWarehouseUserActivitiesProperties - Resource properties.
3346	*DataWarehouseUserActivitiesProperties `json:"properties,omitempty"`
3347	// ID - Resource ID.
3348	ID *string `json:"id,omitempty"`
3349	// Name - Resource name.
3350	Name *string `json:"name,omitempty"`
3351	// Type - Resource type.
3352	Type *string `json:"type,omitempty"`
3353}
3354
3355// MarshalJSON is the custom marshaler for DataWarehouseUserActivities.
3356func (dwua DataWarehouseUserActivities) MarshalJSON() ([]byte, error) {
3357	objectMap := make(map[string]interface{})
3358	if dwua.DataWarehouseUserActivitiesProperties != nil {
3359		objectMap["properties"] = dwua.DataWarehouseUserActivitiesProperties
3360	}
3361	if dwua.ID != nil {
3362		objectMap["id"] = dwua.ID
3363	}
3364	if dwua.Name != nil {
3365		objectMap["name"] = dwua.Name
3366	}
3367	if dwua.Type != nil {
3368		objectMap["type"] = dwua.Type
3369	}
3370	return json.Marshal(objectMap)
3371}
3372
3373// UnmarshalJSON is the custom unmarshaler for DataWarehouseUserActivities struct.
3374func (dwua *DataWarehouseUserActivities) UnmarshalJSON(body []byte) error {
3375	var m map[string]*json.RawMessage
3376	err := json.Unmarshal(body, &m)
3377	if err != nil {
3378		return err
3379	}
3380	for k, v := range m {
3381		switch k {
3382		case "properties":
3383			if v != nil {
3384				var dataWarehouseUserActivitiesProperties DataWarehouseUserActivitiesProperties
3385				err = json.Unmarshal(*v, &dataWarehouseUserActivitiesProperties)
3386				if err != nil {
3387					return err
3388				}
3389				dwua.DataWarehouseUserActivitiesProperties = &dataWarehouseUserActivitiesProperties
3390			}
3391		case "id":
3392			if v != nil {
3393				var ID string
3394				err = json.Unmarshal(*v, &ID)
3395				if err != nil {
3396					return err
3397				}
3398				dwua.ID = &ID
3399			}
3400		case "name":
3401			if v != nil {
3402				var name string
3403				err = json.Unmarshal(*v, &name)
3404				if err != nil {
3405					return err
3406				}
3407				dwua.Name = &name
3408			}
3409		case "type":
3410			if v != nil {
3411				var typeVar string
3412				err = json.Unmarshal(*v, &typeVar)
3413				if err != nil {
3414					return err
3415				}
3416				dwua.Type = &typeVar
3417			}
3418		}
3419	}
3420
3421	return nil
3422}
3423
3424// DataWarehouseUserActivitiesProperties user activities of a data warehouse. This currently includes the count of
3425// running or suspended queries. For more information, please view the sys.dm_pdw_exec_requests dynamic management
3426// view (DMV).
3427type DataWarehouseUserActivitiesProperties struct {
3428	// ActiveQueriesCount - Count of running and suspended queries.
3429	ActiveQueriesCount *int32 `json:"activeQueriesCount,omitempty"`
3430}
3431
3432// EditionCapability the database edition capabilities.
3433type EditionCapability struct {
3434	// Name - The edition name.
3435	Name *string `json:"name,omitempty"`
3436	// Status - The status of the edition. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
3437	Status CapabilityStatus `json:"status,omitempty"`
3438	// SupportedServiceLevelObjectives - The list of supported service objectives for the edition.
3439	SupportedServiceLevelObjectives *[]ServiceObjectiveCapability `json:"supportedServiceLevelObjectives,omitempty"`
3440	// ZoneRedundant - Whether or not zone redundancy is supported for the edition.
3441	ZoneRedundant *bool `json:"zoneRedundant,omitempty"`
3442}
3443
3444// ElasticPool represents a database elastic pool.
3445type ElasticPool struct {
3446	autorest.Response `json:"-"`
3447	// ElasticPoolProperties - The properties representing the resource.
3448	*ElasticPoolProperties `json:"properties,omitempty"`
3449	// Kind - Kind of elastic pool.  This is metadata used for the Azure portal experience.
3450	Kind *string `json:"kind,omitempty"`
3451	// Location - Resource location.
3452	Location *string `json:"location,omitempty"`
3453	// Tags - Resource tags.
3454	Tags map[string]*string `json:"tags"`
3455	// ID - Resource ID.
3456	ID *string `json:"id,omitempty"`
3457	// Name - Resource name.
3458	Name *string `json:"name,omitempty"`
3459	// Type - Resource type.
3460	Type *string `json:"type,omitempty"`
3461}
3462
3463// MarshalJSON is the custom marshaler for ElasticPool.
3464func (ep ElasticPool) MarshalJSON() ([]byte, error) {
3465	objectMap := make(map[string]interface{})
3466	if ep.ElasticPoolProperties != nil {
3467		objectMap["properties"] = ep.ElasticPoolProperties
3468	}
3469	if ep.Kind != nil {
3470		objectMap["kind"] = ep.Kind
3471	}
3472	if ep.Location != nil {
3473		objectMap["location"] = ep.Location
3474	}
3475	if ep.Tags != nil {
3476		objectMap["tags"] = ep.Tags
3477	}
3478	if ep.ID != nil {
3479		objectMap["id"] = ep.ID
3480	}
3481	if ep.Name != nil {
3482		objectMap["name"] = ep.Name
3483	}
3484	if ep.Type != nil {
3485		objectMap["type"] = ep.Type
3486	}
3487	return json.Marshal(objectMap)
3488}
3489
3490// UnmarshalJSON is the custom unmarshaler for ElasticPool struct.
3491func (ep *ElasticPool) UnmarshalJSON(body []byte) error {
3492	var m map[string]*json.RawMessage
3493	err := json.Unmarshal(body, &m)
3494	if err != nil {
3495		return err
3496	}
3497	for k, v := range m {
3498		switch k {
3499		case "properties":
3500			if v != nil {
3501				var elasticPoolProperties ElasticPoolProperties
3502				err = json.Unmarshal(*v, &elasticPoolProperties)
3503				if err != nil {
3504					return err
3505				}
3506				ep.ElasticPoolProperties = &elasticPoolProperties
3507			}
3508		case "kind":
3509			if v != nil {
3510				var kind string
3511				err = json.Unmarshal(*v, &kind)
3512				if err != nil {
3513					return err
3514				}
3515				ep.Kind = &kind
3516			}
3517		case "location":
3518			if v != nil {
3519				var location string
3520				err = json.Unmarshal(*v, &location)
3521				if err != nil {
3522					return err
3523				}
3524				ep.Location = &location
3525			}
3526		case "tags":
3527			if v != nil {
3528				var tags map[string]*string
3529				err = json.Unmarshal(*v, &tags)
3530				if err != nil {
3531					return err
3532				}
3533				ep.Tags = tags
3534			}
3535		case "id":
3536			if v != nil {
3537				var ID string
3538				err = json.Unmarshal(*v, &ID)
3539				if err != nil {
3540					return err
3541				}
3542				ep.ID = &ID
3543			}
3544		case "name":
3545			if v != nil {
3546				var name string
3547				err = json.Unmarshal(*v, &name)
3548				if err != nil {
3549					return err
3550				}
3551				ep.Name = &name
3552			}
3553		case "type":
3554			if v != nil {
3555				var typeVar string
3556				err = json.Unmarshal(*v, &typeVar)
3557				if err != nil {
3558					return err
3559				}
3560				ep.Type = &typeVar
3561			}
3562		}
3563	}
3564
3565	return nil
3566}
3567
3568// ElasticPoolActivity represents the activity on an elastic pool.
3569type ElasticPoolActivity struct {
3570	// Location - The geo-location where the resource lives
3571	Location *string `json:"location,omitempty"`
3572	// ElasticPoolActivityProperties - The properties representing the resource.
3573	*ElasticPoolActivityProperties `json:"properties,omitempty"`
3574	// ID - Resource ID.
3575	ID *string `json:"id,omitempty"`
3576	// Name - Resource name.
3577	Name *string `json:"name,omitempty"`
3578	// Type - Resource type.
3579	Type *string `json:"type,omitempty"`
3580}
3581
3582// MarshalJSON is the custom marshaler for ElasticPoolActivity.
3583func (epa ElasticPoolActivity) MarshalJSON() ([]byte, error) {
3584	objectMap := make(map[string]interface{})
3585	if epa.Location != nil {
3586		objectMap["location"] = epa.Location
3587	}
3588	if epa.ElasticPoolActivityProperties != nil {
3589		objectMap["properties"] = epa.ElasticPoolActivityProperties
3590	}
3591	if epa.ID != nil {
3592		objectMap["id"] = epa.ID
3593	}
3594	if epa.Name != nil {
3595		objectMap["name"] = epa.Name
3596	}
3597	if epa.Type != nil {
3598		objectMap["type"] = epa.Type
3599	}
3600	return json.Marshal(objectMap)
3601}
3602
3603// UnmarshalJSON is the custom unmarshaler for ElasticPoolActivity struct.
3604func (epa *ElasticPoolActivity) UnmarshalJSON(body []byte) error {
3605	var m map[string]*json.RawMessage
3606	err := json.Unmarshal(body, &m)
3607	if err != nil {
3608		return err
3609	}
3610	for k, v := range m {
3611		switch k {
3612		case "location":
3613			if v != nil {
3614				var location string
3615				err = json.Unmarshal(*v, &location)
3616				if err != nil {
3617					return err
3618				}
3619				epa.Location = &location
3620			}
3621		case "properties":
3622			if v != nil {
3623				var elasticPoolActivityProperties ElasticPoolActivityProperties
3624				err = json.Unmarshal(*v, &elasticPoolActivityProperties)
3625				if err != nil {
3626					return err
3627				}
3628				epa.ElasticPoolActivityProperties = &elasticPoolActivityProperties
3629			}
3630		case "id":
3631			if v != nil {
3632				var ID string
3633				err = json.Unmarshal(*v, &ID)
3634				if err != nil {
3635					return err
3636				}
3637				epa.ID = &ID
3638			}
3639		case "name":
3640			if v != nil {
3641				var name string
3642				err = json.Unmarshal(*v, &name)
3643				if err != nil {
3644					return err
3645				}
3646				epa.Name = &name
3647			}
3648		case "type":
3649			if v != nil {
3650				var typeVar string
3651				err = json.Unmarshal(*v, &typeVar)
3652				if err != nil {
3653					return err
3654				}
3655				epa.Type = &typeVar
3656			}
3657		}
3658	}
3659
3660	return nil
3661}
3662
3663// ElasticPoolActivityListResult represents the response to a list elastic pool activity request.
3664type ElasticPoolActivityListResult struct {
3665	autorest.Response `json:"-"`
3666	// Value - The list of elastic pool activities.
3667	Value *[]ElasticPoolActivity `json:"value,omitempty"`
3668}
3669
3670// ElasticPoolActivityProperties represents the properties of an elastic pool.
3671type ElasticPoolActivityProperties struct {
3672	// EndTime - The time the operation finished (ISO8601 format).
3673	EndTime *date.Time `json:"endTime,omitempty"`
3674	// ErrorCode - The error code if available.
3675	ErrorCode *int32 `json:"errorCode,omitempty"`
3676	// ErrorMessage - The error message if available.
3677	ErrorMessage *string `json:"errorMessage,omitempty"`
3678	// ErrorSeverity - The error severity if available.
3679	ErrorSeverity *int32 `json:"errorSeverity,omitempty"`
3680	// Operation - The operation name.
3681	Operation *string `json:"operation,omitempty"`
3682	// OperationID - The unique operation ID.
3683	OperationID *uuid.UUID `json:"operationId,omitempty"`
3684	// PercentComplete - The percentage complete if available.
3685	PercentComplete *int32 `json:"percentComplete,omitempty"`
3686	// RequestedDatabaseDtuMax - The requested max DTU per database if available.
3687	RequestedDatabaseDtuMax *int32 `json:"requestedDatabaseDtuMax,omitempty"`
3688	// RequestedDatabaseDtuMin - The requested min DTU per database if available.
3689	RequestedDatabaseDtuMin *int32 `json:"requestedDatabaseDtuMin,omitempty"`
3690	// RequestedDtu - The requested DTU for the pool if available.
3691	RequestedDtu *int32 `json:"requestedDtu,omitempty"`
3692	// RequestedElasticPoolName - The requested name for the elastic pool if available.
3693	RequestedElasticPoolName *string `json:"requestedElasticPoolName,omitempty"`
3694	// RequestedStorageLimitInGB - The requested storage limit for the pool in GB if available.
3695	RequestedStorageLimitInGB *int64 `json:"requestedStorageLimitInGB,omitempty"`
3696	// ElasticPoolName - The name of the elastic pool.
3697	ElasticPoolName *string `json:"elasticPoolName,omitempty"`
3698	// ServerName - The name of the server the elastic pool is in.
3699	ServerName *string `json:"serverName,omitempty"`
3700	// StartTime - The time the operation started (ISO8601 format).
3701	StartTime *date.Time `json:"startTime,omitempty"`
3702	// State - The current state of the operation.
3703	State *string `json:"state,omitempty"`
3704	// RequestedStorageLimitInMB - The requested storage limit in MB.
3705	RequestedStorageLimitInMB *int32 `json:"requestedStorageLimitInMB,omitempty"`
3706	// RequestedDatabaseDtuGuarantee - The requested per database DTU guarantee.
3707	RequestedDatabaseDtuGuarantee *int32 `json:"requestedDatabaseDtuGuarantee,omitempty"`
3708	// RequestedDatabaseDtuCap - The requested per database DTU cap.
3709	RequestedDatabaseDtuCap *int32 `json:"requestedDatabaseDtuCap,omitempty"`
3710	// RequestedDtuGuarantee - The requested DTU guarantee.
3711	RequestedDtuGuarantee *int32 `json:"requestedDtuGuarantee,omitempty"`
3712}
3713
3714// ElasticPoolDatabaseActivity represents the activity on an elastic pool.
3715type ElasticPoolDatabaseActivity struct {
3716	// Location - The geo-location where the resource lives
3717	Location *string `json:"location,omitempty"`
3718	// ElasticPoolDatabaseActivityProperties - The properties representing the resource.
3719	*ElasticPoolDatabaseActivityProperties `json:"properties,omitempty"`
3720	// ID - Resource ID.
3721	ID *string `json:"id,omitempty"`
3722	// Name - Resource name.
3723	Name *string `json:"name,omitempty"`
3724	// Type - Resource type.
3725	Type *string `json:"type,omitempty"`
3726}
3727
3728// MarshalJSON is the custom marshaler for ElasticPoolDatabaseActivity.
3729func (epda ElasticPoolDatabaseActivity) MarshalJSON() ([]byte, error) {
3730	objectMap := make(map[string]interface{})
3731	if epda.Location != nil {
3732		objectMap["location"] = epda.Location
3733	}
3734	if epda.ElasticPoolDatabaseActivityProperties != nil {
3735		objectMap["properties"] = epda.ElasticPoolDatabaseActivityProperties
3736	}
3737	if epda.ID != nil {
3738		objectMap["id"] = epda.ID
3739	}
3740	if epda.Name != nil {
3741		objectMap["name"] = epda.Name
3742	}
3743	if epda.Type != nil {
3744		objectMap["type"] = epda.Type
3745	}
3746	return json.Marshal(objectMap)
3747}
3748
3749// UnmarshalJSON is the custom unmarshaler for ElasticPoolDatabaseActivity struct.
3750func (epda *ElasticPoolDatabaseActivity) UnmarshalJSON(body []byte) error {
3751	var m map[string]*json.RawMessage
3752	err := json.Unmarshal(body, &m)
3753	if err != nil {
3754		return err
3755	}
3756	for k, v := range m {
3757		switch k {
3758		case "location":
3759			if v != nil {
3760				var location string
3761				err = json.Unmarshal(*v, &location)
3762				if err != nil {
3763					return err
3764				}
3765				epda.Location = &location
3766			}
3767		case "properties":
3768			if v != nil {
3769				var elasticPoolDatabaseActivityProperties ElasticPoolDatabaseActivityProperties
3770				err = json.Unmarshal(*v, &elasticPoolDatabaseActivityProperties)
3771				if err != nil {
3772					return err
3773				}
3774				epda.ElasticPoolDatabaseActivityProperties = &elasticPoolDatabaseActivityProperties
3775			}
3776		case "id":
3777			if v != nil {
3778				var ID string
3779				err = json.Unmarshal(*v, &ID)
3780				if err != nil {
3781					return err
3782				}
3783				epda.ID = &ID
3784			}
3785		case "name":
3786			if v != nil {
3787				var name string
3788				err = json.Unmarshal(*v, &name)
3789				if err != nil {
3790					return err
3791				}
3792				epda.Name = &name
3793			}
3794		case "type":
3795			if v != nil {
3796				var typeVar string
3797				err = json.Unmarshal(*v, &typeVar)
3798				if err != nil {
3799					return err
3800				}
3801				epda.Type = &typeVar
3802			}
3803		}
3804	}
3805
3806	return nil
3807}
3808
3809// ElasticPoolDatabaseActivityListResult represents the response to a list elastic pool database activity request.
3810type ElasticPoolDatabaseActivityListResult struct {
3811	autorest.Response `json:"-"`
3812	// Value - The list of elastic pool database activities.
3813	Value *[]ElasticPoolDatabaseActivity `json:"value,omitempty"`
3814}
3815
3816// ElasticPoolDatabaseActivityProperties represents the properties of an elastic pool database activity.
3817type ElasticPoolDatabaseActivityProperties struct {
3818	// DatabaseName - The database name.
3819	DatabaseName *string `json:"databaseName,omitempty"`
3820	// EndTime - The time the operation finished (ISO8601 format).
3821	EndTime *date.Time `json:"endTime,omitempty"`
3822	// ErrorCode - The error code if available.
3823	ErrorCode *int32 `json:"errorCode,omitempty"`
3824	// ErrorMessage - The error message if available.
3825	ErrorMessage *string `json:"errorMessage,omitempty"`
3826	// ErrorSeverity - The error severity if available.
3827	ErrorSeverity *int32 `json:"errorSeverity,omitempty"`
3828	// Operation - The operation name.
3829	Operation *string `json:"operation,omitempty"`
3830	// OperationID - The unique operation ID.
3831	OperationID *uuid.UUID `json:"operationId,omitempty"`
3832	// PercentComplete - The percentage complete if available.
3833	PercentComplete *int32 `json:"percentComplete,omitempty"`
3834	// RequestedElasticPoolName - The name for the elastic pool the database is moving into if available.
3835	RequestedElasticPoolName *string `json:"requestedElasticPoolName,omitempty"`
3836	// CurrentElasticPoolName - The name of the current elastic pool the database is in if available.
3837	CurrentElasticPoolName *string `json:"currentElasticPoolName,omitempty"`
3838	// CurrentServiceObjective - The name of the current service objective if available.
3839	CurrentServiceObjective *string `json:"currentServiceObjective,omitempty"`
3840	// RequestedServiceObjective - The name of the requested service objective if available.
3841	RequestedServiceObjective *string `json:"requestedServiceObjective,omitempty"`
3842	// ServerName - The name of the server the elastic pool is in.
3843	ServerName *string `json:"serverName,omitempty"`
3844	// StartTime - The time the operation started (ISO8601 format).
3845	StartTime *date.Time `json:"startTime,omitempty"`
3846	// State - The current state of the operation.
3847	State *string `json:"state,omitempty"`
3848}
3849
3850// ElasticPoolDtuCapability the Elastic Pool DTU capability.
3851type ElasticPoolDtuCapability struct {
3852	// Limit - The maximum size of the database (see 'unit' for the units).
3853	Limit *int64 `json:"limit,omitempty"`
3854	// MaxDatabaseCount - The maximum number of databases supported.
3855	MaxDatabaseCount *int64 `json:"maxDatabaseCount,omitempty"`
3856	// Status - The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
3857	Status CapabilityStatus `json:"status,omitempty"`
3858	// SupportedMaxSizes - The list of supported max sizes.
3859	SupportedMaxSizes *[]MaxSizeCapability `json:"supportedMaxSizes,omitempty"`
3860	// IncludedMaxSize - The included (free) max size for this service level objective.
3861	IncludedMaxSize *MaxSizeCapability `json:"includedMaxSize,omitempty"`
3862	// SupportedPerDatabaseMaxSizes - The list of supported max database sizes.
3863	SupportedPerDatabaseMaxSizes *[]MaxSizeCapability `json:"supportedPerDatabaseMaxSizes,omitempty"`
3864	// SupportedPerDatabaseMaxDtus - The list of supported max database DTUs.
3865	SupportedPerDatabaseMaxDtus *[]ElasticPoolPerDatabaseMaxDtuCapability `json:"supportedPerDatabaseMaxDtus,omitempty"`
3866}
3867
3868// ElasticPoolEditionCapability the elastic pool edition capabilities.
3869type ElasticPoolEditionCapability struct {
3870	// Name - The elastic pool edition name.
3871	Name *string `json:"name,omitempty"`
3872	// Status - The status of the elastic pool edition. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
3873	Status CapabilityStatus `json:"status,omitempty"`
3874	// SupportedElasticPoolDtus - The list of supported elastic pool DTU levels for the edition.
3875	SupportedElasticPoolDtus *[]ElasticPoolDtuCapability `json:"supportedElasticPoolDtus,omitempty"`
3876	// ZoneRedundant - Whether or not zone redundancy is supported for the edition.
3877	ZoneRedundant *bool `json:"zoneRedundant,omitempty"`
3878}
3879
3880// ElasticPoolListResult represents the response to a list elastic pool request.
3881type ElasticPoolListResult struct {
3882	autorest.Response `json:"-"`
3883	// Value - The list of elastic pools hosted in the server.
3884	Value *[]ElasticPool `json:"value,omitempty"`
3885}
3886
3887// ElasticPoolPerDatabaseMaxDtuCapability the max per-database DTU capability.
3888type ElasticPoolPerDatabaseMaxDtuCapability struct {
3889	// Limit - The maximum DTUs per database.
3890	Limit *int64 `json:"limit,omitempty"`
3891	// Status - The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
3892	Status CapabilityStatus `json:"status,omitempty"`
3893	// SupportedPerDatabaseMinDtus - The list of supported min database DTUs.
3894	SupportedPerDatabaseMinDtus *[]ElasticPoolPerDatabaseMinDtuCapability `json:"supportedPerDatabaseMinDtus,omitempty"`
3895}
3896
3897// ElasticPoolPerDatabaseMinDtuCapability the minimum per-database DTU capability.
3898type ElasticPoolPerDatabaseMinDtuCapability struct {
3899	// Limit - The maximum DTUs per database.
3900	Limit *int64 `json:"limit,omitempty"`
3901	// Status - The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
3902	Status CapabilityStatus `json:"status,omitempty"`
3903}
3904
3905// ElasticPoolProperties represents the properties of an elastic pool.
3906type ElasticPoolProperties struct {
3907	// CreationDate - The creation date of the elastic pool (ISO8601 format).
3908	CreationDate *date.Time `json:"creationDate,omitempty"`
3909	// State - The state of the elastic pool. Possible values include: 'ElasticPoolStateCreating', 'ElasticPoolStateReady', 'ElasticPoolStateDisabled'
3910	State ElasticPoolState `json:"state,omitempty"`
3911	// Edition - The edition of the elastic pool. Possible values include: 'ElasticPoolEditionBasic', 'ElasticPoolEditionStandard', 'ElasticPoolEditionPremium'
3912	Edition ElasticPoolEdition `json:"edition,omitempty"`
3913	// Dtu - The total shared DTU for the database elastic pool.
3914	Dtu *int32 `json:"dtu,omitempty"`
3915	// DatabaseDtuMax - The maximum DTU any one database can consume.
3916	DatabaseDtuMax *int32 `json:"databaseDtuMax,omitempty"`
3917	// DatabaseDtuMin - The minimum DTU all databases are guaranteed.
3918	DatabaseDtuMin *int32 `json:"databaseDtuMin,omitempty"`
3919	// StorageMB - Gets storage limit for the database elastic pool in MB.
3920	StorageMB *int32 `json:"storageMB,omitempty"`
3921	// ZoneRedundant - Whether or not this database elastic pool is zone redundant, which means the replicas of this database will be spread across multiple availability zones.
3922	ZoneRedundant *bool `json:"zoneRedundant,omitempty"`
3923}
3924
3925// ElasticPoolsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
3926// operation.
3927type ElasticPoolsCreateOrUpdateFuture struct {
3928	azure.Future
3929}
3930
3931// Result returns the result of the asynchronous operation.
3932// If the operation has not completed it will return an error.
3933func (future *ElasticPoolsCreateOrUpdateFuture) Result(client ElasticPoolsClient) (ep ElasticPool, err error) {
3934	var done bool
3935	done, err = future.Done(client)
3936	if err != nil {
3937		err = autorest.NewErrorWithError(err, "sql.ElasticPoolsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
3938		return
3939	}
3940	if !done {
3941		err = azure.NewAsyncOpIncompleteError("sql.ElasticPoolsCreateOrUpdateFuture")
3942		return
3943	}
3944	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3945	if ep.Response.Response, err = future.GetResult(sender); err == nil && ep.Response.Response.StatusCode != http.StatusNoContent {
3946		ep, err = client.CreateOrUpdateResponder(ep.Response.Response)
3947		if err != nil {
3948			err = autorest.NewErrorWithError(err, "sql.ElasticPoolsCreateOrUpdateFuture", "Result", ep.Response.Response, "Failure responding to request")
3949		}
3950	}
3951	return
3952}
3953
3954// ElasticPoolsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
3955type ElasticPoolsUpdateFuture struct {
3956	azure.Future
3957}
3958
3959// Result returns the result of the asynchronous operation.
3960// If the operation has not completed it will return an error.
3961func (future *ElasticPoolsUpdateFuture) Result(client ElasticPoolsClient) (ep ElasticPool, err error) {
3962	var done bool
3963	done, err = future.Done(client)
3964	if err != nil {
3965		err = autorest.NewErrorWithError(err, "sql.ElasticPoolsUpdateFuture", "Result", future.Response(), "Polling failure")
3966		return
3967	}
3968	if !done {
3969		err = azure.NewAsyncOpIncompleteError("sql.ElasticPoolsUpdateFuture")
3970		return
3971	}
3972	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3973	if ep.Response.Response, err = future.GetResult(sender); err == nil && ep.Response.Response.StatusCode != http.StatusNoContent {
3974		ep, err = client.UpdateResponder(ep.Response.Response)
3975		if err != nil {
3976			err = autorest.NewErrorWithError(err, "sql.ElasticPoolsUpdateFuture", "Result", ep.Response.Response, "Failure responding to request")
3977		}
3978	}
3979	return
3980}
3981
3982// ElasticPoolUpdate represents an elastic pool update.
3983type ElasticPoolUpdate struct {
3984	// Tags - Resource tags.
3985	Tags map[string]*string `json:"tags"`
3986	// ElasticPoolProperties - The properties representing the resource.
3987	*ElasticPoolProperties `json:"properties,omitempty"`
3988	// ID - Resource ID.
3989	ID *string `json:"id,omitempty"`
3990	// Name - Resource name.
3991	Name *string `json:"name,omitempty"`
3992	// Type - Resource type.
3993	Type *string `json:"type,omitempty"`
3994}
3995
3996// MarshalJSON is the custom marshaler for ElasticPoolUpdate.
3997func (epu ElasticPoolUpdate) MarshalJSON() ([]byte, error) {
3998	objectMap := make(map[string]interface{})
3999	if epu.Tags != nil {
4000		objectMap["tags"] = epu.Tags
4001	}
4002	if epu.ElasticPoolProperties != nil {
4003		objectMap["properties"] = epu.ElasticPoolProperties
4004	}
4005	if epu.ID != nil {
4006		objectMap["id"] = epu.ID
4007	}
4008	if epu.Name != nil {
4009		objectMap["name"] = epu.Name
4010	}
4011	if epu.Type != nil {
4012		objectMap["type"] = epu.Type
4013	}
4014	return json.Marshal(objectMap)
4015}
4016
4017// UnmarshalJSON is the custom unmarshaler for ElasticPoolUpdate struct.
4018func (epu *ElasticPoolUpdate) UnmarshalJSON(body []byte) error {
4019	var m map[string]*json.RawMessage
4020	err := json.Unmarshal(body, &m)
4021	if err != nil {
4022		return err
4023	}
4024	for k, v := range m {
4025		switch k {
4026		case "tags":
4027			if v != nil {
4028				var tags map[string]*string
4029				err = json.Unmarshal(*v, &tags)
4030				if err != nil {
4031					return err
4032				}
4033				epu.Tags = tags
4034			}
4035		case "properties":
4036			if v != nil {
4037				var elasticPoolProperties ElasticPoolProperties
4038				err = json.Unmarshal(*v, &elasticPoolProperties)
4039				if err != nil {
4040					return err
4041				}
4042				epu.ElasticPoolProperties = &elasticPoolProperties
4043			}
4044		case "id":
4045			if v != nil {
4046				var ID string
4047				err = json.Unmarshal(*v, &ID)
4048				if err != nil {
4049					return err
4050				}
4051				epu.ID = &ID
4052			}
4053		case "name":
4054			if v != nil {
4055				var name string
4056				err = json.Unmarshal(*v, &name)
4057				if err != nil {
4058					return err
4059				}
4060				epu.Name = &name
4061			}
4062		case "type":
4063			if v != nil {
4064				var typeVar string
4065				err = json.Unmarshal(*v, &typeVar)
4066				if err != nil {
4067					return err
4068				}
4069				epu.Type = &typeVar
4070			}
4071		}
4072	}
4073
4074	return nil
4075}
4076
4077// EncryptionProtector the server encryption protector.
4078type EncryptionProtector struct {
4079	autorest.Response `json:"-"`
4080	// Kind - Kind of encryption protector. This is metadata used for the Azure portal experience.
4081	Kind *string `json:"kind,omitempty"`
4082	// Location - Resource location.
4083	Location *string `json:"location,omitempty"`
4084	// EncryptionProtectorProperties - Resource properties.
4085	*EncryptionProtectorProperties `json:"properties,omitempty"`
4086	// ID - Resource ID.
4087	ID *string `json:"id,omitempty"`
4088	// Name - Resource name.
4089	Name *string `json:"name,omitempty"`
4090	// Type - Resource type.
4091	Type *string `json:"type,omitempty"`
4092}
4093
4094// MarshalJSON is the custom marshaler for EncryptionProtector.
4095func (ep EncryptionProtector) MarshalJSON() ([]byte, error) {
4096	objectMap := make(map[string]interface{})
4097	if ep.Kind != nil {
4098		objectMap["kind"] = ep.Kind
4099	}
4100	if ep.Location != nil {
4101		objectMap["location"] = ep.Location
4102	}
4103	if ep.EncryptionProtectorProperties != nil {
4104		objectMap["properties"] = ep.EncryptionProtectorProperties
4105	}
4106	if ep.ID != nil {
4107		objectMap["id"] = ep.ID
4108	}
4109	if ep.Name != nil {
4110		objectMap["name"] = ep.Name
4111	}
4112	if ep.Type != nil {
4113		objectMap["type"] = ep.Type
4114	}
4115	return json.Marshal(objectMap)
4116}
4117
4118// UnmarshalJSON is the custom unmarshaler for EncryptionProtector struct.
4119func (ep *EncryptionProtector) UnmarshalJSON(body []byte) error {
4120	var m map[string]*json.RawMessage
4121	err := json.Unmarshal(body, &m)
4122	if err != nil {
4123		return err
4124	}
4125	for k, v := range m {
4126		switch k {
4127		case "kind":
4128			if v != nil {
4129				var kind string
4130				err = json.Unmarshal(*v, &kind)
4131				if err != nil {
4132					return err
4133				}
4134				ep.Kind = &kind
4135			}
4136		case "location":
4137			if v != nil {
4138				var location string
4139				err = json.Unmarshal(*v, &location)
4140				if err != nil {
4141					return err
4142				}
4143				ep.Location = &location
4144			}
4145		case "properties":
4146			if v != nil {
4147				var encryptionProtectorProperties EncryptionProtectorProperties
4148				err = json.Unmarshal(*v, &encryptionProtectorProperties)
4149				if err != nil {
4150					return err
4151				}
4152				ep.EncryptionProtectorProperties = &encryptionProtectorProperties
4153			}
4154		case "id":
4155			if v != nil {
4156				var ID string
4157				err = json.Unmarshal(*v, &ID)
4158				if err != nil {
4159					return err
4160				}
4161				ep.ID = &ID
4162			}
4163		case "name":
4164			if v != nil {
4165				var name string
4166				err = json.Unmarshal(*v, &name)
4167				if err != nil {
4168					return err
4169				}
4170				ep.Name = &name
4171			}
4172		case "type":
4173			if v != nil {
4174				var typeVar string
4175				err = json.Unmarshal(*v, &typeVar)
4176				if err != nil {
4177					return err
4178				}
4179				ep.Type = &typeVar
4180			}
4181		}
4182	}
4183
4184	return nil
4185}
4186
4187// EncryptionProtectorListResult a list of server encryption protectors.
4188type EncryptionProtectorListResult struct {
4189	autorest.Response `json:"-"`
4190	// Value - Array of results.
4191	Value *[]EncryptionProtector `json:"value,omitempty"`
4192	// NextLink - Link to retrieve next page of results.
4193	NextLink *string `json:"nextLink,omitempty"`
4194}
4195
4196// EncryptionProtectorListResultIterator provides access to a complete listing of EncryptionProtector values.
4197type EncryptionProtectorListResultIterator struct {
4198	i    int
4199	page EncryptionProtectorListResultPage
4200}
4201
4202// Next advances to the next value.  If there was an error making
4203// the request the iterator does not advance and the error is returned.
4204func (iter *EncryptionProtectorListResultIterator) Next() error {
4205	iter.i++
4206	if iter.i < len(iter.page.Values()) {
4207		return nil
4208	}
4209	err := iter.page.Next()
4210	if err != nil {
4211		iter.i--
4212		return err
4213	}
4214	iter.i = 0
4215	return nil
4216}
4217
4218// NotDone returns true if the enumeration should be started or is not yet complete.
4219func (iter EncryptionProtectorListResultIterator) NotDone() bool {
4220	return iter.page.NotDone() && iter.i < len(iter.page.Values())
4221}
4222
4223// Response returns the raw server response from the last page request.
4224func (iter EncryptionProtectorListResultIterator) Response() EncryptionProtectorListResult {
4225	return iter.page.Response()
4226}
4227
4228// Value returns the current value or a zero-initialized value if the
4229// iterator has advanced beyond the end of the collection.
4230func (iter EncryptionProtectorListResultIterator) Value() EncryptionProtector {
4231	if !iter.page.NotDone() {
4232		return EncryptionProtector{}
4233	}
4234	return iter.page.Values()[iter.i]
4235}
4236
4237// IsEmpty returns true if the ListResult contains no values.
4238func (eplr EncryptionProtectorListResult) IsEmpty() bool {
4239	return eplr.Value == nil || len(*eplr.Value) == 0
4240}
4241
4242// encryptionProtectorListResultPreparer prepares a request to retrieve the next set of results.
4243// It returns nil if no more results exist.
4244func (eplr EncryptionProtectorListResult) encryptionProtectorListResultPreparer() (*http.Request, error) {
4245	if eplr.NextLink == nil || len(to.String(eplr.NextLink)) < 1 {
4246		return nil, nil
4247	}
4248	return autorest.Prepare(&http.Request{},
4249		autorest.AsJSON(),
4250		autorest.AsGet(),
4251		autorest.WithBaseURL(to.String(eplr.NextLink)))
4252}
4253
4254// EncryptionProtectorListResultPage contains a page of EncryptionProtector values.
4255type EncryptionProtectorListResultPage struct {
4256	fn   func(EncryptionProtectorListResult) (EncryptionProtectorListResult, error)
4257	eplr EncryptionProtectorListResult
4258}
4259
4260// Next advances to the next page of values.  If there was an error making
4261// the request the page does not advance and the error is returned.
4262func (page *EncryptionProtectorListResultPage) Next() error {
4263	next, err := page.fn(page.eplr)
4264	if err != nil {
4265		return err
4266	}
4267	page.eplr = next
4268	return nil
4269}
4270
4271// NotDone returns true if the page enumeration should be started or is not yet complete.
4272func (page EncryptionProtectorListResultPage) NotDone() bool {
4273	return !page.eplr.IsEmpty()
4274}
4275
4276// Response returns the raw server response from the last page request.
4277func (page EncryptionProtectorListResultPage) Response() EncryptionProtectorListResult {
4278	return page.eplr
4279}
4280
4281// Values returns the slice of values for the current page or nil if there are no values.
4282func (page EncryptionProtectorListResultPage) Values() []EncryptionProtector {
4283	if page.eplr.IsEmpty() {
4284		return nil
4285	}
4286	return *page.eplr.Value
4287}
4288
4289// EncryptionProtectorProperties properties for an encryption protector execution.
4290type EncryptionProtectorProperties struct {
4291	// Subregion - Subregion of the encryption protector.
4292	Subregion *string `json:"subregion,omitempty"`
4293	// ServerKeyName - The name of the server key.
4294	ServerKeyName *string `json:"serverKeyName,omitempty"`
4295	// ServerKeyType - The encryption protector type like 'ServiceManaged', 'AzureKeyVault'. Possible values include: 'ServiceManaged', 'AzureKeyVault'
4296	ServerKeyType ServerKeyType `json:"serverKeyType,omitempty"`
4297	// URI - The URI of the server key.
4298	URI *string `json:"uri,omitempty"`
4299	// Thumbprint - Thumbprint of the server key.
4300	Thumbprint *string `json:"thumbprint,omitempty"`
4301}
4302
4303// EncryptionProtectorsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
4304// long-running operation.
4305type EncryptionProtectorsCreateOrUpdateFuture struct {
4306	azure.Future
4307}
4308
4309// Result returns the result of the asynchronous operation.
4310// If the operation has not completed it will return an error.
4311func (future *EncryptionProtectorsCreateOrUpdateFuture) Result(client EncryptionProtectorsClient) (ep EncryptionProtector, err error) {
4312	var done bool
4313	done, err = future.Done(client)
4314	if err != nil {
4315		err = autorest.NewErrorWithError(err, "sql.EncryptionProtectorsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
4316		return
4317	}
4318	if !done {
4319		err = azure.NewAsyncOpIncompleteError("sql.EncryptionProtectorsCreateOrUpdateFuture")
4320		return
4321	}
4322	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4323	if ep.Response.Response, err = future.GetResult(sender); err == nil && ep.Response.Response.StatusCode != http.StatusNoContent {
4324		ep, err = client.CreateOrUpdateResponder(ep.Response.Response)
4325		if err != nil {
4326			err = autorest.NewErrorWithError(err, "sql.EncryptionProtectorsCreateOrUpdateFuture", "Result", ep.Response.Response, "Failure responding to request")
4327		}
4328	}
4329	return
4330}
4331
4332// ExportRequest export database parameters.
4333type ExportRequest struct {
4334	// StorageKeyType - The type of the storage key to use. Possible values include: 'StorageAccessKey', 'SharedAccessKey'
4335	StorageKeyType StorageKeyType `json:"storageKeyType,omitempty"`
4336	// StorageKey - The storage key to use.  If storage key type is SharedAccessKey, it must be preceded with a "?."
4337	StorageKey *string `json:"storageKey,omitempty"`
4338	// StorageURI - The storage uri to use.
4339	StorageURI *string `json:"storageUri,omitempty"`
4340	// AdministratorLogin - The name of the SQL administrator.
4341	AdministratorLogin *string `json:"administratorLogin,omitempty"`
4342	// AdministratorLoginPassword - The password of the SQL administrator.
4343	AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"`
4344	// AuthenticationType - The authentication type. Possible values include: 'SQL', 'ADPassword'
4345	AuthenticationType AuthenticationType `json:"authenticationType,omitempty"`
4346}
4347
4348// ExtendedDatabaseBlobAuditingPolicy an extended database blob auditing policy.
4349type ExtendedDatabaseBlobAuditingPolicy struct {
4350	autorest.Response `json:"-"`
4351	// ExtendedDatabaseBlobAuditingPolicyProperties - Resource properties.
4352	*ExtendedDatabaseBlobAuditingPolicyProperties `json:"properties,omitempty"`
4353	// ID - Resource ID.
4354	ID *string `json:"id,omitempty"`
4355	// Name - Resource name.
4356	Name *string `json:"name,omitempty"`
4357	// Type - Resource type.
4358	Type *string `json:"type,omitempty"`
4359}
4360
4361// MarshalJSON is the custom marshaler for ExtendedDatabaseBlobAuditingPolicy.
4362func (edbap ExtendedDatabaseBlobAuditingPolicy) MarshalJSON() ([]byte, error) {
4363	objectMap := make(map[string]interface{})
4364	if edbap.ExtendedDatabaseBlobAuditingPolicyProperties != nil {
4365		objectMap["properties"] = edbap.ExtendedDatabaseBlobAuditingPolicyProperties
4366	}
4367	if edbap.ID != nil {
4368		objectMap["id"] = edbap.ID
4369	}
4370	if edbap.Name != nil {
4371		objectMap["name"] = edbap.Name
4372	}
4373	if edbap.Type != nil {
4374		objectMap["type"] = edbap.Type
4375	}
4376	return json.Marshal(objectMap)
4377}
4378
4379// UnmarshalJSON is the custom unmarshaler for ExtendedDatabaseBlobAuditingPolicy struct.
4380func (edbap *ExtendedDatabaseBlobAuditingPolicy) UnmarshalJSON(body []byte) error {
4381	var m map[string]*json.RawMessage
4382	err := json.Unmarshal(body, &m)
4383	if err != nil {
4384		return err
4385	}
4386	for k, v := range m {
4387		switch k {
4388		case "properties":
4389			if v != nil {
4390				var extendedDatabaseBlobAuditingPolicyProperties ExtendedDatabaseBlobAuditingPolicyProperties
4391				err = json.Unmarshal(*v, &extendedDatabaseBlobAuditingPolicyProperties)
4392				if err != nil {
4393					return err
4394				}
4395				edbap.ExtendedDatabaseBlobAuditingPolicyProperties = &extendedDatabaseBlobAuditingPolicyProperties
4396			}
4397		case "id":
4398			if v != nil {
4399				var ID string
4400				err = json.Unmarshal(*v, &ID)
4401				if err != nil {
4402					return err
4403				}
4404				edbap.ID = &ID
4405			}
4406		case "name":
4407			if v != nil {
4408				var name string
4409				err = json.Unmarshal(*v, &name)
4410				if err != nil {
4411					return err
4412				}
4413				edbap.Name = &name
4414			}
4415		case "type":
4416			if v != nil {
4417				var typeVar string
4418				err = json.Unmarshal(*v, &typeVar)
4419				if err != nil {
4420					return err
4421				}
4422				edbap.Type = &typeVar
4423			}
4424		}
4425	}
4426
4427	return nil
4428}
4429
4430// ExtendedDatabaseBlobAuditingPolicyProperties properties of an extended database blob auditing policy.
4431type ExtendedDatabaseBlobAuditingPolicyProperties struct {
4432	// PredicateExpression - Specifies condition of where clause when creating an audit.
4433	PredicateExpression *string `json:"predicateExpression,omitempty"`
4434	// State - Specifies the state of the policy. If state is Enabled, storageEndpoint and storageAccountAccessKey are required. Possible values include: 'BlobAuditingPolicyStateEnabled', 'BlobAuditingPolicyStateDisabled'
4435	State BlobAuditingPolicyState `json:"state,omitempty"`
4436	// StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint is required.
4437	StorageEndpoint *string `json:"storageEndpoint,omitempty"`
4438	// StorageAccountAccessKey - Specifies the identifier key of the auditing storage account. If state is Enabled, storageAccountAccessKey is required.
4439	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
4440	// RetentionDays - Specifies the number of days to keep in the audit logs.
4441	RetentionDays *int32 `json:"retentionDays,omitempty"`
4442	// AuditActionsAndGroups - Specifies the Actions-Groups and Actions to audit.
4443	//
4444	// The recommended set of action groups to use is the following combination - this will audit all the queries and stored procedures executed against the database, as well as successful and failed logins:
4445	//
4446	// BATCH_COMPLETED_GROUP,
4447	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP,
4448	// FAILED_DATABASE_AUTHENTICATION_GROUP.
4449	//
4450	// This above combination is also the set that is configured by default when enabling auditing from the Azure portal.
4451	//
4452	// The supported action groups to audit are (note: choose only specific groups that cover your auditing needs. Using unnecessary groups could lead to very large quantities of audit records):
4453	//
4454	// APPLICATION_ROLE_CHANGE_PASSWORD_GROUP
4455	// BACKUP_RESTORE_GROUP
4456	// DATABASE_LOGOUT_GROUP
4457	// DATABASE_OBJECT_CHANGE_GROUP
4458	// DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP
4459	// DATABASE_OBJECT_PERMISSION_CHANGE_GROUP
4460	// DATABASE_OPERATION_GROUP
4461	// DATABASE_PERMISSION_CHANGE_GROUP
4462	// DATABASE_PRINCIPAL_CHANGE_GROUP
4463	// DATABASE_PRINCIPAL_IMPERSONATION_GROUP
4464	// DATABASE_ROLE_MEMBER_CHANGE_GROUP
4465	// FAILED_DATABASE_AUTHENTICATION_GROUP
4466	// SCHEMA_OBJECT_ACCESS_GROUP
4467	// SCHEMA_OBJECT_CHANGE_GROUP
4468	// SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP
4469	// SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP
4470	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP
4471	// USER_CHANGE_PASSWORD_GROUP
4472	// BATCH_STARTED_GROUP
4473	// BATCH_COMPLETED_GROUP
4474	//
4475	// These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs.
4476	//
4477	// For more information, see [Database-Level Audit Action Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups).
4478	//
4479	// For Database auditing policy, specific Actions can also be specified (note that Actions cannot be specified for Server auditing policy). The supported actions to audit are:
4480	// SELECT
4481	// UPDATE
4482	// INSERT
4483	// DELETE
4484	// EXECUTE
4485	// RECEIVE
4486	// REFERENCES
4487	//
4488	// The general form for defining an action to be audited is:
4489	// <action> ON <object> BY <principal>
4490	//
4491	// Note that <object> in the above format can refer to an object like a table, view, or stored procedure, or an entire database or schema. For the latter cases, the forms DATABASE::<db_name> and SCHEMA::<schema_name> are used, respectively.
4492	//
4493	// For example:
4494	// SELECT on dbo.myTable by public
4495	// SELECT on DATABASE::myDatabase by public
4496	// SELECT on SCHEMA::mySchema by public
4497	//
4498	// For more information, see [Database-Level Audit Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions)
4499	AuditActionsAndGroups *[]string `json:"auditActionsAndGroups,omitempty"`
4500	// StorageAccountSubscriptionID - Specifies the blob storage subscription Id.
4501	StorageAccountSubscriptionID *uuid.UUID `json:"storageAccountSubscriptionId,omitempty"`
4502	// IsStorageSecondaryKeyInUse - Specifies whether storageAccountAccessKey value is the storage's secondary key.
4503	IsStorageSecondaryKeyInUse *bool `json:"isStorageSecondaryKeyInUse,omitempty"`
4504}
4505
4506// ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results
4507// of a long-running operation.
4508type ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture struct {
4509	azure.Future
4510}
4511
4512// Result returns the result of the asynchronous operation.
4513// If the operation has not completed it will return an error.
4514func (future *ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture) Result(client ExtendedServerBlobAuditingPoliciesClient) (esbap ExtendedServerBlobAuditingPolicy, err error) {
4515	var done bool
4516	done, err = future.Done(client)
4517	if err != nil {
4518		err = autorest.NewErrorWithError(err, "sql.ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
4519		return
4520	}
4521	if !done {
4522		err = azure.NewAsyncOpIncompleteError("sql.ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture")
4523		return
4524	}
4525	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4526	if esbap.Response.Response, err = future.GetResult(sender); err == nil && esbap.Response.Response.StatusCode != http.StatusNoContent {
4527		esbap, err = client.CreateOrUpdateResponder(esbap.Response.Response)
4528		if err != nil {
4529			err = autorest.NewErrorWithError(err, "sql.ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture", "Result", esbap.Response.Response, "Failure responding to request")
4530		}
4531	}
4532	return
4533}
4534
4535// ExtendedServerBlobAuditingPolicy an extended server blob auditing policy.
4536type ExtendedServerBlobAuditingPolicy struct {
4537	autorest.Response `json:"-"`
4538	// ExtendedServerBlobAuditingPolicyProperties - Resource properties.
4539	*ExtendedServerBlobAuditingPolicyProperties `json:"properties,omitempty"`
4540	// ID - Resource ID.
4541	ID *string `json:"id,omitempty"`
4542	// Name - Resource name.
4543	Name *string `json:"name,omitempty"`
4544	// Type - Resource type.
4545	Type *string `json:"type,omitempty"`
4546}
4547
4548// MarshalJSON is the custom marshaler for ExtendedServerBlobAuditingPolicy.
4549func (esbap ExtendedServerBlobAuditingPolicy) MarshalJSON() ([]byte, error) {
4550	objectMap := make(map[string]interface{})
4551	if esbap.ExtendedServerBlobAuditingPolicyProperties != nil {
4552		objectMap["properties"] = esbap.ExtendedServerBlobAuditingPolicyProperties
4553	}
4554	if esbap.ID != nil {
4555		objectMap["id"] = esbap.ID
4556	}
4557	if esbap.Name != nil {
4558		objectMap["name"] = esbap.Name
4559	}
4560	if esbap.Type != nil {
4561		objectMap["type"] = esbap.Type
4562	}
4563	return json.Marshal(objectMap)
4564}
4565
4566// UnmarshalJSON is the custom unmarshaler for ExtendedServerBlobAuditingPolicy struct.
4567func (esbap *ExtendedServerBlobAuditingPolicy) UnmarshalJSON(body []byte) error {
4568	var m map[string]*json.RawMessage
4569	err := json.Unmarshal(body, &m)
4570	if err != nil {
4571		return err
4572	}
4573	for k, v := range m {
4574		switch k {
4575		case "properties":
4576			if v != nil {
4577				var extendedServerBlobAuditingPolicyProperties ExtendedServerBlobAuditingPolicyProperties
4578				err = json.Unmarshal(*v, &extendedServerBlobAuditingPolicyProperties)
4579				if err != nil {
4580					return err
4581				}
4582				esbap.ExtendedServerBlobAuditingPolicyProperties = &extendedServerBlobAuditingPolicyProperties
4583			}
4584		case "id":
4585			if v != nil {
4586				var ID string
4587				err = json.Unmarshal(*v, &ID)
4588				if err != nil {
4589					return err
4590				}
4591				esbap.ID = &ID
4592			}
4593		case "name":
4594			if v != nil {
4595				var name string
4596				err = json.Unmarshal(*v, &name)
4597				if err != nil {
4598					return err
4599				}
4600				esbap.Name = &name
4601			}
4602		case "type":
4603			if v != nil {
4604				var typeVar string
4605				err = json.Unmarshal(*v, &typeVar)
4606				if err != nil {
4607					return err
4608				}
4609				esbap.Type = &typeVar
4610			}
4611		}
4612	}
4613
4614	return nil
4615}
4616
4617// ExtendedServerBlobAuditingPolicyProperties properties of an extended server blob auditing policy.
4618type ExtendedServerBlobAuditingPolicyProperties struct {
4619	// PredicateExpression - Specifies condition of where clause when creating an audit.
4620	PredicateExpression *string `json:"predicateExpression,omitempty"`
4621	// State - Specifies the state of the policy. If state is Enabled, storageEndpoint and storageAccountAccessKey are required. Possible values include: 'BlobAuditingPolicyStateEnabled', 'BlobAuditingPolicyStateDisabled'
4622	State BlobAuditingPolicyState `json:"state,omitempty"`
4623	// StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint is required.
4624	StorageEndpoint *string `json:"storageEndpoint,omitempty"`
4625	// StorageAccountAccessKey - Specifies the identifier key of the auditing storage account. If state is Enabled, storageAccountAccessKey is required.
4626	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
4627	// RetentionDays - Specifies the number of days to keep in the audit logs.
4628	RetentionDays *int32 `json:"retentionDays,omitempty"`
4629	// AuditActionsAndGroups - Specifies the Actions-Groups and Actions to audit.
4630	//
4631	// The recommended set of action groups to use is the following combination - this will audit all the queries and stored procedures executed against the database, as well as successful and failed logins:
4632	//
4633	// BATCH_COMPLETED_GROUP,
4634	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP,
4635	// FAILED_DATABASE_AUTHENTICATION_GROUP.
4636	//
4637	// This above combination is also the set that is configured by default when enabling auditing from the Azure portal.
4638	//
4639	// The supported action groups to audit are (note: choose only specific groups that cover your auditing needs. Using unnecessary groups could lead to very large quantities of audit records):
4640	//
4641	// APPLICATION_ROLE_CHANGE_PASSWORD_GROUP
4642	// BACKUP_RESTORE_GROUP
4643	// DATABASE_LOGOUT_GROUP
4644	// DATABASE_OBJECT_CHANGE_GROUP
4645	// DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP
4646	// DATABASE_OBJECT_PERMISSION_CHANGE_GROUP
4647	// DATABASE_OPERATION_GROUP
4648	// DATABASE_PERMISSION_CHANGE_GROUP
4649	// DATABASE_PRINCIPAL_CHANGE_GROUP
4650	// DATABASE_PRINCIPAL_IMPERSONATION_GROUP
4651	// DATABASE_ROLE_MEMBER_CHANGE_GROUP
4652	// FAILED_DATABASE_AUTHENTICATION_GROUP
4653	// SCHEMA_OBJECT_ACCESS_GROUP
4654	// SCHEMA_OBJECT_CHANGE_GROUP
4655	// SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP
4656	// SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP
4657	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP
4658	// USER_CHANGE_PASSWORD_GROUP
4659	// BATCH_STARTED_GROUP
4660	// BATCH_COMPLETED_GROUP
4661	//
4662	// These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs.
4663	//
4664	// For more information, see [Database-Level Audit Action Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups).
4665	//
4666	// For Database auditing policy, specific Actions can also be specified (note that Actions cannot be specified for Server auditing policy). The supported actions to audit are:
4667	// SELECT
4668	// UPDATE
4669	// INSERT
4670	// DELETE
4671	// EXECUTE
4672	// RECEIVE
4673	// REFERENCES
4674	//
4675	// The general form for defining an action to be audited is:
4676	// <action> ON <object> BY <principal>
4677	//
4678	// Note that <object> in the above format can refer to an object like a table, view, or stored procedure, or an entire database or schema. For the latter cases, the forms DATABASE::<db_name> and SCHEMA::<schema_name> are used, respectively.
4679	//
4680	// For example:
4681	// SELECT on dbo.myTable by public
4682	// SELECT on DATABASE::myDatabase by public
4683	// SELECT on SCHEMA::mySchema by public
4684	//
4685	// For more information, see [Database-Level Audit Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions)
4686	AuditActionsAndGroups *[]string `json:"auditActionsAndGroups,omitempty"`
4687	// StorageAccountSubscriptionID - Specifies the blob storage subscription Id.
4688	StorageAccountSubscriptionID *uuid.UUID `json:"storageAccountSubscriptionId,omitempty"`
4689	// IsStorageSecondaryKeyInUse - Specifies whether storageAccountAccessKey value is the storage's secondary key.
4690	IsStorageSecondaryKeyInUse *bool `json:"isStorageSecondaryKeyInUse,omitempty"`
4691}
4692
4693// FailoverGroup a failover group.
4694type FailoverGroup struct {
4695	autorest.Response `json:"-"`
4696	// Location - Resource location.
4697	Location *string `json:"location,omitempty"`
4698	// Tags - Resource tags.
4699	Tags map[string]*string `json:"tags"`
4700	// FailoverGroupProperties - Resource properties.
4701	*FailoverGroupProperties `json:"properties,omitempty"`
4702	// ID - Resource ID.
4703	ID *string `json:"id,omitempty"`
4704	// Name - Resource name.
4705	Name *string `json:"name,omitempty"`
4706	// Type - Resource type.
4707	Type *string `json:"type,omitempty"`
4708}
4709
4710// MarshalJSON is the custom marshaler for FailoverGroup.
4711func (fg FailoverGroup) MarshalJSON() ([]byte, error) {
4712	objectMap := make(map[string]interface{})
4713	if fg.Location != nil {
4714		objectMap["location"] = fg.Location
4715	}
4716	if fg.Tags != nil {
4717		objectMap["tags"] = fg.Tags
4718	}
4719	if fg.FailoverGroupProperties != nil {
4720		objectMap["properties"] = fg.FailoverGroupProperties
4721	}
4722	if fg.ID != nil {
4723		objectMap["id"] = fg.ID
4724	}
4725	if fg.Name != nil {
4726		objectMap["name"] = fg.Name
4727	}
4728	if fg.Type != nil {
4729		objectMap["type"] = fg.Type
4730	}
4731	return json.Marshal(objectMap)
4732}
4733
4734// UnmarshalJSON is the custom unmarshaler for FailoverGroup struct.
4735func (fg *FailoverGroup) UnmarshalJSON(body []byte) error {
4736	var m map[string]*json.RawMessage
4737	err := json.Unmarshal(body, &m)
4738	if err != nil {
4739		return err
4740	}
4741	for k, v := range m {
4742		switch k {
4743		case "location":
4744			if v != nil {
4745				var location string
4746				err = json.Unmarshal(*v, &location)
4747				if err != nil {
4748					return err
4749				}
4750				fg.Location = &location
4751			}
4752		case "tags":
4753			if v != nil {
4754				var tags map[string]*string
4755				err = json.Unmarshal(*v, &tags)
4756				if err != nil {
4757					return err
4758				}
4759				fg.Tags = tags
4760			}
4761		case "properties":
4762			if v != nil {
4763				var failoverGroupProperties FailoverGroupProperties
4764				err = json.Unmarshal(*v, &failoverGroupProperties)
4765				if err != nil {
4766					return err
4767				}
4768				fg.FailoverGroupProperties = &failoverGroupProperties
4769			}
4770		case "id":
4771			if v != nil {
4772				var ID string
4773				err = json.Unmarshal(*v, &ID)
4774				if err != nil {
4775					return err
4776				}
4777				fg.ID = &ID
4778			}
4779		case "name":
4780			if v != nil {
4781				var name string
4782				err = json.Unmarshal(*v, &name)
4783				if err != nil {
4784					return err
4785				}
4786				fg.Name = &name
4787			}
4788		case "type":
4789			if v != nil {
4790				var typeVar string
4791				err = json.Unmarshal(*v, &typeVar)
4792				if err != nil {
4793					return err
4794				}
4795				fg.Type = &typeVar
4796			}
4797		}
4798	}
4799
4800	return nil
4801}
4802
4803// FailoverGroupListResult a list of failover groups.
4804type FailoverGroupListResult struct {
4805	autorest.Response `json:"-"`
4806	// Value - Array of results.
4807	Value *[]FailoverGroup `json:"value,omitempty"`
4808	// NextLink - Link to retrieve next page of results.
4809	NextLink *string `json:"nextLink,omitempty"`
4810}
4811
4812// FailoverGroupListResultIterator provides access to a complete listing of FailoverGroup values.
4813type FailoverGroupListResultIterator struct {
4814	i    int
4815	page FailoverGroupListResultPage
4816}
4817
4818// Next advances to the next value.  If there was an error making
4819// the request the iterator does not advance and the error is returned.
4820func (iter *FailoverGroupListResultIterator) Next() error {
4821	iter.i++
4822	if iter.i < len(iter.page.Values()) {
4823		return nil
4824	}
4825	err := iter.page.Next()
4826	if err != nil {
4827		iter.i--
4828		return err
4829	}
4830	iter.i = 0
4831	return nil
4832}
4833
4834// NotDone returns true if the enumeration should be started or is not yet complete.
4835func (iter FailoverGroupListResultIterator) NotDone() bool {
4836	return iter.page.NotDone() && iter.i < len(iter.page.Values())
4837}
4838
4839// Response returns the raw server response from the last page request.
4840func (iter FailoverGroupListResultIterator) Response() FailoverGroupListResult {
4841	return iter.page.Response()
4842}
4843
4844// Value returns the current value or a zero-initialized value if the
4845// iterator has advanced beyond the end of the collection.
4846func (iter FailoverGroupListResultIterator) Value() FailoverGroup {
4847	if !iter.page.NotDone() {
4848		return FailoverGroup{}
4849	}
4850	return iter.page.Values()[iter.i]
4851}
4852
4853// IsEmpty returns true if the ListResult contains no values.
4854func (fglr FailoverGroupListResult) IsEmpty() bool {
4855	return fglr.Value == nil || len(*fglr.Value) == 0
4856}
4857
4858// failoverGroupListResultPreparer prepares a request to retrieve the next set of results.
4859// It returns nil if no more results exist.
4860func (fglr FailoverGroupListResult) failoverGroupListResultPreparer() (*http.Request, error) {
4861	if fglr.NextLink == nil || len(to.String(fglr.NextLink)) < 1 {
4862		return nil, nil
4863	}
4864	return autorest.Prepare(&http.Request{},
4865		autorest.AsJSON(),
4866		autorest.AsGet(),
4867		autorest.WithBaseURL(to.String(fglr.NextLink)))
4868}
4869
4870// FailoverGroupListResultPage contains a page of FailoverGroup values.
4871type FailoverGroupListResultPage struct {
4872	fn   func(FailoverGroupListResult) (FailoverGroupListResult, error)
4873	fglr FailoverGroupListResult
4874}
4875
4876// Next advances to the next page of values.  If there was an error making
4877// the request the page does not advance and the error is returned.
4878func (page *FailoverGroupListResultPage) Next() error {
4879	next, err := page.fn(page.fglr)
4880	if err != nil {
4881		return err
4882	}
4883	page.fglr = next
4884	return nil
4885}
4886
4887// NotDone returns true if the page enumeration should be started or is not yet complete.
4888func (page FailoverGroupListResultPage) NotDone() bool {
4889	return !page.fglr.IsEmpty()
4890}
4891
4892// Response returns the raw server response from the last page request.
4893func (page FailoverGroupListResultPage) Response() FailoverGroupListResult {
4894	return page.fglr
4895}
4896
4897// Values returns the slice of values for the current page or nil if there are no values.
4898func (page FailoverGroupListResultPage) Values() []FailoverGroup {
4899	if page.fglr.IsEmpty() {
4900		return nil
4901	}
4902	return *page.fglr.Value
4903}
4904
4905// FailoverGroupProperties properties of a failover group.
4906type FailoverGroupProperties struct {
4907	// ReadWriteEndpoint - Read-write endpoint of the failover group instance.
4908	ReadWriteEndpoint *FailoverGroupReadWriteEndpoint `json:"readWriteEndpoint,omitempty"`
4909	// ReadOnlyEndpoint - Read-only endpoint of the failover group instance.
4910	ReadOnlyEndpoint *FailoverGroupReadOnlyEndpoint `json:"readOnlyEndpoint,omitempty"`
4911	// ReplicationRole - Local replication role of the failover group instance. Possible values include: 'Primary', 'Secondary'
4912	ReplicationRole FailoverGroupReplicationRole `json:"replicationRole,omitempty"`
4913	// ReplicationState - Replication state of the failover group instance.
4914	ReplicationState *string `json:"replicationState,omitempty"`
4915	// PartnerServers - List of partner server information for the failover group.
4916	PartnerServers *[]PartnerInfo `json:"partnerServers,omitempty"`
4917	// Databases - List of databases in the failover group.
4918	Databases *[]string `json:"databases,omitempty"`
4919}
4920
4921// FailoverGroupReadOnlyEndpoint read-only endpoint of the failover group instance.
4922type FailoverGroupReadOnlyEndpoint struct {
4923	// FailoverPolicy - Failover policy of the read-only endpoint for the failover group. Possible values include: 'ReadOnlyEndpointFailoverPolicyDisabled', 'ReadOnlyEndpointFailoverPolicyEnabled'
4924	FailoverPolicy ReadOnlyEndpointFailoverPolicy `json:"failoverPolicy,omitempty"`
4925}
4926
4927// FailoverGroupReadWriteEndpoint read-write endpoint of the failover group instance.
4928type FailoverGroupReadWriteEndpoint struct {
4929	// FailoverPolicy - Failover policy of the read-write endpoint for the failover group. If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible values include: 'Manual', 'Automatic'
4930	FailoverPolicy ReadWriteEndpointFailoverPolicy `json:"failoverPolicy,omitempty"`
4931	// FailoverWithDataLossGracePeriodMinutes - Grace period before failover with data loss is attempted for the read-write endpoint. If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required.
4932	FailoverWithDataLossGracePeriodMinutes *int32 `json:"failoverWithDataLossGracePeriodMinutes,omitempty"`
4933}
4934
4935// FailoverGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
4936// operation.
4937type FailoverGroupsCreateOrUpdateFuture struct {
4938	azure.Future
4939}
4940
4941// Result returns the result of the asynchronous operation.
4942// If the operation has not completed it will return an error.
4943func (future *FailoverGroupsCreateOrUpdateFuture) Result(client FailoverGroupsClient) (fg FailoverGroup, err error) {
4944	var done bool
4945	done, err = future.Done(client)
4946	if err != nil {
4947		err = autorest.NewErrorWithError(err, "sql.FailoverGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
4948		return
4949	}
4950	if !done {
4951		err = azure.NewAsyncOpIncompleteError("sql.FailoverGroupsCreateOrUpdateFuture")
4952		return
4953	}
4954	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4955	if fg.Response.Response, err = future.GetResult(sender); err == nil && fg.Response.Response.StatusCode != http.StatusNoContent {
4956		fg, err = client.CreateOrUpdateResponder(fg.Response.Response)
4957		if err != nil {
4958			err = autorest.NewErrorWithError(err, "sql.FailoverGroupsCreateOrUpdateFuture", "Result", fg.Response.Response, "Failure responding to request")
4959		}
4960	}
4961	return
4962}
4963
4964// FailoverGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation.
4965type FailoverGroupsDeleteFuture struct {
4966	azure.Future
4967}
4968
4969// Result returns the result of the asynchronous operation.
4970// If the operation has not completed it will return an error.
4971func (future *FailoverGroupsDeleteFuture) Result(client FailoverGroupsClient) (ar autorest.Response, err error) {
4972	var done bool
4973	done, err = future.Done(client)
4974	if err != nil {
4975		err = autorest.NewErrorWithError(err, "sql.FailoverGroupsDeleteFuture", "Result", future.Response(), "Polling failure")
4976		return
4977	}
4978	if !done {
4979		err = azure.NewAsyncOpIncompleteError("sql.FailoverGroupsDeleteFuture")
4980		return
4981	}
4982	ar.Response = future.Response()
4983	return
4984}
4985
4986// FailoverGroupsFailoverFuture an abstraction for monitoring and retrieving the results of a long-running
4987// operation.
4988type FailoverGroupsFailoverFuture struct {
4989	azure.Future
4990}
4991
4992// Result returns the result of the asynchronous operation.
4993// If the operation has not completed it will return an error.
4994func (future *FailoverGroupsFailoverFuture) Result(client FailoverGroupsClient) (fg FailoverGroup, err error) {
4995	var done bool
4996	done, err = future.Done(client)
4997	if err != nil {
4998		err = autorest.NewErrorWithError(err, "sql.FailoverGroupsFailoverFuture", "Result", future.Response(), "Polling failure")
4999		return
5000	}
5001	if !done {
5002		err = azure.NewAsyncOpIncompleteError("sql.FailoverGroupsFailoverFuture")
5003		return
5004	}
5005	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5006	if fg.Response.Response, err = future.GetResult(sender); err == nil && fg.Response.Response.StatusCode != http.StatusNoContent {
5007		fg, err = client.FailoverResponder(fg.Response.Response)
5008		if err != nil {
5009			err = autorest.NewErrorWithError(err, "sql.FailoverGroupsFailoverFuture", "Result", fg.Response.Response, "Failure responding to request")
5010		}
5011	}
5012	return
5013}
5014
5015// FailoverGroupsForceFailoverAllowDataLossFuture an abstraction for monitoring and retrieving the results of a
5016// long-running operation.
5017type FailoverGroupsForceFailoverAllowDataLossFuture struct {
5018	azure.Future
5019}
5020
5021// Result returns the result of the asynchronous operation.
5022// If the operation has not completed it will return an error.
5023func (future *FailoverGroupsForceFailoverAllowDataLossFuture) Result(client FailoverGroupsClient) (fg FailoverGroup, err error) {
5024	var done bool
5025	done, err = future.Done(client)
5026	if err != nil {
5027		err = autorest.NewErrorWithError(err, "sql.FailoverGroupsForceFailoverAllowDataLossFuture", "Result", future.Response(), "Polling failure")
5028		return
5029	}
5030	if !done {
5031		err = azure.NewAsyncOpIncompleteError("sql.FailoverGroupsForceFailoverAllowDataLossFuture")
5032		return
5033	}
5034	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5035	if fg.Response.Response, err = future.GetResult(sender); err == nil && fg.Response.Response.StatusCode != http.StatusNoContent {
5036		fg, err = client.ForceFailoverAllowDataLossResponder(fg.Response.Response)
5037		if err != nil {
5038			err = autorest.NewErrorWithError(err, "sql.FailoverGroupsForceFailoverAllowDataLossFuture", "Result", fg.Response.Response, "Failure responding to request")
5039		}
5040	}
5041	return
5042}
5043
5044// FailoverGroupsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
5045type FailoverGroupsUpdateFuture struct {
5046	azure.Future
5047}
5048
5049// Result returns the result of the asynchronous operation.
5050// If the operation has not completed it will return an error.
5051func (future *FailoverGroupsUpdateFuture) Result(client FailoverGroupsClient) (fg FailoverGroup, err error) {
5052	var done bool
5053	done, err = future.Done(client)
5054	if err != nil {
5055		err = autorest.NewErrorWithError(err, "sql.FailoverGroupsUpdateFuture", "Result", future.Response(), "Polling failure")
5056		return
5057	}
5058	if !done {
5059		err = azure.NewAsyncOpIncompleteError("sql.FailoverGroupsUpdateFuture")
5060		return
5061	}
5062	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5063	if fg.Response.Response, err = future.GetResult(sender); err == nil && fg.Response.Response.StatusCode != http.StatusNoContent {
5064		fg, err = client.UpdateResponder(fg.Response.Response)
5065		if err != nil {
5066			err = autorest.NewErrorWithError(err, "sql.FailoverGroupsUpdateFuture", "Result", fg.Response.Response, "Failure responding to request")
5067		}
5068	}
5069	return
5070}
5071
5072// FailoverGroupUpdate a failover group update request.
5073type FailoverGroupUpdate struct {
5074	// FailoverGroupUpdateProperties - Resource properties.
5075	*FailoverGroupUpdateProperties `json:"properties,omitempty"`
5076	// Tags - Resource tags.
5077	Tags map[string]*string `json:"tags"`
5078}
5079
5080// MarshalJSON is the custom marshaler for FailoverGroupUpdate.
5081func (fgu FailoverGroupUpdate) MarshalJSON() ([]byte, error) {
5082	objectMap := make(map[string]interface{})
5083	if fgu.FailoverGroupUpdateProperties != nil {
5084		objectMap["properties"] = fgu.FailoverGroupUpdateProperties
5085	}
5086	if fgu.Tags != nil {
5087		objectMap["tags"] = fgu.Tags
5088	}
5089	return json.Marshal(objectMap)
5090}
5091
5092// UnmarshalJSON is the custom unmarshaler for FailoverGroupUpdate struct.
5093func (fgu *FailoverGroupUpdate) UnmarshalJSON(body []byte) error {
5094	var m map[string]*json.RawMessage
5095	err := json.Unmarshal(body, &m)
5096	if err != nil {
5097		return err
5098	}
5099	for k, v := range m {
5100		switch k {
5101		case "properties":
5102			if v != nil {
5103				var failoverGroupUpdateProperties FailoverGroupUpdateProperties
5104				err = json.Unmarshal(*v, &failoverGroupUpdateProperties)
5105				if err != nil {
5106					return err
5107				}
5108				fgu.FailoverGroupUpdateProperties = &failoverGroupUpdateProperties
5109			}
5110		case "tags":
5111			if v != nil {
5112				var tags map[string]*string
5113				err = json.Unmarshal(*v, &tags)
5114				if err != nil {
5115					return err
5116				}
5117				fgu.Tags = tags
5118			}
5119		}
5120	}
5121
5122	return nil
5123}
5124
5125// FailoverGroupUpdateProperties properties of a failover group update.
5126type FailoverGroupUpdateProperties struct {
5127	// ReadWriteEndpoint - Read-write endpoint of the failover group instance.
5128	ReadWriteEndpoint *FailoverGroupReadWriteEndpoint `json:"readWriteEndpoint,omitempty"`
5129	// ReadOnlyEndpoint - Read-only endpoint of the failover group instance.
5130	ReadOnlyEndpoint *FailoverGroupReadOnlyEndpoint `json:"readOnlyEndpoint,omitempty"`
5131	// Databases - List of databases in the failover group.
5132	Databases *[]string `json:"databases,omitempty"`
5133}
5134
5135// FirewallRule represents a server firewall rule.
5136type FirewallRule struct {
5137	autorest.Response `json:"-"`
5138	// Kind - Kind of server that contains this firewall rule.
5139	Kind *string `json:"kind,omitempty"`
5140	// Location - Location of the server that contains this firewall rule.
5141	Location *string `json:"location,omitempty"`
5142	// FirewallRuleProperties - The properties representing the resource.
5143	*FirewallRuleProperties `json:"properties,omitempty"`
5144	// ID - Resource ID.
5145	ID *string `json:"id,omitempty"`
5146	// Name - Resource name.
5147	Name *string `json:"name,omitempty"`
5148	// Type - Resource type.
5149	Type *string `json:"type,omitempty"`
5150}
5151
5152// MarshalJSON is the custom marshaler for FirewallRule.
5153func (fr FirewallRule) MarshalJSON() ([]byte, error) {
5154	objectMap := make(map[string]interface{})
5155	if fr.Kind != nil {
5156		objectMap["kind"] = fr.Kind
5157	}
5158	if fr.Location != nil {
5159		objectMap["location"] = fr.Location
5160	}
5161	if fr.FirewallRuleProperties != nil {
5162		objectMap["properties"] = fr.FirewallRuleProperties
5163	}
5164	if fr.ID != nil {
5165		objectMap["id"] = fr.ID
5166	}
5167	if fr.Name != nil {
5168		objectMap["name"] = fr.Name
5169	}
5170	if fr.Type != nil {
5171		objectMap["type"] = fr.Type
5172	}
5173	return json.Marshal(objectMap)
5174}
5175
5176// UnmarshalJSON is the custom unmarshaler for FirewallRule struct.
5177func (fr *FirewallRule) UnmarshalJSON(body []byte) error {
5178	var m map[string]*json.RawMessage
5179	err := json.Unmarshal(body, &m)
5180	if err != nil {
5181		return err
5182	}
5183	for k, v := range m {
5184		switch k {
5185		case "kind":
5186			if v != nil {
5187				var kind string
5188				err = json.Unmarshal(*v, &kind)
5189				if err != nil {
5190					return err
5191				}
5192				fr.Kind = &kind
5193			}
5194		case "location":
5195			if v != nil {
5196				var location string
5197				err = json.Unmarshal(*v, &location)
5198				if err != nil {
5199					return err
5200				}
5201				fr.Location = &location
5202			}
5203		case "properties":
5204			if v != nil {
5205				var firewallRuleProperties FirewallRuleProperties
5206				err = json.Unmarshal(*v, &firewallRuleProperties)
5207				if err != nil {
5208					return err
5209				}
5210				fr.FirewallRuleProperties = &firewallRuleProperties
5211			}
5212		case "id":
5213			if v != nil {
5214				var ID string
5215				err = json.Unmarshal(*v, &ID)
5216				if err != nil {
5217					return err
5218				}
5219				fr.ID = &ID
5220			}
5221		case "name":
5222			if v != nil {
5223				var name string
5224				err = json.Unmarshal(*v, &name)
5225				if err != nil {
5226					return err
5227				}
5228				fr.Name = &name
5229			}
5230		case "type":
5231			if v != nil {
5232				var typeVar string
5233				err = json.Unmarshal(*v, &typeVar)
5234				if err != nil {
5235					return err
5236				}
5237				fr.Type = &typeVar
5238			}
5239		}
5240	}
5241
5242	return nil
5243}
5244
5245// FirewallRuleListResult represents the response to a List Firewall Rules request.
5246type FirewallRuleListResult struct {
5247	autorest.Response `json:"-"`
5248	// Value - The list of server firewall rules.
5249	Value *[]FirewallRule `json:"value,omitempty"`
5250}
5251
5252// FirewallRuleProperties represents the properties of a server firewall rule.
5253type FirewallRuleProperties struct {
5254	// StartIPAddress - The start IP address of the firewall rule. Must be IPv4 format. Use value '0.0.0.0' to represent all Azure-internal IP addresses.
5255	StartIPAddress *string `json:"startIpAddress,omitempty"`
5256	// EndIPAddress - The end IP address of the firewall rule. Must be IPv4 format. Must be greater than or equal to startIpAddress. Use value '0.0.0.0' to represent all Azure-internal IP addresses.
5257	EndIPAddress *string `json:"endIpAddress,omitempty"`
5258}
5259
5260// GeoBackupPolicy a database geo backup policy.
5261type GeoBackupPolicy struct {
5262	autorest.Response `json:"-"`
5263	// GeoBackupPolicyProperties - The properties of the geo backup policy.
5264	*GeoBackupPolicyProperties `json:"properties,omitempty"`
5265	// Kind - Kind of geo backup policy.  This is metadata used for the Azure portal experience.
5266	Kind *string `json:"kind,omitempty"`
5267	// Location - Backup policy location.
5268	Location *string `json:"location,omitempty"`
5269	// ID - Resource ID.
5270	ID *string `json:"id,omitempty"`
5271	// Name - Resource name.
5272	Name *string `json:"name,omitempty"`
5273	// Type - Resource type.
5274	Type *string `json:"type,omitempty"`
5275}
5276
5277// MarshalJSON is the custom marshaler for GeoBackupPolicy.
5278func (gbp GeoBackupPolicy) MarshalJSON() ([]byte, error) {
5279	objectMap := make(map[string]interface{})
5280	if gbp.GeoBackupPolicyProperties != nil {
5281		objectMap["properties"] = gbp.GeoBackupPolicyProperties
5282	}
5283	if gbp.Kind != nil {
5284		objectMap["kind"] = gbp.Kind
5285	}
5286	if gbp.Location != nil {
5287		objectMap["location"] = gbp.Location
5288	}
5289	if gbp.ID != nil {
5290		objectMap["id"] = gbp.ID
5291	}
5292	if gbp.Name != nil {
5293		objectMap["name"] = gbp.Name
5294	}
5295	if gbp.Type != nil {
5296		objectMap["type"] = gbp.Type
5297	}
5298	return json.Marshal(objectMap)
5299}
5300
5301// UnmarshalJSON is the custom unmarshaler for GeoBackupPolicy struct.
5302func (gbp *GeoBackupPolicy) UnmarshalJSON(body []byte) error {
5303	var m map[string]*json.RawMessage
5304	err := json.Unmarshal(body, &m)
5305	if err != nil {
5306		return err
5307	}
5308	for k, v := range m {
5309		switch k {
5310		case "properties":
5311			if v != nil {
5312				var geoBackupPolicyProperties GeoBackupPolicyProperties
5313				err = json.Unmarshal(*v, &geoBackupPolicyProperties)
5314				if err != nil {
5315					return err
5316				}
5317				gbp.GeoBackupPolicyProperties = &geoBackupPolicyProperties
5318			}
5319		case "kind":
5320			if v != nil {
5321				var kind string
5322				err = json.Unmarshal(*v, &kind)
5323				if err != nil {
5324					return err
5325				}
5326				gbp.Kind = &kind
5327			}
5328		case "location":
5329			if v != nil {
5330				var location string
5331				err = json.Unmarshal(*v, &location)
5332				if err != nil {
5333					return err
5334				}
5335				gbp.Location = &location
5336			}
5337		case "id":
5338			if v != nil {
5339				var ID string
5340				err = json.Unmarshal(*v, &ID)
5341				if err != nil {
5342					return err
5343				}
5344				gbp.ID = &ID
5345			}
5346		case "name":
5347			if v != nil {
5348				var name string
5349				err = json.Unmarshal(*v, &name)
5350				if err != nil {
5351					return err
5352				}
5353				gbp.Name = &name
5354			}
5355		case "type":
5356			if v != nil {
5357				var typeVar string
5358				err = json.Unmarshal(*v, &typeVar)
5359				if err != nil {
5360					return err
5361				}
5362				gbp.Type = &typeVar
5363			}
5364		}
5365	}
5366
5367	return nil
5368}
5369
5370// GeoBackupPolicyListResult the response to a list geo backup policies request.
5371type GeoBackupPolicyListResult struct {
5372	autorest.Response `json:"-"`
5373	// Value - The list of geo backup policies.
5374	Value *[]GeoBackupPolicy `json:"value,omitempty"`
5375}
5376
5377// GeoBackupPolicyProperties the properties of the geo backup policy.
5378type GeoBackupPolicyProperties struct {
5379	// State - The state of the geo backup policy. Possible values include: 'GeoBackupPolicyStateDisabled', 'GeoBackupPolicyStateEnabled'
5380	State GeoBackupPolicyState `json:"state,omitempty"`
5381	// StorageType - The storage type of the geo backup policy.
5382	StorageType *string `json:"storageType,omitempty"`
5383}
5384
5385// ImportExportResponse response for Import/Export Get operation.
5386type ImportExportResponse struct {
5387	autorest.Response `json:"-"`
5388	// ImportExportResponseProperties - The import/export operation properties.
5389	*ImportExportResponseProperties `json:"properties,omitempty"`
5390	// ID - Resource ID.
5391	ID *string `json:"id,omitempty"`
5392	// Name - Resource name.
5393	Name *string `json:"name,omitempty"`
5394	// Type - Resource type.
5395	Type *string `json:"type,omitempty"`
5396}
5397
5398// MarshalJSON is the custom marshaler for ImportExportResponse.
5399func (ier ImportExportResponse) MarshalJSON() ([]byte, error) {
5400	objectMap := make(map[string]interface{})
5401	if ier.ImportExportResponseProperties != nil {
5402		objectMap["properties"] = ier.ImportExportResponseProperties
5403	}
5404	if ier.ID != nil {
5405		objectMap["id"] = ier.ID
5406	}
5407	if ier.Name != nil {
5408		objectMap["name"] = ier.Name
5409	}
5410	if ier.Type != nil {
5411		objectMap["type"] = ier.Type
5412	}
5413	return json.Marshal(objectMap)
5414}
5415
5416// UnmarshalJSON is the custom unmarshaler for ImportExportResponse struct.
5417func (ier *ImportExportResponse) UnmarshalJSON(body []byte) error {
5418	var m map[string]*json.RawMessage
5419	err := json.Unmarshal(body, &m)
5420	if err != nil {
5421		return err
5422	}
5423	for k, v := range m {
5424		switch k {
5425		case "properties":
5426			if v != nil {
5427				var importExportResponseProperties ImportExportResponseProperties
5428				err = json.Unmarshal(*v, &importExportResponseProperties)
5429				if err != nil {
5430					return err
5431				}
5432				ier.ImportExportResponseProperties = &importExportResponseProperties
5433			}
5434		case "id":
5435			if v != nil {
5436				var ID string
5437				err = json.Unmarshal(*v, &ID)
5438				if err != nil {
5439					return err
5440				}
5441				ier.ID = &ID
5442			}
5443		case "name":
5444			if v != nil {
5445				var name string
5446				err = json.Unmarshal(*v, &name)
5447				if err != nil {
5448					return err
5449				}
5450				ier.Name = &name
5451			}
5452		case "type":
5453			if v != nil {
5454				var typeVar string
5455				err = json.Unmarshal(*v, &typeVar)
5456				if err != nil {
5457					return err
5458				}
5459				ier.Type = &typeVar
5460			}
5461		}
5462	}
5463
5464	return nil
5465}
5466
5467// ImportExportResponseProperties response for Import/Export Status operation.
5468type ImportExportResponseProperties struct {
5469	// RequestType - The request type of the operation.
5470	RequestType *string `json:"requestType,omitempty"`
5471	// RequestID - The request type of the operation.
5472	RequestID *uuid.UUID `json:"requestId,omitempty"`
5473	// ServerName - The name of the server.
5474	ServerName *string `json:"serverName,omitempty"`
5475	// DatabaseName - The name of the database.
5476	DatabaseName *string `json:"databaseName,omitempty"`
5477	// Status - The status message returned from the server.
5478	Status *string `json:"status,omitempty"`
5479	// LastModifiedTime - The operation status last modified time.
5480	LastModifiedTime *string `json:"lastModifiedTime,omitempty"`
5481	// QueuedTime - The operation queued time.
5482	QueuedTime *string `json:"queuedTime,omitempty"`
5483	// BlobURI - The blob uri.
5484	BlobURI *string `json:"blobUri,omitempty"`
5485	// ErrorMessage - The error message returned from the server.
5486	ErrorMessage *string `json:"errorMessage,omitempty"`
5487}
5488
5489// ImportExtensionProperties represents the properties for an import operation
5490type ImportExtensionProperties struct {
5491	// OperationMode - The type of import operation being performed. This is always Import.
5492	OperationMode *string `json:"operationMode,omitempty"`
5493	// StorageKeyType - The type of the storage key to use. Possible values include: 'StorageAccessKey', 'SharedAccessKey'
5494	StorageKeyType StorageKeyType `json:"storageKeyType,omitempty"`
5495	// StorageKey - The storage key to use.  If storage key type is SharedAccessKey, it must be preceded with a "?."
5496	StorageKey *string `json:"storageKey,omitempty"`
5497	// StorageURI - The storage uri to use.
5498	StorageURI *string `json:"storageUri,omitempty"`
5499	// AdministratorLogin - The name of the SQL administrator.
5500	AdministratorLogin *string `json:"administratorLogin,omitempty"`
5501	// AdministratorLoginPassword - The password of the SQL administrator.
5502	AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"`
5503	// AuthenticationType - The authentication type. Possible values include: 'SQL', 'ADPassword'
5504	AuthenticationType AuthenticationType `json:"authenticationType,omitempty"`
5505}
5506
5507// ImportExtensionRequest import database parameters.
5508type ImportExtensionRequest struct {
5509	// Name - The name of the extension.
5510	Name *string `json:"name,omitempty"`
5511	// Type - The type of the extension.
5512	Type *string `json:"type,omitempty"`
5513	// ImportExtensionProperties - Represents the properties of the resource.
5514	*ImportExtensionProperties `json:"properties,omitempty"`
5515}
5516
5517// MarshalJSON is the custom marshaler for ImportExtensionRequest.
5518func (ier ImportExtensionRequest) MarshalJSON() ([]byte, error) {
5519	objectMap := make(map[string]interface{})
5520	if ier.Name != nil {
5521		objectMap["name"] = ier.Name
5522	}
5523	if ier.Type != nil {
5524		objectMap["type"] = ier.Type
5525	}
5526	if ier.ImportExtensionProperties != nil {
5527		objectMap["properties"] = ier.ImportExtensionProperties
5528	}
5529	return json.Marshal(objectMap)
5530}
5531
5532// UnmarshalJSON is the custom unmarshaler for ImportExtensionRequest struct.
5533func (ier *ImportExtensionRequest) UnmarshalJSON(body []byte) error {
5534	var m map[string]*json.RawMessage
5535	err := json.Unmarshal(body, &m)
5536	if err != nil {
5537		return err
5538	}
5539	for k, v := range m {
5540		switch k {
5541		case "name":
5542			if v != nil {
5543				var name string
5544				err = json.Unmarshal(*v, &name)
5545				if err != nil {
5546					return err
5547				}
5548				ier.Name = &name
5549			}
5550		case "type":
5551			if v != nil {
5552				var typeVar string
5553				err = json.Unmarshal(*v, &typeVar)
5554				if err != nil {
5555					return err
5556				}
5557				ier.Type = &typeVar
5558			}
5559		case "properties":
5560			if v != nil {
5561				var importExtensionProperties ImportExtensionProperties
5562				err = json.Unmarshal(*v, &importExtensionProperties)
5563				if err != nil {
5564					return err
5565				}
5566				ier.ImportExtensionProperties = &importExtensionProperties
5567			}
5568		}
5569	}
5570
5571	return nil
5572}
5573
5574// ImportRequest import database parameters.
5575type ImportRequest struct {
5576	// DatabaseName - The name of the database to import.
5577	DatabaseName *string `json:"databaseName,omitempty"`
5578	// Edition - The edition for the database being created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2'
5579	Edition DatabaseEdition `json:"edition,omitempty"`
5580	// ServiceObjectiveName - The name of the service objective to assign to the database. Possible values include: 'ServiceObjectiveNameSystem', 'ServiceObjectiveNameSystem0', 'ServiceObjectiveNameSystem1', 'ServiceObjectiveNameSystem2', 'ServiceObjectiveNameSystem3', 'ServiceObjectiveNameSystem4', 'ServiceObjectiveNameSystem2L', 'ServiceObjectiveNameSystem3L', 'ServiceObjectiveNameSystem4L', 'ServiceObjectiveNameFree', 'ServiceObjectiveNameBasic', 'ServiceObjectiveNameS0', 'ServiceObjectiveNameS1', 'ServiceObjectiveNameS2', 'ServiceObjectiveNameS3', 'ServiceObjectiveNameS4', 'ServiceObjectiveNameS6', 'ServiceObjectiveNameS7', 'ServiceObjectiveNameS9', 'ServiceObjectiveNameS12', 'ServiceObjectiveNameP1', 'ServiceObjectiveNameP2', 'ServiceObjectiveNameP3', 'ServiceObjectiveNameP4', 'ServiceObjectiveNameP6', 'ServiceObjectiveNameP11', 'ServiceObjectiveNameP15', 'ServiceObjectiveNamePRS1', 'ServiceObjectiveNamePRS2', 'ServiceObjectiveNamePRS4', 'ServiceObjectiveNamePRS6', 'ServiceObjectiveNameDW100', 'ServiceObjectiveNameDW200', 'ServiceObjectiveNameDW300', 'ServiceObjectiveNameDW400', 'ServiceObjectiveNameDW500', 'ServiceObjectiveNameDW600', 'ServiceObjectiveNameDW1000', 'ServiceObjectiveNameDW1200', 'ServiceObjectiveNameDW1000c', 'ServiceObjectiveNameDW1500', 'ServiceObjectiveNameDW1500c', 'ServiceObjectiveNameDW2000', 'ServiceObjectiveNameDW2000c', 'ServiceObjectiveNameDW3000', 'ServiceObjectiveNameDW2500c', 'ServiceObjectiveNameDW3000c', 'ServiceObjectiveNameDW6000', 'ServiceObjectiveNameDW5000c', 'ServiceObjectiveNameDW6000c', 'ServiceObjectiveNameDW7500c', 'ServiceObjectiveNameDW10000c', 'ServiceObjectiveNameDW15000c', 'ServiceObjectiveNameDW30000c', 'ServiceObjectiveNameDS100', 'ServiceObjectiveNameDS200', 'ServiceObjectiveNameDS300', 'ServiceObjectiveNameDS400', 'ServiceObjectiveNameDS500', 'ServiceObjectiveNameDS600', 'ServiceObjectiveNameDS1000', 'ServiceObjectiveNameDS1200', 'ServiceObjectiveNameDS1500', 'ServiceObjectiveNameDS2000', 'ServiceObjectiveNameElasticPool'
5581	ServiceObjectiveName ServiceObjectiveName `json:"serviceObjectiveName,omitempty"`
5582	// MaxSizeBytes - The maximum size for the newly imported database.
5583	MaxSizeBytes *string `json:"maxSizeBytes,omitempty"`
5584	// StorageKeyType - The type of the storage key to use. Possible values include: 'StorageAccessKey', 'SharedAccessKey'
5585	StorageKeyType StorageKeyType `json:"storageKeyType,omitempty"`
5586	// StorageKey - The storage key to use.  If storage key type is SharedAccessKey, it must be preceded with a "?."
5587	StorageKey *string `json:"storageKey,omitempty"`
5588	// StorageURI - The storage uri to use.
5589	StorageURI *string `json:"storageUri,omitempty"`
5590	// AdministratorLogin - The name of the SQL administrator.
5591	AdministratorLogin *string `json:"administratorLogin,omitempty"`
5592	// AdministratorLoginPassword - The password of the SQL administrator.
5593	AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"`
5594	// AuthenticationType - The authentication type. Possible values include: 'SQL', 'ADPassword'
5595	AuthenticationType AuthenticationType `json:"authenticationType,omitempty"`
5596}
5597
5598// Job a job.
5599type Job struct {
5600	autorest.Response `json:"-"`
5601	// JobProperties - Resource properties.
5602	*JobProperties `json:"properties,omitempty"`
5603	// ID - Resource ID.
5604	ID *string `json:"id,omitempty"`
5605	// Name - Resource name.
5606	Name *string `json:"name,omitempty"`
5607	// Type - Resource type.
5608	Type *string `json:"type,omitempty"`
5609}
5610
5611// MarshalJSON is the custom marshaler for Job.
5612func (j Job) MarshalJSON() ([]byte, error) {
5613	objectMap := make(map[string]interface{})
5614	if j.JobProperties != nil {
5615		objectMap["properties"] = j.JobProperties
5616	}
5617	if j.ID != nil {
5618		objectMap["id"] = j.ID
5619	}
5620	if j.Name != nil {
5621		objectMap["name"] = j.Name
5622	}
5623	if j.Type != nil {
5624		objectMap["type"] = j.Type
5625	}
5626	return json.Marshal(objectMap)
5627}
5628
5629// UnmarshalJSON is the custom unmarshaler for Job struct.
5630func (j *Job) UnmarshalJSON(body []byte) error {
5631	var m map[string]*json.RawMessage
5632	err := json.Unmarshal(body, &m)
5633	if err != nil {
5634		return err
5635	}
5636	for k, v := range m {
5637		switch k {
5638		case "properties":
5639			if v != nil {
5640				var jobProperties JobProperties
5641				err = json.Unmarshal(*v, &jobProperties)
5642				if err != nil {
5643					return err
5644				}
5645				j.JobProperties = &jobProperties
5646			}
5647		case "id":
5648			if v != nil {
5649				var ID string
5650				err = json.Unmarshal(*v, &ID)
5651				if err != nil {
5652					return err
5653				}
5654				j.ID = &ID
5655			}
5656		case "name":
5657			if v != nil {
5658				var name string
5659				err = json.Unmarshal(*v, &name)
5660				if err != nil {
5661					return err
5662				}
5663				j.Name = &name
5664			}
5665		case "type":
5666			if v != nil {
5667				var typeVar string
5668				err = json.Unmarshal(*v, &typeVar)
5669				if err != nil {
5670					return err
5671				}
5672				j.Type = &typeVar
5673			}
5674		}
5675	}
5676
5677	return nil
5678}
5679
5680// JobAgent an Azure SQL job agent.
5681type JobAgent struct {
5682	autorest.Response `json:"-"`
5683	// Sku - The name and tier of the SKU.
5684	Sku *Sku `json:"sku,omitempty"`
5685	// JobAgentProperties - Resource properties.
5686	*JobAgentProperties `json:"properties,omitempty"`
5687	// Location - Resource location.
5688	Location *string `json:"location,omitempty"`
5689	// Tags - Resource tags.
5690	Tags map[string]*string `json:"tags"`
5691	// ID - Resource ID.
5692	ID *string `json:"id,omitempty"`
5693	// Name - Resource name.
5694	Name *string `json:"name,omitempty"`
5695	// Type - Resource type.
5696	Type *string `json:"type,omitempty"`
5697}
5698
5699// MarshalJSON is the custom marshaler for JobAgent.
5700func (ja JobAgent) MarshalJSON() ([]byte, error) {
5701	objectMap := make(map[string]interface{})
5702	if ja.Sku != nil {
5703		objectMap["sku"] = ja.Sku
5704	}
5705	if ja.JobAgentProperties != nil {
5706		objectMap["properties"] = ja.JobAgentProperties
5707	}
5708	if ja.Location != nil {
5709		objectMap["location"] = ja.Location
5710	}
5711	if ja.Tags != nil {
5712		objectMap["tags"] = ja.Tags
5713	}
5714	if ja.ID != nil {
5715		objectMap["id"] = ja.ID
5716	}
5717	if ja.Name != nil {
5718		objectMap["name"] = ja.Name
5719	}
5720	if ja.Type != nil {
5721		objectMap["type"] = ja.Type
5722	}
5723	return json.Marshal(objectMap)
5724}
5725
5726// UnmarshalJSON is the custom unmarshaler for JobAgent struct.
5727func (ja *JobAgent) UnmarshalJSON(body []byte) error {
5728	var m map[string]*json.RawMessage
5729	err := json.Unmarshal(body, &m)
5730	if err != nil {
5731		return err
5732	}
5733	for k, v := range m {
5734		switch k {
5735		case "sku":
5736			if v != nil {
5737				var sku Sku
5738				err = json.Unmarshal(*v, &sku)
5739				if err != nil {
5740					return err
5741				}
5742				ja.Sku = &sku
5743			}
5744		case "properties":
5745			if v != nil {
5746				var jobAgentProperties JobAgentProperties
5747				err = json.Unmarshal(*v, &jobAgentProperties)
5748				if err != nil {
5749					return err
5750				}
5751				ja.JobAgentProperties = &jobAgentProperties
5752			}
5753		case "location":
5754			if v != nil {
5755				var location string
5756				err = json.Unmarshal(*v, &location)
5757				if err != nil {
5758					return err
5759				}
5760				ja.Location = &location
5761			}
5762		case "tags":
5763			if v != nil {
5764				var tags map[string]*string
5765				err = json.Unmarshal(*v, &tags)
5766				if err != nil {
5767					return err
5768				}
5769				ja.Tags = tags
5770			}
5771		case "id":
5772			if v != nil {
5773				var ID string
5774				err = json.Unmarshal(*v, &ID)
5775				if err != nil {
5776					return err
5777				}
5778				ja.ID = &ID
5779			}
5780		case "name":
5781			if v != nil {
5782				var name string
5783				err = json.Unmarshal(*v, &name)
5784				if err != nil {
5785					return err
5786				}
5787				ja.Name = &name
5788			}
5789		case "type":
5790			if v != nil {
5791				var typeVar string
5792				err = json.Unmarshal(*v, &typeVar)
5793				if err != nil {
5794					return err
5795				}
5796				ja.Type = &typeVar
5797			}
5798		}
5799	}
5800
5801	return nil
5802}
5803
5804// JobAgentListResult a list of Azure SQL job agents.
5805type JobAgentListResult struct {
5806	autorest.Response `json:"-"`
5807	// Value - Array of results.
5808	Value *[]JobAgent `json:"value,omitempty"`
5809	// NextLink - Link to retrieve next page of results.
5810	NextLink *string `json:"nextLink,omitempty"`
5811}
5812
5813// JobAgentListResultIterator provides access to a complete listing of JobAgent values.
5814type JobAgentListResultIterator struct {
5815	i    int
5816	page JobAgentListResultPage
5817}
5818
5819// Next advances to the next value.  If there was an error making
5820// the request the iterator does not advance and the error is returned.
5821func (iter *JobAgentListResultIterator) Next() error {
5822	iter.i++
5823	if iter.i < len(iter.page.Values()) {
5824		return nil
5825	}
5826	err := iter.page.Next()
5827	if err != nil {
5828		iter.i--
5829		return err
5830	}
5831	iter.i = 0
5832	return nil
5833}
5834
5835// NotDone returns true if the enumeration should be started or is not yet complete.
5836func (iter JobAgentListResultIterator) NotDone() bool {
5837	return iter.page.NotDone() && iter.i < len(iter.page.Values())
5838}
5839
5840// Response returns the raw server response from the last page request.
5841func (iter JobAgentListResultIterator) Response() JobAgentListResult {
5842	return iter.page.Response()
5843}
5844
5845// Value returns the current value or a zero-initialized value if the
5846// iterator has advanced beyond the end of the collection.
5847func (iter JobAgentListResultIterator) Value() JobAgent {
5848	if !iter.page.NotDone() {
5849		return JobAgent{}
5850	}
5851	return iter.page.Values()[iter.i]
5852}
5853
5854// IsEmpty returns true if the ListResult contains no values.
5855func (jalr JobAgentListResult) IsEmpty() bool {
5856	return jalr.Value == nil || len(*jalr.Value) == 0
5857}
5858
5859// jobAgentListResultPreparer prepares a request to retrieve the next set of results.
5860// It returns nil if no more results exist.
5861func (jalr JobAgentListResult) jobAgentListResultPreparer() (*http.Request, error) {
5862	if jalr.NextLink == nil || len(to.String(jalr.NextLink)) < 1 {
5863		return nil, nil
5864	}
5865	return autorest.Prepare(&http.Request{},
5866		autorest.AsJSON(),
5867		autorest.AsGet(),
5868		autorest.WithBaseURL(to.String(jalr.NextLink)))
5869}
5870
5871// JobAgentListResultPage contains a page of JobAgent values.
5872type JobAgentListResultPage struct {
5873	fn   func(JobAgentListResult) (JobAgentListResult, error)
5874	jalr JobAgentListResult
5875}
5876
5877// Next advances to the next page of values.  If there was an error making
5878// the request the page does not advance and the error is returned.
5879func (page *JobAgentListResultPage) Next() error {
5880	next, err := page.fn(page.jalr)
5881	if err != nil {
5882		return err
5883	}
5884	page.jalr = next
5885	return nil
5886}
5887
5888// NotDone returns true if the page enumeration should be started or is not yet complete.
5889func (page JobAgentListResultPage) NotDone() bool {
5890	return !page.jalr.IsEmpty()
5891}
5892
5893// Response returns the raw server response from the last page request.
5894func (page JobAgentListResultPage) Response() JobAgentListResult {
5895	return page.jalr
5896}
5897
5898// Values returns the slice of values for the current page or nil if there are no values.
5899func (page JobAgentListResultPage) Values() []JobAgent {
5900	if page.jalr.IsEmpty() {
5901		return nil
5902	}
5903	return *page.jalr.Value
5904}
5905
5906// JobAgentProperties properties of a job agent.
5907type JobAgentProperties struct {
5908	// DatabaseID - Resource ID of the database to store job metadata in.
5909	DatabaseID *string `json:"databaseId,omitempty"`
5910	// State - The state of the job agent. Possible values include: 'JobAgentStateCreating', 'JobAgentStateReady', 'JobAgentStateUpdating', 'JobAgentStateDeleting', 'JobAgentStateDisabled'
5911	State JobAgentState `json:"state,omitempty"`
5912}
5913
5914// JobAgentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
5915// operation.
5916type JobAgentsCreateOrUpdateFuture struct {
5917	azure.Future
5918}
5919
5920// Result returns the result of the asynchronous operation.
5921// If the operation has not completed it will return an error.
5922func (future *JobAgentsCreateOrUpdateFuture) Result(client JobAgentsClient) (ja JobAgent, err error) {
5923	var done bool
5924	done, err = future.Done(client)
5925	if err != nil {
5926		err = autorest.NewErrorWithError(err, "sql.JobAgentsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
5927		return
5928	}
5929	if !done {
5930		err = azure.NewAsyncOpIncompleteError("sql.JobAgentsCreateOrUpdateFuture")
5931		return
5932	}
5933	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5934	if ja.Response.Response, err = future.GetResult(sender); err == nil && ja.Response.Response.StatusCode != http.StatusNoContent {
5935		ja, err = client.CreateOrUpdateResponder(ja.Response.Response)
5936		if err != nil {
5937			err = autorest.NewErrorWithError(err, "sql.JobAgentsCreateOrUpdateFuture", "Result", ja.Response.Response, "Failure responding to request")
5938		}
5939	}
5940	return
5941}
5942
5943// JobAgentsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation.
5944type JobAgentsDeleteFuture struct {
5945	azure.Future
5946}
5947
5948// Result returns the result of the asynchronous operation.
5949// If the operation has not completed it will return an error.
5950func (future *JobAgentsDeleteFuture) Result(client JobAgentsClient) (ar autorest.Response, err error) {
5951	var done bool
5952	done, err = future.Done(client)
5953	if err != nil {
5954		err = autorest.NewErrorWithError(err, "sql.JobAgentsDeleteFuture", "Result", future.Response(), "Polling failure")
5955		return
5956	}
5957	if !done {
5958		err = azure.NewAsyncOpIncompleteError("sql.JobAgentsDeleteFuture")
5959		return
5960	}
5961	ar.Response = future.Response()
5962	return
5963}
5964
5965// JobAgentsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
5966type JobAgentsUpdateFuture struct {
5967	azure.Future
5968}
5969
5970// Result returns the result of the asynchronous operation.
5971// If the operation has not completed it will return an error.
5972func (future *JobAgentsUpdateFuture) Result(client JobAgentsClient) (ja JobAgent, err error) {
5973	var done bool
5974	done, err = future.Done(client)
5975	if err != nil {
5976		err = autorest.NewErrorWithError(err, "sql.JobAgentsUpdateFuture", "Result", future.Response(), "Polling failure")
5977		return
5978	}
5979	if !done {
5980		err = azure.NewAsyncOpIncompleteError("sql.JobAgentsUpdateFuture")
5981		return
5982	}
5983	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5984	if ja.Response.Response, err = future.GetResult(sender); err == nil && ja.Response.Response.StatusCode != http.StatusNoContent {
5985		ja, err = client.UpdateResponder(ja.Response.Response)
5986		if err != nil {
5987			err = autorest.NewErrorWithError(err, "sql.JobAgentsUpdateFuture", "Result", ja.Response.Response, "Failure responding to request")
5988		}
5989	}
5990	return
5991}
5992
5993// JobAgentUpdate an update to an Azure SQL job agent.
5994type JobAgentUpdate struct {
5995	// Tags - Resource tags.
5996	Tags map[string]*string `json:"tags"`
5997}
5998
5999// MarshalJSON is the custom marshaler for JobAgentUpdate.
6000func (jau JobAgentUpdate) MarshalJSON() ([]byte, error) {
6001	objectMap := make(map[string]interface{})
6002	if jau.Tags != nil {
6003		objectMap["tags"] = jau.Tags
6004	}
6005	return json.Marshal(objectMap)
6006}
6007
6008// JobCredential a stored credential that can be used by a job to connect to target databases.
6009type JobCredential struct {
6010	autorest.Response `json:"-"`
6011	// JobCredentialProperties - Resource properties.
6012	*JobCredentialProperties `json:"properties,omitempty"`
6013	// ID - Resource ID.
6014	ID *string `json:"id,omitempty"`
6015	// Name - Resource name.
6016	Name *string `json:"name,omitempty"`
6017	// Type - Resource type.
6018	Type *string `json:"type,omitempty"`
6019}
6020
6021// MarshalJSON is the custom marshaler for JobCredential.
6022func (jc JobCredential) MarshalJSON() ([]byte, error) {
6023	objectMap := make(map[string]interface{})
6024	if jc.JobCredentialProperties != nil {
6025		objectMap["properties"] = jc.JobCredentialProperties
6026	}
6027	if jc.ID != nil {
6028		objectMap["id"] = jc.ID
6029	}
6030	if jc.Name != nil {
6031		objectMap["name"] = jc.Name
6032	}
6033	if jc.Type != nil {
6034		objectMap["type"] = jc.Type
6035	}
6036	return json.Marshal(objectMap)
6037}
6038
6039// UnmarshalJSON is the custom unmarshaler for JobCredential struct.
6040func (jc *JobCredential) UnmarshalJSON(body []byte) error {
6041	var m map[string]*json.RawMessage
6042	err := json.Unmarshal(body, &m)
6043	if err != nil {
6044		return err
6045	}
6046	for k, v := range m {
6047		switch k {
6048		case "properties":
6049			if v != nil {
6050				var jobCredentialProperties JobCredentialProperties
6051				err = json.Unmarshal(*v, &jobCredentialProperties)
6052				if err != nil {
6053					return err
6054				}
6055				jc.JobCredentialProperties = &jobCredentialProperties
6056			}
6057		case "id":
6058			if v != nil {
6059				var ID string
6060				err = json.Unmarshal(*v, &ID)
6061				if err != nil {
6062					return err
6063				}
6064				jc.ID = &ID
6065			}
6066		case "name":
6067			if v != nil {
6068				var name string
6069				err = json.Unmarshal(*v, &name)
6070				if err != nil {
6071					return err
6072				}
6073				jc.Name = &name
6074			}
6075		case "type":
6076			if v != nil {
6077				var typeVar string
6078				err = json.Unmarshal(*v, &typeVar)
6079				if err != nil {
6080					return err
6081				}
6082				jc.Type = &typeVar
6083			}
6084		}
6085	}
6086
6087	return nil
6088}
6089
6090// JobCredentialListResult a list of job credentials.
6091type JobCredentialListResult struct {
6092	autorest.Response `json:"-"`
6093	// Value - Array of results.
6094	Value *[]JobCredential `json:"value,omitempty"`
6095	// NextLink - Link to retrieve next page of results.
6096	NextLink *string `json:"nextLink,omitempty"`
6097}
6098
6099// JobCredentialListResultIterator provides access to a complete listing of JobCredential values.
6100type JobCredentialListResultIterator struct {
6101	i    int
6102	page JobCredentialListResultPage
6103}
6104
6105// Next advances to the next value.  If there was an error making
6106// the request the iterator does not advance and the error is returned.
6107func (iter *JobCredentialListResultIterator) Next() error {
6108	iter.i++
6109	if iter.i < len(iter.page.Values()) {
6110		return nil
6111	}
6112	err := iter.page.Next()
6113	if err != nil {
6114		iter.i--
6115		return err
6116	}
6117	iter.i = 0
6118	return nil
6119}
6120
6121// NotDone returns true if the enumeration should be started or is not yet complete.
6122func (iter JobCredentialListResultIterator) NotDone() bool {
6123	return iter.page.NotDone() && iter.i < len(iter.page.Values())
6124}
6125
6126// Response returns the raw server response from the last page request.
6127func (iter JobCredentialListResultIterator) Response() JobCredentialListResult {
6128	return iter.page.Response()
6129}
6130
6131// Value returns the current value or a zero-initialized value if the
6132// iterator has advanced beyond the end of the collection.
6133func (iter JobCredentialListResultIterator) Value() JobCredential {
6134	if !iter.page.NotDone() {
6135		return JobCredential{}
6136	}
6137	return iter.page.Values()[iter.i]
6138}
6139
6140// IsEmpty returns true if the ListResult contains no values.
6141func (jclr JobCredentialListResult) IsEmpty() bool {
6142	return jclr.Value == nil || len(*jclr.Value) == 0
6143}
6144
6145// jobCredentialListResultPreparer prepares a request to retrieve the next set of results.
6146// It returns nil if no more results exist.
6147func (jclr JobCredentialListResult) jobCredentialListResultPreparer() (*http.Request, error) {
6148	if jclr.NextLink == nil || len(to.String(jclr.NextLink)) < 1 {
6149		return nil, nil
6150	}
6151	return autorest.Prepare(&http.Request{},
6152		autorest.AsJSON(),
6153		autorest.AsGet(),
6154		autorest.WithBaseURL(to.String(jclr.NextLink)))
6155}
6156
6157// JobCredentialListResultPage contains a page of JobCredential values.
6158type JobCredentialListResultPage struct {
6159	fn   func(JobCredentialListResult) (JobCredentialListResult, error)
6160	jclr JobCredentialListResult
6161}
6162
6163// Next advances to the next page of values.  If there was an error making
6164// the request the page does not advance and the error is returned.
6165func (page *JobCredentialListResultPage) Next() error {
6166	next, err := page.fn(page.jclr)
6167	if err != nil {
6168		return err
6169	}
6170	page.jclr = next
6171	return nil
6172}
6173
6174// NotDone returns true if the page enumeration should be started or is not yet complete.
6175func (page JobCredentialListResultPage) NotDone() bool {
6176	return !page.jclr.IsEmpty()
6177}
6178
6179// Response returns the raw server response from the last page request.
6180func (page JobCredentialListResultPage) Response() JobCredentialListResult {
6181	return page.jclr
6182}
6183
6184// Values returns the slice of values for the current page or nil if there are no values.
6185func (page JobCredentialListResultPage) Values() []JobCredential {
6186	if page.jclr.IsEmpty() {
6187		return nil
6188	}
6189	return *page.jclr.Value
6190}
6191
6192// JobCredentialProperties properties of a job credential.
6193type JobCredentialProperties struct {
6194	// Username - The credential user name.
6195	Username *string `json:"username,omitempty"`
6196	// Password - The credential password.
6197	Password *string `json:"password,omitempty"`
6198}
6199
6200// JobExecution an execution of a job
6201type JobExecution struct {
6202	autorest.Response `json:"-"`
6203	// JobExecutionProperties - Resource properties.
6204	*JobExecutionProperties `json:"properties,omitempty"`
6205	// ID - Resource ID.
6206	ID *string `json:"id,omitempty"`
6207	// Name - Resource name.
6208	Name *string `json:"name,omitempty"`
6209	// Type - Resource type.
6210	Type *string `json:"type,omitempty"`
6211}
6212
6213// MarshalJSON is the custom marshaler for JobExecution.
6214func (je JobExecution) MarshalJSON() ([]byte, error) {
6215	objectMap := make(map[string]interface{})
6216	if je.JobExecutionProperties != nil {
6217		objectMap["properties"] = je.JobExecutionProperties
6218	}
6219	if je.ID != nil {
6220		objectMap["id"] = je.ID
6221	}
6222	if je.Name != nil {
6223		objectMap["name"] = je.Name
6224	}
6225	if je.Type != nil {
6226		objectMap["type"] = je.Type
6227	}
6228	return json.Marshal(objectMap)
6229}
6230
6231// UnmarshalJSON is the custom unmarshaler for JobExecution struct.
6232func (je *JobExecution) UnmarshalJSON(body []byte) error {
6233	var m map[string]*json.RawMessage
6234	err := json.Unmarshal(body, &m)
6235	if err != nil {
6236		return err
6237	}
6238	for k, v := range m {
6239		switch k {
6240		case "properties":
6241			if v != nil {
6242				var jobExecutionProperties JobExecutionProperties
6243				err = json.Unmarshal(*v, &jobExecutionProperties)
6244				if err != nil {
6245					return err
6246				}
6247				je.JobExecutionProperties = &jobExecutionProperties
6248			}
6249		case "id":
6250			if v != nil {
6251				var ID string
6252				err = json.Unmarshal(*v, &ID)
6253				if err != nil {
6254					return err
6255				}
6256				je.ID = &ID
6257			}
6258		case "name":
6259			if v != nil {
6260				var name string
6261				err = json.Unmarshal(*v, &name)
6262				if err != nil {
6263					return err
6264				}
6265				je.Name = &name
6266			}
6267		case "type":
6268			if v != nil {
6269				var typeVar string
6270				err = json.Unmarshal(*v, &typeVar)
6271				if err != nil {
6272					return err
6273				}
6274				je.Type = &typeVar
6275			}
6276		}
6277	}
6278
6279	return nil
6280}
6281
6282// JobExecutionListResult a list of job executions.
6283type JobExecutionListResult struct {
6284	autorest.Response `json:"-"`
6285	// Value - Array of results.
6286	Value *[]JobExecution `json:"value,omitempty"`
6287	// NextLink - Link to retrieve next page of results.
6288	NextLink *string `json:"nextLink,omitempty"`
6289}
6290
6291// JobExecutionListResultIterator provides access to a complete listing of JobExecution values.
6292type JobExecutionListResultIterator struct {
6293	i    int
6294	page JobExecutionListResultPage
6295}
6296
6297// Next advances to the next value.  If there was an error making
6298// the request the iterator does not advance and the error is returned.
6299func (iter *JobExecutionListResultIterator) Next() error {
6300	iter.i++
6301	if iter.i < len(iter.page.Values()) {
6302		return nil
6303	}
6304	err := iter.page.Next()
6305	if err != nil {
6306		iter.i--
6307		return err
6308	}
6309	iter.i = 0
6310	return nil
6311}
6312
6313// NotDone returns true if the enumeration should be started or is not yet complete.
6314func (iter JobExecutionListResultIterator) NotDone() bool {
6315	return iter.page.NotDone() && iter.i < len(iter.page.Values())
6316}
6317
6318// Response returns the raw server response from the last page request.
6319func (iter JobExecutionListResultIterator) Response() JobExecutionListResult {
6320	return iter.page.Response()
6321}
6322
6323// Value returns the current value or a zero-initialized value if the
6324// iterator has advanced beyond the end of the collection.
6325func (iter JobExecutionListResultIterator) Value() JobExecution {
6326	if !iter.page.NotDone() {
6327		return JobExecution{}
6328	}
6329	return iter.page.Values()[iter.i]
6330}
6331
6332// IsEmpty returns true if the ListResult contains no values.
6333func (jelr JobExecutionListResult) IsEmpty() bool {
6334	return jelr.Value == nil || len(*jelr.Value) == 0
6335}
6336
6337// jobExecutionListResultPreparer prepares a request to retrieve the next set of results.
6338// It returns nil if no more results exist.
6339func (jelr JobExecutionListResult) jobExecutionListResultPreparer() (*http.Request, error) {
6340	if jelr.NextLink == nil || len(to.String(jelr.NextLink)) < 1 {
6341		return nil, nil
6342	}
6343	return autorest.Prepare(&http.Request{},
6344		autorest.AsJSON(),
6345		autorest.AsGet(),
6346		autorest.WithBaseURL(to.String(jelr.NextLink)))
6347}
6348
6349// JobExecutionListResultPage contains a page of JobExecution values.
6350type JobExecutionListResultPage struct {
6351	fn   func(JobExecutionListResult) (JobExecutionListResult, error)
6352	jelr JobExecutionListResult
6353}
6354
6355// Next advances to the next page of values.  If there was an error making
6356// the request the page does not advance and the error is returned.
6357func (page *JobExecutionListResultPage) Next() error {
6358	next, err := page.fn(page.jelr)
6359	if err != nil {
6360		return err
6361	}
6362	page.jelr = next
6363	return nil
6364}
6365
6366// NotDone returns true if the page enumeration should be started or is not yet complete.
6367func (page JobExecutionListResultPage) NotDone() bool {
6368	return !page.jelr.IsEmpty()
6369}
6370
6371// Response returns the raw server response from the last page request.
6372func (page JobExecutionListResultPage) Response() JobExecutionListResult {
6373	return page.jelr
6374}
6375
6376// Values returns the slice of values for the current page or nil if there are no values.
6377func (page JobExecutionListResultPage) Values() []JobExecution {
6378	if page.jelr.IsEmpty() {
6379		return nil
6380	}
6381	return *page.jelr.Value
6382}
6383
6384// JobExecutionProperties properties for an Azure SQL Database Elastic job execution.
6385type JobExecutionProperties struct {
6386	// JobVersion - The job version number.
6387	JobVersion *int32 `json:"jobVersion,omitempty"`
6388	// StepName - The job step name.
6389	StepName *string `json:"stepName,omitempty"`
6390	// StepID - The job step id.
6391	StepID *int32 `json:"stepId,omitempty"`
6392	// JobExecutionID - The unique identifier of the job execution.
6393	JobExecutionID *uuid.UUID `json:"jobExecutionId,omitempty"`
6394	// Lifecycle - The detailed state of the job execution. Possible values include: 'Created', 'InProgress', 'WaitingForChildJobExecutions', 'WaitingForRetry', 'Succeeded', 'SucceededWithSkipped', 'Failed', 'TimedOut', 'Canceled', 'Skipped'
6395	Lifecycle JobExecutionLifecycle `json:"lifecycle,omitempty"`
6396	// ProvisioningState - The ARM provisioning state of the job execution. Possible values include: 'ProvisioningStateCreated', 'ProvisioningStateInProgress', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled'
6397	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
6398	// CreateTime - The time that the job execution was created.
6399	CreateTime *date.Time `json:"createTime,omitempty"`
6400	// StartTime - The time that the job execution started.
6401	StartTime *date.Time `json:"startTime,omitempty"`
6402	// EndTime - The time that the job execution completed.
6403	EndTime *date.Time `json:"endTime,omitempty"`
6404	// CurrentAttempts - Number of times the job execution has been attempted.
6405	CurrentAttempts *int32 `json:"currentAttempts,omitempty"`
6406	// CurrentAttemptStartTime - Start time of the current attempt.
6407	CurrentAttemptStartTime *date.Time `json:"currentAttemptStartTime,omitempty"`
6408	// LastMessage - The last status or error message.
6409	LastMessage *string `json:"lastMessage,omitempty"`
6410	// Target - The target that this execution is executed on.
6411	Target *JobExecutionTarget `json:"target,omitempty"`
6412}
6413
6414// JobExecutionsCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
6415type JobExecutionsCreateFuture struct {
6416	azure.Future
6417}
6418
6419// Result returns the result of the asynchronous operation.
6420// If the operation has not completed it will return an error.
6421func (future *JobExecutionsCreateFuture) Result(client JobExecutionsClient) (je JobExecution, err error) {
6422	var done bool
6423	done, err = future.Done(client)
6424	if err != nil {
6425		err = autorest.NewErrorWithError(err, "sql.JobExecutionsCreateFuture", "Result", future.Response(), "Polling failure")
6426		return
6427	}
6428	if !done {
6429		err = azure.NewAsyncOpIncompleteError("sql.JobExecutionsCreateFuture")
6430		return
6431	}
6432	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6433	if je.Response.Response, err = future.GetResult(sender); err == nil && je.Response.Response.StatusCode != http.StatusNoContent {
6434		je, err = client.CreateResponder(je.Response.Response)
6435		if err != nil {
6436			err = autorest.NewErrorWithError(err, "sql.JobExecutionsCreateFuture", "Result", je.Response.Response, "Failure responding to request")
6437		}
6438	}
6439	return
6440}
6441
6442// JobExecutionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
6443// operation.
6444type JobExecutionsCreateOrUpdateFuture struct {
6445	azure.Future
6446}
6447
6448// Result returns the result of the asynchronous operation.
6449// If the operation has not completed it will return an error.
6450func (future *JobExecutionsCreateOrUpdateFuture) Result(client JobExecutionsClient) (je JobExecution, err error) {
6451	var done bool
6452	done, err = future.Done(client)
6453	if err != nil {
6454		err = autorest.NewErrorWithError(err, "sql.JobExecutionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
6455		return
6456	}
6457	if !done {
6458		err = azure.NewAsyncOpIncompleteError("sql.JobExecutionsCreateOrUpdateFuture")
6459		return
6460	}
6461	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6462	if je.Response.Response, err = future.GetResult(sender); err == nil && je.Response.Response.StatusCode != http.StatusNoContent {
6463		je, err = client.CreateOrUpdateResponder(je.Response.Response)
6464		if err != nil {
6465			err = autorest.NewErrorWithError(err, "sql.JobExecutionsCreateOrUpdateFuture", "Result", je.Response.Response, "Failure responding to request")
6466		}
6467	}
6468	return
6469}
6470
6471// JobExecutionTarget the target that a job execution is executed on.
6472type JobExecutionTarget struct {
6473	// Type - The type of the target. Possible values include: 'JobTargetTypeTargetGroup', 'JobTargetTypeSQLDatabase', 'JobTargetTypeSQLElasticPool', 'JobTargetTypeSQLShardMap', 'JobTargetTypeSQLServer'
6474	Type JobTargetType `json:"type,omitempty"`
6475	// ServerName - The server name.
6476	ServerName *string `json:"serverName,omitempty"`
6477	// DatabaseName - The database name.
6478	DatabaseName *string `json:"databaseName,omitempty"`
6479}
6480
6481// JobListResult a list of jobs.
6482type JobListResult struct {
6483	autorest.Response `json:"-"`
6484	// Value - Array of results.
6485	Value *[]Job `json:"value,omitempty"`
6486	// NextLink - Link to retrieve next page of results.
6487	NextLink *string `json:"nextLink,omitempty"`
6488}
6489
6490// JobListResultIterator provides access to a complete listing of Job values.
6491type JobListResultIterator struct {
6492	i    int
6493	page JobListResultPage
6494}
6495
6496// Next advances to the next value.  If there was an error making
6497// the request the iterator does not advance and the error is returned.
6498func (iter *JobListResultIterator) Next() error {
6499	iter.i++
6500	if iter.i < len(iter.page.Values()) {
6501		return nil
6502	}
6503	err := iter.page.Next()
6504	if err != nil {
6505		iter.i--
6506		return err
6507	}
6508	iter.i = 0
6509	return nil
6510}
6511
6512// NotDone returns true if the enumeration should be started or is not yet complete.
6513func (iter JobListResultIterator) NotDone() bool {
6514	return iter.page.NotDone() && iter.i < len(iter.page.Values())
6515}
6516
6517// Response returns the raw server response from the last page request.
6518func (iter JobListResultIterator) Response() JobListResult {
6519	return iter.page.Response()
6520}
6521
6522// Value returns the current value or a zero-initialized value if the
6523// iterator has advanced beyond the end of the collection.
6524func (iter JobListResultIterator) Value() Job {
6525	if !iter.page.NotDone() {
6526		return Job{}
6527	}
6528	return iter.page.Values()[iter.i]
6529}
6530
6531// IsEmpty returns true if the ListResult contains no values.
6532func (jlr JobListResult) IsEmpty() bool {
6533	return jlr.Value == nil || len(*jlr.Value) == 0
6534}
6535
6536// jobListResultPreparer prepares a request to retrieve the next set of results.
6537// It returns nil if no more results exist.
6538func (jlr JobListResult) jobListResultPreparer() (*http.Request, error) {
6539	if jlr.NextLink == nil || len(to.String(jlr.NextLink)) < 1 {
6540		return nil, nil
6541	}
6542	return autorest.Prepare(&http.Request{},
6543		autorest.AsJSON(),
6544		autorest.AsGet(),
6545		autorest.WithBaseURL(to.String(jlr.NextLink)))
6546}
6547
6548// JobListResultPage contains a page of Job values.
6549type JobListResultPage struct {
6550	fn  func(JobListResult) (JobListResult, error)
6551	jlr JobListResult
6552}
6553
6554// Next advances to the next page of values.  If there was an error making
6555// the request the page does not advance and the error is returned.
6556func (page *JobListResultPage) Next() error {
6557	next, err := page.fn(page.jlr)
6558	if err != nil {
6559		return err
6560	}
6561	page.jlr = next
6562	return nil
6563}
6564
6565// NotDone returns true if the page enumeration should be started or is not yet complete.
6566func (page JobListResultPage) NotDone() bool {
6567	return !page.jlr.IsEmpty()
6568}
6569
6570// Response returns the raw server response from the last page request.
6571func (page JobListResultPage) Response() JobListResult {
6572	return page.jlr
6573}
6574
6575// Values returns the slice of values for the current page or nil if there are no values.
6576func (page JobListResultPage) Values() []Job {
6577	if page.jlr.IsEmpty() {
6578		return nil
6579	}
6580	return *page.jlr.Value
6581}
6582
6583// JobProperties properties of a job.
6584type JobProperties struct {
6585	// Description - User-defined description of the job.
6586	Description *string `json:"description,omitempty"`
6587	// Version - The job version number.
6588	Version *int32 `json:"version,omitempty"`
6589	// Schedule - Schedule properties of the job.
6590	Schedule *JobSchedule `json:"schedule,omitempty"`
6591}
6592
6593// JobSchedule scheduling properties of a job.
6594type JobSchedule struct {
6595	// StartTime - Schedule start time.
6596	StartTime *date.Time `json:"startTime,omitempty"`
6597	// EndTime - Schedule end time.
6598	EndTime *date.Time `json:"endTime,omitempty"`
6599	// Type - Schedule interval type. Possible values include: 'Once', 'Recurring'
6600	Type JobScheduleType `json:"type,omitempty"`
6601	// Enabled - Whether or not the schedule is enabled.
6602	Enabled *bool `json:"enabled,omitempty"`
6603	// Interval - Value of the schedule's recurring interval, if the scheduletype is recurring. ISO8601 duration format.
6604	Interval *string `json:"interval,omitempty"`
6605}
6606
6607// JobStep a job step.
6608type JobStep struct {
6609	autorest.Response `json:"-"`
6610	// JobStepProperties - Resource properties.
6611	*JobStepProperties `json:"properties,omitempty"`
6612	// ID - Resource ID.
6613	ID *string `json:"id,omitempty"`
6614	// Name - Resource name.
6615	Name *string `json:"name,omitempty"`
6616	// Type - Resource type.
6617	Type *string `json:"type,omitempty"`
6618}
6619
6620// MarshalJSON is the custom marshaler for JobStep.
6621func (js JobStep) MarshalJSON() ([]byte, error) {
6622	objectMap := make(map[string]interface{})
6623	if js.JobStepProperties != nil {
6624		objectMap["properties"] = js.JobStepProperties
6625	}
6626	if js.ID != nil {
6627		objectMap["id"] = js.ID
6628	}
6629	if js.Name != nil {
6630		objectMap["name"] = js.Name
6631	}
6632	if js.Type != nil {
6633		objectMap["type"] = js.Type
6634	}
6635	return json.Marshal(objectMap)
6636}
6637
6638// UnmarshalJSON is the custom unmarshaler for JobStep struct.
6639func (js *JobStep) UnmarshalJSON(body []byte) error {
6640	var m map[string]*json.RawMessage
6641	err := json.Unmarshal(body, &m)
6642	if err != nil {
6643		return err
6644	}
6645	for k, v := range m {
6646		switch k {
6647		case "properties":
6648			if v != nil {
6649				var jobStepProperties JobStepProperties
6650				err = json.Unmarshal(*v, &jobStepProperties)
6651				if err != nil {
6652					return err
6653				}
6654				js.JobStepProperties = &jobStepProperties
6655			}
6656		case "id":
6657			if v != nil {
6658				var ID string
6659				err = json.Unmarshal(*v, &ID)
6660				if err != nil {
6661					return err
6662				}
6663				js.ID = &ID
6664			}
6665		case "name":
6666			if v != nil {
6667				var name string
6668				err = json.Unmarshal(*v, &name)
6669				if err != nil {
6670					return err
6671				}
6672				js.Name = &name
6673			}
6674		case "type":
6675			if v != nil {
6676				var typeVar string
6677				err = json.Unmarshal(*v, &typeVar)
6678				if err != nil {
6679					return err
6680				}
6681				js.Type = &typeVar
6682			}
6683		}
6684	}
6685
6686	return nil
6687}
6688
6689// JobStepAction the action to be executed by a job step.
6690type JobStepAction struct {
6691	// Type - Type of action being executed by the job step. Possible values include: 'TSQL'
6692	Type JobStepActionType `json:"type,omitempty"`
6693	// Source - The source of the action to execute. Possible values include: 'Inline'
6694	Source JobStepActionSource `json:"source,omitempty"`
6695	// Value - The action value, for example the text of the T-SQL script to execute.
6696	Value *string `json:"value,omitempty"`
6697}
6698
6699// JobStepExecutionOptions the execution options of a job step.
6700type JobStepExecutionOptions struct {
6701	// TimeoutSeconds - Execution timeout for the job step.
6702	TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"`
6703	// RetryAttempts - Maximum number of times the job step will be reattempted if the first attempt fails.
6704	RetryAttempts *int32 `json:"retryAttempts,omitempty"`
6705	// InitialRetryIntervalSeconds - Initial delay between retries for job step execution.
6706	InitialRetryIntervalSeconds *int32 `json:"initialRetryIntervalSeconds,omitempty"`
6707	// MaximumRetryIntervalSeconds - The maximum amount of time to wait between retries for job step execution.
6708	MaximumRetryIntervalSeconds *int32 `json:"maximumRetryIntervalSeconds,omitempty"`
6709	// RetryIntervalBackoffMultiplier - The backoff multiplier for the time between retries.
6710	RetryIntervalBackoffMultiplier *float64 `json:"retryIntervalBackoffMultiplier,omitempty"`
6711}
6712
6713// JobStepListResult a list of job steps.
6714type JobStepListResult struct {
6715	autorest.Response `json:"-"`
6716	// Value - Array of results.
6717	Value *[]JobStep `json:"value,omitempty"`
6718	// NextLink - Link to retrieve next page of results.
6719	NextLink *string `json:"nextLink,omitempty"`
6720}
6721
6722// JobStepListResultIterator provides access to a complete listing of JobStep values.
6723type JobStepListResultIterator struct {
6724	i    int
6725	page JobStepListResultPage
6726}
6727
6728// Next advances to the next value.  If there was an error making
6729// the request the iterator does not advance and the error is returned.
6730func (iter *JobStepListResultIterator) Next() error {
6731	iter.i++
6732	if iter.i < len(iter.page.Values()) {
6733		return nil
6734	}
6735	err := iter.page.Next()
6736	if err != nil {
6737		iter.i--
6738		return err
6739	}
6740	iter.i = 0
6741	return nil
6742}
6743
6744// NotDone returns true if the enumeration should be started or is not yet complete.
6745func (iter JobStepListResultIterator) NotDone() bool {
6746	return iter.page.NotDone() && iter.i < len(iter.page.Values())
6747}
6748
6749// Response returns the raw server response from the last page request.
6750func (iter JobStepListResultIterator) Response() JobStepListResult {
6751	return iter.page.Response()
6752}
6753
6754// Value returns the current value or a zero-initialized value if the
6755// iterator has advanced beyond the end of the collection.
6756func (iter JobStepListResultIterator) Value() JobStep {
6757	if !iter.page.NotDone() {
6758		return JobStep{}
6759	}
6760	return iter.page.Values()[iter.i]
6761}
6762
6763// IsEmpty returns true if the ListResult contains no values.
6764func (jslr JobStepListResult) IsEmpty() bool {
6765	return jslr.Value == nil || len(*jslr.Value) == 0
6766}
6767
6768// jobStepListResultPreparer prepares a request to retrieve the next set of results.
6769// It returns nil if no more results exist.
6770func (jslr JobStepListResult) jobStepListResultPreparer() (*http.Request, error) {
6771	if jslr.NextLink == nil || len(to.String(jslr.NextLink)) < 1 {
6772		return nil, nil
6773	}
6774	return autorest.Prepare(&http.Request{},
6775		autorest.AsJSON(),
6776		autorest.AsGet(),
6777		autorest.WithBaseURL(to.String(jslr.NextLink)))
6778}
6779
6780// JobStepListResultPage contains a page of JobStep values.
6781type JobStepListResultPage struct {
6782	fn   func(JobStepListResult) (JobStepListResult, error)
6783	jslr JobStepListResult
6784}
6785
6786// Next advances to the next page of values.  If there was an error making
6787// the request the page does not advance and the error is returned.
6788func (page *JobStepListResultPage) Next() error {
6789	next, err := page.fn(page.jslr)
6790	if err != nil {
6791		return err
6792	}
6793	page.jslr = next
6794	return nil
6795}
6796
6797// NotDone returns true if the page enumeration should be started or is not yet complete.
6798func (page JobStepListResultPage) NotDone() bool {
6799	return !page.jslr.IsEmpty()
6800}
6801
6802// Response returns the raw server response from the last page request.
6803func (page JobStepListResultPage) Response() JobStepListResult {
6804	return page.jslr
6805}
6806
6807// Values returns the slice of values for the current page or nil if there are no values.
6808func (page JobStepListResultPage) Values() []JobStep {
6809	if page.jslr.IsEmpty() {
6810		return nil
6811	}
6812	return *page.jslr.Value
6813}
6814
6815// JobStepOutput the output configuration of a job step.
6816type JobStepOutput struct {
6817	// Type - The output destination type. Possible values include: 'SQLDatabase'
6818	Type JobStepOutputType `json:"type,omitempty"`
6819	// SubscriptionID - The output destination subscription id.
6820	SubscriptionID *uuid.UUID `json:"subscriptionId,omitempty"`
6821	// ResourceGroupName - The output destination resource group.
6822	ResourceGroupName *string `json:"resourceGroupName,omitempty"`
6823	// ServerName - The output destination server name.
6824	ServerName *string `json:"serverName,omitempty"`
6825	// DatabaseName - The output destination database.
6826	DatabaseName *string `json:"databaseName,omitempty"`
6827	// SchemaName - The output destination schema.
6828	SchemaName *string `json:"schemaName,omitempty"`
6829	// TableName - The output destination table.
6830	TableName *string `json:"tableName,omitempty"`
6831	// Credential - The resource ID of the credential to use to connect to the output destination.
6832	Credential *string `json:"credential,omitempty"`
6833}
6834
6835// JobStepProperties properties of a job step.
6836type JobStepProperties struct {
6837	// StepID - The job step's index within the job. If not specified when creating the job step, it will be created as the last step. If not specified when updating the job step, the step id is not modified.
6838	StepID *int32 `json:"stepId,omitempty"`
6839	// TargetGroup - The resource ID of the target group that the job step will be executed on.
6840	TargetGroup *string `json:"targetGroup,omitempty"`
6841	// Credential - The resource ID of the job credential that will be used to connect to the targets.
6842	Credential *string `json:"credential,omitempty"`
6843	// Action - The action payload of the job step.
6844	Action *JobStepAction `json:"action,omitempty"`
6845	// Output - Output destination properties of the job step.
6846	Output *JobStepOutput `json:"output,omitempty"`
6847	// ExecutionOptions - Execution options for the job step.
6848	ExecutionOptions *JobStepExecutionOptions `json:"executionOptions,omitempty"`
6849}
6850
6851// JobTarget a job target, for example a specific database or a container of databases that is evaluated during job
6852// execution.
6853type JobTarget struct {
6854	// MembershipType - Whether the target is included or excluded from the group. Possible values include: 'Include', 'Exclude'
6855	MembershipType JobTargetGroupMembershipType `json:"membershipType,omitempty"`
6856	// Type - The target type. Possible values include: 'JobTargetTypeTargetGroup', 'JobTargetTypeSQLDatabase', 'JobTargetTypeSQLElasticPool', 'JobTargetTypeSQLShardMap', 'JobTargetTypeSQLServer'
6857	Type JobTargetType `json:"type,omitempty"`
6858	// ServerName - The target server name.
6859	ServerName *string `json:"serverName,omitempty"`
6860	// DatabaseName - The target database name.
6861	DatabaseName *string `json:"databaseName,omitempty"`
6862	// ElasticPoolName - The target elastic pool name.
6863	ElasticPoolName *string `json:"elasticPoolName,omitempty"`
6864	// ShardMapName - The target shard map.
6865	ShardMapName *string `json:"shardMapName,omitempty"`
6866	// RefreshCredential - The resource ID of the credential that is used during job execution to connect to the target and determine the list of databases inside the target.
6867	RefreshCredential *string `json:"refreshCredential,omitempty"`
6868}
6869
6870// JobTargetGroup a group of job targets.
6871type JobTargetGroup struct {
6872	autorest.Response `json:"-"`
6873	// JobTargetGroupProperties - Resource properties.
6874	*JobTargetGroupProperties `json:"properties,omitempty"`
6875	// ID - Resource ID.
6876	ID *string `json:"id,omitempty"`
6877	// Name - Resource name.
6878	Name *string `json:"name,omitempty"`
6879	// Type - Resource type.
6880	Type *string `json:"type,omitempty"`
6881}
6882
6883// MarshalJSON is the custom marshaler for JobTargetGroup.
6884func (jtg JobTargetGroup) MarshalJSON() ([]byte, error) {
6885	objectMap := make(map[string]interface{})
6886	if jtg.JobTargetGroupProperties != nil {
6887		objectMap["properties"] = jtg.JobTargetGroupProperties
6888	}
6889	if jtg.ID != nil {
6890		objectMap["id"] = jtg.ID
6891	}
6892	if jtg.Name != nil {
6893		objectMap["name"] = jtg.Name
6894	}
6895	if jtg.Type != nil {
6896		objectMap["type"] = jtg.Type
6897	}
6898	return json.Marshal(objectMap)
6899}
6900
6901// UnmarshalJSON is the custom unmarshaler for JobTargetGroup struct.
6902func (jtg *JobTargetGroup) UnmarshalJSON(body []byte) error {
6903	var m map[string]*json.RawMessage
6904	err := json.Unmarshal(body, &m)
6905	if err != nil {
6906		return err
6907	}
6908	for k, v := range m {
6909		switch k {
6910		case "properties":
6911			if v != nil {
6912				var jobTargetGroupProperties JobTargetGroupProperties
6913				err = json.Unmarshal(*v, &jobTargetGroupProperties)
6914				if err != nil {
6915					return err
6916				}
6917				jtg.JobTargetGroupProperties = &jobTargetGroupProperties
6918			}
6919		case "id":
6920			if v != nil {
6921				var ID string
6922				err = json.Unmarshal(*v, &ID)
6923				if err != nil {
6924					return err
6925				}
6926				jtg.ID = &ID
6927			}
6928		case "name":
6929			if v != nil {
6930				var name string
6931				err = json.Unmarshal(*v, &name)
6932				if err != nil {
6933					return err
6934				}
6935				jtg.Name = &name
6936			}
6937		case "type":
6938			if v != nil {
6939				var typeVar string
6940				err = json.Unmarshal(*v, &typeVar)
6941				if err != nil {
6942					return err
6943				}
6944				jtg.Type = &typeVar
6945			}
6946		}
6947	}
6948
6949	return nil
6950}
6951
6952// JobTargetGroupListResult a list of target groups.
6953type JobTargetGroupListResult struct {
6954	autorest.Response `json:"-"`
6955	// Value - Array of results.
6956	Value *[]JobTargetGroup `json:"value,omitempty"`
6957	// NextLink - Link to retrieve next page of results.
6958	NextLink *string `json:"nextLink,omitempty"`
6959}
6960
6961// JobTargetGroupListResultIterator provides access to a complete listing of JobTargetGroup values.
6962type JobTargetGroupListResultIterator struct {
6963	i    int
6964	page JobTargetGroupListResultPage
6965}
6966
6967// Next advances to the next value.  If there was an error making
6968// the request the iterator does not advance and the error is returned.
6969func (iter *JobTargetGroupListResultIterator) Next() error {
6970	iter.i++
6971	if iter.i < len(iter.page.Values()) {
6972		return nil
6973	}
6974	err := iter.page.Next()
6975	if err != nil {
6976		iter.i--
6977		return err
6978	}
6979	iter.i = 0
6980	return nil
6981}
6982
6983// NotDone returns true if the enumeration should be started or is not yet complete.
6984func (iter JobTargetGroupListResultIterator) NotDone() bool {
6985	return iter.page.NotDone() && iter.i < len(iter.page.Values())
6986}
6987
6988// Response returns the raw server response from the last page request.
6989func (iter JobTargetGroupListResultIterator) Response() JobTargetGroupListResult {
6990	return iter.page.Response()
6991}
6992
6993// Value returns the current value or a zero-initialized value if the
6994// iterator has advanced beyond the end of the collection.
6995func (iter JobTargetGroupListResultIterator) Value() JobTargetGroup {
6996	if !iter.page.NotDone() {
6997		return JobTargetGroup{}
6998	}
6999	return iter.page.Values()[iter.i]
7000}
7001
7002// IsEmpty returns true if the ListResult contains no values.
7003func (jtglr JobTargetGroupListResult) IsEmpty() bool {
7004	return jtglr.Value == nil || len(*jtglr.Value) == 0
7005}
7006
7007// jobTargetGroupListResultPreparer prepares a request to retrieve the next set of results.
7008// It returns nil if no more results exist.
7009func (jtglr JobTargetGroupListResult) jobTargetGroupListResultPreparer() (*http.Request, error) {
7010	if jtglr.NextLink == nil || len(to.String(jtglr.NextLink)) < 1 {
7011		return nil, nil
7012	}
7013	return autorest.Prepare(&http.Request{},
7014		autorest.AsJSON(),
7015		autorest.AsGet(),
7016		autorest.WithBaseURL(to.String(jtglr.NextLink)))
7017}
7018
7019// JobTargetGroupListResultPage contains a page of JobTargetGroup values.
7020type JobTargetGroupListResultPage struct {
7021	fn    func(JobTargetGroupListResult) (JobTargetGroupListResult, error)
7022	jtglr JobTargetGroupListResult
7023}
7024
7025// Next advances to the next page of values.  If there was an error making
7026// the request the page does not advance and the error is returned.
7027func (page *JobTargetGroupListResultPage) Next() error {
7028	next, err := page.fn(page.jtglr)
7029	if err != nil {
7030		return err
7031	}
7032	page.jtglr = next
7033	return nil
7034}
7035
7036// NotDone returns true if the page enumeration should be started or is not yet complete.
7037func (page JobTargetGroupListResultPage) NotDone() bool {
7038	return !page.jtglr.IsEmpty()
7039}
7040
7041// Response returns the raw server response from the last page request.
7042func (page JobTargetGroupListResultPage) Response() JobTargetGroupListResult {
7043	return page.jtglr
7044}
7045
7046// Values returns the slice of values for the current page or nil if there are no values.
7047func (page JobTargetGroupListResultPage) Values() []JobTargetGroup {
7048	if page.jtglr.IsEmpty() {
7049		return nil
7050	}
7051	return *page.jtglr.Value
7052}
7053
7054// JobTargetGroupProperties properties of job target group.
7055type JobTargetGroupProperties struct {
7056	// Members - Members of the target group.
7057	Members *[]JobTarget `json:"members,omitempty"`
7058}
7059
7060// JobVersion a job version.
7061type JobVersion struct {
7062	autorest.Response `json:"-"`
7063	// ID - Resource ID.
7064	ID *string `json:"id,omitempty"`
7065	// Name - Resource name.
7066	Name *string `json:"name,omitempty"`
7067	// Type - Resource type.
7068	Type *string `json:"type,omitempty"`
7069}
7070
7071// JobVersionListResult a list of job versions.
7072type JobVersionListResult struct {
7073	autorest.Response `json:"-"`
7074	// Value - Array of results.
7075	Value *[]JobVersion `json:"value,omitempty"`
7076	// NextLink - Link to retrieve next page of results.
7077	NextLink *string `json:"nextLink,omitempty"`
7078}
7079
7080// JobVersionListResultIterator provides access to a complete listing of JobVersion values.
7081type JobVersionListResultIterator struct {
7082	i    int
7083	page JobVersionListResultPage
7084}
7085
7086// Next advances to the next value.  If there was an error making
7087// the request the iterator does not advance and the error is returned.
7088func (iter *JobVersionListResultIterator) Next() error {
7089	iter.i++
7090	if iter.i < len(iter.page.Values()) {
7091		return nil
7092	}
7093	err := iter.page.Next()
7094	if err != nil {
7095		iter.i--
7096		return err
7097	}
7098	iter.i = 0
7099	return nil
7100}
7101
7102// NotDone returns true if the enumeration should be started or is not yet complete.
7103func (iter JobVersionListResultIterator) NotDone() bool {
7104	return iter.page.NotDone() && iter.i < len(iter.page.Values())
7105}
7106
7107// Response returns the raw server response from the last page request.
7108func (iter JobVersionListResultIterator) Response() JobVersionListResult {
7109	return iter.page.Response()
7110}
7111
7112// Value returns the current value or a zero-initialized value if the
7113// iterator has advanced beyond the end of the collection.
7114func (iter JobVersionListResultIterator) Value() JobVersion {
7115	if !iter.page.NotDone() {
7116		return JobVersion{}
7117	}
7118	return iter.page.Values()[iter.i]
7119}
7120
7121// IsEmpty returns true if the ListResult contains no values.
7122func (jvlr JobVersionListResult) IsEmpty() bool {
7123	return jvlr.Value == nil || len(*jvlr.Value) == 0
7124}
7125
7126// jobVersionListResultPreparer prepares a request to retrieve the next set of results.
7127// It returns nil if no more results exist.
7128func (jvlr JobVersionListResult) jobVersionListResultPreparer() (*http.Request, error) {
7129	if jvlr.NextLink == nil || len(to.String(jvlr.NextLink)) < 1 {
7130		return nil, nil
7131	}
7132	return autorest.Prepare(&http.Request{},
7133		autorest.AsJSON(),
7134		autorest.AsGet(),
7135		autorest.WithBaseURL(to.String(jvlr.NextLink)))
7136}
7137
7138// JobVersionListResultPage contains a page of JobVersion values.
7139type JobVersionListResultPage struct {
7140	fn   func(JobVersionListResult) (JobVersionListResult, error)
7141	jvlr JobVersionListResult
7142}
7143
7144// Next advances to the next page of values.  If there was an error making
7145// the request the page does not advance and the error is returned.
7146func (page *JobVersionListResultPage) Next() error {
7147	next, err := page.fn(page.jvlr)
7148	if err != nil {
7149		return err
7150	}
7151	page.jvlr = next
7152	return nil
7153}
7154
7155// NotDone returns true if the page enumeration should be started or is not yet complete.
7156func (page JobVersionListResultPage) NotDone() bool {
7157	return !page.jvlr.IsEmpty()
7158}
7159
7160// Response returns the raw server response from the last page request.
7161func (page JobVersionListResultPage) Response() JobVersionListResult {
7162	return page.jvlr
7163}
7164
7165// Values returns the slice of values for the current page or nil if there are no values.
7166func (page JobVersionListResultPage) Values() []JobVersion {
7167	if page.jvlr.IsEmpty() {
7168		return nil
7169	}
7170	return *page.jvlr.Value
7171}
7172
7173// LocationCapabilities the capabilities for a location.
7174type LocationCapabilities struct {
7175	autorest.Response `json:"-"`
7176	// Name - The location name.
7177	Name *string `json:"name,omitempty"`
7178	// Status - Azure SQL Database's status for the location. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
7179	Status CapabilityStatus `json:"status,omitempty"`
7180	// SupportedServerVersions - The list of supported server versions.
7181	SupportedServerVersions *[]ServerVersionCapability `json:"supportedServerVersions,omitempty"`
7182}
7183
7184// ManagedDatabase a managed database resource.
7185type ManagedDatabase struct {
7186	autorest.Response `json:"-"`
7187	// ManagedDatabaseProperties - Resource properties.
7188	*ManagedDatabaseProperties `json:"properties,omitempty"`
7189	// Location - Resource location.
7190	Location *string `json:"location,omitempty"`
7191	// Tags - Resource tags.
7192	Tags map[string]*string `json:"tags"`
7193	// ID - Resource ID.
7194	ID *string `json:"id,omitempty"`
7195	// Name - Resource name.
7196	Name *string `json:"name,omitempty"`
7197	// Type - Resource type.
7198	Type *string `json:"type,omitempty"`
7199}
7200
7201// MarshalJSON is the custom marshaler for ManagedDatabase.
7202func (md ManagedDatabase) MarshalJSON() ([]byte, error) {
7203	objectMap := make(map[string]interface{})
7204	if md.ManagedDatabaseProperties != nil {
7205		objectMap["properties"] = md.ManagedDatabaseProperties
7206	}
7207	if md.Location != nil {
7208		objectMap["location"] = md.Location
7209	}
7210	if md.Tags != nil {
7211		objectMap["tags"] = md.Tags
7212	}
7213	if md.ID != nil {
7214		objectMap["id"] = md.ID
7215	}
7216	if md.Name != nil {
7217		objectMap["name"] = md.Name
7218	}
7219	if md.Type != nil {
7220		objectMap["type"] = md.Type
7221	}
7222	return json.Marshal(objectMap)
7223}
7224
7225// UnmarshalJSON is the custom unmarshaler for ManagedDatabase struct.
7226func (md *ManagedDatabase) UnmarshalJSON(body []byte) error {
7227	var m map[string]*json.RawMessage
7228	err := json.Unmarshal(body, &m)
7229	if err != nil {
7230		return err
7231	}
7232	for k, v := range m {
7233		switch k {
7234		case "properties":
7235			if v != nil {
7236				var managedDatabaseProperties ManagedDatabaseProperties
7237				err = json.Unmarshal(*v, &managedDatabaseProperties)
7238				if err != nil {
7239					return err
7240				}
7241				md.ManagedDatabaseProperties = &managedDatabaseProperties
7242			}
7243		case "location":
7244			if v != nil {
7245				var location string
7246				err = json.Unmarshal(*v, &location)
7247				if err != nil {
7248					return err
7249				}
7250				md.Location = &location
7251			}
7252		case "tags":
7253			if v != nil {
7254				var tags map[string]*string
7255				err = json.Unmarshal(*v, &tags)
7256				if err != nil {
7257					return err
7258				}
7259				md.Tags = tags
7260			}
7261		case "id":
7262			if v != nil {
7263				var ID string
7264				err = json.Unmarshal(*v, &ID)
7265				if err != nil {
7266					return err
7267				}
7268				md.ID = &ID
7269			}
7270		case "name":
7271			if v != nil {
7272				var name string
7273				err = json.Unmarshal(*v, &name)
7274				if err != nil {
7275					return err
7276				}
7277				md.Name = &name
7278			}
7279		case "type":
7280			if v != nil {
7281				var typeVar string
7282				err = json.Unmarshal(*v, &typeVar)
7283				if err != nil {
7284					return err
7285				}
7286				md.Type = &typeVar
7287			}
7288		}
7289	}
7290
7291	return nil
7292}
7293
7294// ManagedDatabaseListResult a list of managed databases.
7295type ManagedDatabaseListResult struct {
7296	autorest.Response `json:"-"`
7297	// Value - Array of results.
7298	Value *[]ManagedDatabase `json:"value,omitempty"`
7299	// NextLink - Link to retrieve next page of results.
7300	NextLink *string `json:"nextLink,omitempty"`
7301}
7302
7303// ManagedDatabaseListResultIterator provides access to a complete listing of ManagedDatabase values.
7304type ManagedDatabaseListResultIterator struct {
7305	i    int
7306	page ManagedDatabaseListResultPage
7307}
7308
7309// Next advances to the next value.  If there was an error making
7310// the request the iterator does not advance and the error is returned.
7311func (iter *ManagedDatabaseListResultIterator) Next() error {
7312	iter.i++
7313	if iter.i < len(iter.page.Values()) {
7314		return nil
7315	}
7316	err := iter.page.Next()
7317	if err != nil {
7318		iter.i--
7319		return err
7320	}
7321	iter.i = 0
7322	return nil
7323}
7324
7325// NotDone returns true if the enumeration should be started or is not yet complete.
7326func (iter ManagedDatabaseListResultIterator) NotDone() bool {
7327	return iter.page.NotDone() && iter.i < len(iter.page.Values())
7328}
7329
7330// Response returns the raw server response from the last page request.
7331func (iter ManagedDatabaseListResultIterator) Response() ManagedDatabaseListResult {
7332	return iter.page.Response()
7333}
7334
7335// Value returns the current value or a zero-initialized value if the
7336// iterator has advanced beyond the end of the collection.
7337func (iter ManagedDatabaseListResultIterator) Value() ManagedDatabase {
7338	if !iter.page.NotDone() {
7339		return ManagedDatabase{}
7340	}
7341	return iter.page.Values()[iter.i]
7342}
7343
7344// IsEmpty returns true if the ListResult contains no values.
7345func (mdlr ManagedDatabaseListResult) IsEmpty() bool {
7346	return mdlr.Value == nil || len(*mdlr.Value) == 0
7347}
7348
7349// managedDatabaseListResultPreparer prepares a request to retrieve the next set of results.
7350// It returns nil if no more results exist.
7351func (mdlr ManagedDatabaseListResult) managedDatabaseListResultPreparer() (*http.Request, error) {
7352	if mdlr.NextLink == nil || len(to.String(mdlr.NextLink)) < 1 {
7353		return nil, nil
7354	}
7355	return autorest.Prepare(&http.Request{},
7356		autorest.AsJSON(),
7357		autorest.AsGet(),
7358		autorest.WithBaseURL(to.String(mdlr.NextLink)))
7359}
7360
7361// ManagedDatabaseListResultPage contains a page of ManagedDatabase values.
7362type ManagedDatabaseListResultPage struct {
7363	fn   func(ManagedDatabaseListResult) (ManagedDatabaseListResult, error)
7364	mdlr ManagedDatabaseListResult
7365}
7366
7367// Next advances to the next page of values.  If there was an error making
7368// the request the page does not advance and the error is returned.
7369func (page *ManagedDatabaseListResultPage) Next() error {
7370	next, err := page.fn(page.mdlr)
7371	if err != nil {
7372		return err
7373	}
7374	page.mdlr = next
7375	return nil
7376}
7377
7378// NotDone returns true if the page enumeration should be started or is not yet complete.
7379func (page ManagedDatabaseListResultPage) NotDone() bool {
7380	return !page.mdlr.IsEmpty()
7381}
7382
7383// Response returns the raw server response from the last page request.
7384func (page ManagedDatabaseListResultPage) Response() ManagedDatabaseListResult {
7385	return page.mdlr
7386}
7387
7388// Values returns the slice of values for the current page or nil if there are no values.
7389func (page ManagedDatabaseListResultPage) Values() []ManagedDatabase {
7390	if page.mdlr.IsEmpty() {
7391		return nil
7392	}
7393	return *page.mdlr.Value
7394}
7395
7396// ManagedDatabaseProperties the managed database's properties.
7397type ManagedDatabaseProperties struct {
7398	// Collation - Collation of the managed database.
7399	Collation *string `json:"collation,omitempty"`
7400	// Status - Status for the database. Possible values include: 'Online', 'Offline', 'Shutdown', 'Creating', 'Inaccessible'
7401	Status ManagedDatabaseStatus `json:"status,omitempty"`
7402	// CreationDate - Creation date of the database.
7403	CreationDate *date.Time `json:"creationDate,omitempty"`
7404	// EarliestRestorePoint - Earliest restore point in time for point in time restore.
7405	EarliestRestorePoint *date.Time `json:"earliestRestorePoint,omitempty"`
7406	// RestorePointInTime - Conditional. If createMode is PointInTimeRestore, this value is required. Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database.
7407	RestorePointInTime *date.Time `json:"restorePointInTime,omitempty"`
7408	// DefaultSecondaryLocation - Geo paired region.
7409	DefaultSecondaryLocation *string `json:"defaultSecondaryLocation,omitempty"`
7410	// CatalogCollation - Collation of the metadata catalog. Possible values include: 'DATABASEDEFAULT', 'SQLLatin1GeneralCP1CIAS'
7411	CatalogCollation CatalogCollationType `json:"catalogCollation,omitempty"`
7412	// CreateMode - Managed database create mode. PointInTimeRestore: Create a database by restoring a point in time backup of an existing database. SourceDatabaseName, SourceManagedInstanceName and PointInTime must be specified. RestoreExternalBackup: Create a database by restoring from external backup files. Collation, StorageContainerUri and StorageContainerSasToken must be specified. Possible values include: 'ManagedDatabaseCreateModeDefault', 'ManagedDatabaseCreateModeRestoreExternalBackup', 'ManagedDatabaseCreateModePointInTimeRestore'
7413	CreateMode ManagedDatabaseCreateMode `json:"createMode,omitempty"`
7414	// StorageContainerURI - Conditional. If createMode is RestoreExternalBackup, this value is required. Specifies the uri of the storage container where backups for this restore are stored.
7415	StorageContainerURI *string `json:"storageContainerUri,omitempty"`
7416	// SourceDatabaseID - The resource identifier of the source database associated with create operation of this database.
7417	SourceDatabaseID *string `json:"sourceDatabaseId,omitempty"`
7418	// StorageContainerSasToken - Conditional. If createMode is RestoreExternalBackup, this value is required. Specifies the storage container sas token.
7419	StorageContainerSasToken *string `json:"storageContainerSasToken,omitempty"`
7420	// FailoverGroupID - Instance Failover Group resource identifier that this managed database belongs to.
7421	FailoverGroupID *string `json:"failoverGroupId,omitempty"`
7422}
7423
7424// ManagedDatabasesCompleteRestoreFuture an abstraction for monitoring and retrieving the results of a long-running
7425// operation.
7426type ManagedDatabasesCompleteRestoreFuture struct {
7427	azure.Future
7428}
7429
7430// Result returns the result of the asynchronous operation.
7431// If the operation has not completed it will return an error.
7432func (future *ManagedDatabasesCompleteRestoreFuture) Result(client ManagedDatabasesClient) (ar autorest.Response, err error) {
7433	var done bool
7434	done, err = future.Done(client)
7435	if err != nil {
7436		err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesCompleteRestoreFuture", "Result", future.Response(), "Polling failure")
7437		return
7438	}
7439	if !done {
7440		err = azure.NewAsyncOpIncompleteError("sql.ManagedDatabasesCompleteRestoreFuture")
7441		return
7442	}
7443	ar.Response = future.Response()
7444	return
7445}
7446
7447// ManagedDatabasesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
7448// operation.
7449type ManagedDatabasesCreateOrUpdateFuture struct {
7450	azure.Future
7451}
7452
7453// Result returns the result of the asynchronous operation.
7454// If the operation has not completed it will return an error.
7455func (future *ManagedDatabasesCreateOrUpdateFuture) Result(client ManagedDatabasesClient) (md ManagedDatabase, err error) {
7456	var done bool
7457	done, err = future.Done(client)
7458	if err != nil {
7459		err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
7460		return
7461	}
7462	if !done {
7463		err = azure.NewAsyncOpIncompleteError("sql.ManagedDatabasesCreateOrUpdateFuture")
7464		return
7465	}
7466	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7467	if md.Response.Response, err = future.GetResult(sender); err == nil && md.Response.Response.StatusCode != http.StatusNoContent {
7468		md, err = client.CreateOrUpdateResponder(md.Response.Response)
7469		if err != nil {
7470			err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesCreateOrUpdateFuture", "Result", md.Response.Response, "Failure responding to request")
7471		}
7472	}
7473	return
7474}
7475
7476// ManagedDatabasesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
7477// operation.
7478type ManagedDatabasesDeleteFuture struct {
7479	azure.Future
7480}
7481
7482// Result returns the result of the asynchronous operation.
7483// If the operation has not completed it will return an error.
7484func (future *ManagedDatabasesDeleteFuture) Result(client ManagedDatabasesClient) (ar autorest.Response, err error) {
7485	var done bool
7486	done, err = future.Done(client)
7487	if err != nil {
7488		err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesDeleteFuture", "Result", future.Response(), "Polling failure")
7489		return
7490	}
7491	if !done {
7492		err = azure.NewAsyncOpIncompleteError("sql.ManagedDatabasesDeleteFuture")
7493		return
7494	}
7495	ar.Response = future.Response()
7496	return
7497}
7498
7499// ManagedDatabasesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
7500// operation.
7501type ManagedDatabasesUpdateFuture struct {
7502	azure.Future
7503}
7504
7505// Result returns the result of the asynchronous operation.
7506// If the operation has not completed it will return an error.
7507func (future *ManagedDatabasesUpdateFuture) Result(client ManagedDatabasesClient) (md ManagedDatabase, err error) {
7508	var done bool
7509	done, err = future.Done(client)
7510	if err != nil {
7511		err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesUpdateFuture", "Result", future.Response(), "Polling failure")
7512		return
7513	}
7514	if !done {
7515		err = azure.NewAsyncOpIncompleteError("sql.ManagedDatabasesUpdateFuture")
7516		return
7517	}
7518	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7519	if md.Response.Response, err = future.GetResult(sender); err == nil && md.Response.Response.StatusCode != http.StatusNoContent {
7520		md, err = client.UpdateResponder(md.Response.Response)
7521		if err != nil {
7522			err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesUpdateFuture", "Result", md.Response.Response, "Failure responding to request")
7523		}
7524	}
7525	return
7526}
7527
7528// ManagedDatabaseUpdate an managed database update.
7529type ManagedDatabaseUpdate struct {
7530	// ManagedDatabaseProperties - Resource properties.
7531	*ManagedDatabaseProperties `json:"properties,omitempty"`
7532	// Tags - Resource tags.
7533	Tags map[string]*string `json:"tags"`
7534}
7535
7536// MarshalJSON is the custom marshaler for ManagedDatabaseUpdate.
7537func (mdu ManagedDatabaseUpdate) MarshalJSON() ([]byte, error) {
7538	objectMap := make(map[string]interface{})
7539	if mdu.ManagedDatabaseProperties != nil {
7540		objectMap["properties"] = mdu.ManagedDatabaseProperties
7541	}
7542	if mdu.Tags != nil {
7543		objectMap["tags"] = mdu.Tags
7544	}
7545	return json.Marshal(objectMap)
7546}
7547
7548// UnmarshalJSON is the custom unmarshaler for ManagedDatabaseUpdate struct.
7549func (mdu *ManagedDatabaseUpdate) UnmarshalJSON(body []byte) error {
7550	var m map[string]*json.RawMessage
7551	err := json.Unmarshal(body, &m)
7552	if err != nil {
7553		return err
7554	}
7555	for k, v := range m {
7556		switch k {
7557		case "properties":
7558			if v != nil {
7559				var managedDatabaseProperties ManagedDatabaseProperties
7560				err = json.Unmarshal(*v, &managedDatabaseProperties)
7561				if err != nil {
7562					return err
7563				}
7564				mdu.ManagedDatabaseProperties = &managedDatabaseProperties
7565			}
7566		case "tags":
7567			if v != nil {
7568				var tags map[string]*string
7569				err = json.Unmarshal(*v, &tags)
7570				if err != nil {
7571					return err
7572				}
7573				mdu.Tags = tags
7574			}
7575		}
7576	}
7577
7578	return nil
7579}
7580
7581// ManagedInstance an Azure SQL managed instance.
7582type ManagedInstance struct {
7583	autorest.Response `json:"-"`
7584	// Identity - The Azure Active Directory identity of the managed instance.
7585	Identity *ResourceIdentity `json:"identity,omitempty"`
7586	// Sku - Managed instance sku
7587	Sku *Sku `json:"sku,omitempty"`
7588	// ManagedInstanceProperties - Resource properties.
7589	*ManagedInstanceProperties `json:"properties,omitempty"`
7590	// Location - Resource location.
7591	Location *string `json:"location,omitempty"`
7592	// Tags - Resource tags.
7593	Tags map[string]*string `json:"tags"`
7594	// ID - Resource ID.
7595	ID *string `json:"id,omitempty"`
7596	// Name - Resource name.
7597	Name *string `json:"name,omitempty"`
7598	// Type - Resource type.
7599	Type *string `json:"type,omitempty"`
7600}
7601
7602// MarshalJSON is the custom marshaler for ManagedInstance.
7603func (mi ManagedInstance) MarshalJSON() ([]byte, error) {
7604	objectMap := make(map[string]interface{})
7605	if mi.Identity != nil {
7606		objectMap["identity"] = mi.Identity
7607	}
7608	if mi.Sku != nil {
7609		objectMap["sku"] = mi.Sku
7610	}
7611	if mi.ManagedInstanceProperties != nil {
7612		objectMap["properties"] = mi.ManagedInstanceProperties
7613	}
7614	if mi.Location != nil {
7615		objectMap["location"] = mi.Location
7616	}
7617	if mi.Tags != nil {
7618		objectMap["tags"] = mi.Tags
7619	}
7620	if mi.ID != nil {
7621		objectMap["id"] = mi.ID
7622	}
7623	if mi.Name != nil {
7624		objectMap["name"] = mi.Name
7625	}
7626	if mi.Type != nil {
7627		objectMap["type"] = mi.Type
7628	}
7629	return json.Marshal(objectMap)
7630}
7631
7632// UnmarshalJSON is the custom unmarshaler for ManagedInstance struct.
7633func (mi *ManagedInstance) UnmarshalJSON(body []byte) error {
7634	var m map[string]*json.RawMessage
7635	err := json.Unmarshal(body, &m)
7636	if err != nil {
7637		return err
7638	}
7639	for k, v := range m {
7640		switch k {
7641		case "identity":
7642			if v != nil {
7643				var identity ResourceIdentity
7644				err = json.Unmarshal(*v, &identity)
7645				if err != nil {
7646					return err
7647				}
7648				mi.Identity = &identity
7649			}
7650		case "sku":
7651			if v != nil {
7652				var sku Sku
7653				err = json.Unmarshal(*v, &sku)
7654				if err != nil {
7655					return err
7656				}
7657				mi.Sku = &sku
7658			}
7659		case "properties":
7660			if v != nil {
7661				var managedInstanceProperties ManagedInstanceProperties
7662				err = json.Unmarshal(*v, &managedInstanceProperties)
7663				if err != nil {
7664					return err
7665				}
7666				mi.ManagedInstanceProperties = &managedInstanceProperties
7667			}
7668		case "location":
7669			if v != nil {
7670				var location string
7671				err = json.Unmarshal(*v, &location)
7672				if err != nil {
7673					return err
7674				}
7675				mi.Location = &location
7676			}
7677		case "tags":
7678			if v != nil {
7679				var tags map[string]*string
7680				err = json.Unmarshal(*v, &tags)
7681				if err != nil {
7682					return err
7683				}
7684				mi.Tags = tags
7685			}
7686		case "id":
7687			if v != nil {
7688				var ID string
7689				err = json.Unmarshal(*v, &ID)
7690				if err != nil {
7691					return err
7692				}
7693				mi.ID = &ID
7694			}
7695		case "name":
7696			if v != nil {
7697				var name string
7698				err = json.Unmarshal(*v, &name)
7699				if err != nil {
7700					return err
7701				}
7702				mi.Name = &name
7703			}
7704		case "type":
7705			if v != nil {
7706				var typeVar string
7707				err = json.Unmarshal(*v, &typeVar)
7708				if err != nil {
7709					return err
7710				}
7711				mi.Type = &typeVar
7712			}
7713		}
7714	}
7715
7716	return nil
7717}
7718
7719// ManagedInstanceListResult a list of managed instances.
7720type ManagedInstanceListResult struct {
7721	autorest.Response `json:"-"`
7722	// Value - Array of results.
7723	Value *[]ManagedInstance `json:"value,omitempty"`
7724	// NextLink - Link to retrieve next page of results.
7725	NextLink *string `json:"nextLink,omitempty"`
7726}
7727
7728// ManagedInstanceListResultIterator provides access to a complete listing of ManagedInstance values.
7729type ManagedInstanceListResultIterator struct {
7730	i    int
7731	page ManagedInstanceListResultPage
7732}
7733
7734// Next advances to the next value.  If there was an error making
7735// the request the iterator does not advance and the error is returned.
7736func (iter *ManagedInstanceListResultIterator) Next() error {
7737	iter.i++
7738	if iter.i < len(iter.page.Values()) {
7739		return nil
7740	}
7741	err := iter.page.Next()
7742	if err != nil {
7743		iter.i--
7744		return err
7745	}
7746	iter.i = 0
7747	return nil
7748}
7749
7750// NotDone returns true if the enumeration should be started or is not yet complete.
7751func (iter ManagedInstanceListResultIterator) NotDone() bool {
7752	return iter.page.NotDone() && iter.i < len(iter.page.Values())
7753}
7754
7755// Response returns the raw server response from the last page request.
7756func (iter ManagedInstanceListResultIterator) Response() ManagedInstanceListResult {
7757	return iter.page.Response()
7758}
7759
7760// Value returns the current value or a zero-initialized value if the
7761// iterator has advanced beyond the end of the collection.
7762func (iter ManagedInstanceListResultIterator) Value() ManagedInstance {
7763	if !iter.page.NotDone() {
7764		return ManagedInstance{}
7765	}
7766	return iter.page.Values()[iter.i]
7767}
7768
7769// IsEmpty returns true if the ListResult contains no values.
7770func (milr ManagedInstanceListResult) IsEmpty() bool {
7771	return milr.Value == nil || len(*milr.Value) == 0
7772}
7773
7774// managedInstanceListResultPreparer prepares a request to retrieve the next set of results.
7775// It returns nil if no more results exist.
7776func (milr ManagedInstanceListResult) managedInstanceListResultPreparer() (*http.Request, error) {
7777	if milr.NextLink == nil || len(to.String(milr.NextLink)) < 1 {
7778		return nil, nil
7779	}
7780	return autorest.Prepare(&http.Request{},
7781		autorest.AsJSON(),
7782		autorest.AsGet(),
7783		autorest.WithBaseURL(to.String(milr.NextLink)))
7784}
7785
7786// ManagedInstanceListResultPage contains a page of ManagedInstance values.
7787type ManagedInstanceListResultPage struct {
7788	fn   func(ManagedInstanceListResult) (ManagedInstanceListResult, error)
7789	milr ManagedInstanceListResult
7790}
7791
7792// Next advances to the next page of values.  If there was an error making
7793// the request the page does not advance and the error is returned.
7794func (page *ManagedInstanceListResultPage) Next() error {
7795	next, err := page.fn(page.milr)
7796	if err != nil {
7797		return err
7798	}
7799	page.milr = next
7800	return nil
7801}
7802
7803// NotDone returns true if the page enumeration should be started or is not yet complete.
7804func (page ManagedInstanceListResultPage) NotDone() bool {
7805	return !page.milr.IsEmpty()
7806}
7807
7808// Response returns the raw server response from the last page request.
7809func (page ManagedInstanceListResultPage) Response() ManagedInstanceListResult {
7810	return page.milr
7811}
7812
7813// Values returns the slice of values for the current page or nil if there are no values.
7814func (page ManagedInstanceListResultPage) Values() []ManagedInstance {
7815	if page.milr.IsEmpty() {
7816		return nil
7817	}
7818	return *page.milr.Value
7819}
7820
7821// ManagedInstanceProperties the properties of a managed instance.
7822type ManagedInstanceProperties struct {
7823	// FullyQualifiedDomainName - The fully qualified domain name of the managed instance.
7824	FullyQualifiedDomainName *string `json:"fullyQualifiedDomainName,omitempty"`
7825	// AdministratorLogin - Administrator username for the managed instance. Can only be specified when the managed instance is being created (and is required for creation).
7826	AdministratorLogin *string `json:"administratorLogin,omitempty"`
7827	// AdministratorLoginPassword - The administrator login password (required for managed instance creation).
7828	AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"`
7829	// SubnetID - Subnet resource ID for the managed instance.
7830	SubnetID *string `json:"subnetId,omitempty"`
7831	// State - The state of the managed instance.
7832	State *string `json:"state,omitempty"`
7833	// LicenseType - The license type. Possible values are 'LicenseIncluded' and 'BasePrice'.
7834	LicenseType *string `json:"licenseType,omitempty"`
7835	// VCores - The number of VCores.
7836	VCores *int32 `json:"vCores,omitempty"`
7837	// StorageSizeInGB - The maximum storage size in GB.
7838	StorageSizeInGB *int32 `json:"storageSizeInGB,omitempty"`
7839	// Collation - Collation of the managed instance.
7840	Collation *string `json:"collation,omitempty"`
7841	// DNSZone - The Dns Zone that the managed instance is in.
7842	DNSZone *string `json:"dnsZone,omitempty"`
7843	// DNSZonePartner - The resource id of another managed instance whose DNS zone this managed instance will share after creation.
7844	DNSZonePartner *string `json:"dnsZonePartner,omitempty"`
7845}
7846
7847// ManagedInstancesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
7848// operation.
7849type ManagedInstancesCreateOrUpdateFuture struct {
7850	azure.Future
7851}
7852
7853// Result returns the result of the asynchronous operation.
7854// If the operation has not completed it will return an error.
7855func (future *ManagedInstancesCreateOrUpdateFuture) Result(client ManagedInstancesClient) (mi ManagedInstance, err error) {
7856	var done bool
7857	done, err = future.Done(client)
7858	if err != nil {
7859		err = autorest.NewErrorWithError(err, "sql.ManagedInstancesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
7860		return
7861	}
7862	if !done {
7863		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstancesCreateOrUpdateFuture")
7864		return
7865	}
7866	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7867	if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent {
7868		mi, err = client.CreateOrUpdateResponder(mi.Response.Response)
7869		if err != nil {
7870			err = autorest.NewErrorWithError(err, "sql.ManagedInstancesCreateOrUpdateFuture", "Result", mi.Response.Response, "Failure responding to request")
7871		}
7872	}
7873	return
7874}
7875
7876// ManagedInstancesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
7877// operation.
7878type ManagedInstancesDeleteFuture struct {
7879	azure.Future
7880}
7881
7882// Result returns the result of the asynchronous operation.
7883// If the operation has not completed it will return an error.
7884func (future *ManagedInstancesDeleteFuture) Result(client ManagedInstancesClient) (ar autorest.Response, err error) {
7885	var done bool
7886	done, err = future.Done(client)
7887	if err != nil {
7888		err = autorest.NewErrorWithError(err, "sql.ManagedInstancesDeleteFuture", "Result", future.Response(), "Polling failure")
7889		return
7890	}
7891	if !done {
7892		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstancesDeleteFuture")
7893		return
7894	}
7895	ar.Response = future.Response()
7896	return
7897}
7898
7899// ManagedInstancesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
7900// operation.
7901type ManagedInstancesUpdateFuture struct {
7902	azure.Future
7903}
7904
7905// Result returns the result of the asynchronous operation.
7906// If the operation has not completed it will return an error.
7907func (future *ManagedInstancesUpdateFuture) Result(client ManagedInstancesClient) (mi ManagedInstance, err error) {
7908	var done bool
7909	done, err = future.Done(client)
7910	if err != nil {
7911		err = autorest.NewErrorWithError(err, "sql.ManagedInstancesUpdateFuture", "Result", future.Response(), "Polling failure")
7912		return
7913	}
7914	if !done {
7915		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstancesUpdateFuture")
7916		return
7917	}
7918	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7919	if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent {
7920		mi, err = client.UpdateResponder(mi.Response.Response)
7921		if err != nil {
7922			err = autorest.NewErrorWithError(err, "sql.ManagedInstancesUpdateFuture", "Result", mi.Response.Response, "Failure responding to request")
7923		}
7924	}
7925	return
7926}
7927
7928// ManagedInstanceUpdate an update request for an Azure SQL Database managed instance.
7929type ManagedInstanceUpdate struct {
7930	// Sku - Managed instance sku
7931	Sku *Sku `json:"sku,omitempty"`
7932	// ManagedInstanceProperties - Resource properties.
7933	*ManagedInstanceProperties `json:"properties,omitempty"`
7934	// Tags - Resource tags.
7935	Tags map[string]*string `json:"tags"`
7936}
7937
7938// MarshalJSON is the custom marshaler for ManagedInstanceUpdate.
7939func (miu ManagedInstanceUpdate) MarshalJSON() ([]byte, error) {
7940	objectMap := make(map[string]interface{})
7941	if miu.Sku != nil {
7942		objectMap["sku"] = miu.Sku
7943	}
7944	if miu.ManagedInstanceProperties != nil {
7945		objectMap["properties"] = miu.ManagedInstanceProperties
7946	}
7947	if miu.Tags != nil {
7948		objectMap["tags"] = miu.Tags
7949	}
7950	return json.Marshal(objectMap)
7951}
7952
7953// UnmarshalJSON is the custom unmarshaler for ManagedInstanceUpdate struct.
7954func (miu *ManagedInstanceUpdate) UnmarshalJSON(body []byte) error {
7955	var m map[string]*json.RawMessage
7956	err := json.Unmarshal(body, &m)
7957	if err != nil {
7958		return err
7959	}
7960	for k, v := range m {
7961		switch k {
7962		case "sku":
7963			if v != nil {
7964				var sku Sku
7965				err = json.Unmarshal(*v, &sku)
7966				if err != nil {
7967					return err
7968				}
7969				miu.Sku = &sku
7970			}
7971		case "properties":
7972			if v != nil {
7973				var managedInstanceProperties ManagedInstanceProperties
7974				err = json.Unmarshal(*v, &managedInstanceProperties)
7975				if err != nil {
7976					return err
7977				}
7978				miu.ManagedInstanceProperties = &managedInstanceProperties
7979			}
7980		case "tags":
7981			if v != nil {
7982				var tags map[string]*string
7983				err = json.Unmarshal(*v, &tags)
7984				if err != nil {
7985					return err
7986				}
7987				miu.Tags = tags
7988			}
7989		}
7990	}
7991
7992	return nil
7993}
7994
7995// MaxSizeCapability the maximum size limits for a database.
7996type MaxSizeCapability struct {
7997	// Limit - The maximum size of the database (see 'unit' for the units).
7998	Limit *int64 `json:"limit,omitempty"`
7999	// Unit - The units that the limit is expressed in. Possible values include: 'Megabytes', 'Gigabytes', 'Terabytes', 'Petabytes'
8000	Unit MaxSizeUnits `json:"unit,omitempty"`
8001	// Status - The status of the maximum size capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
8002	Status CapabilityStatus `json:"status,omitempty"`
8003}
8004
8005// Metric database metrics.
8006type Metric struct {
8007	// StartTime - The start time for the metric (ISO-8601 format).
8008	StartTime *date.Time `json:"startTime,omitempty"`
8009	// EndTime - The end time for the metric (ISO-8601 format).
8010	EndTime *date.Time `json:"endTime,omitempty"`
8011	// TimeGrain - The time step to be used to summarize the metric values.
8012	TimeGrain *string `json:"timeGrain,omitempty"`
8013	// Unit - The unit of the metric. Possible values include: 'UnitTypeCount', 'UnitTypeBytes', 'UnitTypeSeconds', 'UnitTypePercent', 'UnitTypeCountPerSecond', 'UnitTypeBytesPerSecond'
8014	Unit UnitType `json:"unit,omitempty"`
8015	// Name - The name information for the metric.
8016	Name *MetricName `json:"name,omitempty"`
8017	// MetricValues - The metric values for the specified time window and timestep.
8018	MetricValues *[]MetricValue `json:"metricValues,omitempty"`
8019}
8020
8021// MetricAvailability a metric availability value.
8022type MetricAvailability struct {
8023	// Retention - The length of retention for the database metric.
8024	Retention *string `json:"retention,omitempty"`
8025	// TimeGrain - The granularity of the database metric.
8026	TimeGrain *string `json:"timeGrain,omitempty"`
8027}
8028
8029// MetricDefinition a database metric definition.
8030type MetricDefinition struct {
8031	// Name - The name information for the metric.
8032	Name *MetricName `json:"name,omitempty"`
8033	// PrimaryAggregationType - The primary aggregation type defining how metric values are displayed. Possible values include: 'None', 'Average', 'Count', 'Minimum', 'Maximum', 'Total'
8034	PrimaryAggregationType PrimaryAggregationType `json:"primaryAggregationType,omitempty"`
8035	// ResourceURI - The resource uri of the database.
8036	ResourceURI *string `json:"resourceUri,omitempty"`
8037	// Unit - The unit of the metric. Possible values include: 'UnitDefinitionTypeCount', 'UnitDefinitionTypeBytes', 'UnitDefinitionTypeSeconds', 'UnitDefinitionTypePercent', 'UnitDefinitionTypeCountPerSecond', 'UnitDefinitionTypeBytesPerSecond'
8038	Unit UnitDefinitionType `json:"unit,omitempty"`
8039	// MetricAvailabilities - The list of database metric availabities for the metric.
8040	MetricAvailabilities *[]MetricAvailability `json:"metricAvailabilities,omitempty"`
8041}
8042
8043// MetricDefinitionListResult the response to a list database metric definitions request.
8044type MetricDefinitionListResult struct {
8045	autorest.Response `json:"-"`
8046	// Value - The list of metric definitions for the database.
8047	Value *[]MetricDefinition `json:"value,omitempty"`
8048}
8049
8050// MetricListResult the response to a list database metrics request.
8051type MetricListResult struct {
8052	autorest.Response `json:"-"`
8053	// Value - The list of metrics for the database.
8054	Value *[]Metric `json:"value,omitempty"`
8055}
8056
8057// MetricName a database metric name.
8058type MetricName struct {
8059	// Value - The name of the database metric.
8060	Value *string `json:"value,omitempty"`
8061	// LocalizedValue - The friendly name of the database metric.
8062	LocalizedValue *string `json:"localizedValue,omitempty"`
8063}
8064
8065// MetricValue represents database metrics.
8066type MetricValue struct {
8067	// Count - The number of values for the metric.
8068	Count *float64 `json:"count,omitempty"`
8069	// Average - The average value of the metric.
8070	Average *float64 `json:"average,omitempty"`
8071	// Maximum - The max value of the metric.
8072	Maximum *float64 `json:"maximum,omitempty"`
8073	// Minimum - The min value of the metric.
8074	Minimum *float64 `json:"minimum,omitempty"`
8075	// Timestamp - The metric timestamp (ISO-8601 format).
8076	Timestamp *date.Time `json:"timestamp,omitempty"`
8077	// Total - The total value of the metric.
8078	Total *float64 `json:"total,omitempty"`
8079}
8080
8081// Operation SQL REST API operation definition.
8082type Operation struct {
8083	// Name - The name of the operation being performed on this particular object.
8084	Name *string `json:"name,omitempty"`
8085	// Display - The localized display information for this particular operation / action.
8086	Display *OperationDisplay `json:"display,omitempty"`
8087	// Origin - The intended executor of the operation. Possible values include: 'OperationOriginUser', 'OperationOriginSystem'
8088	Origin OperationOrigin `json:"origin,omitempty"`
8089	// Properties - Additional descriptions for the operation.
8090	Properties map[string]interface{} `json:"properties"`
8091}
8092
8093// MarshalJSON is the custom marshaler for Operation.
8094func (o Operation) MarshalJSON() ([]byte, error) {
8095	objectMap := make(map[string]interface{})
8096	if o.Name != nil {
8097		objectMap["name"] = o.Name
8098	}
8099	if o.Display != nil {
8100		objectMap["display"] = o.Display
8101	}
8102	if o.Origin != "" {
8103		objectMap["origin"] = o.Origin
8104	}
8105	if o.Properties != nil {
8106		objectMap["properties"] = o.Properties
8107	}
8108	return json.Marshal(objectMap)
8109}
8110
8111// OperationDisplay display metadata associated with the operation.
8112type OperationDisplay struct {
8113	// Provider - The localized friendly form of the resource provider name.
8114	Provider *string `json:"provider,omitempty"`
8115	// Resource - The localized friendly form of the resource type related to this action/operation.
8116	Resource *string `json:"resource,omitempty"`
8117	// Operation - The localized friendly name for the operation.
8118	Operation *string `json:"operation,omitempty"`
8119	// Description - The localized friendly description for the operation.
8120	Description *string `json:"description,omitempty"`
8121}
8122
8123// OperationImpact the impact of an operation, both in absolute and relative terms.
8124type OperationImpact struct {
8125	// Name - The name of the impact dimension.
8126	Name *string `json:"name,omitempty"`
8127	// Unit - The unit in which estimated impact to dimension is measured.
8128	Unit *string `json:"unit,omitempty"`
8129	// ChangeValueAbsolute - The absolute impact to dimension.
8130	ChangeValueAbsolute *float64 `json:"changeValueAbsolute,omitempty"`
8131	// ChangeValueRelative - The relative impact to dimension (null if not applicable)
8132	ChangeValueRelative *float64 `json:"changeValueRelative,omitempty"`
8133}
8134
8135// OperationListResult result of the request to list SQL operations.
8136type OperationListResult struct {
8137	autorest.Response `json:"-"`
8138	// Value - Array of results.
8139	Value *[]Operation `json:"value,omitempty"`
8140	// NextLink - Link to retrieve next page of results.
8141	NextLink *string `json:"nextLink,omitempty"`
8142}
8143
8144// OperationListResultIterator provides access to a complete listing of Operation values.
8145type OperationListResultIterator struct {
8146	i    int
8147	page OperationListResultPage
8148}
8149
8150// Next advances to the next value.  If there was an error making
8151// the request the iterator does not advance and the error is returned.
8152func (iter *OperationListResultIterator) Next() error {
8153	iter.i++
8154	if iter.i < len(iter.page.Values()) {
8155		return nil
8156	}
8157	err := iter.page.Next()
8158	if err != nil {
8159		iter.i--
8160		return err
8161	}
8162	iter.i = 0
8163	return nil
8164}
8165
8166// NotDone returns true if the enumeration should be started or is not yet complete.
8167func (iter OperationListResultIterator) NotDone() bool {
8168	return iter.page.NotDone() && iter.i < len(iter.page.Values())
8169}
8170
8171// Response returns the raw server response from the last page request.
8172func (iter OperationListResultIterator) Response() OperationListResult {
8173	return iter.page.Response()
8174}
8175
8176// Value returns the current value or a zero-initialized value if the
8177// iterator has advanced beyond the end of the collection.
8178func (iter OperationListResultIterator) Value() Operation {
8179	if !iter.page.NotDone() {
8180		return Operation{}
8181	}
8182	return iter.page.Values()[iter.i]
8183}
8184
8185// IsEmpty returns true if the ListResult contains no values.
8186func (olr OperationListResult) IsEmpty() bool {
8187	return olr.Value == nil || len(*olr.Value) == 0
8188}
8189
8190// operationListResultPreparer prepares a request to retrieve the next set of results.
8191// It returns nil if no more results exist.
8192func (olr OperationListResult) operationListResultPreparer() (*http.Request, error) {
8193	if olr.NextLink == nil || len(to.String(olr.NextLink)) < 1 {
8194		return nil, nil
8195	}
8196	return autorest.Prepare(&http.Request{},
8197		autorest.AsJSON(),
8198		autorest.AsGet(),
8199		autorest.WithBaseURL(to.String(olr.NextLink)))
8200}
8201
8202// OperationListResultPage contains a page of Operation values.
8203type OperationListResultPage struct {
8204	fn  func(OperationListResult) (OperationListResult, error)
8205	olr OperationListResult
8206}
8207
8208// Next advances to the next page of values.  If there was an error making
8209// the request the page does not advance and the error is returned.
8210func (page *OperationListResultPage) Next() error {
8211	next, err := page.fn(page.olr)
8212	if err != nil {
8213		return err
8214	}
8215	page.olr = next
8216	return nil
8217}
8218
8219// NotDone returns true if the page enumeration should be started or is not yet complete.
8220func (page OperationListResultPage) NotDone() bool {
8221	return !page.olr.IsEmpty()
8222}
8223
8224// Response returns the raw server response from the last page request.
8225func (page OperationListResultPage) Response() OperationListResult {
8226	return page.olr
8227}
8228
8229// Values returns the slice of values for the current page or nil if there are no values.
8230func (page OperationListResultPage) Values() []Operation {
8231	if page.olr.IsEmpty() {
8232		return nil
8233	}
8234	return *page.olr.Value
8235}
8236
8237// PartnerInfo partner server information for the failover group.
8238type PartnerInfo struct {
8239	// ID - Resource identifier of the partner server.
8240	ID *string `json:"id,omitempty"`
8241	// Location - Geo location of the partner server.
8242	Location *string `json:"location,omitempty"`
8243	// ReplicationRole - Replication role of the partner server. Possible values include: 'Primary', 'Secondary'
8244	ReplicationRole FailoverGroupReplicationRole `json:"replicationRole,omitempty"`
8245}
8246
8247// PerformanceLevel a possible performance level of a service objective capability.
8248type PerformanceLevel struct {
8249	// Unit - Unit type used to measure service objective performance level. Possible values include: 'DTU'
8250	Unit PerformanceLevelUnit `json:"unit,omitempty"`
8251	// Value - Performance level value.
8252	Value *int32 `json:"value,omitempty"`
8253}
8254
8255// ProxyResource ARM proxy resource.
8256type ProxyResource struct {
8257	// ID - Resource ID.
8258	ID *string `json:"id,omitempty"`
8259	// Name - Resource name.
8260	Name *string `json:"name,omitempty"`
8261	// Type - Resource type.
8262	Type *string `json:"type,omitempty"`
8263}
8264
8265// RecommendedIndex represents a database recommended index.
8266type RecommendedIndex struct {
8267	// RecommendedIndexProperties - The properties representing the resource.
8268	*RecommendedIndexProperties `json:"properties,omitempty"`
8269	// ID - Resource ID.
8270	ID *string `json:"id,omitempty"`
8271	// Name - Resource name.
8272	Name *string `json:"name,omitempty"`
8273	// Type - Resource type.
8274	Type *string `json:"type,omitempty"`
8275}
8276
8277// MarshalJSON is the custom marshaler for RecommendedIndex.
8278func (ri RecommendedIndex) MarshalJSON() ([]byte, error) {
8279	objectMap := make(map[string]interface{})
8280	if ri.RecommendedIndexProperties != nil {
8281		objectMap["properties"] = ri.RecommendedIndexProperties
8282	}
8283	if ri.ID != nil {
8284		objectMap["id"] = ri.ID
8285	}
8286	if ri.Name != nil {
8287		objectMap["name"] = ri.Name
8288	}
8289	if ri.Type != nil {
8290		objectMap["type"] = ri.Type
8291	}
8292	return json.Marshal(objectMap)
8293}
8294
8295// UnmarshalJSON is the custom unmarshaler for RecommendedIndex struct.
8296func (ri *RecommendedIndex) UnmarshalJSON(body []byte) error {
8297	var m map[string]*json.RawMessage
8298	err := json.Unmarshal(body, &m)
8299	if err != nil {
8300		return err
8301	}
8302	for k, v := range m {
8303		switch k {
8304		case "properties":
8305			if v != nil {
8306				var recommendedIndexProperties RecommendedIndexProperties
8307				err = json.Unmarshal(*v, &recommendedIndexProperties)
8308				if err != nil {
8309					return err
8310				}
8311				ri.RecommendedIndexProperties = &recommendedIndexProperties
8312			}
8313		case "id":
8314			if v != nil {
8315				var ID string
8316				err = json.Unmarshal(*v, &ID)
8317				if err != nil {
8318					return err
8319				}
8320				ri.ID = &ID
8321			}
8322		case "name":
8323			if v != nil {
8324				var name string
8325				err = json.Unmarshal(*v, &name)
8326				if err != nil {
8327					return err
8328				}
8329				ri.Name = &name
8330			}
8331		case "type":
8332			if v != nil {
8333				var typeVar string
8334				err = json.Unmarshal(*v, &typeVar)
8335				if err != nil {
8336					return err
8337				}
8338				ri.Type = &typeVar
8339			}
8340		}
8341	}
8342
8343	return nil
8344}
8345
8346// RecommendedIndexProperties represents the properties of a database recommended index.
8347type RecommendedIndexProperties struct {
8348	// Action - The proposed index action. You can create a missing index, drop an unused index, or rebuild an existing index to improve its performance. Possible values include: 'Create', 'Drop', 'Rebuild'
8349	Action RecommendedIndexAction `json:"action,omitempty"`
8350	// State - The current recommendation state. Possible values include: 'Active', 'Pending', 'Executing', 'Verifying', 'PendingRevert', 'Reverting', 'Reverted', 'Ignored', 'Expired', 'Blocked', 'Success'
8351	State RecommendedIndexState `json:"state,omitempty"`
8352	// Created - The UTC datetime showing when this resource was created (ISO8601 format).
8353	Created *date.Time `json:"created,omitempty"`
8354	// LastModified - The UTC datetime of when was this resource last changed (ISO8601 format).
8355	LastModified *date.Time `json:"lastModified,omitempty"`
8356	// IndexType - The type of index (CLUSTERED, NONCLUSTERED, COLUMNSTORE, CLUSTERED COLUMNSTORE). Possible values include: 'CLUSTERED', 'NONCLUSTERED', 'COLUMNSTORE', 'CLUSTEREDCOLUMNSTORE'
8357	IndexType RecommendedIndexType `json:"indexType,omitempty"`
8358	// Schema - The schema where table to build index over resides
8359	Schema *string `json:"schema,omitempty"`
8360	// Table - The table on which to build index.
8361	Table *string `json:"table,omitempty"`
8362	// Columns - Columns over which to build index
8363	Columns *[]string `json:"columns,omitempty"`
8364	// IncludedColumns - The list of column names to be included in the index
8365	IncludedColumns *[]string `json:"includedColumns,omitempty"`
8366	// IndexScript - The full build index script
8367	IndexScript *string `json:"indexScript,omitempty"`
8368	// EstimatedImpact - The estimated impact of doing recommended index action.
8369	EstimatedImpact *[]OperationImpact `json:"estimatedImpact,omitempty"`
8370	// ReportedImpact - The values reported after index action is complete.
8371	ReportedImpact *[]OperationImpact `json:"reportedImpact,omitempty"`
8372}
8373
8374// RecoverableDatabase a recoverable database
8375type RecoverableDatabase struct {
8376	autorest.Response `json:"-"`
8377	// RecoverableDatabaseProperties - The properties of a recoverable database
8378	*RecoverableDatabaseProperties `json:"properties,omitempty"`
8379	// ID - Resource ID.
8380	ID *string `json:"id,omitempty"`
8381	// Name - Resource name.
8382	Name *string `json:"name,omitempty"`
8383	// Type - Resource type.
8384	Type *string `json:"type,omitempty"`
8385}
8386
8387// MarshalJSON is the custom marshaler for RecoverableDatabase.
8388func (rd RecoverableDatabase) MarshalJSON() ([]byte, error) {
8389	objectMap := make(map[string]interface{})
8390	if rd.RecoverableDatabaseProperties != nil {
8391		objectMap["properties"] = rd.RecoverableDatabaseProperties
8392	}
8393	if rd.ID != nil {
8394		objectMap["id"] = rd.ID
8395	}
8396	if rd.Name != nil {
8397		objectMap["name"] = rd.Name
8398	}
8399	if rd.Type != nil {
8400		objectMap["type"] = rd.Type
8401	}
8402	return json.Marshal(objectMap)
8403}
8404
8405// UnmarshalJSON is the custom unmarshaler for RecoverableDatabase struct.
8406func (rd *RecoverableDatabase) UnmarshalJSON(body []byte) error {
8407	var m map[string]*json.RawMessage
8408	err := json.Unmarshal(body, &m)
8409	if err != nil {
8410		return err
8411	}
8412	for k, v := range m {
8413		switch k {
8414		case "properties":
8415			if v != nil {
8416				var recoverableDatabaseProperties RecoverableDatabaseProperties
8417				err = json.Unmarshal(*v, &recoverableDatabaseProperties)
8418				if err != nil {
8419					return err
8420				}
8421				rd.RecoverableDatabaseProperties = &recoverableDatabaseProperties
8422			}
8423		case "id":
8424			if v != nil {
8425				var ID string
8426				err = json.Unmarshal(*v, &ID)
8427				if err != nil {
8428					return err
8429				}
8430				rd.ID = &ID
8431			}
8432		case "name":
8433			if v != nil {
8434				var name string
8435				err = json.Unmarshal(*v, &name)
8436				if err != nil {
8437					return err
8438				}
8439				rd.Name = &name
8440			}
8441		case "type":
8442			if v != nil {
8443				var typeVar string
8444				err = json.Unmarshal(*v, &typeVar)
8445				if err != nil {
8446					return err
8447				}
8448				rd.Type = &typeVar
8449			}
8450		}
8451	}
8452
8453	return nil
8454}
8455
8456// RecoverableDatabaseListResult the response to a list recoverable databases request
8457type RecoverableDatabaseListResult struct {
8458	autorest.Response `json:"-"`
8459	// Value - A list of recoverable databases
8460	Value *[]RecoverableDatabase `json:"value,omitempty"`
8461}
8462
8463// RecoverableDatabaseProperties the properties of a recoverable database
8464type RecoverableDatabaseProperties struct {
8465	// Edition - The edition of the database
8466	Edition *string `json:"edition,omitempty"`
8467	// ServiceLevelObjective - The service level objective name of the database
8468	ServiceLevelObjective *string `json:"serviceLevelObjective,omitempty"`
8469	// ElasticPoolName - The elastic pool name of the database
8470	ElasticPoolName *string `json:"elasticPoolName,omitempty"`
8471	// LastAvailableBackupDate - The last available backup date of the database (ISO8601 format)
8472	LastAvailableBackupDate *date.Time `json:"lastAvailableBackupDate,omitempty"`
8473}
8474
8475// ReplicationLink represents a database replication link.
8476type ReplicationLink struct {
8477	autorest.Response `json:"-"`
8478	// Location - Location of the server that contains this firewall rule.
8479	Location *string `json:"location,omitempty"`
8480	// ReplicationLinkProperties - The properties representing the resource.
8481	*ReplicationLinkProperties `json:"properties,omitempty"`
8482	// ID - Resource ID.
8483	ID *string `json:"id,omitempty"`
8484	// Name - Resource name.
8485	Name *string `json:"name,omitempty"`
8486	// Type - Resource type.
8487	Type *string `json:"type,omitempty"`
8488}
8489
8490// MarshalJSON is the custom marshaler for ReplicationLink.
8491func (rl ReplicationLink) MarshalJSON() ([]byte, error) {
8492	objectMap := make(map[string]interface{})
8493	if rl.Location != nil {
8494		objectMap["location"] = rl.Location
8495	}
8496	if rl.ReplicationLinkProperties != nil {
8497		objectMap["properties"] = rl.ReplicationLinkProperties
8498	}
8499	if rl.ID != nil {
8500		objectMap["id"] = rl.ID
8501	}
8502	if rl.Name != nil {
8503		objectMap["name"] = rl.Name
8504	}
8505	if rl.Type != nil {
8506		objectMap["type"] = rl.Type
8507	}
8508	return json.Marshal(objectMap)
8509}
8510
8511// UnmarshalJSON is the custom unmarshaler for ReplicationLink struct.
8512func (rl *ReplicationLink) UnmarshalJSON(body []byte) error {
8513	var m map[string]*json.RawMessage
8514	err := json.Unmarshal(body, &m)
8515	if err != nil {
8516		return err
8517	}
8518	for k, v := range m {
8519		switch k {
8520		case "location":
8521			if v != nil {
8522				var location string
8523				err = json.Unmarshal(*v, &location)
8524				if err != nil {
8525					return err
8526				}
8527				rl.Location = &location
8528			}
8529		case "properties":
8530			if v != nil {
8531				var replicationLinkProperties ReplicationLinkProperties
8532				err = json.Unmarshal(*v, &replicationLinkProperties)
8533				if err != nil {
8534					return err
8535				}
8536				rl.ReplicationLinkProperties = &replicationLinkProperties
8537			}
8538		case "id":
8539			if v != nil {
8540				var ID string
8541				err = json.Unmarshal(*v, &ID)
8542				if err != nil {
8543					return err
8544				}
8545				rl.ID = &ID
8546			}
8547		case "name":
8548			if v != nil {
8549				var name string
8550				err = json.Unmarshal(*v, &name)
8551				if err != nil {
8552					return err
8553				}
8554				rl.Name = &name
8555			}
8556		case "type":
8557			if v != nil {
8558				var typeVar string
8559				err = json.Unmarshal(*v, &typeVar)
8560				if err != nil {
8561					return err
8562				}
8563				rl.Type = &typeVar
8564			}
8565		}
8566	}
8567
8568	return nil
8569}
8570
8571// ReplicationLinkListResult represents the response to a List database replication link request.
8572type ReplicationLinkListResult struct {
8573	autorest.Response `json:"-"`
8574	// Value - The list of database replication links housed in the database.
8575	Value *[]ReplicationLink `json:"value,omitempty"`
8576}
8577
8578// ReplicationLinkProperties represents the properties of a database replication link.
8579type ReplicationLinkProperties struct {
8580	// IsTerminationAllowed - Legacy value indicating whether termination is allowed.  Currently always returns true.
8581	IsTerminationAllowed *bool `json:"isTerminationAllowed,omitempty"`
8582	// ReplicationMode - Replication mode of this replication link.
8583	ReplicationMode *string `json:"replicationMode,omitempty"`
8584	// PartnerServer - The name of the server hosting the partner database.
8585	PartnerServer *string `json:"partnerServer,omitempty"`
8586	// PartnerDatabase - The name of the partner database.
8587	PartnerDatabase *string `json:"partnerDatabase,omitempty"`
8588	// PartnerLocation - The Azure Region of the partner database.
8589	PartnerLocation *string `json:"partnerLocation,omitempty"`
8590	// Role - The role of the database in the replication link. Possible values include: 'ReplicationRolePrimary', 'ReplicationRoleSecondary', 'ReplicationRoleNonReadableSecondary', 'ReplicationRoleSource', 'ReplicationRoleCopy'
8591	Role ReplicationRole `json:"role,omitempty"`
8592	// PartnerRole - The role of the partner database in the replication link. Possible values include: 'ReplicationRolePrimary', 'ReplicationRoleSecondary', 'ReplicationRoleNonReadableSecondary', 'ReplicationRoleSource', 'ReplicationRoleCopy'
8593	PartnerRole ReplicationRole `json:"partnerRole,omitempty"`
8594	// StartTime - The start time for the replication link.
8595	StartTime *date.Time `json:"startTime,omitempty"`
8596	// PercentComplete - The percentage of seeding complete for the replication link.
8597	PercentComplete *int32 `json:"percentComplete,omitempty"`
8598	// ReplicationState - The replication state for the replication link. Possible values include: 'PENDING', 'SEEDING', 'CATCHUP', 'SUSPENDED'
8599	ReplicationState ReplicationState `json:"replicationState,omitempty"`
8600}
8601
8602// ReplicationLinksFailoverAllowDataLossFuture an abstraction for monitoring and retrieving the results of a
8603// long-running operation.
8604type ReplicationLinksFailoverAllowDataLossFuture struct {
8605	azure.Future
8606}
8607
8608// Result returns the result of the asynchronous operation.
8609// If the operation has not completed it will return an error.
8610func (future *ReplicationLinksFailoverAllowDataLossFuture) Result(client ReplicationLinksClient) (ar autorest.Response, err error) {
8611	var done bool
8612	done, err = future.Done(client)
8613	if err != nil {
8614		err = autorest.NewErrorWithError(err, "sql.ReplicationLinksFailoverAllowDataLossFuture", "Result", future.Response(), "Polling failure")
8615		return
8616	}
8617	if !done {
8618		err = azure.NewAsyncOpIncompleteError("sql.ReplicationLinksFailoverAllowDataLossFuture")
8619		return
8620	}
8621	ar.Response = future.Response()
8622	return
8623}
8624
8625// ReplicationLinksFailoverFuture an abstraction for monitoring and retrieving the results of a long-running
8626// operation.
8627type ReplicationLinksFailoverFuture struct {
8628	azure.Future
8629}
8630
8631// Result returns the result of the asynchronous operation.
8632// If the operation has not completed it will return an error.
8633func (future *ReplicationLinksFailoverFuture) Result(client ReplicationLinksClient) (ar autorest.Response, err error) {
8634	var done bool
8635	done, err = future.Done(client)
8636	if err != nil {
8637		err = autorest.NewErrorWithError(err, "sql.ReplicationLinksFailoverFuture", "Result", future.Response(), "Polling failure")
8638		return
8639	}
8640	if !done {
8641		err = azure.NewAsyncOpIncompleteError("sql.ReplicationLinksFailoverFuture")
8642		return
8643	}
8644	ar.Response = future.Response()
8645	return
8646}
8647
8648// Resource ARM resource.
8649type Resource struct {
8650	// ID - Resource ID.
8651	ID *string `json:"id,omitempty"`
8652	// Name - Resource name.
8653	Name *string `json:"name,omitempty"`
8654	// Type - Resource type.
8655	Type *string `json:"type,omitempty"`
8656}
8657
8658// ResourceIdentity azure Active Directory identity configuration for a resource.
8659type ResourceIdentity struct {
8660	// PrincipalID - The Azure Active Directory principal id.
8661	PrincipalID *uuid.UUID `json:"principalId,omitempty"`
8662	// Type - The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal for the resource. Possible values include: 'SystemAssigned'
8663	Type IdentityType `json:"type,omitempty"`
8664	// TenantID - The Azure Active Directory tenant id.
8665	TenantID *uuid.UUID `json:"tenantId,omitempty"`
8666}
8667
8668// ResourceMoveDefinition contains the information necessary to perform a resource move (rename).
8669type ResourceMoveDefinition struct {
8670	// ID - The target ID for the resource
8671	ID *string `json:"id,omitempty"`
8672}
8673
8674// RestorableDroppedDatabase a restorable dropped database
8675type RestorableDroppedDatabase struct {
8676	autorest.Response `json:"-"`
8677	// Location - The geo-location where the resource lives
8678	Location *string `json:"location,omitempty"`
8679	// RestorableDroppedDatabaseProperties - The properties of a restorable dropped database
8680	*RestorableDroppedDatabaseProperties `json:"properties,omitempty"`
8681	// ID - Resource ID.
8682	ID *string `json:"id,omitempty"`
8683	// Name - Resource name.
8684	Name *string `json:"name,omitempty"`
8685	// Type - Resource type.
8686	Type *string `json:"type,omitempty"`
8687}
8688
8689// MarshalJSON is the custom marshaler for RestorableDroppedDatabase.
8690func (rdd RestorableDroppedDatabase) MarshalJSON() ([]byte, error) {
8691	objectMap := make(map[string]interface{})
8692	if rdd.Location != nil {
8693		objectMap["location"] = rdd.Location
8694	}
8695	if rdd.RestorableDroppedDatabaseProperties != nil {
8696		objectMap["properties"] = rdd.RestorableDroppedDatabaseProperties
8697	}
8698	if rdd.ID != nil {
8699		objectMap["id"] = rdd.ID
8700	}
8701	if rdd.Name != nil {
8702		objectMap["name"] = rdd.Name
8703	}
8704	if rdd.Type != nil {
8705		objectMap["type"] = rdd.Type
8706	}
8707	return json.Marshal(objectMap)
8708}
8709
8710// UnmarshalJSON is the custom unmarshaler for RestorableDroppedDatabase struct.
8711func (rdd *RestorableDroppedDatabase) UnmarshalJSON(body []byte) error {
8712	var m map[string]*json.RawMessage
8713	err := json.Unmarshal(body, &m)
8714	if err != nil {
8715		return err
8716	}
8717	for k, v := range m {
8718		switch k {
8719		case "location":
8720			if v != nil {
8721				var location string
8722				err = json.Unmarshal(*v, &location)
8723				if err != nil {
8724					return err
8725				}
8726				rdd.Location = &location
8727			}
8728		case "properties":
8729			if v != nil {
8730				var restorableDroppedDatabaseProperties RestorableDroppedDatabaseProperties
8731				err = json.Unmarshal(*v, &restorableDroppedDatabaseProperties)
8732				if err != nil {
8733					return err
8734				}
8735				rdd.RestorableDroppedDatabaseProperties = &restorableDroppedDatabaseProperties
8736			}
8737		case "id":
8738			if v != nil {
8739				var ID string
8740				err = json.Unmarshal(*v, &ID)
8741				if err != nil {
8742					return err
8743				}
8744				rdd.ID = &ID
8745			}
8746		case "name":
8747			if v != nil {
8748				var name string
8749				err = json.Unmarshal(*v, &name)
8750				if err != nil {
8751					return err
8752				}
8753				rdd.Name = &name
8754			}
8755		case "type":
8756			if v != nil {
8757				var typeVar string
8758				err = json.Unmarshal(*v, &typeVar)
8759				if err != nil {
8760					return err
8761				}
8762				rdd.Type = &typeVar
8763			}
8764		}
8765	}
8766
8767	return nil
8768}
8769
8770// RestorableDroppedDatabaseListResult the response to a list restorable dropped databases request
8771type RestorableDroppedDatabaseListResult struct {
8772	autorest.Response `json:"-"`
8773	// Value - A list of restorable dropped databases
8774	Value *[]RestorableDroppedDatabase `json:"value,omitempty"`
8775}
8776
8777// RestorableDroppedDatabaseProperties the properties of a restorable dropped database
8778type RestorableDroppedDatabaseProperties struct {
8779	// DatabaseName - The name of the database
8780	DatabaseName *string `json:"databaseName,omitempty"`
8781	// Edition - The edition of the database
8782	Edition *string `json:"edition,omitempty"`
8783	// MaxSizeBytes - The max size in bytes of the database
8784	MaxSizeBytes *string `json:"maxSizeBytes,omitempty"`
8785	// ServiceLevelObjective - The service level objective name of the database
8786	ServiceLevelObjective *string `json:"serviceLevelObjective,omitempty"`
8787	// ElasticPoolName - The elastic pool name of the database
8788	ElasticPoolName *string `json:"elasticPoolName,omitempty"`
8789	// CreationDate - The creation date of the database (ISO8601 format)
8790	CreationDate *date.Time `json:"creationDate,omitempty"`
8791	// DeletionDate - The deletion date of the database (ISO8601 format)
8792	DeletionDate *date.Time `json:"deletionDate,omitempty"`
8793	// EarliestRestoreDate - The earliest restore date of the database (ISO8601 format)
8794	EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"`
8795}
8796
8797// RestorePoint database restore points.
8798type RestorePoint struct {
8799	autorest.Response `json:"-"`
8800	// Location - Resource location.
8801	Location *string `json:"location,omitempty"`
8802	// RestorePointProperties - Resource properties.
8803	*RestorePointProperties `json:"properties,omitempty"`
8804	// ID - Resource ID.
8805	ID *string `json:"id,omitempty"`
8806	// Name - Resource name.
8807	Name *string `json:"name,omitempty"`
8808	// Type - Resource type.
8809	Type *string `json:"type,omitempty"`
8810}
8811
8812// MarshalJSON is the custom marshaler for RestorePoint.
8813func (rp RestorePoint) MarshalJSON() ([]byte, error) {
8814	objectMap := make(map[string]interface{})
8815	if rp.Location != nil {
8816		objectMap["location"] = rp.Location
8817	}
8818	if rp.RestorePointProperties != nil {
8819		objectMap["properties"] = rp.RestorePointProperties
8820	}
8821	if rp.ID != nil {
8822		objectMap["id"] = rp.ID
8823	}
8824	if rp.Name != nil {
8825		objectMap["name"] = rp.Name
8826	}
8827	if rp.Type != nil {
8828		objectMap["type"] = rp.Type
8829	}
8830	return json.Marshal(objectMap)
8831}
8832
8833// UnmarshalJSON is the custom unmarshaler for RestorePoint struct.
8834func (rp *RestorePoint) UnmarshalJSON(body []byte) error {
8835	var m map[string]*json.RawMessage
8836	err := json.Unmarshal(body, &m)
8837	if err != nil {
8838		return err
8839	}
8840	for k, v := range m {
8841		switch k {
8842		case "location":
8843			if v != nil {
8844				var location string
8845				err = json.Unmarshal(*v, &location)
8846				if err != nil {
8847					return err
8848				}
8849				rp.Location = &location
8850			}
8851		case "properties":
8852			if v != nil {
8853				var restorePointProperties RestorePointProperties
8854				err = json.Unmarshal(*v, &restorePointProperties)
8855				if err != nil {
8856					return err
8857				}
8858				rp.RestorePointProperties = &restorePointProperties
8859			}
8860		case "id":
8861			if v != nil {
8862				var ID string
8863				err = json.Unmarshal(*v, &ID)
8864				if err != nil {
8865					return err
8866				}
8867				rp.ID = &ID
8868			}
8869		case "name":
8870			if v != nil {
8871				var name string
8872				err = json.Unmarshal(*v, &name)
8873				if err != nil {
8874					return err
8875				}
8876				rp.Name = &name
8877			}
8878		case "type":
8879			if v != nil {
8880				var typeVar string
8881				err = json.Unmarshal(*v, &typeVar)
8882				if err != nil {
8883					return err
8884				}
8885				rp.Type = &typeVar
8886			}
8887		}
8888	}
8889
8890	return nil
8891}
8892
8893// RestorePointListResult a list of long term retention bacukps.
8894type RestorePointListResult struct {
8895	autorest.Response `json:"-"`
8896	// Value - Array of results.
8897	Value *[]RestorePoint `json:"value,omitempty"`
8898	// NextLink - Link to retrieve next page of results.
8899	NextLink *string `json:"nextLink,omitempty"`
8900}
8901
8902// RestorePointProperties properties of a database restore point
8903type RestorePointProperties struct {
8904	// RestorePointType - The type of restore point. Possible values include: 'CONTINUOUS', 'DISCRETE'
8905	RestorePointType RestorePointType `json:"restorePointType,omitempty"`
8906	// EarliestRestoreDate - The earliest time to which this database can be restored
8907	EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"`
8908	// RestorePointCreationDate - The time the backup was taken
8909	RestorePointCreationDate *date.Time `json:"restorePointCreationDate,omitempty"`
8910	// RestorePointLabel - The label of restore point for backup request by user
8911	RestorePointLabel *string `json:"restorePointLabel,omitempty"`
8912}
8913
8914// RestorePointsCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
8915type RestorePointsCreateFuture struct {
8916	azure.Future
8917}
8918
8919// Result returns the result of the asynchronous operation.
8920// If the operation has not completed it will return an error.
8921func (future *RestorePointsCreateFuture) Result(client RestorePointsClient) (rp RestorePoint, err error) {
8922	var done bool
8923	done, err = future.Done(client)
8924	if err != nil {
8925		err = autorest.NewErrorWithError(err, "sql.RestorePointsCreateFuture", "Result", future.Response(), "Polling failure")
8926		return
8927	}
8928	if !done {
8929		err = azure.NewAsyncOpIncompleteError("sql.RestorePointsCreateFuture")
8930		return
8931	}
8932	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8933	if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent {
8934		rp, err = client.CreateResponder(rp.Response.Response)
8935		if err != nil {
8936			err = autorest.NewErrorWithError(err, "sql.RestorePointsCreateFuture", "Result", rp.Response.Response, "Failure responding to request")
8937		}
8938	}
8939	return
8940}
8941
8942// SecurityAlertPolicyProperties properties of a security alert policy.
8943type SecurityAlertPolicyProperties struct {
8944	// State - Specifies the state of the policy, whether it is enabled or disabled. Possible values include: 'SecurityAlertPolicyStateNew', 'SecurityAlertPolicyStateEnabled', 'SecurityAlertPolicyStateDisabled'
8945	State SecurityAlertPolicyState `json:"state,omitempty"`
8946	// DisabledAlerts - Specifies an array of alerts that are disabled. Allowed values are: Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action
8947	DisabledAlerts *[]string `json:"disabledAlerts,omitempty"`
8948	// EmailAddresses - Specifies an array of e-mail addresses to which the alert is sent.
8949	EmailAddresses *[]string `json:"emailAddresses,omitempty"`
8950	// EmailAccountAdmins - Specifies that the alert is sent to the account administrators.
8951	EmailAccountAdmins *bool `json:"emailAccountAdmins,omitempty"`
8952	// StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs.
8953	StorageEndpoint *string `json:"storageEndpoint,omitempty"`
8954	// StorageAccountAccessKey - Specifies the identifier key of the Threat Detection audit storage account.
8955	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
8956	// RetentionDays - Specifies the number of days to keep in the Threat Detection audit logs.
8957	RetentionDays *int32 `json:"retentionDays,omitempty"`
8958}
8959
8960// Server an Azure SQL Database server.
8961type Server struct {
8962	autorest.Response `json:"-"`
8963	// Identity - The Azure Active Directory identity of the server.
8964	Identity *ResourceIdentity `json:"identity,omitempty"`
8965	// Kind - Kind of sql server. This is metadata used for the Azure portal experience.
8966	Kind *string `json:"kind,omitempty"`
8967	// ServerProperties - Resource properties.
8968	*ServerProperties `json:"properties,omitempty"`
8969	// Location - Resource location.
8970	Location *string `json:"location,omitempty"`
8971	// Tags - Resource tags.
8972	Tags map[string]*string `json:"tags"`
8973	// ID - Resource ID.
8974	ID *string `json:"id,omitempty"`
8975	// Name - Resource name.
8976	Name *string `json:"name,omitempty"`
8977	// Type - Resource type.
8978	Type *string `json:"type,omitempty"`
8979}
8980
8981// MarshalJSON is the custom marshaler for Server.
8982func (s Server) MarshalJSON() ([]byte, error) {
8983	objectMap := make(map[string]interface{})
8984	if s.Identity != nil {
8985		objectMap["identity"] = s.Identity
8986	}
8987	if s.Kind != nil {
8988		objectMap["kind"] = s.Kind
8989	}
8990	if s.ServerProperties != nil {
8991		objectMap["properties"] = s.ServerProperties
8992	}
8993	if s.Location != nil {
8994		objectMap["location"] = s.Location
8995	}
8996	if s.Tags != nil {
8997		objectMap["tags"] = s.Tags
8998	}
8999	if s.ID != nil {
9000		objectMap["id"] = s.ID
9001	}
9002	if s.Name != nil {
9003		objectMap["name"] = s.Name
9004	}
9005	if s.Type != nil {
9006		objectMap["type"] = s.Type
9007	}
9008	return json.Marshal(objectMap)
9009}
9010
9011// UnmarshalJSON is the custom unmarshaler for Server struct.
9012func (s *Server) UnmarshalJSON(body []byte) error {
9013	var m map[string]*json.RawMessage
9014	err := json.Unmarshal(body, &m)
9015	if err != nil {
9016		return err
9017	}
9018	for k, v := range m {
9019		switch k {
9020		case "identity":
9021			if v != nil {
9022				var identity ResourceIdentity
9023				err = json.Unmarshal(*v, &identity)
9024				if err != nil {
9025					return err
9026				}
9027				s.Identity = &identity
9028			}
9029		case "kind":
9030			if v != nil {
9031				var kind string
9032				err = json.Unmarshal(*v, &kind)
9033				if err != nil {
9034					return err
9035				}
9036				s.Kind = &kind
9037			}
9038		case "properties":
9039			if v != nil {
9040				var serverProperties ServerProperties
9041				err = json.Unmarshal(*v, &serverProperties)
9042				if err != nil {
9043					return err
9044				}
9045				s.ServerProperties = &serverProperties
9046			}
9047		case "location":
9048			if v != nil {
9049				var location string
9050				err = json.Unmarshal(*v, &location)
9051				if err != nil {
9052					return err
9053				}
9054				s.Location = &location
9055			}
9056		case "tags":
9057			if v != nil {
9058				var tags map[string]*string
9059				err = json.Unmarshal(*v, &tags)
9060				if err != nil {
9061					return err
9062				}
9063				s.Tags = tags
9064			}
9065		case "id":
9066			if v != nil {
9067				var ID string
9068				err = json.Unmarshal(*v, &ID)
9069				if err != nil {
9070					return err
9071				}
9072				s.ID = &ID
9073			}
9074		case "name":
9075			if v != nil {
9076				var name string
9077				err = json.Unmarshal(*v, &name)
9078				if err != nil {
9079					return err
9080				}
9081				s.Name = &name
9082			}
9083		case "type":
9084			if v != nil {
9085				var typeVar string
9086				err = json.Unmarshal(*v, &typeVar)
9087				if err != nil {
9088					return err
9089				}
9090				s.Type = &typeVar
9091			}
9092		}
9093	}
9094
9095	return nil
9096}
9097
9098// ServerAdministratorListResult the response to a list Active Directory Administrators request.
9099type ServerAdministratorListResult struct {
9100	autorest.Response `json:"-"`
9101	// Value - The list of server Active Directory Administrators for the server.
9102	Value *[]ServerAzureADAdministrator `json:"value,omitempty"`
9103}
9104
9105// ServerAdministratorProperties the properties of an server Administrator.
9106type ServerAdministratorProperties struct {
9107	// AdministratorType - The type of administrator.
9108	AdministratorType *string `json:"administratorType,omitempty"`
9109	// Login - The server administrator login value.
9110	Login *string `json:"login,omitempty"`
9111	// Sid - The server administrator Sid (Secure ID).
9112	Sid *uuid.UUID `json:"sid,omitempty"`
9113	// TenantID - The server Active Directory Administrator tenant id.
9114	TenantID *uuid.UUID `json:"tenantId,omitempty"`
9115}
9116
9117// ServerAutomaticTuning server-level Automatic Tuning.
9118type ServerAutomaticTuning struct {
9119	autorest.Response `json:"-"`
9120	// AutomaticTuningServerProperties - Resource properties.
9121	*AutomaticTuningServerProperties `json:"properties,omitempty"`
9122	// ID - Resource ID.
9123	ID *string `json:"id,omitempty"`
9124	// Name - Resource name.
9125	Name *string `json:"name,omitempty"`
9126	// Type - Resource type.
9127	Type *string `json:"type,omitempty"`
9128}
9129
9130// MarshalJSON is the custom marshaler for ServerAutomaticTuning.
9131func (sat ServerAutomaticTuning) MarshalJSON() ([]byte, error) {
9132	objectMap := make(map[string]interface{})
9133	if sat.AutomaticTuningServerProperties != nil {
9134		objectMap["properties"] = sat.AutomaticTuningServerProperties
9135	}
9136	if sat.ID != nil {
9137		objectMap["id"] = sat.ID
9138	}
9139	if sat.Name != nil {
9140		objectMap["name"] = sat.Name
9141	}
9142	if sat.Type != nil {
9143		objectMap["type"] = sat.Type
9144	}
9145	return json.Marshal(objectMap)
9146}
9147
9148// UnmarshalJSON is the custom unmarshaler for ServerAutomaticTuning struct.
9149func (sat *ServerAutomaticTuning) UnmarshalJSON(body []byte) error {
9150	var m map[string]*json.RawMessage
9151	err := json.Unmarshal(body, &m)
9152	if err != nil {
9153		return err
9154	}
9155	for k, v := range m {
9156		switch k {
9157		case "properties":
9158			if v != nil {
9159				var automaticTuningServerProperties AutomaticTuningServerProperties
9160				err = json.Unmarshal(*v, &automaticTuningServerProperties)
9161				if err != nil {
9162					return err
9163				}
9164				sat.AutomaticTuningServerProperties = &automaticTuningServerProperties
9165			}
9166		case "id":
9167			if v != nil {
9168				var ID string
9169				err = json.Unmarshal(*v, &ID)
9170				if err != nil {
9171					return err
9172				}
9173				sat.ID = &ID
9174			}
9175		case "name":
9176			if v != nil {
9177				var name string
9178				err = json.Unmarshal(*v, &name)
9179				if err != nil {
9180					return err
9181				}
9182				sat.Name = &name
9183			}
9184		case "type":
9185			if v != nil {
9186				var typeVar string
9187				err = json.Unmarshal(*v, &typeVar)
9188				if err != nil {
9189					return err
9190				}
9191				sat.Type = &typeVar
9192			}
9193		}
9194	}
9195
9196	return nil
9197}
9198
9199// ServerAzureADAdministrator an server Active Directory Administrator.
9200type ServerAzureADAdministrator struct {
9201	autorest.Response `json:"-"`
9202	// ServerAdministratorProperties - The properties of the resource.
9203	*ServerAdministratorProperties `json:"properties,omitempty"`
9204	// ID - Resource ID.
9205	ID *string `json:"id,omitempty"`
9206	// Name - Resource name.
9207	Name *string `json:"name,omitempty"`
9208	// Type - Resource type.
9209	Type *string `json:"type,omitempty"`
9210}
9211
9212// MarshalJSON is the custom marshaler for ServerAzureADAdministrator.
9213func (saaa ServerAzureADAdministrator) MarshalJSON() ([]byte, error) {
9214	objectMap := make(map[string]interface{})
9215	if saaa.ServerAdministratorProperties != nil {
9216		objectMap["properties"] = saaa.ServerAdministratorProperties
9217	}
9218	if saaa.ID != nil {
9219		objectMap["id"] = saaa.ID
9220	}
9221	if saaa.Name != nil {
9222		objectMap["name"] = saaa.Name
9223	}
9224	if saaa.Type != nil {
9225		objectMap["type"] = saaa.Type
9226	}
9227	return json.Marshal(objectMap)
9228}
9229
9230// UnmarshalJSON is the custom unmarshaler for ServerAzureADAdministrator struct.
9231func (saaa *ServerAzureADAdministrator) UnmarshalJSON(body []byte) error {
9232	var m map[string]*json.RawMessage
9233	err := json.Unmarshal(body, &m)
9234	if err != nil {
9235		return err
9236	}
9237	for k, v := range m {
9238		switch k {
9239		case "properties":
9240			if v != nil {
9241				var serverAdministratorProperties ServerAdministratorProperties
9242				err = json.Unmarshal(*v, &serverAdministratorProperties)
9243				if err != nil {
9244					return err
9245				}
9246				saaa.ServerAdministratorProperties = &serverAdministratorProperties
9247			}
9248		case "id":
9249			if v != nil {
9250				var ID string
9251				err = json.Unmarshal(*v, &ID)
9252				if err != nil {
9253					return err
9254				}
9255				saaa.ID = &ID
9256			}
9257		case "name":
9258			if v != nil {
9259				var name string
9260				err = json.Unmarshal(*v, &name)
9261				if err != nil {
9262					return err
9263				}
9264				saaa.Name = &name
9265			}
9266		case "type":
9267			if v != nil {
9268				var typeVar string
9269				err = json.Unmarshal(*v, &typeVar)
9270				if err != nil {
9271					return err
9272				}
9273				saaa.Type = &typeVar
9274			}
9275		}
9276	}
9277
9278	return nil
9279}
9280
9281// ServerAzureADAdministratorsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
9282// long-running operation.
9283type ServerAzureADAdministratorsCreateOrUpdateFuture struct {
9284	azure.Future
9285}
9286
9287// Result returns the result of the asynchronous operation.
9288// If the operation has not completed it will return an error.
9289func (future *ServerAzureADAdministratorsCreateOrUpdateFuture) Result(client ServerAzureADAdministratorsClient) (saaa ServerAzureADAdministrator, err error) {
9290	var done bool
9291	done, err = future.Done(client)
9292	if err != nil {
9293		err = autorest.NewErrorWithError(err, "sql.ServerAzureADAdministratorsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
9294		return
9295	}
9296	if !done {
9297		err = azure.NewAsyncOpIncompleteError("sql.ServerAzureADAdministratorsCreateOrUpdateFuture")
9298		return
9299	}
9300	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9301	if saaa.Response.Response, err = future.GetResult(sender); err == nil && saaa.Response.Response.StatusCode != http.StatusNoContent {
9302		saaa, err = client.CreateOrUpdateResponder(saaa.Response.Response)
9303		if err != nil {
9304			err = autorest.NewErrorWithError(err, "sql.ServerAzureADAdministratorsCreateOrUpdateFuture", "Result", saaa.Response.Response, "Failure responding to request")
9305		}
9306	}
9307	return
9308}
9309
9310// ServerAzureADAdministratorsDeleteFuture an abstraction for monitoring and retrieving the results of a
9311// long-running operation.
9312type ServerAzureADAdministratorsDeleteFuture struct {
9313	azure.Future
9314}
9315
9316// Result returns the result of the asynchronous operation.
9317// If the operation has not completed it will return an error.
9318func (future *ServerAzureADAdministratorsDeleteFuture) Result(client ServerAzureADAdministratorsClient) (saaa ServerAzureADAdministrator, err error) {
9319	var done bool
9320	done, err = future.Done(client)
9321	if err != nil {
9322		err = autorest.NewErrorWithError(err, "sql.ServerAzureADAdministratorsDeleteFuture", "Result", future.Response(), "Polling failure")
9323		return
9324	}
9325	if !done {
9326		err = azure.NewAsyncOpIncompleteError("sql.ServerAzureADAdministratorsDeleteFuture")
9327		return
9328	}
9329	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9330	if saaa.Response.Response, err = future.GetResult(sender); err == nil && saaa.Response.Response.StatusCode != http.StatusNoContent {
9331		saaa, err = client.DeleteResponder(saaa.Response.Response)
9332		if err != nil {
9333			err = autorest.NewErrorWithError(err, "sql.ServerAzureADAdministratorsDeleteFuture", "Result", saaa.Response.Response, "Failure responding to request")
9334		}
9335	}
9336	return
9337}
9338
9339// ServerBlobAuditingPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
9340// long-running operation.
9341type ServerBlobAuditingPoliciesCreateOrUpdateFuture struct {
9342	azure.Future
9343}
9344
9345// Result returns the result of the asynchronous operation.
9346// If the operation has not completed it will return an error.
9347func (future *ServerBlobAuditingPoliciesCreateOrUpdateFuture) Result(client ServerBlobAuditingPoliciesClient) (sbap ServerBlobAuditingPolicy, err error) {
9348	var done bool
9349	done, err = future.Done(client)
9350	if err != nil {
9351		err = autorest.NewErrorWithError(err, "sql.ServerBlobAuditingPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
9352		return
9353	}
9354	if !done {
9355		err = azure.NewAsyncOpIncompleteError("sql.ServerBlobAuditingPoliciesCreateOrUpdateFuture")
9356		return
9357	}
9358	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9359	if sbap.Response.Response, err = future.GetResult(sender); err == nil && sbap.Response.Response.StatusCode != http.StatusNoContent {
9360		sbap, err = client.CreateOrUpdateResponder(sbap.Response.Response)
9361		if err != nil {
9362			err = autorest.NewErrorWithError(err, "sql.ServerBlobAuditingPoliciesCreateOrUpdateFuture", "Result", sbap.Response.Response, "Failure responding to request")
9363		}
9364	}
9365	return
9366}
9367
9368// ServerBlobAuditingPolicy a server blob auditing policy.
9369type ServerBlobAuditingPolicy struct {
9370	autorest.Response `json:"-"`
9371	// ServerBlobAuditingPolicyProperties - Resource properties.
9372	*ServerBlobAuditingPolicyProperties `json:"properties,omitempty"`
9373	// ID - Resource ID.
9374	ID *string `json:"id,omitempty"`
9375	// Name - Resource name.
9376	Name *string `json:"name,omitempty"`
9377	// Type - Resource type.
9378	Type *string `json:"type,omitempty"`
9379}
9380
9381// MarshalJSON is the custom marshaler for ServerBlobAuditingPolicy.
9382func (sbap ServerBlobAuditingPolicy) MarshalJSON() ([]byte, error) {
9383	objectMap := make(map[string]interface{})
9384	if sbap.ServerBlobAuditingPolicyProperties != nil {
9385		objectMap["properties"] = sbap.ServerBlobAuditingPolicyProperties
9386	}
9387	if sbap.ID != nil {
9388		objectMap["id"] = sbap.ID
9389	}
9390	if sbap.Name != nil {
9391		objectMap["name"] = sbap.Name
9392	}
9393	if sbap.Type != nil {
9394		objectMap["type"] = sbap.Type
9395	}
9396	return json.Marshal(objectMap)
9397}
9398
9399// UnmarshalJSON is the custom unmarshaler for ServerBlobAuditingPolicy struct.
9400func (sbap *ServerBlobAuditingPolicy) UnmarshalJSON(body []byte) error {
9401	var m map[string]*json.RawMessage
9402	err := json.Unmarshal(body, &m)
9403	if err != nil {
9404		return err
9405	}
9406	for k, v := range m {
9407		switch k {
9408		case "properties":
9409			if v != nil {
9410				var serverBlobAuditingPolicyProperties ServerBlobAuditingPolicyProperties
9411				err = json.Unmarshal(*v, &serverBlobAuditingPolicyProperties)
9412				if err != nil {
9413					return err
9414				}
9415				sbap.ServerBlobAuditingPolicyProperties = &serverBlobAuditingPolicyProperties
9416			}
9417		case "id":
9418			if v != nil {
9419				var ID string
9420				err = json.Unmarshal(*v, &ID)
9421				if err != nil {
9422					return err
9423				}
9424				sbap.ID = &ID
9425			}
9426		case "name":
9427			if v != nil {
9428				var name string
9429				err = json.Unmarshal(*v, &name)
9430				if err != nil {
9431					return err
9432				}
9433				sbap.Name = &name
9434			}
9435		case "type":
9436			if v != nil {
9437				var typeVar string
9438				err = json.Unmarshal(*v, &typeVar)
9439				if err != nil {
9440					return err
9441				}
9442				sbap.Type = &typeVar
9443			}
9444		}
9445	}
9446
9447	return nil
9448}
9449
9450// ServerBlobAuditingPolicyProperties properties of a server blob auditing policy.
9451type ServerBlobAuditingPolicyProperties struct {
9452	// State - Specifies the state of the policy. If state is Enabled, storageEndpoint and storageAccountAccessKey are required. Possible values include: 'BlobAuditingPolicyStateEnabled', 'BlobAuditingPolicyStateDisabled'
9453	State BlobAuditingPolicyState `json:"state,omitempty"`
9454	// StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint is required.
9455	StorageEndpoint *string `json:"storageEndpoint,omitempty"`
9456	// StorageAccountAccessKey - Specifies the identifier key of the auditing storage account. If state is Enabled, storageAccountAccessKey is required.
9457	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
9458	// RetentionDays - Specifies the number of days to keep in the audit logs.
9459	RetentionDays *int32 `json:"retentionDays,omitempty"`
9460	// AuditActionsAndGroups - Specifies the Actions-Groups and Actions to audit.
9461	//
9462	// The recommended set of action groups to use is the following combination - this will audit all the queries and stored procedures executed against the database, as well as successful and failed logins:
9463	//
9464	// BATCH_COMPLETED_GROUP,
9465	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP,
9466	// FAILED_DATABASE_AUTHENTICATION_GROUP.
9467	//
9468	// This above combination is also the set that is configured by default when enabling auditing from the Azure portal.
9469	//
9470	// The supported action groups to audit are (note: choose only specific groups that cover your auditing needs. Using unnecessary groups could lead to very large quantities of audit records):
9471	//
9472	// APPLICATION_ROLE_CHANGE_PASSWORD_GROUP
9473	// BACKUP_RESTORE_GROUP
9474	// DATABASE_LOGOUT_GROUP
9475	// DATABASE_OBJECT_CHANGE_GROUP
9476	// DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP
9477	// DATABASE_OBJECT_PERMISSION_CHANGE_GROUP
9478	// DATABASE_OPERATION_GROUP
9479	// DATABASE_PERMISSION_CHANGE_GROUP
9480	// DATABASE_PRINCIPAL_CHANGE_GROUP
9481	// DATABASE_PRINCIPAL_IMPERSONATION_GROUP
9482	// DATABASE_ROLE_MEMBER_CHANGE_GROUP
9483	// FAILED_DATABASE_AUTHENTICATION_GROUP
9484	// SCHEMA_OBJECT_ACCESS_GROUP
9485	// SCHEMA_OBJECT_CHANGE_GROUP
9486	// SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP
9487	// SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP
9488	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP
9489	// USER_CHANGE_PASSWORD_GROUP
9490	// BATCH_STARTED_GROUP
9491	// BATCH_COMPLETED_GROUP
9492	//
9493	// These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs.
9494	//
9495	// For more information, see [Database-Level Audit Action Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups).
9496	//
9497	// For Database auditing policy, specific Actions can also be specified (note that Actions cannot be specified for Server auditing policy). The supported actions to audit are:
9498	// SELECT
9499	// UPDATE
9500	// INSERT
9501	// DELETE
9502	// EXECUTE
9503	// RECEIVE
9504	// REFERENCES
9505	//
9506	// The general form for defining an action to be audited is:
9507	// <action> ON <object> BY <principal>
9508	//
9509	// Note that <object> in the above format can refer to an object like a table, view, or stored procedure, or an entire database or schema. For the latter cases, the forms DATABASE::<db_name> and SCHEMA::<schema_name> are used, respectively.
9510	//
9511	// For example:
9512	// SELECT on dbo.myTable by public
9513	// SELECT on DATABASE::myDatabase by public
9514	// SELECT on SCHEMA::mySchema by public
9515	//
9516	// For more information, see [Database-Level Audit Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions)
9517	AuditActionsAndGroups *[]string `json:"auditActionsAndGroups,omitempty"`
9518	// StorageAccountSubscriptionID - Specifies the blob storage subscription Id.
9519	StorageAccountSubscriptionID *uuid.UUID `json:"storageAccountSubscriptionId,omitempty"`
9520	// IsStorageSecondaryKeyInUse - Specifies whether storageAccountAccessKey value is the storage's secondary key.
9521	IsStorageSecondaryKeyInUse *bool `json:"isStorageSecondaryKeyInUse,omitempty"`
9522}
9523
9524// ServerCommunicationLink server communication link.
9525type ServerCommunicationLink struct {
9526	autorest.Response `json:"-"`
9527	// ServerCommunicationLinkProperties - The properties of resource.
9528	*ServerCommunicationLinkProperties `json:"properties,omitempty"`
9529	// Location - Communication link location.
9530	Location *string `json:"location,omitempty"`
9531	// Kind - Communication link kind.  This property is used for Azure Portal metadata.
9532	Kind *string `json:"kind,omitempty"`
9533	// ID - Resource ID.
9534	ID *string `json:"id,omitempty"`
9535	// Name - Resource name.
9536	Name *string `json:"name,omitempty"`
9537	// Type - Resource type.
9538	Type *string `json:"type,omitempty"`
9539}
9540
9541// MarshalJSON is the custom marshaler for ServerCommunicationLink.
9542func (scl ServerCommunicationLink) MarshalJSON() ([]byte, error) {
9543	objectMap := make(map[string]interface{})
9544	if scl.ServerCommunicationLinkProperties != nil {
9545		objectMap["properties"] = scl.ServerCommunicationLinkProperties
9546	}
9547	if scl.Location != nil {
9548		objectMap["location"] = scl.Location
9549	}
9550	if scl.Kind != nil {
9551		objectMap["kind"] = scl.Kind
9552	}
9553	if scl.ID != nil {
9554		objectMap["id"] = scl.ID
9555	}
9556	if scl.Name != nil {
9557		objectMap["name"] = scl.Name
9558	}
9559	if scl.Type != nil {
9560		objectMap["type"] = scl.Type
9561	}
9562	return json.Marshal(objectMap)
9563}
9564
9565// UnmarshalJSON is the custom unmarshaler for ServerCommunicationLink struct.
9566func (scl *ServerCommunicationLink) UnmarshalJSON(body []byte) error {
9567	var m map[string]*json.RawMessage
9568	err := json.Unmarshal(body, &m)
9569	if err != nil {
9570		return err
9571	}
9572	for k, v := range m {
9573		switch k {
9574		case "properties":
9575			if v != nil {
9576				var serverCommunicationLinkProperties ServerCommunicationLinkProperties
9577				err = json.Unmarshal(*v, &serverCommunicationLinkProperties)
9578				if err != nil {
9579					return err
9580				}
9581				scl.ServerCommunicationLinkProperties = &serverCommunicationLinkProperties
9582			}
9583		case "location":
9584			if v != nil {
9585				var location string
9586				err = json.Unmarshal(*v, &location)
9587				if err != nil {
9588					return err
9589				}
9590				scl.Location = &location
9591			}
9592		case "kind":
9593			if v != nil {
9594				var kind string
9595				err = json.Unmarshal(*v, &kind)
9596				if err != nil {
9597					return err
9598				}
9599				scl.Kind = &kind
9600			}
9601		case "id":
9602			if v != nil {
9603				var ID string
9604				err = json.Unmarshal(*v, &ID)
9605				if err != nil {
9606					return err
9607				}
9608				scl.ID = &ID
9609			}
9610		case "name":
9611			if v != nil {
9612				var name string
9613				err = json.Unmarshal(*v, &name)
9614				if err != nil {
9615					return err
9616				}
9617				scl.Name = &name
9618			}
9619		case "type":
9620			if v != nil {
9621				var typeVar string
9622				err = json.Unmarshal(*v, &typeVar)
9623				if err != nil {
9624					return err
9625				}
9626				scl.Type = &typeVar
9627			}
9628		}
9629	}
9630
9631	return nil
9632}
9633
9634// ServerCommunicationLinkListResult a list of server communication links.
9635type ServerCommunicationLinkListResult struct {
9636	autorest.Response `json:"-"`
9637	// Value - The list of server communication links.
9638	Value *[]ServerCommunicationLink `json:"value,omitempty"`
9639}
9640
9641// ServerCommunicationLinkProperties the properties of a server communication link.
9642type ServerCommunicationLinkProperties struct {
9643	// State - The state.
9644	State *string `json:"state,omitempty"`
9645	// PartnerServer - The name of the partner server.
9646	PartnerServer *string `json:"partnerServer,omitempty"`
9647}
9648
9649// ServerCommunicationLinksCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
9650// long-running operation.
9651type ServerCommunicationLinksCreateOrUpdateFuture struct {
9652	azure.Future
9653}
9654
9655// Result returns the result of the asynchronous operation.
9656// If the operation has not completed it will return an error.
9657func (future *ServerCommunicationLinksCreateOrUpdateFuture) Result(client ServerCommunicationLinksClient) (scl ServerCommunicationLink, err error) {
9658	var done bool
9659	done, err = future.Done(client)
9660	if err != nil {
9661		err = autorest.NewErrorWithError(err, "sql.ServerCommunicationLinksCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
9662		return
9663	}
9664	if !done {
9665		err = azure.NewAsyncOpIncompleteError("sql.ServerCommunicationLinksCreateOrUpdateFuture")
9666		return
9667	}
9668	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9669	if scl.Response.Response, err = future.GetResult(sender); err == nil && scl.Response.Response.StatusCode != http.StatusNoContent {
9670		scl, err = client.CreateOrUpdateResponder(scl.Response.Response)
9671		if err != nil {
9672			err = autorest.NewErrorWithError(err, "sql.ServerCommunicationLinksCreateOrUpdateFuture", "Result", scl.Response.Response, "Failure responding to request")
9673		}
9674	}
9675	return
9676}
9677
9678// ServerConnectionPolicy a server secure connection policy.
9679type ServerConnectionPolicy struct {
9680	autorest.Response `json:"-"`
9681	// Kind - Metadata used for the Azure portal experience.
9682	Kind *string `json:"kind,omitempty"`
9683	// Location - Resource location.
9684	Location *string `json:"location,omitempty"`
9685	// ServerConnectionPolicyProperties - The properties of the server secure connection policy.
9686	*ServerConnectionPolicyProperties `json:"properties,omitempty"`
9687	// ID - Resource ID.
9688	ID *string `json:"id,omitempty"`
9689	// Name - Resource name.
9690	Name *string `json:"name,omitempty"`
9691	// Type - Resource type.
9692	Type *string `json:"type,omitempty"`
9693}
9694
9695// MarshalJSON is the custom marshaler for ServerConnectionPolicy.
9696func (scp ServerConnectionPolicy) MarshalJSON() ([]byte, error) {
9697	objectMap := make(map[string]interface{})
9698	if scp.Kind != nil {
9699		objectMap["kind"] = scp.Kind
9700	}
9701	if scp.Location != nil {
9702		objectMap["location"] = scp.Location
9703	}
9704	if scp.ServerConnectionPolicyProperties != nil {
9705		objectMap["properties"] = scp.ServerConnectionPolicyProperties
9706	}
9707	if scp.ID != nil {
9708		objectMap["id"] = scp.ID
9709	}
9710	if scp.Name != nil {
9711		objectMap["name"] = scp.Name
9712	}
9713	if scp.Type != nil {
9714		objectMap["type"] = scp.Type
9715	}
9716	return json.Marshal(objectMap)
9717}
9718
9719// UnmarshalJSON is the custom unmarshaler for ServerConnectionPolicy struct.
9720func (scp *ServerConnectionPolicy) UnmarshalJSON(body []byte) error {
9721	var m map[string]*json.RawMessage
9722	err := json.Unmarshal(body, &m)
9723	if err != nil {
9724		return err
9725	}
9726	for k, v := range m {
9727		switch k {
9728		case "kind":
9729			if v != nil {
9730				var kind string
9731				err = json.Unmarshal(*v, &kind)
9732				if err != nil {
9733					return err
9734				}
9735				scp.Kind = &kind
9736			}
9737		case "location":
9738			if v != nil {
9739				var location string
9740				err = json.Unmarshal(*v, &location)
9741				if err != nil {
9742					return err
9743				}
9744				scp.Location = &location
9745			}
9746		case "properties":
9747			if v != nil {
9748				var serverConnectionPolicyProperties ServerConnectionPolicyProperties
9749				err = json.Unmarshal(*v, &serverConnectionPolicyProperties)
9750				if err != nil {
9751					return err
9752				}
9753				scp.ServerConnectionPolicyProperties = &serverConnectionPolicyProperties
9754			}
9755		case "id":
9756			if v != nil {
9757				var ID string
9758				err = json.Unmarshal(*v, &ID)
9759				if err != nil {
9760					return err
9761				}
9762				scp.ID = &ID
9763			}
9764		case "name":
9765			if v != nil {
9766				var name string
9767				err = json.Unmarshal(*v, &name)
9768				if err != nil {
9769					return err
9770				}
9771				scp.Name = &name
9772			}
9773		case "type":
9774			if v != nil {
9775				var typeVar string
9776				err = json.Unmarshal(*v, &typeVar)
9777				if err != nil {
9778					return err
9779				}
9780				scp.Type = &typeVar
9781			}
9782		}
9783	}
9784
9785	return nil
9786}
9787
9788// ServerConnectionPolicyProperties the properties of a server secure connection policy.
9789type ServerConnectionPolicyProperties struct {
9790	// ConnectionType - The server connection type. Possible values include: 'ServerConnectionTypeDefault', 'ServerConnectionTypeProxy', 'ServerConnectionTypeRedirect'
9791	ConnectionType ServerConnectionType `json:"connectionType,omitempty"`
9792}
9793
9794// ServerDNSAlias a server DNS alias.
9795type ServerDNSAlias struct {
9796	autorest.Response `json:"-"`
9797	// ServerDNSAliasProperties - Resource properties.
9798	*ServerDNSAliasProperties `json:"properties,omitempty"`
9799	// ID - Resource ID.
9800	ID *string `json:"id,omitempty"`
9801	// Name - Resource name.
9802	Name *string `json:"name,omitempty"`
9803	// Type - Resource type.
9804	Type *string `json:"type,omitempty"`
9805}
9806
9807// MarshalJSON is the custom marshaler for ServerDNSAlias.
9808func (sda ServerDNSAlias) MarshalJSON() ([]byte, error) {
9809	objectMap := make(map[string]interface{})
9810	if sda.ServerDNSAliasProperties != nil {
9811		objectMap["properties"] = sda.ServerDNSAliasProperties
9812	}
9813	if sda.ID != nil {
9814		objectMap["id"] = sda.ID
9815	}
9816	if sda.Name != nil {
9817		objectMap["name"] = sda.Name
9818	}
9819	if sda.Type != nil {
9820		objectMap["type"] = sda.Type
9821	}
9822	return json.Marshal(objectMap)
9823}
9824
9825// UnmarshalJSON is the custom unmarshaler for ServerDNSAlias struct.
9826func (sda *ServerDNSAlias) UnmarshalJSON(body []byte) error {
9827	var m map[string]*json.RawMessage
9828	err := json.Unmarshal(body, &m)
9829	if err != nil {
9830		return err
9831	}
9832	for k, v := range m {
9833		switch k {
9834		case "properties":
9835			if v != nil {
9836				var serverDNSAliasProperties ServerDNSAliasProperties
9837				err = json.Unmarshal(*v, &serverDNSAliasProperties)
9838				if err != nil {
9839					return err
9840				}
9841				sda.ServerDNSAliasProperties = &serverDNSAliasProperties
9842			}
9843		case "id":
9844			if v != nil {
9845				var ID string
9846				err = json.Unmarshal(*v, &ID)
9847				if err != nil {
9848					return err
9849				}
9850				sda.ID = &ID
9851			}
9852		case "name":
9853			if v != nil {
9854				var name string
9855				err = json.Unmarshal(*v, &name)
9856				if err != nil {
9857					return err
9858				}
9859				sda.Name = &name
9860			}
9861		case "type":
9862			if v != nil {
9863				var typeVar string
9864				err = json.Unmarshal(*v, &typeVar)
9865				if err != nil {
9866					return err
9867				}
9868				sda.Type = &typeVar
9869			}
9870		}
9871	}
9872
9873	return nil
9874}
9875
9876// ServerDNSAliasAcquisition a server DNS alias acquisition request.
9877type ServerDNSAliasAcquisition struct {
9878	// OldServerDNSAliasID - The id of the server alias that will be acquired to point to this server instead.
9879	OldServerDNSAliasID *string `json:"oldServerDnsAliasId,omitempty"`
9880}
9881
9882// ServerDNSAliasesAcquireFuture an abstraction for monitoring and retrieving the results of a long-running
9883// operation.
9884type ServerDNSAliasesAcquireFuture struct {
9885	azure.Future
9886}
9887
9888// Result returns the result of the asynchronous operation.
9889// If the operation has not completed it will return an error.
9890func (future *ServerDNSAliasesAcquireFuture) Result(client ServerDNSAliasesClient) (ar autorest.Response, err error) {
9891	var done bool
9892	done, err = future.Done(client)
9893	if err != nil {
9894		err = autorest.NewErrorWithError(err, "sql.ServerDNSAliasesAcquireFuture", "Result", future.Response(), "Polling failure")
9895		return
9896	}
9897	if !done {
9898		err = azure.NewAsyncOpIncompleteError("sql.ServerDNSAliasesAcquireFuture")
9899		return
9900	}
9901	ar.Response = future.Response()
9902	return
9903}
9904
9905// ServerDNSAliasesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
9906// operation.
9907type ServerDNSAliasesCreateOrUpdateFuture struct {
9908	azure.Future
9909}
9910
9911// Result returns the result of the asynchronous operation.
9912// If the operation has not completed it will return an error.
9913func (future *ServerDNSAliasesCreateOrUpdateFuture) Result(client ServerDNSAliasesClient) (sda ServerDNSAlias, err error) {
9914	var done bool
9915	done, err = future.Done(client)
9916	if err != nil {
9917		err = autorest.NewErrorWithError(err, "sql.ServerDNSAliasesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
9918		return
9919	}
9920	if !done {
9921		err = azure.NewAsyncOpIncompleteError("sql.ServerDNSAliasesCreateOrUpdateFuture")
9922		return
9923	}
9924	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9925	if sda.Response.Response, err = future.GetResult(sender); err == nil && sda.Response.Response.StatusCode != http.StatusNoContent {
9926		sda, err = client.CreateOrUpdateResponder(sda.Response.Response)
9927		if err != nil {
9928			err = autorest.NewErrorWithError(err, "sql.ServerDNSAliasesCreateOrUpdateFuture", "Result", sda.Response.Response, "Failure responding to request")
9929		}
9930	}
9931	return
9932}
9933
9934// ServerDNSAliasesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
9935// operation.
9936type ServerDNSAliasesDeleteFuture struct {
9937	azure.Future
9938}
9939
9940// Result returns the result of the asynchronous operation.
9941// If the operation has not completed it will return an error.
9942func (future *ServerDNSAliasesDeleteFuture) Result(client ServerDNSAliasesClient) (ar autorest.Response, err error) {
9943	var done bool
9944	done, err = future.Done(client)
9945	if err != nil {
9946		err = autorest.NewErrorWithError(err, "sql.ServerDNSAliasesDeleteFuture", "Result", future.Response(), "Polling failure")
9947		return
9948	}
9949	if !done {
9950		err = azure.NewAsyncOpIncompleteError("sql.ServerDNSAliasesDeleteFuture")
9951		return
9952	}
9953	ar.Response = future.Response()
9954	return
9955}
9956
9957// ServerDNSAliasListResult a list of server DNS aliases.
9958type ServerDNSAliasListResult struct {
9959	autorest.Response `json:"-"`
9960	// Value - Array of results.
9961	Value *[]ServerDNSAlias `json:"value,omitempty"`
9962	// NextLink - Link to retrieve next page of results.
9963	NextLink *string `json:"nextLink,omitempty"`
9964}
9965
9966// ServerDNSAliasListResultIterator provides access to a complete listing of ServerDNSAlias values.
9967type ServerDNSAliasListResultIterator struct {
9968	i    int
9969	page ServerDNSAliasListResultPage
9970}
9971
9972// Next advances to the next value.  If there was an error making
9973// the request the iterator does not advance and the error is returned.
9974func (iter *ServerDNSAliasListResultIterator) Next() error {
9975	iter.i++
9976	if iter.i < len(iter.page.Values()) {
9977		return nil
9978	}
9979	err := iter.page.Next()
9980	if err != nil {
9981		iter.i--
9982		return err
9983	}
9984	iter.i = 0
9985	return nil
9986}
9987
9988// NotDone returns true if the enumeration should be started or is not yet complete.
9989func (iter ServerDNSAliasListResultIterator) NotDone() bool {
9990	return iter.page.NotDone() && iter.i < len(iter.page.Values())
9991}
9992
9993// Response returns the raw server response from the last page request.
9994func (iter ServerDNSAliasListResultIterator) Response() ServerDNSAliasListResult {
9995	return iter.page.Response()
9996}
9997
9998// Value returns the current value or a zero-initialized value if the
9999// iterator has advanced beyond the end of the collection.
10000func (iter ServerDNSAliasListResultIterator) Value() ServerDNSAlias {
10001	if !iter.page.NotDone() {
10002		return ServerDNSAlias{}
10003	}
10004	return iter.page.Values()[iter.i]
10005}
10006
10007// IsEmpty returns true if the ListResult contains no values.
10008func (sdalr ServerDNSAliasListResult) IsEmpty() bool {
10009	return sdalr.Value == nil || len(*sdalr.Value) == 0
10010}
10011
10012// serverDNSAliasListResultPreparer prepares a request to retrieve the next set of results.
10013// It returns nil if no more results exist.
10014func (sdalr ServerDNSAliasListResult) serverDNSAliasListResultPreparer() (*http.Request, error) {
10015	if sdalr.NextLink == nil || len(to.String(sdalr.NextLink)) < 1 {
10016		return nil, nil
10017	}
10018	return autorest.Prepare(&http.Request{},
10019		autorest.AsJSON(),
10020		autorest.AsGet(),
10021		autorest.WithBaseURL(to.String(sdalr.NextLink)))
10022}
10023
10024// ServerDNSAliasListResultPage contains a page of ServerDNSAlias values.
10025type ServerDNSAliasListResultPage struct {
10026	fn    func(ServerDNSAliasListResult) (ServerDNSAliasListResult, error)
10027	sdalr ServerDNSAliasListResult
10028}
10029
10030// Next advances to the next page of values.  If there was an error making
10031// the request the page does not advance and the error is returned.
10032func (page *ServerDNSAliasListResultPage) Next() error {
10033	next, err := page.fn(page.sdalr)
10034	if err != nil {
10035		return err
10036	}
10037	page.sdalr = next
10038	return nil
10039}
10040
10041// NotDone returns true if the page enumeration should be started or is not yet complete.
10042func (page ServerDNSAliasListResultPage) NotDone() bool {
10043	return !page.sdalr.IsEmpty()
10044}
10045
10046// Response returns the raw server response from the last page request.
10047func (page ServerDNSAliasListResultPage) Response() ServerDNSAliasListResult {
10048	return page.sdalr
10049}
10050
10051// Values returns the slice of values for the current page or nil if there are no values.
10052func (page ServerDNSAliasListResultPage) Values() []ServerDNSAlias {
10053	if page.sdalr.IsEmpty() {
10054		return nil
10055	}
10056	return *page.sdalr.Value
10057}
10058
10059// ServerDNSAliasProperties properties of a server DNS alias.
10060type ServerDNSAliasProperties struct {
10061	// AzureDNSRecord - The fully qualified DNS record for alias
10062	AzureDNSRecord *string `json:"azureDnsRecord,omitempty"`
10063}
10064
10065// ServerKey a server key.
10066type ServerKey struct {
10067	autorest.Response `json:"-"`
10068	// Kind - Kind of encryption protector. This is metadata used for the Azure portal experience.
10069	Kind *string `json:"kind,omitempty"`
10070	// Location - Resource location.
10071	Location *string `json:"location,omitempty"`
10072	// ServerKeyProperties - Resource properties.
10073	*ServerKeyProperties `json:"properties,omitempty"`
10074	// ID - Resource ID.
10075	ID *string `json:"id,omitempty"`
10076	// Name - Resource name.
10077	Name *string `json:"name,omitempty"`
10078	// Type - Resource type.
10079	Type *string `json:"type,omitempty"`
10080}
10081
10082// MarshalJSON is the custom marshaler for ServerKey.
10083func (sk ServerKey) MarshalJSON() ([]byte, error) {
10084	objectMap := make(map[string]interface{})
10085	if sk.Kind != nil {
10086		objectMap["kind"] = sk.Kind
10087	}
10088	if sk.Location != nil {
10089		objectMap["location"] = sk.Location
10090	}
10091	if sk.ServerKeyProperties != nil {
10092		objectMap["properties"] = sk.ServerKeyProperties
10093	}
10094	if sk.ID != nil {
10095		objectMap["id"] = sk.ID
10096	}
10097	if sk.Name != nil {
10098		objectMap["name"] = sk.Name
10099	}
10100	if sk.Type != nil {
10101		objectMap["type"] = sk.Type
10102	}
10103	return json.Marshal(objectMap)
10104}
10105
10106// UnmarshalJSON is the custom unmarshaler for ServerKey struct.
10107func (sk *ServerKey) UnmarshalJSON(body []byte) error {
10108	var m map[string]*json.RawMessage
10109	err := json.Unmarshal(body, &m)
10110	if err != nil {
10111		return err
10112	}
10113	for k, v := range m {
10114		switch k {
10115		case "kind":
10116			if v != nil {
10117				var kind string
10118				err = json.Unmarshal(*v, &kind)
10119				if err != nil {
10120					return err
10121				}
10122				sk.Kind = &kind
10123			}
10124		case "location":
10125			if v != nil {
10126				var location string
10127				err = json.Unmarshal(*v, &location)
10128				if err != nil {
10129					return err
10130				}
10131				sk.Location = &location
10132			}
10133		case "properties":
10134			if v != nil {
10135				var serverKeyProperties ServerKeyProperties
10136				err = json.Unmarshal(*v, &serverKeyProperties)
10137				if err != nil {
10138					return err
10139				}
10140				sk.ServerKeyProperties = &serverKeyProperties
10141			}
10142		case "id":
10143			if v != nil {
10144				var ID string
10145				err = json.Unmarshal(*v, &ID)
10146				if err != nil {
10147					return err
10148				}
10149				sk.ID = &ID
10150			}
10151		case "name":
10152			if v != nil {
10153				var name string
10154				err = json.Unmarshal(*v, &name)
10155				if err != nil {
10156					return err
10157				}
10158				sk.Name = &name
10159			}
10160		case "type":
10161			if v != nil {
10162				var typeVar string
10163				err = json.Unmarshal(*v, &typeVar)
10164				if err != nil {
10165					return err
10166				}
10167				sk.Type = &typeVar
10168			}
10169		}
10170	}
10171
10172	return nil
10173}
10174
10175// ServerKeyListResult a list of server keys.
10176type ServerKeyListResult struct {
10177	autorest.Response `json:"-"`
10178	// Value - Array of results.
10179	Value *[]ServerKey `json:"value,omitempty"`
10180	// NextLink - Link to retrieve next page of results.
10181	NextLink *string `json:"nextLink,omitempty"`
10182}
10183
10184// ServerKeyListResultIterator provides access to a complete listing of ServerKey values.
10185type ServerKeyListResultIterator struct {
10186	i    int
10187	page ServerKeyListResultPage
10188}
10189
10190// Next advances to the next value.  If there was an error making
10191// the request the iterator does not advance and the error is returned.
10192func (iter *ServerKeyListResultIterator) Next() error {
10193	iter.i++
10194	if iter.i < len(iter.page.Values()) {
10195		return nil
10196	}
10197	err := iter.page.Next()
10198	if err != nil {
10199		iter.i--
10200		return err
10201	}
10202	iter.i = 0
10203	return nil
10204}
10205
10206// NotDone returns true if the enumeration should be started or is not yet complete.
10207func (iter ServerKeyListResultIterator) NotDone() bool {
10208	return iter.page.NotDone() && iter.i < len(iter.page.Values())
10209}
10210
10211// Response returns the raw server response from the last page request.
10212func (iter ServerKeyListResultIterator) Response() ServerKeyListResult {
10213	return iter.page.Response()
10214}
10215
10216// Value returns the current value or a zero-initialized value if the
10217// iterator has advanced beyond the end of the collection.
10218func (iter ServerKeyListResultIterator) Value() ServerKey {
10219	if !iter.page.NotDone() {
10220		return ServerKey{}
10221	}
10222	return iter.page.Values()[iter.i]
10223}
10224
10225// IsEmpty returns true if the ListResult contains no values.
10226func (sklr ServerKeyListResult) IsEmpty() bool {
10227	return sklr.Value == nil || len(*sklr.Value) == 0
10228}
10229
10230// serverKeyListResultPreparer prepares a request to retrieve the next set of results.
10231// It returns nil if no more results exist.
10232func (sklr ServerKeyListResult) serverKeyListResultPreparer() (*http.Request, error) {
10233	if sklr.NextLink == nil || len(to.String(sklr.NextLink)) < 1 {
10234		return nil, nil
10235	}
10236	return autorest.Prepare(&http.Request{},
10237		autorest.AsJSON(),
10238		autorest.AsGet(),
10239		autorest.WithBaseURL(to.String(sklr.NextLink)))
10240}
10241
10242// ServerKeyListResultPage contains a page of ServerKey values.
10243type ServerKeyListResultPage struct {
10244	fn   func(ServerKeyListResult) (ServerKeyListResult, error)
10245	sklr ServerKeyListResult
10246}
10247
10248// Next advances to the next page of values.  If there was an error making
10249// the request the page does not advance and the error is returned.
10250func (page *ServerKeyListResultPage) Next() error {
10251	next, err := page.fn(page.sklr)
10252	if err != nil {
10253		return err
10254	}
10255	page.sklr = next
10256	return nil
10257}
10258
10259// NotDone returns true if the page enumeration should be started or is not yet complete.
10260func (page ServerKeyListResultPage) NotDone() bool {
10261	return !page.sklr.IsEmpty()
10262}
10263
10264// Response returns the raw server response from the last page request.
10265func (page ServerKeyListResultPage) Response() ServerKeyListResult {
10266	return page.sklr
10267}
10268
10269// Values returns the slice of values for the current page or nil if there are no values.
10270func (page ServerKeyListResultPage) Values() []ServerKey {
10271	if page.sklr.IsEmpty() {
10272		return nil
10273	}
10274	return *page.sklr.Value
10275}
10276
10277// ServerKeyProperties properties for a server key execution.
10278type ServerKeyProperties struct {
10279	// Subregion - Subregion of the server key.
10280	Subregion *string `json:"subregion,omitempty"`
10281	// ServerKeyType - The server key type like 'ServiceManaged', 'AzureKeyVault'. Possible values include: 'ServiceManaged', 'AzureKeyVault'
10282	ServerKeyType ServerKeyType `json:"serverKeyType,omitempty"`
10283	// URI - The URI of the server key.
10284	URI *string `json:"uri,omitempty"`
10285	// Thumbprint - Thumbprint of the server key.
10286	Thumbprint *string `json:"thumbprint,omitempty"`
10287	// CreationDate - The server key creation date.
10288	CreationDate *date.Time `json:"creationDate,omitempty"`
10289}
10290
10291// ServerKeysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
10292// operation.
10293type ServerKeysCreateOrUpdateFuture struct {
10294	azure.Future
10295}
10296
10297// Result returns the result of the asynchronous operation.
10298// If the operation has not completed it will return an error.
10299func (future *ServerKeysCreateOrUpdateFuture) Result(client ServerKeysClient) (sk ServerKey, err error) {
10300	var done bool
10301	done, err = future.Done(client)
10302	if err != nil {
10303		err = autorest.NewErrorWithError(err, "sql.ServerKeysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
10304		return
10305	}
10306	if !done {
10307		err = azure.NewAsyncOpIncompleteError("sql.ServerKeysCreateOrUpdateFuture")
10308		return
10309	}
10310	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10311	if sk.Response.Response, err = future.GetResult(sender); err == nil && sk.Response.Response.StatusCode != http.StatusNoContent {
10312		sk, err = client.CreateOrUpdateResponder(sk.Response.Response)
10313		if err != nil {
10314			err = autorest.NewErrorWithError(err, "sql.ServerKeysCreateOrUpdateFuture", "Result", sk.Response.Response, "Failure responding to request")
10315		}
10316	}
10317	return
10318}
10319
10320// ServerKeysDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation.
10321type ServerKeysDeleteFuture struct {
10322	azure.Future
10323}
10324
10325// Result returns the result of the asynchronous operation.
10326// If the operation has not completed it will return an error.
10327func (future *ServerKeysDeleteFuture) Result(client ServerKeysClient) (ar autorest.Response, err error) {
10328	var done bool
10329	done, err = future.Done(client)
10330	if err != nil {
10331		err = autorest.NewErrorWithError(err, "sql.ServerKeysDeleteFuture", "Result", future.Response(), "Polling failure")
10332		return
10333	}
10334	if !done {
10335		err = azure.NewAsyncOpIncompleteError("sql.ServerKeysDeleteFuture")
10336		return
10337	}
10338	ar.Response = future.Response()
10339	return
10340}
10341
10342// ServerListResult a list of servers.
10343type ServerListResult struct {
10344	autorest.Response `json:"-"`
10345	// Value - Array of results.
10346	Value *[]Server `json:"value,omitempty"`
10347	// NextLink - Link to retrieve next page of results.
10348	NextLink *string `json:"nextLink,omitempty"`
10349}
10350
10351// ServerListResultIterator provides access to a complete listing of Server values.
10352type ServerListResultIterator struct {
10353	i    int
10354	page ServerListResultPage
10355}
10356
10357// Next advances to the next value.  If there was an error making
10358// the request the iterator does not advance and the error is returned.
10359func (iter *ServerListResultIterator) Next() error {
10360	iter.i++
10361	if iter.i < len(iter.page.Values()) {
10362		return nil
10363	}
10364	err := iter.page.Next()
10365	if err != nil {
10366		iter.i--
10367		return err
10368	}
10369	iter.i = 0
10370	return nil
10371}
10372
10373// NotDone returns true if the enumeration should be started or is not yet complete.
10374func (iter ServerListResultIterator) NotDone() bool {
10375	return iter.page.NotDone() && iter.i < len(iter.page.Values())
10376}
10377
10378// Response returns the raw server response from the last page request.
10379func (iter ServerListResultIterator) Response() ServerListResult {
10380	return iter.page.Response()
10381}
10382
10383// Value returns the current value or a zero-initialized value if the
10384// iterator has advanced beyond the end of the collection.
10385func (iter ServerListResultIterator) Value() Server {
10386	if !iter.page.NotDone() {
10387		return Server{}
10388	}
10389	return iter.page.Values()[iter.i]
10390}
10391
10392// IsEmpty returns true if the ListResult contains no values.
10393func (slr ServerListResult) IsEmpty() bool {
10394	return slr.Value == nil || len(*slr.Value) == 0
10395}
10396
10397// serverListResultPreparer prepares a request to retrieve the next set of results.
10398// It returns nil if no more results exist.
10399func (slr ServerListResult) serverListResultPreparer() (*http.Request, error) {
10400	if slr.NextLink == nil || len(to.String(slr.NextLink)) < 1 {
10401		return nil, nil
10402	}
10403	return autorest.Prepare(&http.Request{},
10404		autorest.AsJSON(),
10405		autorest.AsGet(),
10406		autorest.WithBaseURL(to.String(slr.NextLink)))
10407}
10408
10409// ServerListResultPage contains a page of Server values.
10410type ServerListResultPage struct {
10411	fn  func(ServerListResult) (ServerListResult, error)
10412	slr ServerListResult
10413}
10414
10415// Next advances to the next page of values.  If there was an error making
10416// the request the page does not advance and the error is returned.
10417func (page *ServerListResultPage) Next() error {
10418	next, err := page.fn(page.slr)
10419	if err != nil {
10420		return err
10421	}
10422	page.slr = next
10423	return nil
10424}
10425
10426// NotDone returns true if the page enumeration should be started or is not yet complete.
10427func (page ServerListResultPage) NotDone() bool {
10428	return !page.slr.IsEmpty()
10429}
10430
10431// Response returns the raw server response from the last page request.
10432func (page ServerListResultPage) Response() ServerListResult {
10433	return page.slr
10434}
10435
10436// Values returns the slice of values for the current page or nil if there are no values.
10437func (page ServerListResultPage) Values() []Server {
10438	if page.slr.IsEmpty() {
10439		return nil
10440	}
10441	return *page.slr.Value
10442}
10443
10444// ServerProperties the properties of a server.
10445type ServerProperties struct {
10446	// AdministratorLogin - Administrator username for the server. Once created it cannot be changed.
10447	AdministratorLogin *string `json:"administratorLogin,omitempty"`
10448	// AdministratorLoginPassword - The administrator login password (required for server creation).
10449	AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"`
10450	// Version - The version of the server.
10451	Version *string `json:"version,omitempty"`
10452	// State - The state of the server.
10453	State *string `json:"state,omitempty"`
10454	// FullyQualifiedDomainName - The fully qualified domain name of the server.
10455	FullyQualifiedDomainName *string `json:"fullyQualifiedDomainName,omitempty"`
10456}
10457
10458// ServersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
10459// operation.
10460type ServersCreateOrUpdateFuture struct {
10461	azure.Future
10462}
10463
10464// Result returns the result of the asynchronous operation.
10465// If the operation has not completed it will return an error.
10466func (future *ServersCreateOrUpdateFuture) Result(client ServersClient) (s Server, err error) {
10467	var done bool
10468	done, err = future.Done(client)
10469	if err != nil {
10470		err = autorest.NewErrorWithError(err, "sql.ServersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
10471		return
10472	}
10473	if !done {
10474		err = azure.NewAsyncOpIncompleteError("sql.ServersCreateOrUpdateFuture")
10475		return
10476	}
10477	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10478	if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent {
10479		s, err = client.CreateOrUpdateResponder(s.Response.Response)
10480		if err != nil {
10481			err = autorest.NewErrorWithError(err, "sql.ServersCreateOrUpdateFuture", "Result", s.Response.Response, "Failure responding to request")
10482		}
10483	}
10484	return
10485}
10486
10487// ServersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation.
10488type ServersDeleteFuture struct {
10489	azure.Future
10490}
10491
10492// Result returns the result of the asynchronous operation.
10493// If the operation has not completed it will return an error.
10494func (future *ServersDeleteFuture) Result(client ServersClient) (ar autorest.Response, err error) {
10495	var done bool
10496	done, err = future.Done(client)
10497	if err != nil {
10498		err = autorest.NewErrorWithError(err, "sql.ServersDeleteFuture", "Result", future.Response(), "Polling failure")
10499		return
10500	}
10501	if !done {
10502		err = azure.NewAsyncOpIncompleteError("sql.ServersDeleteFuture")
10503		return
10504	}
10505	ar.Response = future.Response()
10506	return
10507}
10508
10509// ServerSecurityAlertPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
10510// long-running operation.
10511type ServerSecurityAlertPoliciesCreateOrUpdateFuture struct {
10512	azure.Future
10513}
10514
10515// Result returns the result of the asynchronous operation.
10516// If the operation has not completed it will return an error.
10517func (future *ServerSecurityAlertPoliciesCreateOrUpdateFuture) Result(client ServerSecurityAlertPoliciesClient) (ssap ServerSecurityAlertPolicy, err error) {
10518	var done bool
10519	done, err = future.Done(client)
10520	if err != nil {
10521		err = autorest.NewErrorWithError(err, "sql.ServerSecurityAlertPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
10522		return
10523	}
10524	if !done {
10525		err = azure.NewAsyncOpIncompleteError("sql.ServerSecurityAlertPoliciesCreateOrUpdateFuture")
10526		return
10527	}
10528	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10529	if ssap.Response.Response, err = future.GetResult(sender); err == nil && ssap.Response.Response.StatusCode != http.StatusNoContent {
10530		ssap, err = client.CreateOrUpdateResponder(ssap.Response.Response)
10531		if err != nil {
10532			err = autorest.NewErrorWithError(err, "sql.ServerSecurityAlertPoliciesCreateOrUpdateFuture", "Result", ssap.Response.Response, "Failure responding to request")
10533		}
10534	}
10535	return
10536}
10537
10538// ServerSecurityAlertPolicy a server security alert policy.
10539type ServerSecurityAlertPolicy struct {
10540	autorest.Response `json:"-"`
10541	// SecurityAlertPolicyProperties - Resource properties.
10542	*SecurityAlertPolicyProperties `json:"properties,omitempty"`
10543	// ID - Resource ID.
10544	ID *string `json:"id,omitempty"`
10545	// Name - Resource name.
10546	Name *string `json:"name,omitempty"`
10547	// Type - Resource type.
10548	Type *string `json:"type,omitempty"`
10549}
10550
10551// MarshalJSON is the custom marshaler for ServerSecurityAlertPolicy.
10552func (ssap ServerSecurityAlertPolicy) MarshalJSON() ([]byte, error) {
10553	objectMap := make(map[string]interface{})
10554	if ssap.SecurityAlertPolicyProperties != nil {
10555		objectMap["properties"] = ssap.SecurityAlertPolicyProperties
10556	}
10557	if ssap.ID != nil {
10558		objectMap["id"] = ssap.ID
10559	}
10560	if ssap.Name != nil {
10561		objectMap["name"] = ssap.Name
10562	}
10563	if ssap.Type != nil {
10564		objectMap["type"] = ssap.Type
10565	}
10566	return json.Marshal(objectMap)
10567}
10568
10569// UnmarshalJSON is the custom unmarshaler for ServerSecurityAlertPolicy struct.
10570func (ssap *ServerSecurityAlertPolicy) UnmarshalJSON(body []byte) error {
10571	var m map[string]*json.RawMessage
10572	err := json.Unmarshal(body, &m)
10573	if err != nil {
10574		return err
10575	}
10576	for k, v := range m {
10577		switch k {
10578		case "properties":
10579			if v != nil {
10580				var securityAlertPolicyProperties SecurityAlertPolicyProperties
10581				err = json.Unmarshal(*v, &securityAlertPolicyProperties)
10582				if err != nil {
10583					return err
10584				}
10585				ssap.SecurityAlertPolicyProperties = &securityAlertPolicyProperties
10586			}
10587		case "id":
10588			if v != nil {
10589				var ID string
10590				err = json.Unmarshal(*v, &ID)
10591				if err != nil {
10592					return err
10593				}
10594				ssap.ID = &ID
10595			}
10596		case "name":
10597			if v != nil {
10598				var name string
10599				err = json.Unmarshal(*v, &name)
10600				if err != nil {
10601					return err
10602				}
10603				ssap.Name = &name
10604			}
10605		case "type":
10606			if v != nil {
10607				var typeVar string
10608				err = json.Unmarshal(*v, &typeVar)
10609				if err != nil {
10610					return err
10611				}
10612				ssap.Type = &typeVar
10613			}
10614		}
10615	}
10616
10617	return nil
10618}
10619
10620// ServersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
10621type ServersUpdateFuture struct {
10622	azure.Future
10623}
10624
10625// Result returns the result of the asynchronous operation.
10626// If the operation has not completed it will return an error.
10627func (future *ServersUpdateFuture) Result(client ServersClient) (s Server, err error) {
10628	var done bool
10629	done, err = future.Done(client)
10630	if err != nil {
10631		err = autorest.NewErrorWithError(err, "sql.ServersUpdateFuture", "Result", future.Response(), "Polling failure")
10632		return
10633	}
10634	if !done {
10635		err = azure.NewAsyncOpIncompleteError("sql.ServersUpdateFuture")
10636		return
10637	}
10638	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10639	if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent {
10640		s, err = client.UpdateResponder(s.Response.Response)
10641		if err != nil {
10642			err = autorest.NewErrorWithError(err, "sql.ServersUpdateFuture", "Result", s.Response.Response, "Failure responding to request")
10643		}
10644	}
10645	return
10646}
10647
10648// ServerUpdate an update request for an Azure SQL Database server.
10649type ServerUpdate struct {
10650	// ServerProperties - Resource properties.
10651	*ServerProperties `json:"properties,omitempty"`
10652	// Tags - Resource tags.
10653	Tags map[string]*string `json:"tags"`
10654}
10655
10656// MarshalJSON is the custom marshaler for ServerUpdate.
10657func (su ServerUpdate) MarshalJSON() ([]byte, error) {
10658	objectMap := make(map[string]interface{})
10659	if su.ServerProperties != nil {
10660		objectMap["properties"] = su.ServerProperties
10661	}
10662	if su.Tags != nil {
10663		objectMap["tags"] = su.Tags
10664	}
10665	return json.Marshal(objectMap)
10666}
10667
10668// UnmarshalJSON is the custom unmarshaler for ServerUpdate struct.
10669func (su *ServerUpdate) UnmarshalJSON(body []byte) error {
10670	var m map[string]*json.RawMessage
10671	err := json.Unmarshal(body, &m)
10672	if err != nil {
10673		return err
10674	}
10675	for k, v := range m {
10676		switch k {
10677		case "properties":
10678			if v != nil {
10679				var serverProperties ServerProperties
10680				err = json.Unmarshal(*v, &serverProperties)
10681				if err != nil {
10682					return err
10683				}
10684				su.ServerProperties = &serverProperties
10685			}
10686		case "tags":
10687			if v != nil {
10688				var tags map[string]*string
10689				err = json.Unmarshal(*v, &tags)
10690				if err != nil {
10691					return err
10692				}
10693				su.Tags = tags
10694			}
10695		}
10696	}
10697
10698	return nil
10699}
10700
10701// ServerUsage represents server metrics.
10702type ServerUsage struct {
10703	// Name - Name of the server usage metric.
10704	Name *string `json:"name,omitempty"`
10705	// ResourceName - The name of the resource.
10706	ResourceName *string `json:"resourceName,omitempty"`
10707	// DisplayName - The metric display name.
10708	DisplayName *string `json:"displayName,omitempty"`
10709	// CurrentValue - The current value of the metric.
10710	CurrentValue *float64 `json:"currentValue,omitempty"`
10711	// Limit - The current limit of the metric.
10712	Limit *float64 `json:"limit,omitempty"`
10713	// Unit - The units of the metric.
10714	Unit *string `json:"unit,omitempty"`
10715	// NextResetTime - The next reset time for the metric (ISO8601 format).
10716	NextResetTime *date.Time `json:"nextResetTime,omitempty"`
10717}
10718
10719// ServerUsageListResult represents the response to a list server metrics request.
10720type ServerUsageListResult struct {
10721	autorest.Response `json:"-"`
10722	// Value - The list of server metrics for the server.
10723	Value *[]ServerUsage `json:"value,omitempty"`
10724}
10725
10726// ServerVersionCapability the server capabilities.
10727type ServerVersionCapability struct {
10728	// Name - The server version name.
10729	Name *string `json:"name,omitempty"`
10730	// Status - The status of the server version. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
10731	Status CapabilityStatus `json:"status,omitempty"`
10732	// SupportedEditions - The list of supported database editions.
10733	SupportedEditions *[]EditionCapability `json:"supportedEditions,omitempty"`
10734	// SupportedElasticPoolEditions - The list of supported elastic pool editions.
10735	SupportedElasticPoolEditions *[]ElasticPoolEditionCapability `json:"supportedElasticPoolEditions,omitempty"`
10736}
10737
10738// ServiceObjective represents a database service objective.
10739type ServiceObjective struct {
10740	autorest.Response `json:"-"`
10741	// ServiceObjectiveProperties - Represents the properties of the resource.
10742	*ServiceObjectiveProperties `json:"properties,omitempty"`
10743	// ID - Resource ID.
10744	ID *string `json:"id,omitempty"`
10745	// Name - Resource name.
10746	Name *string `json:"name,omitempty"`
10747	// Type - Resource type.
10748	Type *string `json:"type,omitempty"`
10749}
10750
10751// MarshalJSON is the custom marshaler for ServiceObjective.
10752func (so ServiceObjective) MarshalJSON() ([]byte, error) {
10753	objectMap := make(map[string]interface{})
10754	if so.ServiceObjectiveProperties != nil {
10755		objectMap["properties"] = so.ServiceObjectiveProperties
10756	}
10757	if so.ID != nil {
10758		objectMap["id"] = so.ID
10759	}
10760	if so.Name != nil {
10761		objectMap["name"] = so.Name
10762	}
10763	if so.Type != nil {
10764		objectMap["type"] = so.Type
10765	}
10766	return json.Marshal(objectMap)
10767}
10768
10769// UnmarshalJSON is the custom unmarshaler for ServiceObjective struct.
10770func (so *ServiceObjective) UnmarshalJSON(body []byte) error {
10771	var m map[string]*json.RawMessage
10772	err := json.Unmarshal(body, &m)
10773	if err != nil {
10774		return err
10775	}
10776	for k, v := range m {
10777		switch k {
10778		case "properties":
10779			if v != nil {
10780				var serviceObjectiveProperties ServiceObjectiveProperties
10781				err = json.Unmarshal(*v, &serviceObjectiveProperties)
10782				if err != nil {
10783					return err
10784				}
10785				so.ServiceObjectiveProperties = &serviceObjectiveProperties
10786			}
10787		case "id":
10788			if v != nil {
10789				var ID string
10790				err = json.Unmarshal(*v, &ID)
10791				if err != nil {
10792					return err
10793				}
10794				so.ID = &ID
10795			}
10796		case "name":
10797			if v != nil {
10798				var name string
10799				err = json.Unmarshal(*v, &name)
10800				if err != nil {
10801					return err
10802				}
10803				so.Name = &name
10804			}
10805		case "type":
10806			if v != nil {
10807				var typeVar string
10808				err = json.Unmarshal(*v, &typeVar)
10809				if err != nil {
10810					return err
10811				}
10812				so.Type = &typeVar
10813			}
10814		}
10815	}
10816
10817	return nil
10818}
10819
10820// ServiceObjectiveCapability the service objectives capability.
10821type ServiceObjectiveCapability struct {
10822	// Name - The service objective name.
10823	Name *string `json:"name,omitempty"`
10824	// Status - The status of the service objective. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
10825	Status CapabilityStatus `json:"status,omitempty"`
10826	// PerformanceLevel - The performance level of the service objective capability.
10827	*PerformanceLevel `json:"performanceLevel,omitempty"`
10828	// ID - The unique ID of the service objective.
10829	ID *uuid.UUID `json:"id,omitempty"`
10830	// SupportedMaxSizes - The list of supported maximum database sizes for this service objective.
10831	SupportedMaxSizes *[]MaxSizeCapability `json:"supportedMaxSizes,omitempty"`
10832	// IncludedMaxSize - The included (free) max size for this service level objective.
10833	IncludedMaxSize *MaxSizeCapability `json:"includedMaxSize,omitempty"`
10834}
10835
10836// MarshalJSON is the custom marshaler for ServiceObjectiveCapability.
10837func (soc ServiceObjectiveCapability) MarshalJSON() ([]byte, error) {
10838	objectMap := make(map[string]interface{})
10839	if soc.Name != nil {
10840		objectMap["name"] = soc.Name
10841	}
10842	if soc.Status != "" {
10843		objectMap["status"] = soc.Status
10844	}
10845	if soc.PerformanceLevel != nil {
10846		objectMap["performanceLevel"] = soc.PerformanceLevel
10847	}
10848	if soc.ID != nil {
10849		objectMap["id"] = soc.ID
10850	}
10851	if soc.SupportedMaxSizes != nil {
10852		objectMap["supportedMaxSizes"] = soc.SupportedMaxSizes
10853	}
10854	if soc.IncludedMaxSize != nil {
10855		objectMap["includedMaxSize"] = soc.IncludedMaxSize
10856	}
10857	return json.Marshal(objectMap)
10858}
10859
10860// UnmarshalJSON is the custom unmarshaler for ServiceObjectiveCapability struct.
10861func (soc *ServiceObjectiveCapability) UnmarshalJSON(body []byte) error {
10862	var m map[string]*json.RawMessage
10863	err := json.Unmarshal(body, &m)
10864	if err != nil {
10865		return err
10866	}
10867	for k, v := range m {
10868		switch k {
10869		case "name":
10870			if v != nil {
10871				var name string
10872				err = json.Unmarshal(*v, &name)
10873				if err != nil {
10874					return err
10875				}
10876				soc.Name = &name
10877			}
10878		case "status":
10879			if v != nil {
10880				var status CapabilityStatus
10881				err = json.Unmarshal(*v, &status)
10882				if err != nil {
10883					return err
10884				}
10885				soc.Status = status
10886			}
10887		case "performanceLevel":
10888			if v != nil {
10889				var performanceLevel PerformanceLevel
10890				err = json.Unmarshal(*v, &performanceLevel)
10891				if err != nil {
10892					return err
10893				}
10894				soc.PerformanceLevel = &performanceLevel
10895			}
10896		case "id":
10897			if v != nil {
10898				var ID uuid.UUID
10899				err = json.Unmarshal(*v, &ID)
10900				if err != nil {
10901					return err
10902				}
10903				soc.ID = &ID
10904			}
10905		case "supportedMaxSizes":
10906			if v != nil {
10907				var supportedMaxSizes []MaxSizeCapability
10908				err = json.Unmarshal(*v, &supportedMaxSizes)
10909				if err != nil {
10910					return err
10911				}
10912				soc.SupportedMaxSizes = &supportedMaxSizes
10913			}
10914		case "includedMaxSize":
10915			if v != nil {
10916				var includedMaxSize MaxSizeCapability
10917				err = json.Unmarshal(*v, &includedMaxSize)
10918				if err != nil {
10919					return err
10920				}
10921				soc.IncludedMaxSize = &includedMaxSize
10922			}
10923		}
10924	}
10925
10926	return nil
10927}
10928
10929// ServiceObjectiveListResult represents the response to a get database service objectives request.
10930type ServiceObjectiveListResult struct {
10931	autorest.Response `json:"-"`
10932	// Value - The list of database service objectives.
10933	Value *[]ServiceObjective `json:"value,omitempty"`
10934}
10935
10936// ServiceObjectiveProperties represents the properties of a database service objective.
10937type ServiceObjectiveProperties struct {
10938	// ServiceObjectiveName - The name for the service objective.
10939	ServiceObjectiveName *string `json:"serviceObjectiveName,omitempty"`
10940	// IsDefault - Gets whether the service level objective is the default service objective.
10941	IsDefault *bool `json:"isDefault,omitempty"`
10942	// IsSystem - Gets whether the service level objective is a system service objective.
10943	IsSystem *bool `json:"isSystem,omitempty"`
10944	// Description - The description for the service level objective.
10945	Description *string `json:"description,omitempty"`
10946	// Enabled - Gets whether the service level objective is enabled.
10947	Enabled *bool `json:"enabled,omitempty"`
10948}
10949
10950// ServiceTierAdvisor represents a Service Tier Advisor.
10951type ServiceTierAdvisor struct {
10952	autorest.Response `json:"-"`
10953	// ServiceTierAdvisorProperties - The properites representing the resource.
10954	*ServiceTierAdvisorProperties `json:"properties,omitempty"`
10955	// ID - Resource ID.
10956	ID *string `json:"id,omitempty"`
10957	// Name - Resource name.
10958	Name *string `json:"name,omitempty"`
10959	// Type - Resource type.
10960	Type *string `json:"type,omitempty"`
10961}
10962
10963// MarshalJSON is the custom marshaler for ServiceTierAdvisor.
10964func (sta ServiceTierAdvisor) MarshalJSON() ([]byte, error) {
10965	objectMap := make(map[string]interface{})
10966	if sta.ServiceTierAdvisorProperties != nil {
10967		objectMap["properties"] = sta.ServiceTierAdvisorProperties
10968	}
10969	if sta.ID != nil {
10970		objectMap["id"] = sta.ID
10971	}
10972	if sta.Name != nil {
10973		objectMap["name"] = sta.Name
10974	}
10975	if sta.Type != nil {
10976		objectMap["type"] = sta.Type
10977	}
10978	return json.Marshal(objectMap)
10979}
10980
10981// UnmarshalJSON is the custom unmarshaler for ServiceTierAdvisor struct.
10982func (sta *ServiceTierAdvisor) UnmarshalJSON(body []byte) error {
10983	var m map[string]*json.RawMessage
10984	err := json.Unmarshal(body, &m)
10985	if err != nil {
10986		return err
10987	}
10988	for k, v := range m {
10989		switch k {
10990		case "properties":
10991			if v != nil {
10992				var serviceTierAdvisorProperties ServiceTierAdvisorProperties
10993				err = json.Unmarshal(*v, &serviceTierAdvisorProperties)
10994				if err != nil {
10995					return err
10996				}
10997				sta.ServiceTierAdvisorProperties = &serviceTierAdvisorProperties
10998			}
10999		case "id":
11000			if v != nil {
11001				var ID string
11002				err = json.Unmarshal(*v, &ID)
11003				if err != nil {
11004					return err
11005				}
11006				sta.ID = &ID
11007			}
11008		case "name":
11009			if v != nil {
11010				var name string
11011				err = json.Unmarshal(*v, &name)
11012				if err != nil {
11013					return err
11014				}
11015				sta.Name = &name
11016			}
11017		case "type":
11018			if v != nil {
11019				var typeVar string
11020				err = json.Unmarshal(*v, &typeVar)
11021				if err != nil {
11022					return err
11023				}
11024				sta.Type = &typeVar
11025			}
11026		}
11027	}
11028
11029	return nil
11030}
11031
11032// ServiceTierAdvisorListResult represents the response to a list service tier advisor request.
11033type ServiceTierAdvisorListResult struct {
11034	autorest.Response `json:"-"`
11035	// Value - The list of service tier advisors for specified database.
11036	Value *[]ServiceTierAdvisor `json:"value,omitempty"`
11037}
11038
11039// ServiceTierAdvisorProperties represents the properties of a Service Tier Advisor.
11040type ServiceTierAdvisorProperties struct {
11041	// ObservationPeriodStart - The observation period start (ISO8601 format).
11042	ObservationPeriodStart *date.Time `json:"observationPeriodStart,omitempty"`
11043	// ObservationPeriodEnd - The observation period start (ISO8601 format).
11044	ObservationPeriodEnd *date.Time `json:"observationPeriodEnd,omitempty"`
11045	// ActiveTimeRatio - The activeTimeRatio for service tier advisor.
11046	ActiveTimeRatio *float64 `json:"activeTimeRatio,omitempty"`
11047	// MinDtu - Gets or sets minDtu for service tier advisor.
11048	MinDtu *float64 `json:"minDtu,omitempty"`
11049	// AvgDtu - Gets or sets avgDtu for service tier advisor.
11050	AvgDtu *float64 `json:"avgDtu,omitempty"`
11051	// MaxDtu - Gets or sets maxDtu for service tier advisor.
11052	MaxDtu *float64 `json:"maxDtu,omitempty"`
11053	// MaxSizeInGB - Gets or sets maxSizeInGB for service tier advisor.
11054	MaxSizeInGB *float64 `json:"maxSizeInGB,omitempty"`
11055	// ServiceLevelObjectiveUsageMetrics - Gets or sets serviceLevelObjectiveUsageMetrics for the service tier advisor.
11056	ServiceLevelObjectiveUsageMetrics *[]SloUsageMetric `json:"serviceLevelObjectiveUsageMetrics,omitempty"`
11057	// CurrentServiceLevelObjective - Gets or sets currentServiceLevelObjective for service tier advisor.
11058	CurrentServiceLevelObjective *string `json:"currentServiceLevelObjective,omitempty"`
11059	// CurrentServiceLevelObjectiveID - Gets or sets currentServiceLevelObjectiveId for service tier advisor.
11060	CurrentServiceLevelObjectiveID *uuid.UUID `json:"currentServiceLevelObjectiveId,omitempty"`
11061	// UsageBasedRecommendationServiceLevelObjective - Gets or sets usageBasedRecommendationServiceLevelObjective for service tier advisor.
11062	UsageBasedRecommendationServiceLevelObjective *string `json:"usageBasedRecommendationServiceLevelObjective,omitempty"`
11063	// UsageBasedRecommendationServiceLevelObjectiveID - Gets or sets usageBasedRecommendationServiceLevelObjectiveId for service tier advisor.
11064	UsageBasedRecommendationServiceLevelObjectiveID *uuid.UUID `json:"usageBasedRecommendationServiceLevelObjectiveId,omitempty"`
11065	// DatabaseSizeBasedRecommendationServiceLevelObjective - Gets or sets databaseSizeBasedRecommendationServiceLevelObjective for service tier advisor.
11066	DatabaseSizeBasedRecommendationServiceLevelObjective *string `json:"databaseSizeBasedRecommendationServiceLevelObjective,omitempty"`
11067	// DatabaseSizeBasedRecommendationServiceLevelObjectiveID - Gets or sets databaseSizeBasedRecommendationServiceLevelObjectiveId for service tier advisor.
11068	DatabaseSizeBasedRecommendationServiceLevelObjectiveID *uuid.UUID `json:"databaseSizeBasedRecommendationServiceLevelObjectiveId,omitempty"`
11069	// DisasterPlanBasedRecommendationServiceLevelObjective - Gets or sets disasterPlanBasedRecommendationServiceLevelObjective for service tier advisor.
11070	DisasterPlanBasedRecommendationServiceLevelObjective *string `json:"disasterPlanBasedRecommendationServiceLevelObjective,omitempty"`
11071	// DisasterPlanBasedRecommendationServiceLevelObjectiveID - Gets or sets disasterPlanBasedRecommendationServiceLevelObjectiveId for service tier advisor.
11072	DisasterPlanBasedRecommendationServiceLevelObjectiveID *uuid.UUID `json:"disasterPlanBasedRecommendationServiceLevelObjectiveId,omitempty"`
11073	// OverallRecommendationServiceLevelObjective - Gets or sets overallRecommendationServiceLevelObjective for service tier advisor.
11074	OverallRecommendationServiceLevelObjective *string `json:"overallRecommendationServiceLevelObjective,omitempty"`
11075	// OverallRecommendationServiceLevelObjectiveID - Gets or sets overallRecommendationServiceLevelObjectiveId for service tier advisor.
11076	OverallRecommendationServiceLevelObjectiveID *uuid.UUID `json:"overallRecommendationServiceLevelObjectiveId,omitempty"`
11077	// Confidence - Gets or sets confidence for service tier advisor.
11078	Confidence *float64 `json:"confidence,omitempty"`
11079}
11080
11081// Sku the resource model definition representing SKU
11082type Sku struct {
11083	// Name - The name of the SKU. Ex - P3. It is typically a letter+number code
11084	Name *string `json:"name,omitempty"`
11085	// Tier - This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT.
11086	Tier *string `json:"tier,omitempty"`
11087	// Size - The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code.
11088	Size *string `json:"size,omitempty"`
11089	// Family - If the service has different generations of hardware, for the same SKU, then that can be captured here.
11090	Family *string `json:"family,omitempty"`
11091	// Capacity - If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted.
11092	Capacity *int32 `json:"capacity,omitempty"`
11093}
11094
11095// SloUsageMetric a Slo Usage Metric.
11096type SloUsageMetric struct {
11097	// ServiceLevelObjective - The serviceLevelObjective for SLO usage metric. Possible values include: 'ServiceObjectiveNameSystem', 'ServiceObjectiveNameSystem0', 'ServiceObjectiveNameSystem1', 'ServiceObjectiveNameSystem2', 'ServiceObjectiveNameSystem3', 'ServiceObjectiveNameSystem4', 'ServiceObjectiveNameSystem2L', 'ServiceObjectiveNameSystem3L', 'ServiceObjectiveNameSystem4L', 'ServiceObjectiveNameFree', 'ServiceObjectiveNameBasic', 'ServiceObjectiveNameS0', 'ServiceObjectiveNameS1', 'ServiceObjectiveNameS2', 'ServiceObjectiveNameS3', 'ServiceObjectiveNameS4', 'ServiceObjectiveNameS6', 'ServiceObjectiveNameS7', 'ServiceObjectiveNameS9', 'ServiceObjectiveNameS12', 'ServiceObjectiveNameP1', 'ServiceObjectiveNameP2', 'ServiceObjectiveNameP3', 'ServiceObjectiveNameP4', 'ServiceObjectiveNameP6', 'ServiceObjectiveNameP11', 'ServiceObjectiveNameP15', 'ServiceObjectiveNamePRS1', 'ServiceObjectiveNamePRS2', 'ServiceObjectiveNamePRS4', 'ServiceObjectiveNamePRS6', 'ServiceObjectiveNameDW100', 'ServiceObjectiveNameDW200', 'ServiceObjectiveNameDW300', 'ServiceObjectiveNameDW400', 'ServiceObjectiveNameDW500', 'ServiceObjectiveNameDW600', 'ServiceObjectiveNameDW1000', 'ServiceObjectiveNameDW1200', 'ServiceObjectiveNameDW1000c', 'ServiceObjectiveNameDW1500', 'ServiceObjectiveNameDW1500c', 'ServiceObjectiveNameDW2000', 'ServiceObjectiveNameDW2000c', 'ServiceObjectiveNameDW3000', 'ServiceObjectiveNameDW2500c', 'ServiceObjectiveNameDW3000c', 'ServiceObjectiveNameDW6000', 'ServiceObjectiveNameDW5000c', 'ServiceObjectiveNameDW6000c', 'ServiceObjectiveNameDW7500c', 'ServiceObjectiveNameDW10000c', 'ServiceObjectiveNameDW15000c', 'ServiceObjectiveNameDW30000c', 'ServiceObjectiveNameDS100', 'ServiceObjectiveNameDS200', 'ServiceObjectiveNameDS300', 'ServiceObjectiveNameDS400', 'ServiceObjectiveNameDS500', 'ServiceObjectiveNameDS600', 'ServiceObjectiveNameDS1000', 'ServiceObjectiveNameDS1200', 'ServiceObjectiveNameDS1500', 'ServiceObjectiveNameDS2000', 'ServiceObjectiveNameElasticPool'
11098	ServiceLevelObjective ServiceObjectiveName `json:"serviceLevelObjective,omitempty"`
11099	// ServiceLevelObjectiveID - The serviceLevelObjectiveId for SLO usage metric.
11100	ServiceLevelObjectiveID *uuid.UUID `json:"serviceLevelObjectiveId,omitempty"`
11101	// InRangeTimeRatio - Gets or sets inRangeTimeRatio for SLO usage metric.
11102	InRangeTimeRatio *float64 `json:"inRangeTimeRatio,omitempty"`
11103}
11104
11105// SubscriptionUsage usage Metric of a Subscription in a Location.
11106type SubscriptionUsage struct {
11107	autorest.Response `json:"-"`
11108	// SubscriptionUsageProperties - Resource properties.
11109	*SubscriptionUsageProperties `json:"properties,omitempty"`
11110	// ID - Resource ID.
11111	ID *string `json:"id,omitempty"`
11112	// Name - Resource name.
11113	Name *string `json:"name,omitempty"`
11114	// Type - Resource type.
11115	Type *string `json:"type,omitempty"`
11116}
11117
11118// MarshalJSON is the custom marshaler for SubscriptionUsage.
11119func (su SubscriptionUsage) MarshalJSON() ([]byte, error) {
11120	objectMap := make(map[string]interface{})
11121	if su.SubscriptionUsageProperties != nil {
11122		objectMap["properties"] = su.SubscriptionUsageProperties
11123	}
11124	if su.ID != nil {
11125		objectMap["id"] = su.ID
11126	}
11127	if su.Name != nil {
11128		objectMap["name"] = su.Name
11129	}
11130	if su.Type != nil {
11131		objectMap["type"] = su.Type
11132	}
11133	return json.Marshal(objectMap)
11134}
11135
11136// UnmarshalJSON is the custom unmarshaler for SubscriptionUsage struct.
11137func (su *SubscriptionUsage) UnmarshalJSON(body []byte) error {
11138	var m map[string]*json.RawMessage
11139	err := json.Unmarshal(body, &m)
11140	if err != nil {
11141		return err
11142	}
11143	for k, v := range m {
11144		switch k {
11145		case "properties":
11146			if v != nil {
11147				var subscriptionUsageProperties SubscriptionUsageProperties
11148				err = json.Unmarshal(*v, &subscriptionUsageProperties)
11149				if err != nil {
11150					return err
11151				}
11152				su.SubscriptionUsageProperties = &subscriptionUsageProperties
11153			}
11154		case "id":
11155			if v != nil {
11156				var ID string
11157				err = json.Unmarshal(*v, &ID)
11158				if err != nil {
11159					return err
11160				}
11161				su.ID = &ID
11162			}
11163		case "name":
11164			if v != nil {
11165				var name string
11166				err = json.Unmarshal(*v, &name)
11167				if err != nil {
11168					return err
11169				}
11170				su.Name = &name
11171			}
11172		case "type":
11173			if v != nil {
11174				var typeVar string
11175				err = json.Unmarshal(*v, &typeVar)
11176				if err != nil {
11177					return err
11178				}
11179				su.Type = &typeVar
11180			}
11181		}
11182	}
11183
11184	return nil
11185}
11186
11187// SubscriptionUsageListResult a list of subscription usage metrics in a location.
11188type SubscriptionUsageListResult struct {
11189	autorest.Response `json:"-"`
11190	// Value - Array of results.
11191	Value *[]SubscriptionUsage `json:"value,omitempty"`
11192	// NextLink - Link to retrieve next page of results.
11193	NextLink *string `json:"nextLink,omitempty"`
11194}
11195
11196// SubscriptionUsageListResultIterator provides access to a complete listing of SubscriptionUsage values.
11197type SubscriptionUsageListResultIterator struct {
11198	i    int
11199	page SubscriptionUsageListResultPage
11200}
11201
11202// Next advances to the next value.  If there was an error making
11203// the request the iterator does not advance and the error is returned.
11204func (iter *SubscriptionUsageListResultIterator) Next() error {
11205	iter.i++
11206	if iter.i < len(iter.page.Values()) {
11207		return nil
11208	}
11209	err := iter.page.Next()
11210	if err != nil {
11211		iter.i--
11212		return err
11213	}
11214	iter.i = 0
11215	return nil
11216}
11217
11218// NotDone returns true if the enumeration should be started or is not yet complete.
11219func (iter SubscriptionUsageListResultIterator) NotDone() bool {
11220	return iter.page.NotDone() && iter.i < len(iter.page.Values())
11221}
11222
11223// Response returns the raw server response from the last page request.
11224func (iter SubscriptionUsageListResultIterator) Response() SubscriptionUsageListResult {
11225	return iter.page.Response()
11226}
11227
11228// Value returns the current value or a zero-initialized value if the
11229// iterator has advanced beyond the end of the collection.
11230func (iter SubscriptionUsageListResultIterator) Value() SubscriptionUsage {
11231	if !iter.page.NotDone() {
11232		return SubscriptionUsage{}
11233	}
11234	return iter.page.Values()[iter.i]
11235}
11236
11237// IsEmpty returns true if the ListResult contains no values.
11238func (sulr SubscriptionUsageListResult) IsEmpty() bool {
11239	return sulr.Value == nil || len(*sulr.Value) == 0
11240}
11241
11242// subscriptionUsageListResultPreparer prepares a request to retrieve the next set of results.
11243// It returns nil if no more results exist.
11244func (sulr SubscriptionUsageListResult) subscriptionUsageListResultPreparer() (*http.Request, error) {
11245	if sulr.NextLink == nil || len(to.String(sulr.NextLink)) < 1 {
11246		return nil, nil
11247	}
11248	return autorest.Prepare(&http.Request{},
11249		autorest.AsJSON(),
11250		autorest.AsGet(),
11251		autorest.WithBaseURL(to.String(sulr.NextLink)))
11252}
11253
11254// SubscriptionUsageListResultPage contains a page of SubscriptionUsage values.
11255type SubscriptionUsageListResultPage struct {
11256	fn   func(SubscriptionUsageListResult) (SubscriptionUsageListResult, error)
11257	sulr SubscriptionUsageListResult
11258}
11259
11260// Next advances to the next page of values.  If there was an error making
11261// the request the page does not advance and the error is returned.
11262func (page *SubscriptionUsageListResultPage) Next() error {
11263	next, err := page.fn(page.sulr)
11264	if err != nil {
11265		return err
11266	}
11267	page.sulr = next
11268	return nil
11269}
11270
11271// NotDone returns true if the page enumeration should be started or is not yet complete.
11272func (page SubscriptionUsageListResultPage) NotDone() bool {
11273	return !page.sulr.IsEmpty()
11274}
11275
11276// Response returns the raw server response from the last page request.
11277func (page SubscriptionUsageListResultPage) Response() SubscriptionUsageListResult {
11278	return page.sulr
11279}
11280
11281// Values returns the slice of values for the current page or nil if there are no values.
11282func (page SubscriptionUsageListResultPage) Values() []SubscriptionUsage {
11283	if page.sulr.IsEmpty() {
11284		return nil
11285	}
11286	return *page.sulr.Value
11287}
11288
11289// SubscriptionUsageProperties properties of a subscription usage.
11290type SubscriptionUsageProperties struct {
11291	// DisplayName - User-readable name of the metric.
11292	DisplayName *string `json:"displayName,omitempty"`
11293	// CurrentValue - Current value of the metric.
11294	CurrentValue *float64 `json:"currentValue,omitempty"`
11295	// Limit - Boundary value of the metric.
11296	Limit *float64 `json:"limit,omitempty"`
11297	// Unit - Unit of the metric.
11298	Unit *string `json:"unit,omitempty"`
11299}
11300
11301// SyncAgent an Azure SQL Database sync agent.
11302type SyncAgent struct {
11303	autorest.Response `json:"-"`
11304	// SyncAgentProperties - Resource properties.
11305	*SyncAgentProperties `json:"properties,omitempty"`
11306	// ID - Resource ID.
11307	ID *string `json:"id,omitempty"`
11308	// Name - Resource name.
11309	Name *string `json:"name,omitempty"`
11310	// Type - Resource type.
11311	Type *string `json:"type,omitempty"`
11312}
11313
11314// MarshalJSON is the custom marshaler for SyncAgent.
11315func (sa SyncAgent) MarshalJSON() ([]byte, error) {
11316	objectMap := make(map[string]interface{})
11317	if sa.SyncAgentProperties != nil {
11318		objectMap["properties"] = sa.SyncAgentProperties
11319	}
11320	if sa.ID != nil {
11321		objectMap["id"] = sa.ID
11322	}
11323	if sa.Name != nil {
11324		objectMap["name"] = sa.Name
11325	}
11326	if sa.Type != nil {
11327		objectMap["type"] = sa.Type
11328	}
11329	return json.Marshal(objectMap)
11330}
11331
11332// UnmarshalJSON is the custom unmarshaler for SyncAgent struct.
11333func (sa *SyncAgent) UnmarshalJSON(body []byte) error {
11334	var m map[string]*json.RawMessage
11335	err := json.Unmarshal(body, &m)
11336	if err != nil {
11337		return err
11338	}
11339	for k, v := range m {
11340		switch k {
11341		case "properties":
11342			if v != nil {
11343				var syncAgentProperties SyncAgentProperties
11344				err = json.Unmarshal(*v, &syncAgentProperties)
11345				if err != nil {
11346					return err
11347				}
11348				sa.SyncAgentProperties = &syncAgentProperties
11349			}
11350		case "id":
11351			if v != nil {
11352				var ID string
11353				err = json.Unmarshal(*v, &ID)
11354				if err != nil {
11355					return err
11356				}
11357				sa.ID = &ID
11358			}
11359		case "name":
11360			if v != nil {
11361				var name string
11362				err = json.Unmarshal(*v, &name)
11363				if err != nil {
11364					return err
11365				}
11366				sa.Name = &name
11367			}
11368		case "type":
11369			if v != nil {
11370				var typeVar string
11371				err = json.Unmarshal(*v, &typeVar)
11372				if err != nil {
11373					return err
11374				}
11375				sa.Type = &typeVar
11376			}
11377		}
11378	}
11379
11380	return nil
11381}
11382
11383// SyncAgentKeyProperties properties of an Azure SQL Database sync agent key.
11384type SyncAgentKeyProperties struct {
11385	autorest.Response `json:"-"`
11386	// SyncAgentKey - Key of sync agent.
11387	SyncAgentKey *string `json:"syncAgentKey,omitempty"`
11388}
11389
11390// SyncAgentLinkedDatabase an Azure SQL Database sync agent linked database.
11391type SyncAgentLinkedDatabase struct {
11392	// SyncAgentLinkedDatabaseProperties - Resource properties.
11393	*SyncAgentLinkedDatabaseProperties `json:"properties,omitempty"`
11394	// ID - Resource ID.
11395	ID *string `json:"id,omitempty"`
11396	// Name - Resource name.
11397	Name *string `json:"name,omitempty"`
11398	// Type - Resource type.
11399	Type *string `json:"type,omitempty"`
11400}
11401
11402// MarshalJSON is the custom marshaler for SyncAgentLinkedDatabase.
11403func (sald SyncAgentLinkedDatabase) MarshalJSON() ([]byte, error) {
11404	objectMap := make(map[string]interface{})
11405	if sald.SyncAgentLinkedDatabaseProperties != nil {
11406		objectMap["properties"] = sald.SyncAgentLinkedDatabaseProperties
11407	}
11408	if sald.ID != nil {
11409		objectMap["id"] = sald.ID
11410	}
11411	if sald.Name != nil {
11412		objectMap["name"] = sald.Name
11413	}
11414	if sald.Type != nil {
11415		objectMap["type"] = sald.Type
11416	}
11417	return json.Marshal(objectMap)
11418}
11419
11420// UnmarshalJSON is the custom unmarshaler for SyncAgentLinkedDatabase struct.
11421func (sald *SyncAgentLinkedDatabase) UnmarshalJSON(body []byte) error {
11422	var m map[string]*json.RawMessage
11423	err := json.Unmarshal(body, &m)
11424	if err != nil {
11425		return err
11426	}
11427	for k, v := range m {
11428		switch k {
11429		case "properties":
11430			if v != nil {
11431				var syncAgentLinkedDatabaseProperties SyncAgentLinkedDatabaseProperties
11432				err = json.Unmarshal(*v, &syncAgentLinkedDatabaseProperties)
11433				if err != nil {
11434					return err
11435				}
11436				sald.SyncAgentLinkedDatabaseProperties = &syncAgentLinkedDatabaseProperties
11437			}
11438		case "id":
11439			if v != nil {
11440				var ID string
11441				err = json.Unmarshal(*v, &ID)
11442				if err != nil {
11443					return err
11444				}
11445				sald.ID = &ID
11446			}
11447		case "name":
11448			if v != nil {
11449				var name string
11450				err = json.Unmarshal(*v, &name)
11451				if err != nil {
11452					return err
11453				}
11454				sald.Name = &name
11455			}
11456		case "type":
11457			if v != nil {
11458				var typeVar string
11459				err = json.Unmarshal(*v, &typeVar)
11460				if err != nil {
11461					return err
11462				}
11463				sald.Type = &typeVar
11464			}
11465		}
11466	}
11467
11468	return nil
11469}
11470
11471// SyncAgentLinkedDatabaseListResult a list of sync agent linked databases.
11472type SyncAgentLinkedDatabaseListResult struct {
11473	autorest.Response `json:"-"`
11474	// Value - Array of results.
11475	Value *[]SyncAgentLinkedDatabase `json:"value,omitempty"`
11476	// NextLink - Link to retrieve next page of results.
11477	NextLink *string `json:"nextLink,omitempty"`
11478}
11479
11480// SyncAgentLinkedDatabaseListResultIterator provides access to a complete listing of SyncAgentLinkedDatabase
11481// values.
11482type SyncAgentLinkedDatabaseListResultIterator struct {
11483	i    int
11484	page SyncAgentLinkedDatabaseListResultPage
11485}
11486
11487// Next advances to the next value.  If there was an error making
11488// the request the iterator does not advance and the error is returned.
11489func (iter *SyncAgentLinkedDatabaseListResultIterator) Next() error {
11490	iter.i++
11491	if iter.i < len(iter.page.Values()) {
11492		return nil
11493	}
11494	err := iter.page.Next()
11495	if err != nil {
11496		iter.i--
11497		return err
11498	}
11499	iter.i = 0
11500	return nil
11501}
11502
11503// NotDone returns true if the enumeration should be started or is not yet complete.
11504func (iter SyncAgentLinkedDatabaseListResultIterator) NotDone() bool {
11505	return iter.page.NotDone() && iter.i < len(iter.page.Values())
11506}
11507
11508// Response returns the raw server response from the last page request.
11509func (iter SyncAgentLinkedDatabaseListResultIterator) Response() SyncAgentLinkedDatabaseListResult {
11510	return iter.page.Response()
11511}
11512
11513// Value returns the current value or a zero-initialized value if the
11514// iterator has advanced beyond the end of the collection.
11515func (iter SyncAgentLinkedDatabaseListResultIterator) Value() SyncAgentLinkedDatabase {
11516	if !iter.page.NotDone() {
11517		return SyncAgentLinkedDatabase{}
11518	}
11519	return iter.page.Values()[iter.i]
11520}
11521
11522// IsEmpty returns true if the ListResult contains no values.
11523func (saldlr SyncAgentLinkedDatabaseListResult) IsEmpty() bool {
11524	return saldlr.Value == nil || len(*saldlr.Value) == 0
11525}
11526
11527// syncAgentLinkedDatabaseListResultPreparer prepares a request to retrieve the next set of results.
11528// It returns nil if no more results exist.
11529func (saldlr SyncAgentLinkedDatabaseListResult) syncAgentLinkedDatabaseListResultPreparer() (*http.Request, error) {
11530	if saldlr.NextLink == nil || len(to.String(saldlr.NextLink)) < 1 {
11531		return nil, nil
11532	}
11533	return autorest.Prepare(&http.Request{},
11534		autorest.AsJSON(),
11535		autorest.AsGet(),
11536		autorest.WithBaseURL(to.String(saldlr.NextLink)))
11537}
11538
11539// SyncAgentLinkedDatabaseListResultPage contains a page of SyncAgentLinkedDatabase values.
11540type SyncAgentLinkedDatabaseListResultPage struct {
11541	fn     func(SyncAgentLinkedDatabaseListResult) (SyncAgentLinkedDatabaseListResult, error)
11542	saldlr SyncAgentLinkedDatabaseListResult
11543}
11544
11545// Next advances to the next page of values.  If there was an error making
11546// the request the page does not advance and the error is returned.
11547func (page *SyncAgentLinkedDatabaseListResultPage) Next() error {
11548	next, err := page.fn(page.saldlr)
11549	if err != nil {
11550		return err
11551	}
11552	page.saldlr = next
11553	return nil
11554}
11555
11556// NotDone returns true if the page enumeration should be started or is not yet complete.
11557func (page SyncAgentLinkedDatabaseListResultPage) NotDone() bool {
11558	return !page.saldlr.IsEmpty()
11559}
11560
11561// Response returns the raw server response from the last page request.
11562func (page SyncAgentLinkedDatabaseListResultPage) Response() SyncAgentLinkedDatabaseListResult {
11563	return page.saldlr
11564}
11565
11566// Values returns the slice of values for the current page or nil if there are no values.
11567func (page SyncAgentLinkedDatabaseListResultPage) Values() []SyncAgentLinkedDatabase {
11568	if page.saldlr.IsEmpty() {
11569		return nil
11570	}
11571	return *page.saldlr.Value
11572}
11573
11574// SyncAgentLinkedDatabaseProperties properties of an Azure SQL Database sync agent linked database.
11575type SyncAgentLinkedDatabaseProperties struct {
11576	// DatabaseType - Type of the sync agent linked database. Possible values include: 'AzureSQLDatabase', 'SQLServerDatabase'
11577	DatabaseType SyncMemberDbType `json:"databaseType,omitempty"`
11578	// DatabaseID - Id of the sync agent linked database.
11579	DatabaseID *string `json:"databaseId,omitempty"`
11580	// Description - Description of the sync agent linked database.
11581	Description *string `json:"description,omitempty"`
11582	// ServerName - Server name of the sync agent linked database.
11583	ServerName *string `json:"serverName,omitempty"`
11584	// DatabaseName - Database name of the sync agent linked database.
11585	DatabaseName *string `json:"databaseName,omitempty"`
11586	// UserName - User name of the sync agent linked database.
11587	UserName *string `json:"userName,omitempty"`
11588}
11589
11590// SyncAgentListResult a list of sync agents.
11591type SyncAgentListResult struct {
11592	autorest.Response `json:"-"`
11593	// Value - Array of results.
11594	Value *[]SyncAgent `json:"value,omitempty"`
11595	// NextLink - Link to retrieve next page of results.
11596	NextLink *string `json:"nextLink,omitempty"`
11597}
11598
11599// SyncAgentListResultIterator provides access to a complete listing of SyncAgent values.
11600type SyncAgentListResultIterator struct {
11601	i    int
11602	page SyncAgentListResultPage
11603}
11604
11605// Next advances to the next value.  If there was an error making
11606// the request the iterator does not advance and the error is returned.
11607func (iter *SyncAgentListResultIterator) Next() error {
11608	iter.i++
11609	if iter.i < len(iter.page.Values()) {
11610		return nil
11611	}
11612	err := iter.page.Next()
11613	if err != nil {
11614		iter.i--
11615		return err
11616	}
11617	iter.i = 0
11618	return nil
11619}
11620
11621// NotDone returns true if the enumeration should be started or is not yet complete.
11622func (iter SyncAgentListResultIterator) NotDone() bool {
11623	return iter.page.NotDone() && iter.i < len(iter.page.Values())
11624}
11625
11626// Response returns the raw server response from the last page request.
11627func (iter SyncAgentListResultIterator) Response() SyncAgentListResult {
11628	return iter.page.Response()
11629}
11630
11631// Value returns the current value or a zero-initialized value if the
11632// iterator has advanced beyond the end of the collection.
11633func (iter SyncAgentListResultIterator) Value() SyncAgent {
11634	if !iter.page.NotDone() {
11635		return SyncAgent{}
11636	}
11637	return iter.page.Values()[iter.i]
11638}
11639
11640// IsEmpty returns true if the ListResult contains no values.
11641func (salr SyncAgentListResult) IsEmpty() bool {
11642	return salr.Value == nil || len(*salr.Value) == 0
11643}
11644
11645// syncAgentListResultPreparer prepares a request to retrieve the next set of results.
11646// It returns nil if no more results exist.
11647func (salr SyncAgentListResult) syncAgentListResultPreparer() (*http.Request, error) {
11648	if salr.NextLink == nil || len(to.String(salr.NextLink)) < 1 {
11649		return nil, nil
11650	}
11651	return autorest.Prepare(&http.Request{},
11652		autorest.AsJSON(),
11653		autorest.AsGet(),
11654		autorest.WithBaseURL(to.String(salr.NextLink)))
11655}
11656
11657// SyncAgentListResultPage contains a page of SyncAgent values.
11658type SyncAgentListResultPage struct {
11659	fn   func(SyncAgentListResult) (SyncAgentListResult, error)
11660	salr SyncAgentListResult
11661}
11662
11663// Next advances to the next page of values.  If there was an error making
11664// the request the page does not advance and the error is returned.
11665func (page *SyncAgentListResultPage) Next() error {
11666	next, err := page.fn(page.salr)
11667	if err != nil {
11668		return err
11669	}
11670	page.salr = next
11671	return nil
11672}
11673
11674// NotDone returns true if the page enumeration should be started or is not yet complete.
11675func (page SyncAgentListResultPage) NotDone() bool {
11676	return !page.salr.IsEmpty()
11677}
11678
11679// Response returns the raw server response from the last page request.
11680func (page SyncAgentListResultPage) Response() SyncAgentListResult {
11681	return page.salr
11682}
11683
11684// Values returns the slice of values for the current page or nil if there are no values.
11685func (page SyncAgentListResultPage) Values() []SyncAgent {
11686	if page.salr.IsEmpty() {
11687		return nil
11688	}
11689	return *page.salr.Value
11690}
11691
11692// SyncAgentProperties properties of an Azure SQL Database sync agent.
11693type SyncAgentProperties struct {
11694	// Name - Name of the sync agent.
11695	Name *string `json:"name,omitempty"`
11696	// SyncDatabaseID - ARM resource id of the sync database in the sync agent.
11697	SyncDatabaseID *string `json:"syncDatabaseId,omitempty"`
11698	// LastAliveTime - Last alive time of the sync agent.
11699	LastAliveTime *date.Time `json:"lastAliveTime,omitempty"`
11700	// State - State of the sync agent. Possible values include: 'SyncAgentStateOnline', 'SyncAgentStateOffline', 'SyncAgentStateNeverConnected'
11701	State SyncAgentState `json:"state,omitempty"`
11702	// IsUpToDate - If the sync agent version is up to date.
11703	IsUpToDate *bool `json:"isUpToDate,omitempty"`
11704	// ExpiryTime - Expiration time of the sync agent version.
11705	ExpiryTime *date.Time `json:"expiryTime,omitempty"`
11706	// Version - Version of the sync agent.
11707	Version *string `json:"version,omitempty"`
11708}
11709
11710// SyncAgentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
11711// operation.
11712type SyncAgentsCreateOrUpdateFuture struct {
11713	azure.Future
11714}
11715
11716// Result returns the result of the asynchronous operation.
11717// If the operation has not completed it will return an error.
11718func (future *SyncAgentsCreateOrUpdateFuture) Result(client SyncAgentsClient) (sa SyncAgent, err error) {
11719	var done bool
11720	done, err = future.Done(client)
11721	if err != nil {
11722		err = autorest.NewErrorWithError(err, "sql.SyncAgentsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
11723		return
11724	}
11725	if !done {
11726		err = azure.NewAsyncOpIncompleteError("sql.SyncAgentsCreateOrUpdateFuture")
11727		return
11728	}
11729	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11730	if sa.Response.Response, err = future.GetResult(sender); err == nil && sa.Response.Response.StatusCode != http.StatusNoContent {
11731		sa, err = client.CreateOrUpdateResponder(sa.Response.Response)
11732		if err != nil {
11733			err = autorest.NewErrorWithError(err, "sql.SyncAgentsCreateOrUpdateFuture", "Result", sa.Response.Response, "Failure responding to request")
11734		}
11735	}
11736	return
11737}
11738
11739// SyncAgentsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation.
11740type SyncAgentsDeleteFuture struct {
11741	azure.Future
11742}
11743
11744// Result returns the result of the asynchronous operation.
11745// If the operation has not completed it will return an error.
11746func (future *SyncAgentsDeleteFuture) Result(client SyncAgentsClient) (ar autorest.Response, err error) {
11747	var done bool
11748	done, err = future.Done(client)
11749	if err != nil {
11750		err = autorest.NewErrorWithError(err, "sql.SyncAgentsDeleteFuture", "Result", future.Response(), "Polling failure")
11751		return
11752	}
11753	if !done {
11754		err = azure.NewAsyncOpIncompleteError("sql.SyncAgentsDeleteFuture")
11755		return
11756	}
11757	ar.Response = future.Response()
11758	return
11759}
11760
11761// SyncDatabaseIDListResult a list of sync database ID properties.
11762type SyncDatabaseIDListResult struct {
11763	autorest.Response `json:"-"`
11764	// Value - Array of results.
11765	Value *[]SyncDatabaseIDProperties `json:"value,omitempty"`
11766	// NextLink - Link to retrieve next page of results.
11767	NextLink *string `json:"nextLink,omitempty"`
11768}
11769
11770// SyncDatabaseIDListResultIterator provides access to a complete listing of SyncDatabaseIDProperties values.
11771type SyncDatabaseIDListResultIterator struct {
11772	i    int
11773	page SyncDatabaseIDListResultPage
11774}
11775
11776// Next advances to the next value.  If there was an error making
11777// the request the iterator does not advance and the error is returned.
11778func (iter *SyncDatabaseIDListResultIterator) Next() error {
11779	iter.i++
11780	if iter.i < len(iter.page.Values()) {
11781		return nil
11782	}
11783	err := iter.page.Next()
11784	if err != nil {
11785		iter.i--
11786		return err
11787	}
11788	iter.i = 0
11789	return nil
11790}
11791
11792// NotDone returns true if the enumeration should be started or is not yet complete.
11793func (iter SyncDatabaseIDListResultIterator) NotDone() bool {
11794	return iter.page.NotDone() && iter.i < len(iter.page.Values())
11795}
11796
11797// Response returns the raw server response from the last page request.
11798func (iter SyncDatabaseIDListResultIterator) Response() SyncDatabaseIDListResult {
11799	return iter.page.Response()
11800}
11801
11802// Value returns the current value or a zero-initialized value if the
11803// iterator has advanced beyond the end of the collection.
11804func (iter SyncDatabaseIDListResultIterator) Value() SyncDatabaseIDProperties {
11805	if !iter.page.NotDone() {
11806		return SyncDatabaseIDProperties{}
11807	}
11808	return iter.page.Values()[iter.i]
11809}
11810
11811// IsEmpty returns true if the ListResult contains no values.
11812func (sdilr SyncDatabaseIDListResult) IsEmpty() bool {
11813	return sdilr.Value == nil || len(*sdilr.Value) == 0
11814}
11815
11816// syncDatabaseIDListResultPreparer prepares a request to retrieve the next set of results.
11817// It returns nil if no more results exist.
11818func (sdilr SyncDatabaseIDListResult) syncDatabaseIDListResultPreparer() (*http.Request, error) {
11819	if sdilr.NextLink == nil || len(to.String(sdilr.NextLink)) < 1 {
11820		return nil, nil
11821	}
11822	return autorest.Prepare(&http.Request{},
11823		autorest.AsJSON(),
11824		autorest.AsGet(),
11825		autorest.WithBaseURL(to.String(sdilr.NextLink)))
11826}
11827
11828// SyncDatabaseIDListResultPage contains a page of SyncDatabaseIDProperties values.
11829type SyncDatabaseIDListResultPage struct {
11830	fn    func(SyncDatabaseIDListResult) (SyncDatabaseIDListResult, error)
11831	sdilr SyncDatabaseIDListResult
11832}
11833
11834// Next advances to the next page of values.  If there was an error making
11835// the request the page does not advance and the error is returned.
11836func (page *SyncDatabaseIDListResultPage) Next() error {
11837	next, err := page.fn(page.sdilr)
11838	if err != nil {
11839		return err
11840	}
11841	page.sdilr = next
11842	return nil
11843}
11844
11845// NotDone returns true if the page enumeration should be started or is not yet complete.
11846func (page SyncDatabaseIDListResultPage) NotDone() bool {
11847	return !page.sdilr.IsEmpty()
11848}
11849
11850// Response returns the raw server response from the last page request.
11851func (page SyncDatabaseIDListResultPage) Response() SyncDatabaseIDListResult {
11852	return page.sdilr
11853}
11854
11855// Values returns the slice of values for the current page or nil if there are no values.
11856func (page SyncDatabaseIDListResultPage) Values() []SyncDatabaseIDProperties {
11857	if page.sdilr.IsEmpty() {
11858		return nil
11859	}
11860	return *page.sdilr.Value
11861}
11862
11863// SyncDatabaseIDProperties properties of the sync database id.
11864type SyncDatabaseIDProperties struct {
11865	// ID - ARM resource id of sync database.
11866	ID *string `json:"id,omitempty"`
11867}
11868
11869// SyncFullSchemaProperties properties of the database full schema.
11870type SyncFullSchemaProperties struct {
11871	// Tables - List of tables in the database full schema.
11872	Tables *[]SyncFullSchemaTable `json:"tables,omitempty"`
11873	// LastUpdateTime - Last update time of the database schema.
11874	LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"`
11875}
11876
11877// SyncFullSchemaPropertiesListResult a list of sync schema properties.
11878type SyncFullSchemaPropertiesListResult struct {
11879	autorest.Response `json:"-"`
11880	// Value - Array of results.
11881	Value *[]SyncFullSchemaProperties `json:"value,omitempty"`
11882	// NextLink - Link to retrieve next page of results.
11883	NextLink *string `json:"nextLink,omitempty"`
11884}
11885
11886// SyncFullSchemaPropertiesListResultIterator provides access to a complete listing of SyncFullSchemaProperties
11887// values.
11888type SyncFullSchemaPropertiesListResultIterator struct {
11889	i    int
11890	page SyncFullSchemaPropertiesListResultPage
11891}
11892
11893// Next advances to the next value.  If there was an error making
11894// the request the iterator does not advance and the error is returned.
11895func (iter *SyncFullSchemaPropertiesListResultIterator) Next() error {
11896	iter.i++
11897	if iter.i < len(iter.page.Values()) {
11898		return nil
11899	}
11900	err := iter.page.Next()
11901	if err != nil {
11902		iter.i--
11903		return err
11904	}
11905	iter.i = 0
11906	return nil
11907}
11908
11909// NotDone returns true if the enumeration should be started or is not yet complete.
11910func (iter SyncFullSchemaPropertiesListResultIterator) NotDone() bool {
11911	return iter.page.NotDone() && iter.i < len(iter.page.Values())
11912}
11913
11914// Response returns the raw server response from the last page request.
11915func (iter SyncFullSchemaPropertiesListResultIterator) Response() SyncFullSchemaPropertiesListResult {
11916	return iter.page.Response()
11917}
11918
11919// Value returns the current value or a zero-initialized value if the
11920// iterator has advanced beyond the end of the collection.
11921func (iter SyncFullSchemaPropertiesListResultIterator) Value() SyncFullSchemaProperties {
11922	if !iter.page.NotDone() {
11923		return SyncFullSchemaProperties{}
11924	}
11925	return iter.page.Values()[iter.i]
11926}
11927
11928// IsEmpty returns true if the ListResult contains no values.
11929func (sfsplr SyncFullSchemaPropertiesListResult) IsEmpty() bool {
11930	return sfsplr.Value == nil || len(*sfsplr.Value) == 0
11931}
11932
11933// syncFullSchemaPropertiesListResultPreparer prepares a request to retrieve the next set of results.
11934// It returns nil if no more results exist.
11935func (sfsplr SyncFullSchemaPropertiesListResult) syncFullSchemaPropertiesListResultPreparer() (*http.Request, error) {
11936	if sfsplr.NextLink == nil || len(to.String(sfsplr.NextLink)) < 1 {
11937		return nil, nil
11938	}
11939	return autorest.Prepare(&http.Request{},
11940		autorest.AsJSON(),
11941		autorest.AsGet(),
11942		autorest.WithBaseURL(to.String(sfsplr.NextLink)))
11943}
11944
11945// SyncFullSchemaPropertiesListResultPage contains a page of SyncFullSchemaProperties values.
11946type SyncFullSchemaPropertiesListResultPage struct {
11947	fn     func(SyncFullSchemaPropertiesListResult) (SyncFullSchemaPropertiesListResult, error)
11948	sfsplr SyncFullSchemaPropertiesListResult
11949}
11950
11951// Next advances to the next page of values.  If there was an error making
11952// the request the page does not advance and the error is returned.
11953func (page *SyncFullSchemaPropertiesListResultPage) Next() error {
11954	next, err := page.fn(page.sfsplr)
11955	if err != nil {
11956		return err
11957	}
11958	page.sfsplr = next
11959	return nil
11960}
11961
11962// NotDone returns true if the page enumeration should be started or is not yet complete.
11963func (page SyncFullSchemaPropertiesListResultPage) NotDone() bool {
11964	return !page.sfsplr.IsEmpty()
11965}
11966
11967// Response returns the raw server response from the last page request.
11968func (page SyncFullSchemaPropertiesListResultPage) Response() SyncFullSchemaPropertiesListResult {
11969	return page.sfsplr
11970}
11971
11972// Values returns the slice of values for the current page or nil if there are no values.
11973func (page SyncFullSchemaPropertiesListResultPage) Values() []SyncFullSchemaProperties {
11974	if page.sfsplr.IsEmpty() {
11975		return nil
11976	}
11977	return *page.sfsplr.Value
11978}
11979
11980// SyncFullSchemaTable properties of the table in the database full schema.
11981type SyncFullSchemaTable struct {
11982	// Columns - List of columns in the table of database full schema.
11983	Columns *[]SyncFullSchemaTableColumn `json:"columns,omitempty"`
11984	// ErrorID - Error id of the table.
11985	ErrorID *string `json:"errorId,omitempty"`
11986	// HasError - If there is error in the table.
11987	HasError *bool `json:"hasError,omitempty"`
11988	// Name - Name of the table.
11989	Name *string `json:"name,omitempty"`
11990	// QuotedName - Quoted name of the table.
11991	QuotedName *string `json:"quotedName,omitempty"`
11992}
11993
11994// SyncFullSchemaTableColumn properties of the column in the table of database full schema.
11995type SyncFullSchemaTableColumn struct {
11996	// DataSize - Data size of the column.
11997	DataSize *string `json:"dataSize,omitempty"`
11998	// DataType - Data type of the column.
11999	DataType *string `json:"dataType,omitempty"`
12000	// ErrorID - Error id of the column.
12001	ErrorID *string `json:"errorId,omitempty"`
12002	// HasError - If there is error in the table.
12003	HasError *bool `json:"hasError,omitempty"`
12004	// IsPrimaryKey - If it is the primary key of the table.
12005	IsPrimaryKey *bool `json:"isPrimaryKey,omitempty"`
12006	// Name - Name of the column.
12007	Name *string `json:"name,omitempty"`
12008	// QuotedName - Quoted name of the column.
12009	QuotedName *string `json:"quotedName,omitempty"`
12010}
12011
12012// SyncGroup an Azure SQL Database sync group.
12013type SyncGroup struct {
12014	autorest.Response `json:"-"`
12015	// SyncGroupProperties - Resource properties.
12016	*SyncGroupProperties `json:"properties,omitempty"`
12017	// ID - Resource ID.
12018	ID *string `json:"id,omitempty"`
12019	// Name - Resource name.
12020	Name *string `json:"name,omitempty"`
12021	// Type - Resource type.
12022	Type *string `json:"type,omitempty"`
12023}
12024
12025// MarshalJSON is the custom marshaler for SyncGroup.
12026func (sg SyncGroup) MarshalJSON() ([]byte, error) {
12027	objectMap := make(map[string]interface{})
12028	if sg.SyncGroupProperties != nil {
12029		objectMap["properties"] = sg.SyncGroupProperties
12030	}
12031	if sg.ID != nil {
12032		objectMap["id"] = sg.ID
12033	}
12034	if sg.Name != nil {
12035		objectMap["name"] = sg.Name
12036	}
12037	if sg.Type != nil {
12038		objectMap["type"] = sg.Type
12039	}
12040	return json.Marshal(objectMap)
12041}
12042
12043// UnmarshalJSON is the custom unmarshaler for SyncGroup struct.
12044func (sg *SyncGroup) UnmarshalJSON(body []byte) error {
12045	var m map[string]*json.RawMessage
12046	err := json.Unmarshal(body, &m)
12047	if err != nil {
12048		return err
12049	}
12050	for k, v := range m {
12051		switch k {
12052		case "properties":
12053			if v != nil {
12054				var syncGroupProperties SyncGroupProperties
12055				err = json.Unmarshal(*v, &syncGroupProperties)
12056				if err != nil {
12057					return err
12058				}
12059				sg.SyncGroupProperties = &syncGroupProperties
12060			}
12061		case "id":
12062			if v != nil {
12063				var ID string
12064				err = json.Unmarshal(*v, &ID)
12065				if err != nil {
12066					return err
12067				}
12068				sg.ID = &ID
12069			}
12070		case "name":
12071			if v != nil {
12072				var name string
12073				err = json.Unmarshal(*v, &name)
12074				if err != nil {
12075					return err
12076				}
12077				sg.Name = &name
12078			}
12079		case "type":
12080			if v != nil {
12081				var typeVar string
12082				err = json.Unmarshal(*v, &typeVar)
12083				if err != nil {
12084					return err
12085				}
12086				sg.Type = &typeVar
12087			}
12088		}
12089	}
12090
12091	return nil
12092}
12093
12094// SyncGroupListResult a list of sync groups.
12095type SyncGroupListResult struct {
12096	autorest.Response `json:"-"`
12097	// Value - Array of results.
12098	Value *[]SyncGroup `json:"value,omitempty"`
12099	// NextLink - Link to retrieve next page of results.
12100	NextLink *string `json:"nextLink,omitempty"`
12101}
12102
12103// SyncGroupListResultIterator provides access to a complete listing of SyncGroup values.
12104type SyncGroupListResultIterator struct {
12105	i    int
12106	page SyncGroupListResultPage
12107}
12108
12109// Next advances to the next value.  If there was an error making
12110// the request the iterator does not advance and the error is returned.
12111func (iter *SyncGroupListResultIterator) Next() error {
12112	iter.i++
12113	if iter.i < len(iter.page.Values()) {
12114		return nil
12115	}
12116	err := iter.page.Next()
12117	if err != nil {
12118		iter.i--
12119		return err
12120	}
12121	iter.i = 0
12122	return nil
12123}
12124
12125// NotDone returns true if the enumeration should be started or is not yet complete.
12126func (iter SyncGroupListResultIterator) NotDone() bool {
12127	return iter.page.NotDone() && iter.i < len(iter.page.Values())
12128}
12129
12130// Response returns the raw server response from the last page request.
12131func (iter SyncGroupListResultIterator) Response() SyncGroupListResult {
12132	return iter.page.Response()
12133}
12134
12135// Value returns the current value or a zero-initialized value if the
12136// iterator has advanced beyond the end of the collection.
12137func (iter SyncGroupListResultIterator) Value() SyncGroup {
12138	if !iter.page.NotDone() {
12139		return SyncGroup{}
12140	}
12141	return iter.page.Values()[iter.i]
12142}
12143
12144// IsEmpty returns true if the ListResult contains no values.
12145func (sglr SyncGroupListResult) IsEmpty() bool {
12146	return sglr.Value == nil || len(*sglr.Value) == 0
12147}
12148
12149// syncGroupListResultPreparer prepares a request to retrieve the next set of results.
12150// It returns nil if no more results exist.
12151func (sglr SyncGroupListResult) syncGroupListResultPreparer() (*http.Request, error) {
12152	if sglr.NextLink == nil || len(to.String(sglr.NextLink)) < 1 {
12153		return nil, nil
12154	}
12155	return autorest.Prepare(&http.Request{},
12156		autorest.AsJSON(),
12157		autorest.AsGet(),
12158		autorest.WithBaseURL(to.String(sglr.NextLink)))
12159}
12160
12161// SyncGroupListResultPage contains a page of SyncGroup values.
12162type SyncGroupListResultPage struct {
12163	fn   func(SyncGroupListResult) (SyncGroupListResult, error)
12164	sglr SyncGroupListResult
12165}
12166
12167// Next advances to the next page of values.  If there was an error making
12168// the request the page does not advance and the error is returned.
12169func (page *SyncGroupListResultPage) Next() error {
12170	next, err := page.fn(page.sglr)
12171	if err != nil {
12172		return err
12173	}
12174	page.sglr = next
12175	return nil
12176}
12177
12178// NotDone returns true if the page enumeration should be started or is not yet complete.
12179func (page SyncGroupListResultPage) NotDone() bool {
12180	return !page.sglr.IsEmpty()
12181}
12182
12183// Response returns the raw server response from the last page request.
12184func (page SyncGroupListResultPage) Response() SyncGroupListResult {
12185	return page.sglr
12186}
12187
12188// Values returns the slice of values for the current page or nil if there are no values.
12189func (page SyncGroupListResultPage) Values() []SyncGroup {
12190	if page.sglr.IsEmpty() {
12191		return nil
12192	}
12193	return *page.sglr.Value
12194}
12195
12196// SyncGroupLogListResult a list of sync group log properties.
12197type SyncGroupLogListResult struct {
12198	autorest.Response `json:"-"`
12199	// Value - Array of results.
12200	Value *[]SyncGroupLogProperties `json:"value,omitempty"`
12201	// NextLink - Link to retrieve next page of results.
12202	NextLink *string `json:"nextLink,omitempty"`
12203}
12204
12205// SyncGroupLogListResultIterator provides access to a complete listing of SyncGroupLogProperties values.
12206type SyncGroupLogListResultIterator struct {
12207	i    int
12208	page SyncGroupLogListResultPage
12209}
12210
12211// Next advances to the next value.  If there was an error making
12212// the request the iterator does not advance and the error is returned.
12213func (iter *SyncGroupLogListResultIterator) Next() error {
12214	iter.i++
12215	if iter.i < len(iter.page.Values()) {
12216		return nil
12217	}
12218	err := iter.page.Next()
12219	if err != nil {
12220		iter.i--
12221		return err
12222	}
12223	iter.i = 0
12224	return nil
12225}
12226
12227// NotDone returns true if the enumeration should be started or is not yet complete.
12228func (iter SyncGroupLogListResultIterator) NotDone() bool {
12229	return iter.page.NotDone() && iter.i < len(iter.page.Values())
12230}
12231
12232// Response returns the raw server response from the last page request.
12233func (iter SyncGroupLogListResultIterator) Response() SyncGroupLogListResult {
12234	return iter.page.Response()
12235}
12236
12237// Value returns the current value or a zero-initialized value if the
12238// iterator has advanced beyond the end of the collection.
12239func (iter SyncGroupLogListResultIterator) Value() SyncGroupLogProperties {
12240	if !iter.page.NotDone() {
12241		return SyncGroupLogProperties{}
12242	}
12243	return iter.page.Values()[iter.i]
12244}
12245
12246// IsEmpty returns true if the ListResult contains no values.
12247func (sgllr SyncGroupLogListResult) IsEmpty() bool {
12248	return sgllr.Value == nil || len(*sgllr.Value) == 0
12249}
12250
12251// syncGroupLogListResultPreparer prepares a request to retrieve the next set of results.
12252// It returns nil if no more results exist.
12253func (sgllr SyncGroupLogListResult) syncGroupLogListResultPreparer() (*http.Request, error) {
12254	if sgllr.NextLink == nil || len(to.String(sgllr.NextLink)) < 1 {
12255		return nil, nil
12256	}
12257	return autorest.Prepare(&http.Request{},
12258		autorest.AsJSON(),
12259		autorest.AsGet(),
12260		autorest.WithBaseURL(to.String(sgllr.NextLink)))
12261}
12262
12263// SyncGroupLogListResultPage contains a page of SyncGroupLogProperties values.
12264type SyncGroupLogListResultPage struct {
12265	fn    func(SyncGroupLogListResult) (SyncGroupLogListResult, error)
12266	sgllr SyncGroupLogListResult
12267}
12268
12269// Next advances to the next page of values.  If there was an error making
12270// the request the page does not advance and the error is returned.
12271func (page *SyncGroupLogListResultPage) Next() error {
12272	next, err := page.fn(page.sgllr)
12273	if err != nil {
12274		return err
12275	}
12276	page.sgllr = next
12277	return nil
12278}
12279
12280// NotDone returns true if the page enumeration should be started or is not yet complete.
12281func (page SyncGroupLogListResultPage) NotDone() bool {
12282	return !page.sgllr.IsEmpty()
12283}
12284
12285// Response returns the raw server response from the last page request.
12286func (page SyncGroupLogListResultPage) Response() SyncGroupLogListResult {
12287	return page.sgllr
12288}
12289
12290// Values returns the slice of values for the current page or nil if there are no values.
12291func (page SyncGroupLogListResultPage) Values() []SyncGroupLogProperties {
12292	if page.sgllr.IsEmpty() {
12293		return nil
12294	}
12295	return *page.sgllr.Value
12296}
12297
12298// SyncGroupLogProperties properties of an Azure SQL Database sync group log.
12299type SyncGroupLogProperties struct {
12300	// Timestamp - Timestamp of the sync group log.
12301	Timestamp *date.Time `json:"timestamp,omitempty"`
12302	// Type - Type of the sync group log. Possible values include: 'SyncGroupLogTypeAll', 'SyncGroupLogTypeError', 'SyncGroupLogTypeWarning', 'SyncGroupLogTypeSuccess'
12303	Type SyncGroupLogType `json:"type,omitempty"`
12304	// Source - Source of the sync group log.
12305	Source *string `json:"source,omitempty"`
12306	// Details - Details of the sync group log.
12307	Details *string `json:"details,omitempty"`
12308	// TracingID - TracingId of the sync group log.
12309	TracingID *uuid.UUID `json:"tracingId,omitempty"`
12310	// OperationStatus - OperationStatus of the sync group log.
12311	OperationStatus *string `json:"operationStatus,omitempty"`
12312}
12313
12314// SyncGroupProperties properties of a sync group.
12315type SyncGroupProperties struct {
12316	// Interval - Sync interval of the sync group.
12317	Interval *int32 `json:"interval,omitempty"`
12318	// LastSyncTime - Last sync time of the sync group.
12319	LastSyncTime *date.Time `json:"lastSyncTime,omitempty"`
12320	// ConflictResolutionPolicy - Conflict resolution policy of the sync group. Possible values include: 'HubWin', 'MemberWin'
12321	ConflictResolutionPolicy SyncConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"`
12322	// SyncDatabaseID - ARM resource id of the sync database in the sync group.
12323	SyncDatabaseID *string `json:"syncDatabaseId,omitempty"`
12324	// HubDatabaseUserName - User name for the sync group hub database credential.
12325	HubDatabaseUserName *string `json:"hubDatabaseUserName,omitempty"`
12326	// HubDatabasePassword - Password for the sync group hub database credential.
12327	HubDatabasePassword *string `json:"hubDatabasePassword,omitempty"`
12328	// SyncState - Sync state of the sync group. Possible values include: 'NotReady', 'Error', 'Warning', 'Progressing', 'Good'
12329	SyncState SyncGroupState `json:"syncState,omitempty"`
12330	// Schema - Sync schema of the sync group.
12331	Schema *SyncGroupSchema `json:"schema,omitempty"`
12332}
12333
12334// SyncGroupSchema properties of sync group schema.
12335type SyncGroupSchema struct {
12336	// Tables - List of tables in sync group schema.
12337	Tables *[]SyncGroupSchemaTable `json:"tables,omitempty"`
12338	// MasterSyncMemberName - Name of master sync member where the schema is from.
12339	MasterSyncMemberName *string `json:"masterSyncMemberName,omitempty"`
12340}
12341
12342// SyncGroupSchemaTable properties of table in sync group schema.
12343type SyncGroupSchemaTable struct {
12344	// Columns - List of columns in sync group schema.
12345	Columns *[]SyncGroupSchemaTableColumn `json:"columns,omitempty"`
12346	// QuotedName - Quoted name of sync group schema table.
12347	QuotedName *string `json:"quotedName,omitempty"`
12348}
12349
12350// SyncGroupSchemaTableColumn properties of column in sync group table.
12351type SyncGroupSchemaTableColumn struct {
12352	// QuotedName - Quoted name of sync group table column.
12353	QuotedName *string `json:"quotedName,omitempty"`
12354	// DataSize - Data size of the column.
12355	DataSize *string `json:"dataSize,omitempty"`
12356	// DataType - Data type of the column.
12357	DataType *string `json:"dataType,omitempty"`
12358}
12359
12360// SyncGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
12361// operation.
12362type SyncGroupsCreateOrUpdateFuture struct {
12363	azure.Future
12364}
12365
12366// Result returns the result of the asynchronous operation.
12367// If the operation has not completed it will return an error.
12368func (future *SyncGroupsCreateOrUpdateFuture) Result(client SyncGroupsClient) (sg SyncGroup, err error) {
12369	var done bool
12370	done, err = future.Done(client)
12371	if err != nil {
12372		err = autorest.NewErrorWithError(err, "sql.SyncGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
12373		return
12374	}
12375	if !done {
12376		err = azure.NewAsyncOpIncompleteError("sql.SyncGroupsCreateOrUpdateFuture")
12377		return
12378	}
12379	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12380	if sg.Response.Response, err = future.GetResult(sender); err == nil && sg.Response.Response.StatusCode != http.StatusNoContent {
12381		sg, err = client.CreateOrUpdateResponder(sg.Response.Response)
12382		if err != nil {
12383			err = autorest.NewErrorWithError(err, "sql.SyncGroupsCreateOrUpdateFuture", "Result", sg.Response.Response, "Failure responding to request")
12384		}
12385	}
12386	return
12387}
12388
12389// SyncGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation.
12390type SyncGroupsDeleteFuture struct {
12391	azure.Future
12392}
12393
12394// Result returns the result of the asynchronous operation.
12395// If the operation has not completed it will return an error.
12396func (future *SyncGroupsDeleteFuture) Result(client SyncGroupsClient) (ar autorest.Response, err error) {
12397	var done bool
12398	done, err = future.Done(client)
12399	if err != nil {
12400		err = autorest.NewErrorWithError(err, "sql.SyncGroupsDeleteFuture", "Result", future.Response(), "Polling failure")
12401		return
12402	}
12403	if !done {
12404		err = azure.NewAsyncOpIncompleteError("sql.SyncGroupsDeleteFuture")
12405		return
12406	}
12407	ar.Response = future.Response()
12408	return
12409}
12410
12411// SyncGroupsRefreshHubSchemaFuture an abstraction for monitoring and retrieving the results of a long-running
12412// operation.
12413type SyncGroupsRefreshHubSchemaFuture struct {
12414	azure.Future
12415}
12416
12417// Result returns the result of the asynchronous operation.
12418// If the operation has not completed it will return an error.
12419func (future *SyncGroupsRefreshHubSchemaFuture) Result(client SyncGroupsClient) (ar autorest.Response, err error) {
12420	var done bool
12421	done, err = future.Done(client)
12422	if err != nil {
12423		err = autorest.NewErrorWithError(err, "sql.SyncGroupsRefreshHubSchemaFuture", "Result", future.Response(), "Polling failure")
12424		return
12425	}
12426	if !done {
12427		err = azure.NewAsyncOpIncompleteError("sql.SyncGroupsRefreshHubSchemaFuture")
12428		return
12429	}
12430	ar.Response = future.Response()
12431	return
12432}
12433
12434// SyncGroupsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
12435type SyncGroupsUpdateFuture struct {
12436	azure.Future
12437}
12438
12439// Result returns the result of the asynchronous operation.
12440// If the operation has not completed it will return an error.
12441func (future *SyncGroupsUpdateFuture) Result(client SyncGroupsClient) (sg SyncGroup, err error) {
12442	var done bool
12443	done, err = future.Done(client)
12444	if err != nil {
12445		err = autorest.NewErrorWithError(err, "sql.SyncGroupsUpdateFuture", "Result", future.Response(), "Polling failure")
12446		return
12447	}
12448	if !done {
12449		err = azure.NewAsyncOpIncompleteError("sql.SyncGroupsUpdateFuture")
12450		return
12451	}
12452	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12453	if sg.Response.Response, err = future.GetResult(sender); err == nil && sg.Response.Response.StatusCode != http.StatusNoContent {
12454		sg, err = client.UpdateResponder(sg.Response.Response)
12455		if err != nil {
12456			err = autorest.NewErrorWithError(err, "sql.SyncGroupsUpdateFuture", "Result", sg.Response.Response, "Failure responding to request")
12457		}
12458	}
12459	return
12460}
12461
12462// SyncMember an Azure SQL Database sync member.
12463type SyncMember struct {
12464	autorest.Response `json:"-"`
12465	// SyncMemberProperties - Resource properties.
12466	*SyncMemberProperties `json:"properties,omitempty"`
12467	// ID - Resource ID.
12468	ID *string `json:"id,omitempty"`
12469	// Name - Resource name.
12470	Name *string `json:"name,omitempty"`
12471	// Type - Resource type.
12472	Type *string `json:"type,omitempty"`
12473}
12474
12475// MarshalJSON is the custom marshaler for SyncMember.
12476func (sm SyncMember) MarshalJSON() ([]byte, error) {
12477	objectMap := make(map[string]interface{})
12478	if sm.SyncMemberProperties != nil {
12479		objectMap["properties"] = sm.SyncMemberProperties
12480	}
12481	if sm.ID != nil {
12482		objectMap["id"] = sm.ID
12483	}
12484	if sm.Name != nil {
12485		objectMap["name"] = sm.Name
12486	}
12487	if sm.Type != nil {
12488		objectMap["type"] = sm.Type
12489	}
12490	return json.Marshal(objectMap)
12491}
12492
12493// UnmarshalJSON is the custom unmarshaler for SyncMember struct.
12494func (sm *SyncMember) UnmarshalJSON(body []byte) error {
12495	var m map[string]*json.RawMessage
12496	err := json.Unmarshal(body, &m)
12497	if err != nil {
12498		return err
12499	}
12500	for k, v := range m {
12501		switch k {
12502		case "properties":
12503			if v != nil {
12504				var syncMemberProperties SyncMemberProperties
12505				err = json.Unmarshal(*v, &syncMemberProperties)
12506				if err != nil {
12507					return err
12508				}
12509				sm.SyncMemberProperties = &syncMemberProperties
12510			}
12511		case "id":
12512			if v != nil {
12513				var ID string
12514				err = json.Unmarshal(*v, &ID)
12515				if err != nil {
12516					return err
12517				}
12518				sm.ID = &ID
12519			}
12520		case "name":
12521			if v != nil {
12522				var name string
12523				err = json.Unmarshal(*v, &name)
12524				if err != nil {
12525					return err
12526				}
12527				sm.Name = &name
12528			}
12529		case "type":
12530			if v != nil {
12531				var typeVar string
12532				err = json.Unmarshal(*v, &typeVar)
12533				if err != nil {
12534					return err
12535				}
12536				sm.Type = &typeVar
12537			}
12538		}
12539	}
12540
12541	return nil
12542}
12543
12544// SyncMemberListResult a list of Azure SQL Database sync members.
12545type SyncMemberListResult struct {
12546	autorest.Response `json:"-"`
12547	// Value - Array of results.
12548	Value *[]SyncMember `json:"value,omitempty"`
12549	// NextLink - Link to retrieve next page of results.
12550	NextLink *string `json:"nextLink,omitempty"`
12551}
12552
12553// SyncMemberListResultIterator provides access to a complete listing of SyncMember values.
12554type SyncMemberListResultIterator struct {
12555	i    int
12556	page SyncMemberListResultPage
12557}
12558
12559// Next advances to the next value.  If there was an error making
12560// the request the iterator does not advance and the error is returned.
12561func (iter *SyncMemberListResultIterator) Next() error {
12562	iter.i++
12563	if iter.i < len(iter.page.Values()) {
12564		return nil
12565	}
12566	err := iter.page.Next()
12567	if err != nil {
12568		iter.i--
12569		return err
12570	}
12571	iter.i = 0
12572	return nil
12573}
12574
12575// NotDone returns true if the enumeration should be started or is not yet complete.
12576func (iter SyncMemberListResultIterator) NotDone() bool {
12577	return iter.page.NotDone() && iter.i < len(iter.page.Values())
12578}
12579
12580// Response returns the raw server response from the last page request.
12581func (iter SyncMemberListResultIterator) Response() SyncMemberListResult {
12582	return iter.page.Response()
12583}
12584
12585// Value returns the current value or a zero-initialized value if the
12586// iterator has advanced beyond the end of the collection.
12587func (iter SyncMemberListResultIterator) Value() SyncMember {
12588	if !iter.page.NotDone() {
12589		return SyncMember{}
12590	}
12591	return iter.page.Values()[iter.i]
12592}
12593
12594// IsEmpty returns true if the ListResult contains no values.
12595func (smlr SyncMemberListResult) IsEmpty() bool {
12596	return smlr.Value == nil || len(*smlr.Value) == 0
12597}
12598
12599// syncMemberListResultPreparer prepares a request to retrieve the next set of results.
12600// It returns nil if no more results exist.
12601func (smlr SyncMemberListResult) syncMemberListResultPreparer() (*http.Request, error) {
12602	if smlr.NextLink == nil || len(to.String(smlr.NextLink)) < 1 {
12603		return nil, nil
12604	}
12605	return autorest.Prepare(&http.Request{},
12606		autorest.AsJSON(),
12607		autorest.AsGet(),
12608		autorest.WithBaseURL(to.String(smlr.NextLink)))
12609}
12610
12611// SyncMemberListResultPage contains a page of SyncMember values.
12612type SyncMemberListResultPage struct {
12613	fn   func(SyncMemberListResult) (SyncMemberListResult, error)
12614	smlr SyncMemberListResult
12615}
12616
12617// Next advances to the next page of values.  If there was an error making
12618// the request the page does not advance and the error is returned.
12619func (page *SyncMemberListResultPage) Next() error {
12620	next, err := page.fn(page.smlr)
12621	if err != nil {
12622		return err
12623	}
12624	page.smlr = next
12625	return nil
12626}
12627
12628// NotDone returns true if the page enumeration should be started or is not yet complete.
12629func (page SyncMemberListResultPage) NotDone() bool {
12630	return !page.smlr.IsEmpty()
12631}
12632
12633// Response returns the raw server response from the last page request.
12634func (page SyncMemberListResultPage) Response() SyncMemberListResult {
12635	return page.smlr
12636}
12637
12638// Values returns the slice of values for the current page or nil if there are no values.
12639func (page SyncMemberListResultPage) Values() []SyncMember {
12640	if page.smlr.IsEmpty() {
12641		return nil
12642	}
12643	return *page.smlr.Value
12644}
12645
12646// SyncMemberProperties properties of a sync member.
12647type SyncMemberProperties struct {
12648	// DatabaseType - Database type of the sync member. Possible values include: 'AzureSQLDatabase', 'SQLServerDatabase'
12649	DatabaseType SyncMemberDbType `json:"databaseType,omitempty"`
12650	// SyncAgentID - ARM resource id of the sync agent in the sync member.
12651	SyncAgentID *string `json:"syncAgentId,omitempty"`
12652	// SQLServerDatabaseID - SQL Server database id of the sync member.
12653	SQLServerDatabaseID *uuid.UUID `json:"sqlServerDatabaseId,omitempty"`
12654	// ServerName - Server name of the member database in the sync member
12655	ServerName *string `json:"serverName,omitempty"`
12656	// DatabaseName - Database name of the member database in the sync member.
12657	DatabaseName *string `json:"databaseName,omitempty"`
12658	// UserName - User name of the member database in the sync member.
12659	UserName *string `json:"userName,omitempty"`
12660	// Password - Password of the member database in the sync member.
12661	Password *string `json:"password,omitempty"`
12662	// SyncDirection - Sync direction of the sync member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', 'OneWayHubToMember'
12663	SyncDirection SyncDirection `json:"syncDirection,omitempty"`
12664	// SyncState - Sync state of the sync member. Possible values include: 'SyncInProgress', 'SyncSucceeded', 'SyncFailed', 'DisabledTombstoneCleanup', 'DisabledBackupRestore', 'SyncSucceededWithWarnings', 'SyncCancelling', 'SyncCancelled', 'UnProvisioned', 'Provisioning', 'Provisioned', 'ProvisionFailed', 'DeProvisioning', 'DeProvisioned', 'DeProvisionFailed', 'Reprovisioning', 'ReprovisionFailed', 'UnReprovisioned'
12665	SyncState SyncMemberState `json:"syncState,omitempty"`
12666}
12667
12668// SyncMembersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
12669// operation.
12670type SyncMembersCreateOrUpdateFuture struct {
12671	azure.Future
12672}
12673
12674// Result returns the result of the asynchronous operation.
12675// If the operation has not completed it will return an error.
12676func (future *SyncMembersCreateOrUpdateFuture) Result(client SyncMembersClient) (sm SyncMember, err error) {
12677	var done bool
12678	done, err = future.Done(client)
12679	if err != nil {
12680		err = autorest.NewErrorWithError(err, "sql.SyncMembersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
12681		return
12682	}
12683	if !done {
12684		err = azure.NewAsyncOpIncompleteError("sql.SyncMembersCreateOrUpdateFuture")
12685		return
12686	}
12687	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12688	if sm.Response.Response, err = future.GetResult(sender); err == nil && sm.Response.Response.StatusCode != http.StatusNoContent {
12689		sm, err = client.CreateOrUpdateResponder(sm.Response.Response)
12690		if err != nil {
12691			err = autorest.NewErrorWithError(err, "sql.SyncMembersCreateOrUpdateFuture", "Result", sm.Response.Response, "Failure responding to request")
12692		}
12693	}
12694	return
12695}
12696
12697// SyncMembersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation.
12698type SyncMembersDeleteFuture struct {
12699	azure.Future
12700}
12701
12702// Result returns the result of the asynchronous operation.
12703// If the operation has not completed it will return an error.
12704func (future *SyncMembersDeleteFuture) Result(client SyncMembersClient) (ar autorest.Response, err error) {
12705	var done bool
12706	done, err = future.Done(client)
12707	if err != nil {
12708		err = autorest.NewErrorWithError(err, "sql.SyncMembersDeleteFuture", "Result", future.Response(), "Polling failure")
12709		return
12710	}
12711	if !done {
12712		err = azure.NewAsyncOpIncompleteError("sql.SyncMembersDeleteFuture")
12713		return
12714	}
12715	ar.Response = future.Response()
12716	return
12717}
12718
12719// SyncMembersRefreshMemberSchemaFuture an abstraction for monitoring and retrieving the results of a long-running
12720// operation.
12721type SyncMembersRefreshMemberSchemaFuture struct {
12722	azure.Future
12723}
12724
12725// Result returns the result of the asynchronous operation.
12726// If the operation has not completed it will return an error.
12727func (future *SyncMembersRefreshMemberSchemaFuture) Result(client SyncMembersClient) (ar autorest.Response, err error) {
12728	var done bool
12729	done, err = future.Done(client)
12730	if err != nil {
12731		err = autorest.NewErrorWithError(err, "sql.SyncMembersRefreshMemberSchemaFuture", "Result", future.Response(), "Polling failure")
12732		return
12733	}
12734	if !done {
12735		err = azure.NewAsyncOpIncompleteError("sql.SyncMembersRefreshMemberSchemaFuture")
12736		return
12737	}
12738	ar.Response = future.Response()
12739	return
12740}
12741
12742// SyncMembersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
12743type SyncMembersUpdateFuture struct {
12744	azure.Future
12745}
12746
12747// Result returns the result of the asynchronous operation.
12748// If the operation has not completed it will return an error.
12749func (future *SyncMembersUpdateFuture) Result(client SyncMembersClient) (sm SyncMember, err error) {
12750	var done bool
12751	done, err = future.Done(client)
12752	if err != nil {
12753		err = autorest.NewErrorWithError(err, "sql.SyncMembersUpdateFuture", "Result", future.Response(), "Polling failure")
12754		return
12755	}
12756	if !done {
12757		err = azure.NewAsyncOpIncompleteError("sql.SyncMembersUpdateFuture")
12758		return
12759	}
12760	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12761	if sm.Response.Response, err = future.GetResult(sender); err == nil && sm.Response.Response.StatusCode != http.StatusNoContent {
12762		sm, err = client.UpdateResponder(sm.Response.Response)
12763		if err != nil {
12764			err = autorest.NewErrorWithError(err, "sql.SyncMembersUpdateFuture", "Result", sm.Response.Response, "Failure responding to request")
12765		}
12766	}
12767	return
12768}
12769
12770// TrackedResource ARM tracked top level resource.
12771type TrackedResource struct {
12772	// Location - Resource location.
12773	Location *string `json:"location,omitempty"`
12774	// Tags - Resource tags.
12775	Tags map[string]*string `json:"tags"`
12776	// ID - Resource ID.
12777	ID *string `json:"id,omitempty"`
12778	// Name - Resource name.
12779	Name *string `json:"name,omitempty"`
12780	// Type - Resource type.
12781	Type *string `json:"type,omitempty"`
12782}
12783
12784// MarshalJSON is the custom marshaler for TrackedResource.
12785func (tr TrackedResource) MarshalJSON() ([]byte, error) {
12786	objectMap := make(map[string]interface{})
12787	if tr.Location != nil {
12788		objectMap["location"] = tr.Location
12789	}
12790	if tr.Tags != nil {
12791		objectMap["tags"] = tr.Tags
12792	}
12793	if tr.ID != nil {
12794		objectMap["id"] = tr.ID
12795	}
12796	if tr.Name != nil {
12797		objectMap["name"] = tr.Name
12798	}
12799	if tr.Type != nil {
12800		objectMap["type"] = tr.Type
12801	}
12802	return json.Marshal(objectMap)
12803}
12804
12805// TransparentDataEncryption represents a database transparent data encryption configuration.
12806type TransparentDataEncryption struct {
12807	autorest.Response `json:"-"`
12808	// Location - Resource location.
12809	Location *string `json:"location,omitempty"`
12810	// TransparentDataEncryptionProperties - Represents the properties of the resource.
12811	*TransparentDataEncryptionProperties `json:"properties,omitempty"`
12812	// ID - Resource ID.
12813	ID *string `json:"id,omitempty"`
12814	// Name - Resource name.
12815	Name *string `json:"name,omitempty"`
12816	// Type - Resource type.
12817	Type *string `json:"type,omitempty"`
12818}
12819
12820// MarshalJSON is the custom marshaler for TransparentDataEncryption.
12821func (tde TransparentDataEncryption) MarshalJSON() ([]byte, error) {
12822	objectMap := make(map[string]interface{})
12823	if tde.Location != nil {
12824		objectMap["location"] = tde.Location
12825	}
12826	if tde.TransparentDataEncryptionProperties != nil {
12827		objectMap["properties"] = tde.TransparentDataEncryptionProperties
12828	}
12829	if tde.ID != nil {
12830		objectMap["id"] = tde.ID
12831	}
12832	if tde.Name != nil {
12833		objectMap["name"] = tde.Name
12834	}
12835	if tde.Type != nil {
12836		objectMap["type"] = tde.Type
12837	}
12838	return json.Marshal(objectMap)
12839}
12840
12841// UnmarshalJSON is the custom unmarshaler for TransparentDataEncryption struct.
12842func (tde *TransparentDataEncryption) UnmarshalJSON(body []byte) error {
12843	var m map[string]*json.RawMessage
12844	err := json.Unmarshal(body, &m)
12845	if err != nil {
12846		return err
12847	}
12848	for k, v := range m {
12849		switch k {
12850		case "location":
12851			if v != nil {
12852				var location string
12853				err = json.Unmarshal(*v, &location)
12854				if err != nil {
12855					return err
12856				}
12857				tde.Location = &location
12858			}
12859		case "properties":
12860			if v != nil {
12861				var transparentDataEncryptionProperties TransparentDataEncryptionProperties
12862				err = json.Unmarshal(*v, &transparentDataEncryptionProperties)
12863				if err != nil {
12864					return err
12865				}
12866				tde.TransparentDataEncryptionProperties = &transparentDataEncryptionProperties
12867			}
12868		case "id":
12869			if v != nil {
12870				var ID string
12871				err = json.Unmarshal(*v, &ID)
12872				if err != nil {
12873					return err
12874				}
12875				tde.ID = &ID
12876			}
12877		case "name":
12878			if v != nil {
12879				var name string
12880				err = json.Unmarshal(*v, &name)
12881				if err != nil {
12882					return err
12883				}
12884				tde.Name = &name
12885			}
12886		case "type":
12887			if v != nil {
12888				var typeVar string
12889				err = json.Unmarshal(*v, &typeVar)
12890				if err != nil {
12891					return err
12892				}
12893				tde.Type = &typeVar
12894			}
12895		}
12896	}
12897
12898	return nil
12899}
12900
12901// TransparentDataEncryptionActivity represents a database transparent data encryption Scan.
12902type TransparentDataEncryptionActivity struct {
12903	// Location - Resource location.
12904	Location *string `json:"location,omitempty"`
12905	// TransparentDataEncryptionActivityProperties - Represents the properties of the resource.
12906	*TransparentDataEncryptionActivityProperties `json:"properties,omitempty"`
12907	// ID - Resource ID.
12908	ID *string `json:"id,omitempty"`
12909	// Name - Resource name.
12910	Name *string `json:"name,omitempty"`
12911	// Type - Resource type.
12912	Type *string `json:"type,omitempty"`
12913}
12914
12915// MarshalJSON is the custom marshaler for TransparentDataEncryptionActivity.
12916func (tdea TransparentDataEncryptionActivity) MarshalJSON() ([]byte, error) {
12917	objectMap := make(map[string]interface{})
12918	if tdea.Location != nil {
12919		objectMap["location"] = tdea.Location
12920	}
12921	if tdea.TransparentDataEncryptionActivityProperties != nil {
12922		objectMap["properties"] = tdea.TransparentDataEncryptionActivityProperties
12923	}
12924	if tdea.ID != nil {
12925		objectMap["id"] = tdea.ID
12926	}
12927	if tdea.Name != nil {
12928		objectMap["name"] = tdea.Name
12929	}
12930	if tdea.Type != nil {
12931		objectMap["type"] = tdea.Type
12932	}
12933	return json.Marshal(objectMap)
12934}
12935
12936// UnmarshalJSON is the custom unmarshaler for TransparentDataEncryptionActivity struct.
12937func (tdea *TransparentDataEncryptionActivity) UnmarshalJSON(body []byte) error {
12938	var m map[string]*json.RawMessage
12939	err := json.Unmarshal(body, &m)
12940	if err != nil {
12941		return err
12942	}
12943	for k, v := range m {
12944		switch k {
12945		case "location":
12946			if v != nil {
12947				var location string
12948				err = json.Unmarshal(*v, &location)
12949				if err != nil {
12950					return err
12951				}
12952				tdea.Location = &location
12953			}
12954		case "properties":
12955			if v != nil {
12956				var transparentDataEncryptionActivityProperties TransparentDataEncryptionActivityProperties
12957				err = json.Unmarshal(*v, &transparentDataEncryptionActivityProperties)
12958				if err != nil {
12959					return err
12960				}
12961				tdea.TransparentDataEncryptionActivityProperties = &transparentDataEncryptionActivityProperties
12962			}
12963		case "id":
12964			if v != nil {
12965				var ID string
12966				err = json.Unmarshal(*v, &ID)
12967				if err != nil {
12968					return err
12969				}
12970				tdea.ID = &ID
12971			}
12972		case "name":
12973			if v != nil {
12974				var name string
12975				err = json.Unmarshal(*v, &name)
12976				if err != nil {
12977					return err
12978				}
12979				tdea.Name = &name
12980			}
12981		case "type":
12982			if v != nil {
12983				var typeVar string
12984				err = json.Unmarshal(*v, &typeVar)
12985				if err != nil {
12986					return err
12987				}
12988				tdea.Type = &typeVar
12989			}
12990		}
12991	}
12992
12993	return nil
12994}
12995
12996// TransparentDataEncryptionActivityListResult represents the response to a list database transparent data
12997// encryption activity request.
12998type TransparentDataEncryptionActivityListResult struct {
12999	autorest.Response `json:"-"`
13000	// Value - The list of database transparent data encryption activities.
13001	Value *[]TransparentDataEncryptionActivity `json:"value,omitempty"`
13002}
13003
13004// TransparentDataEncryptionActivityProperties represents the properties of a database transparent data encryption
13005// Scan.
13006type TransparentDataEncryptionActivityProperties struct {
13007	// Status - The status of the database. Possible values include: 'Encrypting', 'Decrypting'
13008	Status TransparentDataEncryptionActivityStatus `json:"status,omitempty"`
13009	// PercentComplete - The percent complete of the transparent data encryption scan for a database.
13010	PercentComplete *float64 `json:"percentComplete,omitempty"`
13011}
13012
13013// TransparentDataEncryptionProperties represents the properties of a database transparent data encryption.
13014type TransparentDataEncryptionProperties struct {
13015	// Status - The status of the database transparent data encryption. Possible values include: 'TransparentDataEncryptionStatusEnabled', 'TransparentDataEncryptionStatusDisabled'
13016	Status TransparentDataEncryptionStatus `json:"status,omitempty"`
13017}
13018
13019// VirtualNetworkRule a virtual network rule.
13020type VirtualNetworkRule struct {
13021	autorest.Response `json:"-"`
13022	// VirtualNetworkRuleProperties - Resource properties.
13023	*VirtualNetworkRuleProperties `json:"properties,omitempty"`
13024	// ID - Resource ID.
13025	ID *string `json:"id,omitempty"`
13026	// Name - Resource name.
13027	Name *string `json:"name,omitempty"`
13028	// Type - Resource type.
13029	Type *string `json:"type,omitempty"`
13030}
13031
13032// MarshalJSON is the custom marshaler for VirtualNetworkRule.
13033func (vnr VirtualNetworkRule) MarshalJSON() ([]byte, error) {
13034	objectMap := make(map[string]interface{})
13035	if vnr.VirtualNetworkRuleProperties != nil {
13036		objectMap["properties"] = vnr.VirtualNetworkRuleProperties
13037	}
13038	if vnr.ID != nil {
13039		objectMap["id"] = vnr.ID
13040	}
13041	if vnr.Name != nil {
13042		objectMap["name"] = vnr.Name
13043	}
13044	if vnr.Type != nil {
13045		objectMap["type"] = vnr.Type
13046	}
13047	return json.Marshal(objectMap)
13048}
13049
13050// UnmarshalJSON is the custom unmarshaler for VirtualNetworkRule struct.
13051func (vnr *VirtualNetworkRule) UnmarshalJSON(body []byte) error {
13052	var m map[string]*json.RawMessage
13053	err := json.Unmarshal(body, &m)
13054	if err != nil {
13055		return err
13056	}
13057	for k, v := range m {
13058		switch k {
13059		case "properties":
13060			if v != nil {
13061				var virtualNetworkRuleProperties VirtualNetworkRuleProperties
13062				err = json.Unmarshal(*v, &virtualNetworkRuleProperties)
13063				if err != nil {
13064					return err
13065				}
13066				vnr.VirtualNetworkRuleProperties = &virtualNetworkRuleProperties
13067			}
13068		case "id":
13069			if v != nil {
13070				var ID string
13071				err = json.Unmarshal(*v, &ID)
13072				if err != nil {
13073					return err
13074				}
13075				vnr.ID = &ID
13076			}
13077		case "name":
13078			if v != nil {
13079				var name string
13080				err = json.Unmarshal(*v, &name)
13081				if err != nil {
13082					return err
13083				}
13084				vnr.Name = &name
13085			}
13086		case "type":
13087			if v != nil {
13088				var typeVar string
13089				err = json.Unmarshal(*v, &typeVar)
13090				if err != nil {
13091					return err
13092				}
13093				vnr.Type = &typeVar
13094			}
13095		}
13096	}
13097
13098	return nil
13099}
13100
13101// VirtualNetworkRuleListResult a list of virtual network rules.
13102type VirtualNetworkRuleListResult struct {
13103	autorest.Response `json:"-"`
13104	// Value - Array of results.
13105	Value *[]VirtualNetworkRule `json:"value,omitempty"`
13106	// NextLink - Link to retrieve next page of results.
13107	NextLink *string `json:"nextLink,omitempty"`
13108}
13109
13110// VirtualNetworkRuleListResultIterator provides access to a complete listing of VirtualNetworkRule values.
13111type VirtualNetworkRuleListResultIterator struct {
13112	i    int
13113	page VirtualNetworkRuleListResultPage
13114}
13115
13116// Next advances to the next value.  If there was an error making
13117// the request the iterator does not advance and the error is returned.
13118func (iter *VirtualNetworkRuleListResultIterator) Next() error {
13119	iter.i++
13120	if iter.i < len(iter.page.Values()) {
13121		return nil
13122	}
13123	err := iter.page.Next()
13124	if err != nil {
13125		iter.i--
13126		return err
13127	}
13128	iter.i = 0
13129	return nil
13130}
13131
13132// NotDone returns true if the enumeration should be started or is not yet complete.
13133func (iter VirtualNetworkRuleListResultIterator) NotDone() bool {
13134	return iter.page.NotDone() && iter.i < len(iter.page.Values())
13135}
13136
13137// Response returns the raw server response from the last page request.
13138func (iter VirtualNetworkRuleListResultIterator) Response() VirtualNetworkRuleListResult {
13139	return iter.page.Response()
13140}
13141
13142// Value returns the current value or a zero-initialized value if the
13143// iterator has advanced beyond the end of the collection.
13144func (iter VirtualNetworkRuleListResultIterator) Value() VirtualNetworkRule {
13145	if !iter.page.NotDone() {
13146		return VirtualNetworkRule{}
13147	}
13148	return iter.page.Values()[iter.i]
13149}
13150
13151// IsEmpty returns true if the ListResult contains no values.
13152func (vnrlr VirtualNetworkRuleListResult) IsEmpty() bool {
13153	return vnrlr.Value == nil || len(*vnrlr.Value) == 0
13154}
13155
13156// virtualNetworkRuleListResultPreparer prepares a request to retrieve the next set of results.
13157// It returns nil if no more results exist.
13158func (vnrlr VirtualNetworkRuleListResult) virtualNetworkRuleListResultPreparer() (*http.Request, error) {
13159	if vnrlr.NextLink == nil || len(to.String(vnrlr.NextLink)) < 1 {
13160		return nil, nil
13161	}
13162	return autorest.Prepare(&http.Request{},
13163		autorest.AsJSON(),
13164		autorest.AsGet(),
13165		autorest.WithBaseURL(to.String(vnrlr.NextLink)))
13166}
13167
13168// VirtualNetworkRuleListResultPage contains a page of VirtualNetworkRule values.
13169type VirtualNetworkRuleListResultPage struct {
13170	fn    func(VirtualNetworkRuleListResult) (VirtualNetworkRuleListResult, error)
13171	vnrlr VirtualNetworkRuleListResult
13172}
13173
13174// Next advances to the next page of values.  If there was an error making
13175// the request the page does not advance and the error is returned.
13176func (page *VirtualNetworkRuleListResultPage) Next() error {
13177	next, err := page.fn(page.vnrlr)
13178	if err != nil {
13179		return err
13180	}
13181	page.vnrlr = next
13182	return nil
13183}
13184
13185// NotDone returns true if the page enumeration should be started or is not yet complete.
13186func (page VirtualNetworkRuleListResultPage) NotDone() bool {
13187	return !page.vnrlr.IsEmpty()
13188}
13189
13190// Response returns the raw server response from the last page request.
13191func (page VirtualNetworkRuleListResultPage) Response() VirtualNetworkRuleListResult {
13192	return page.vnrlr
13193}
13194
13195// Values returns the slice of values for the current page or nil if there are no values.
13196func (page VirtualNetworkRuleListResultPage) Values() []VirtualNetworkRule {
13197	if page.vnrlr.IsEmpty() {
13198		return nil
13199	}
13200	return *page.vnrlr.Value
13201}
13202
13203// VirtualNetworkRuleProperties properties of a virtual network rule.
13204type VirtualNetworkRuleProperties struct {
13205	// VirtualNetworkSubnetID - The ARM resource id of the virtual network subnet.
13206	VirtualNetworkSubnetID *string `json:"virtualNetworkSubnetId,omitempty"`
13207	// IgnoreMissingVnetServiceEndpoint - Create firewall rule before the virtual network has vnet service endpoint enabled.
13208	IgnoreMissingVnetServiceEndpoint *bool `json:"ignoreMissingVnetServiceEndpoint,omitempty"`
13209	// State - Virtual Network Rule State. Possible values include: 'VirtualNetworkRuleStateInitializing', 'VirtualNetworkRuleStateInProgress', 'VirtualNetworkRuleStateReady', 'VirtualNetworkRuleStateDeleting', 'VirtualNetworkRuleStateUnknown'
13210	State VirtualNetworkRuleState `json:"state,omitempty"`
13211}
13212
13213// VirtualNetworkRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
13214// long-running operation.
13215type VirtualNetworkRulesCreateOrUpdateFuture struct {
13216	azure.Future
13217}
13218
13219// Result returns the result of the asynchronous operation.
13220// If the operation has not completed it will return an error.
13221func (future *VirtualNetworkRulesCreateOrUpdateFuture) Result(client VirtualNetworkRulesClient) (vnr VirtualNetworkRule, err error) {
13222	var done bool
13223	done, err = future.Done(client)
13224	if err != nil {
13225		err = autorest.NewErrorWithError(err, "sql.VirtualNetworkRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
13226		return
13227	}
13228	if !done {
13229		err = azure.NewAsyncOpIncompleteError("sql.VirtualNetworkRulesCreateOrUpdateFuture")
13230		return
13231	}
13232	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13233	if vnr.Response.Response, err = future.GetResult(sender); err == nil && vnr.Response.Response.StatusCode != http.StatusNoContent {
13234		vnr, err = client.CreateOrUpdateResponder(vnr.Response.Response)
13235		if err != nil {
13236			err = autorest.NewErrorWithError(err, "sql.VirtualNetworkRulesCreateOrUpdateFuture", "Result", vnr.Response.Response, "Failure responding to request")
13237		}
13238	}
13239	return
13240}
13241
13242// VirtualNetworkRulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
13243// operation.
13244type VirtualNetworkRulesDeleteFuture struct {
13245	azure.Future
13246}
13247
13248// Result returns the result of the asynchronous operation.
13249// If the operation has not completed it will return an error.
13250func (future *VirtualNetworkRulesDeleteFuture) Result(client VirtualNetworkRulesClient) (ar autorest.Response, err error) {
13251	var done bool
13252	done, err = future.Done(client)
13253	if err != nil {
13254		err = autorest.NewErrorWithError(err, "sql.VirtualNetworkRulesDeleteFuture", "Result", future.Response(), "Polling failure")
13255		return
13256	}
13257	if !done {
13258		err = azure.NewAsyncOpIncompleteError("sql.VirtualNetworkRulesDeleteFuture")
13259		return
13260	}
13261	ar.Response = future.Response()
13262	return
13263}
13264
13265// VulnerabilityAssessmentRecurringScansProperties properties of a Vulnerability Assessment recurring scans.
13266type VulnerabilityAssessmentRecurringScansProperties struct {
13267	// IsEnabled - Recurring scans state.
13268	IsEnabled *bool `json:"isEnabled,omitempty"`
13269	// EmailSubscriptionAdmins - Specifies that the schedule scan notification will be is sent to the subscription administrators.
13270	EmailSubscriptionAdmins *bool `json:"emailSubscriptionAdmins,omitempty"`
13271	// Emails - Specifies an array of e-mail addresses to which the scan notification is sent.
13272	Emails *[]string `json:"emails,omitempty"`
13273}
13274