1package sql
2
3// Copyright (c) Microsoft Corporation. All rights reserved.
4// Licensed under the MIT License. See License.txt in the project root for license information.
5//
6// Code generated by Microsoft (R) AutoRest Code Generator.
7// Changes may cause incorrect behavior and will be lost if the code is regenerated.
8
9import (
10	"context"
11	"encoding/json"
12	"github.com/Azure/go-autorest/autorest"
13	"github.com/Azure/go-autorest/autorest/azure"
14	"github.com/Azure/go-autorest/autorest/date"
15	"github.com/Azure/go-autorest/autorest/to"
16	"github.com/Azure/go-autorest/tracing"
17	"github.com/gofrs/uuid"
18	"net/http"
19)
20
21// The package's fully qualified name.
22const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v5.0/sql"
23
24// AdministratorListResult a list of active directory administrators.
25type AdministratorListResult struct {
26	autorest.Response `json:"-"`
27	// Value - READ-ONLY; Array of results.
28	Value *[]ServerAzureADAdministrator `json:"value,omitempty"`
29	// NextLink - READ-ONLY; Link to retrieve next page of results.
30	NextLink *string `json:"nextLink,omitempty"`
31}
32
33// MarshalJSON is the custom marshaler for AdministratorListResult.
34func (alr AdministratorListResult) MarshalJSON() ([]byte, error) {
35	objectMap := make(map[string]interface{})
36	return json.Marshal(objectMap)
37}
38
39// AdministratorListResultIterator provides access to a complete listing of ServerAzureADAdministrator
40// values.
41type AdministratorListResultIterator struct {
42	i    int
43	page AdministratorListResultPage
44}
45
46// NextWithContext advances to the next value.  If there was an error making
47// the request the iterator does not advance and the error is returned.
48func (iter *AdministratorListResultIterator) NextWithContext(ctx context.Context) (err error) {
49	if tracing.IsEnabled() {
50		ctx = tracing.StartSpan(ctx, fqdn+"/AdministratorListResultIterator.NextWithContext")
51		defer func() {
52			sc := -1
53			if iter.Response().Response.Response != nil {
54				sc = iter.Response().Response.Response.StatusCode
55			}
56			tracing.EndSpan(ctx, sc, err)
57		}()
58	}
59	iter.i++
60	if iter.i < len(iter.page.Values()) {
61		return nil
62	}
63	err = iter.page.NextWithContext(ctx)
64	if err != nil {
65		iter.i--
66		return err
67	}
68	iter.i = 0
69	return nil
70}
71
72// Next advances to the next value.  If there was an error making
73// the request the iterator does not advance and the error is returned.
74// Deprecated: Use NextWithContext() instead.
75func (iter *AdministratorListResultIterator) Next() error {
76	return iter.NextWithContext(context.Background())
77}
78
79// NotDone returns true if the enumeration should be started or is not yet complete.
80func (iter AdministratorListResultIterator) NotDone() bool {
81	return iter.page.NotDone() && iter.i < len(iter.page.Values())
82}
83
84// Response returns the raw server response from the last page request.
85func (iter AdministratorListResultIterator) Response() AdministratorListResult {
86	return iter.page.Response()
87}
88
89// Value returns the current value or a zero-initialized value if the
90// iterator has advanced beyond the end of the collection.
91func (iter AdministratorListResultIterator) Value() ServerAzureADAdministrator {
92	if !iter.page.NotDone() {
93		return ServerAzureADAdministrator{}
94	}
95	return iter.page.Values()[iter.i]
96}
97
98// Creates a new instance of the AdministratorListResultIterator type.
99func NewAdministratorListResultIterator(page AdministratorListResultPage) AdministratorListResultIterator {
100	return AdministratorListResultIterator{page: page}
101}
102
103// IsEmpty returns true if the ListResult contains no values.
104func (alr AdministratorListResult) IsEmpty() bool {
105	return alr.Value == nil || len(*alr.Value) == 0
106}
107
108// hasNextLink returns true if the NextLink is not empty.
109func (alr AdministratorListResult) hasNextLink() bool {
110	return alr.NextLink != nil && len(*alr.NextLink) != 0
111}
112
113// administratorListResultPreparer prepares a request to retrieve the next set of results.
114// It returns nil if no more results exist.
115func (alr AdministratorListResult) administratorListResultPreparer(ctx context.Context) (*http.Request, error) {
116	if !alr.hasNextLink() {
117		return nil, nil
118	}
119	return autorest.Prepare((&http.Request{}).WithContext(ctx),
120		autorest.AsJSON(),
121		autorest.AsGet(),
122		autorest.WithBaseURL(to.String(alr.NextLink)))
123}
124
125// AdministratorListResultPage contains a page of ServerAzureADAdministrator values.
126type AdministratorListResultPage struct {
127	fn  func(context.Context, AdministratorListResult) (AdministratorListResult, error)
128	alr AdministratorListResult
129}
130
131// NextWithContext advances to the next page of values.  If there was an error making
132// the request the page does not advance and the error is returned.
133func (page *AdministratorListResultPage) NextWithContext(ctx context.Context) (err error) {
134	if tracing.IsEnabled() {
135		ctx = tracing.StartSpan(ctx, fqdn+"/AdministratorListResultPage.NextWithContext")
136		defer func() {
137			sc := -1
138			if page.Response().Response.Response != nil {
139				sc = page.Response().Response.Response.StatusCode
140			}
141			tracing.EndSpan(ctx, sc, err)
142		}()
143	}
144	for {
145		next, err := page.fn(ctx, page.alr)
146		if err != nil {
147			return err
148		}
149		page.alr = next
150		if !next.hasNextLink() || !next.IsEmpty() {
151			break
152		}
153	}
154	return nil
155}
156
157// Next advances to the next page of values.  If there was an error making
158// the request the page does not advance and the error is returned.
159// Deprecated: Use NextWithContext() instead.
160func (page *AdministratorListResultPage) Next() error {
161	return page.NextWithContext(context.Background())
162}
163
164// NotDone returns true if the page enumeration should be started or is not yet complete.
165func (page AdministratorListResultPage) NotDone() bool {
166	return !page.alr.IsEmpty()
167}
168
169// Response returns the raw server response from the last page request.
170func (page AdministratorListResultPage) Response() AdministratorListResult {
171	return page.alr
172}
173
174// Values returns the slice of values for the current page or nil if there are no values.
175func (page AdministratorListResultPage) Values() []ServerAzureADAdministrator {
176	if page.alr.IsEmpty() {
177		return nil
178	}
179	return *page.alr.Value
180}
181
182// Creates a new instance of the AdministratorListResultPage type.
183func NewAdministratorListResultPage(cur AdministratorListResult, getNextPage func(context.Context, AdministratorListResult) (AdministratorListResult, error)) AdministratorListResultPage {
184	return AdministratorListResultPage{
185		fn:  getNextPage,
186		alr: cur,
187	}
188}
189
190// AdministratorProperties properties of a active directory administrator.
191type AdministratorProperties struct {
192	// AdministratorType - Type of the sever administrator.
193	AdministratorType *string `json:"administratorType,omitempty"`
194	// Login - Login name of the server administrator.
195	Login *string `json:"login,omitempty"`
196	// Sid - SID (object ID) of the server administrator.
197	Sid *uuid.UUID `json:"sid,omitempty"`
198	// TenantID - Tenant ID of the administrator.
199	TenantID *uuid.UUID `json:"tenantId,omitempty"`
200	// AzureADOnlyAuthentication - READ-ONLY; Azure Active Directory only Authentication enabled.
201	AzureADOnlyAuthentication *bool `json:"azureADOnlyAuthentication,omitempty"`
202}
203
204// MarshalJSON is the custom marshaler for AdministratorProperties.
205func (ap AdministratorProperties) MarshalJSON() ([]byte, error) {
206	objectMap := make(map[string]interface{})
207	if ap.AdministratorType != nil {
208		objectMap["administratorType"] = ap.AdministratorType
209	}
210	if ap.Login != nil {
211		objectMap["login"] = ap.Login
212	}
213	if ap.Sid != nil {
214		objectMap["sid"] = ap.Sid
215	}
216	if ap.TenantID != nil {
217		objectMap["tenantId"] = ap.TenantID
218	}
219	return json.Marshal(objectMap)
220}
221
222// Advisor database, Server or Elastic Pool Advisor.
223type Advisor struct {
224	autorest.Response `json:"-"`
225	// Kind - READ-ONLY; Resource kind.
226	Kind *string `json:"kind,omitempty"`
227	// Location - READ-ONLY; Resource location.
228	Location *string `json:"location,omitempty"`
229	// AdvisorProperties - Resource properties.
230	*AdvisorProperties `json:"properties,omitempty"`
231	// ID - READ-ONLY; Resource ID.
232	ID *string `json:"id,omitempty"`
233	// Name - READ-ONLY; Resource name.
234	Name *string `json:"name,omitempty"`
235	// Type - READ-ONLY; Resource type.
236	Type *string `json:"type,omitempty"`
237}
238
239// MarshalJSON is the custom marshaler for Advisor.
240func (a Advisor) MarshalJSON() ([]byte, error) {
241	objectMap := make(map[string]interface{})
242	if a.AdvisorProperties != nil {
243		objectMap["properties"] = a.AdvisorProperties
244	}
245	return json.Marshal(objectMap)
246}
247
248// UnmarshalJSON is the custom unmarshaler for Advisor struct.
249func (a *Advisor) UnmarshalJSON(body []byte) error {
250	var m map[string]*json.RawMessage
251	err := json.Unmarshal(body, &m)
252	if err != nil {
253		return err
254	}
255	for k, v := range m {
256		switch k {
257		case "kind":
258			if v != nil {
259				var kind string
260				err = json.Unmarshal(*v, &kind)
261				if err != nil {
262					return err
263				}
264				a.Kind = &kind
265			}
266		case "location":
267			if v != nil {
268				var location string
269				err = json.Unmarshal(*v, &location)
270				if err != nil {
271					return err
272				}
273				a.Location = &location
274			}
275		case "properties":
276			if v != nil {
277				var advisorProperties AdvisorProperties
278				err = json.Unmarshal(*v, &advisorProperties)
279				if err != nil {
280					return err
281				}
282				a.AdvisorProperties = &advisorProperties
283			}
284		case "id":
285			if v != nil {
286				var ID string
287				err = json.Unmarshal(*v, &ID)
288				if err != nil {
289					return err
290				}
291				a.ID = &ID
292			}
293		case "name":
294			if v != nil {
295				var name string
296				err = json.Unmarshal(*v, &name)
297				if err != nil {
298					return err
299				}
300				a.Name = &name
301			}
302		case "type":
303			if v != nil {
304				var typeVar string
305				err = json.Unmarshal(*v, &typeVar)
306				if err != nil {
307					return err
308				}
309				a.Type = &typeVar
310			}
311		}
312	}
313
314	return nil
315}
316
317// AdvisorProperties properties for a Database, Server or Elastic Pool Advisor.
318type AdvisorProperties struct {
319	// AdvisorStatus - READ-ONLY; Gets the status of availability of this advisor to customers. Possible values are 'GA', 'PublicPreview', 'LimitedPublicPreview' and 'PrivatePreview'. Possible values include: 'AdvisorStatusGA', 'AdvisorStatusPublicPreview', 'AdvisorStatusLimitedPublicPreview', 'AdvisorStatusPrivatePreview'
320	AdvisorStatus AdvisorStatus `json:"advisorStatus,omitempty"`
321	// AutoExecuteStatus - Gets the auto-execute status (whether to let the system execute the recommendations) of this advisor. Possible values are 'Enabled' and 'Disabled'. Possible values include: 'AutoExecuteStatusEnabled', 'AutoExecuteStatusDisabled', 'AutoExecuteStatusDefault'
322	AutoExecuteStatus AutoExecuteStatus `json:"autoExecuteStatus,omitempty"`
323	// AutoExecuteStatusInheritedFrom - READ-ONLY; Gets the resource from which current value of auto-execute status is inherited. Auto-execute status can be set on (and inherited from) different levels in the resource hierarchy. Possible values are 'Subscription', 'Server', 'ElasticPool', 'Database' and 'Default' (when status is not explicitly set on any level). Possible values include: 'AutoExecuteStatusInheritedFromDefault', 'AutoExecuteStatusInheritedFromSubscription', 'AutoExecuteStatusInheritedFromServer', 'AutoExecuteStatusInheritedFromElasticPool', 'AutoExecuteStatusInheritedFromDatabase'
324	AutoExecuteStatusInheritedFrom AutoExecuteStatusInheritedFrom `json:"autoExecuteStatusInheritedFrom,omitempty"`
325	// RecommendationsStatus - READ-ONLY; Gets that status of recommendations for this advisor and reason for not having any recommendations. Possible values include, but are not limited to, 'Ok' (Recommendations available),LowActivity (not enough workload to analyze), 'DbSeemsTuned' (Database is doing well), etc.
326	RecommendationsStatus *string `json:"recommendationsStatus,omitempty"`
327	// LastChecked - READ-ONLY; Gets the time when the current resource was analyzed for recommendations by this advisor.
328	LastChecked *date.Time `json:"lastChecked,omitempty"`
329	// RecommendedActions - READ-ONLY; Gets the recommended actions for this advisor.
330	RecommendedActions *[]RecommendedAction `json:"recommendedActions,omitempty"`
331}
332
333// MarshalJSON is the custom marshaler for AdvisorProperties.
334func (ap AdvisorProperties) MarshalJSON() ([]byte, error) {
335	objectMap := make(map[string]interface{})
336	if ap.AutoExecuteStatus != "" {
337		objectMap["autoExecuteStatus"] = ap.AutoExecuteStatus
338	}
339	return json.Marshal(objectMap)
340}
341
342// AgentConfiguration a recoverable managed database resource.
343type AgentConfiguration struct {
344	autorest.Response `json:"-"`
345	// AgentConfigurationProperties - Resource properties.
346	*AgentConfigurationProperties `json:"properties,omitempty"`
347	// ID - READ-ONLY; Resource ID.
348	ID *string `json:"id,omitempty"`
349	// Name - READ-ONLY; Resource name.
350	Name *string `json:"name,omitempty"`
351	// Type - READ-ONLY; Resource type.
352	Type *string `json:"type,omitempty"`
353}
354
355// MarshalJSON is the custom marshaler for AgentConfiguration.
356func (ac AgentConfiguration) MarshalJSON() ([]byte, error) {
357	objectMap := make(map[string]interface{})
358	if ac.AgentConfigurationProperties != nil {
359		objectMap["properties"] = ac.AgentConfigurationProperties
360	}
361	return json.Marshal(objectMap)
362}
363
364// UnmarshalJSON is the custom unmarshaler for AgentConfiguration struct.
365func (ac *AgentConfiguration) UnmarshalJSON(body []byte) error {
366	var m map[string]*json.RawMessage
367	err := json.Unmarshal(body, &m)
368	if err != nil {
369		return err
370	}
371	for k, v := range m {
372		switch k {
373		case "properties":
374			if v != nil {
375				var agentConfigurationProperties AgentConfigurationProperties
376				err = json.Unmarshal(*v, &agentConfigurationProperties)
377				if err != nil {
378					return err
379				}
380				ac.AgentConfigurationProperties = &agentConfigurationProperties
381			}
382		case "id":
383			if v != nil {
384				var ID string
385				err = json.Unmarshal(*v, &ID)
386				if err != nil {
387					return err
388				}
389				ac.ID = &ID
390			}
391		case "name":
392			if v != nil {
393				var name string
394				err = json.Unmarshal(*v, &name)
395				if err != nil {
396					return err
397				}
398				ac.Name = &name
399			}
400		case "type":
401			if v != nil {
402				var typeVar string
403				err = json.Unmarshal(*v, &typeVar)
404				if err != nil {
405					return err
406				}
407				ac.Type = &typeVar
408			}
409		}
410	}
411
412	return nil
413}
414
415// AgentConfigurationProperties sql agent configuration properties.
416type AgentConfigurationProperties struct {
417	// State - The state of Sql Agent. Possible values include: 'StateEnabled', 'StateDisabled'
418	State State `json:"state,omitempty"`
419}
420
421// AutomaticTuningOptions automatic tuning properties for individual advisors.
422type AutomaticTuningOptions struct {
423	// DesiredState - Automatic tuning option desired state. Possible values include: 'AutomaticTuningOptionModeDesiredOff', 'AutomaticTuningOptionModeDesiredOn', 'AutomaticTuningOptionModeDesiredDefault'
424	DesiredState AutomaticTuningOptionModeDesired `json:"desiredState,omitempty"`
425	// ActualState - READ-ONLY; Automatic tuning option actual state. Possible values include: 'AutomaticTuningOptionModeActualOff', 'AutomaticTuningOptionModeActualOn'
426	ActualState AutomaticTuningOptionModeActual `json:"actualState,omitempty"`
427	// ReasonCode - READ-ONLY; Reason code if desired and actual state are different.
428	ReasonCode *int32 `json:"reasonCode,omitempty"`
429	// ReasonDesc - READ-ONLY; Reason description if desired and actual state are different. Possible values include: 'AutomaticTuningDisabledReasonDefault', 'AutomaticTuningDisabledReasonDisabled', 'AutomaticTuningDisabledReasonAutoConfigured', 'AutomaticTuningDisabledReasonInheritedFromServer', 'AutomaticTuningDisabledReasonQueryStoreOff', 'AutomaticTuningDisabledReasonQueryStoreReadOnly', 'AutomaticTuningDisabledReasonNotSupported'
430	ReasonDesc AutomaticTuningDisabledReason `json:"reasonDesc,omitempty"`
431}
432
433// MarshalJSON is the custom marshaler for AutomaticTuningOptions.
434func (ato AutomaticTuningOptions) MarshalJSON() ([]byte, error) {
435	objectMap := make(map[string]interface{})
436	if ato.DesiredState != "" {
437		objectMap["desiredState"] = ato.DesiredState
438	}
439	return json.Marshal(objectMap)
440}
441
442// AutomaticTuningServerOptions automatic tuning properties for individual advisors.
443type AutomaticTuningServerOptions struct {
444	// DesiredState - Automatic tuning option desired state. Possible values include: 'AutomaticTuningOptionModeDesiredOff', 'AutomaticTuningOptionModeDesiredOn', 'AutomaticTuningOptionModeDesiredDefault'
445	DesiredState AutomaticTuningOptionModeDesired `json:"desiredState,omitempty"`
446	// ActualState - READ-ONLY; Automatic tuning option actual state. Possible values include: 'AutomaticTuningOptionModeActualOff', 'AutomaticTuningOptionModeActualOn'
447	ActualState AutomaticTuningOptionModeActual `json:"actualState,omitempty"`
448	// ReasonCode - READ-ONLY; Reason code if desired and actual state are different.
449	ReasonCode *int32 `json:"reasonCode,omitempty"`
450	// ReasonDesc - READ-ONLY; Reason description if desired and actual state are different. Possible values include: 'AutomaticTuningServerReasonDefault', 'AutomaticTuningServerReasonDisabled', 'AutomaticTuningServerReasonAutoConfigured'
451	ReasonDesc AutomaticTuningServerReason `json:"reasonDesc,omitempty"`
452}
453
454// MarshalJSON is the custom marshaler for AutomaticTuningServerOptions.
455func (atso AutomaticTuningServerOptions) MarshalJSON() ([]byte, error) {
456	objectMap := make(map[string]interface{})
457	if atso.DesiredState != "" {
458		objectMap["desiredState"] = atso.DesiredState
459	}
460	return json.Marshal(objectMap)
461}
462
463// AutomaticTuningServerProperties server-level Automatic Tuning properties.
464type AutomaticTuningServerProperties struct {
465	// DesiredState - Automatic tuning desired state. Possible values include: 'AutomaticTuningServerModeCustom', 'AutomaticTuningServerModeAuto', 'AutomaticTuningServerModeUnspecified'
466	DesiredState AutomaticTuningServerMode `json:"desiredState,omitempty"`
467	// ActualState - READ-ONLY; Automatic tuning actual state. Possible values include: 'AutomaticTuningServerModeCustom', 'AutomaticTuningServerModeAuto', 'AutomaticTuningServerModeUnspecified'
468	ActualState AutomaticTuningServerMode `json:"actualState,omitempty"`
469	// Options - Automatic tuning options definition.
470	Options map[string]*AutomaticTuningServerOptions `json:"options"`
471}
472
473// MarshalJSON is the custom marshaler for AutomaticTuningServerProperties.
474func (atsp AutomaticTuningServerProperties) MarshalJSON() ([]byte, error) {
475	objectMap := make(map[string]interface{})
476	if atsp.DesiredState != "" {
477		objectMap["desiredState"] = atsp.DesiredState
478	}
479	if atsp.Options != nil {
480		objectMap["options"] = atsp.Options
481	}
482	return json.Marshal(objectMap)
483}
484
485// AutoPauseDelayTimeRange supported auto pause delay time range
486type AutoPauseDelayTimeRange struct {
487	// MinValue - READ-ONLY; Minimum value
488	MinValue *int32 `json:"minValue,omitempty"`
489	// MaxValue - READ-ONLY; Maximum value
490	MaxValue *int32 `json:"maxValue,omitempty"`
491	// StepSize - READ-ONLY; Step value for discrete values between the minimum value and the maximum value.
492	StepSize *int32 `json:"stepSize,omitempty"`
493	// Default - READ-ONLY; Default value is no value is provided
494	Default *int32 `json:"default,omitempty"`
495	// Unit - READ-ONLY; Unit of time that delay is expressed in. Possible values include: 'PauseDelayTimeUnitMinutes'
496	Unit PauseDelayTimeUnit `json:"unit,omitempty"`
497	// DoNotPauseValue - READ-ONLY; Value that is used to not pause (infinite delay before pause)
498	DoNotPauseValue *int32 `json:"doNotPauseValue,omitempty"`
499}
500
501// MarshalJSON is the custom marshaler for AutoPauseDelayTimeRange.
502func (apdtr AutoPauseDelayTimeRange) MarshalJSON() ([]byte, error) {
503	objectMap := make(map[string]interface{})
504	return json.Marshal(objectMap)
505}
506
507// AzureADOnlyAuthListResult a list of active directory only authentications.
508type AzureADOnlyAuthListResult struct {
509	autorest.Response `json:"-"`
510	// Value - READ-ONLY; Array of results.
511	Value *[]ServerAzureADOnlyAuthentication `json:"value,omitempty"`
512	// NextLink - READ-ONLY; Link to retrieve next page of results.
513	NextLink *string `json:"nextLink,omitempty"`
514}
515
516// MarshalJSON is the custom marshaler for AzureADOnlyAuthListResult.
517func (aaoalr AzureADOnlyAuthListResult) MarshalJSON() ([]byte, error) {
518	objectMap := make(map[string]interface{})
519	return json.Marshal(objectMap)
520}
521
522// AzureADOnlyAuthListResultIterator provides access to a complete listing of
523// ServerAzureADOnlyAuthentication values.
524type AzureADOnlyAuthListResultIterator struct {
525	i    int
526	page AzureADOnlyAuthListResultPage
527}
528
529// NextWithContext advances to the next value.  If there was an error making
530// the request the iterator does not advance and the error is returned.
531func (iter *AzureADOnlyAuthListResultIterator) NextWithContext(ctx context.Context) (err error) {
532	if tracing.IsEnabled() {
533		ctx = tracing.StartSpan(ctx, fqdn+"/AzureADOnlyAuthListResultIterator.NextWithContext")
534		defer func() {
535			sc := -1
536			if iter.Response().Response.Response != nil {
537				sc = iter.Response().Response.Response.StatusCode
538			}
539			tracing.EndSpan(ctx, sc, err)
540		}()
541	}
542	iter.i++
543	if iter.i < len(iter.page.Values()) {
544		return nil
545	}
546	err = iter.page.NextWithContext(ctx)
547	if err != nil {
548		iter.i--
549		return err
550	}
551	iter.i = 0
552	return nil
553}
554
555// Next advances to the next value.  If there was an error making
556// the request the iterator does not advance and the error is returned.
557// Deprecated: Use NextWithContext() instead.
558func (iter *AzureADOnlyAuthListResultIterator) Next() error {
559	return iter.NextWithContext(context.Background())
560}
561
562// NotDone returns true if the enumeration should be started or is not yet complete.
563func (iter AzureADOnlyAuthListResultIterator) NotDone() bool {
564	return iter.page.NotDone() && iter.i < len(iter.page.Values())
565}
566
567// Response returns the raw server response from the last page request.
568func (iter AzureADOnlyAuthListResultIterator) Response() AzureADOnlyAuthListResult {
569	return iter.page.Response()
570}
571
572// Value returns the current value or a zero-initialized value if the
573// iterator has advanced beyond the end of the collection.
574func (iter AzureADOnlyAuthListResultIterator) Value() ServerAzureADOnlyAuthentication {
575	if !iter.page.NotDone() {
576		return ServerAzureADOnlyAuthentication{}
577	}
578	return iter.page.Values()[iter.i]
579}
580
581// Creates a new instance of the AzureADOnlyAuthListResultIterator type.
582func NewAzureADOnlyAuthListResultIterator(page AzureADOnlyAuthListResultPage) AzureADOnlyAuthListResultIterator {
583	return AzureADOnlyAuthListResultIterator{page: page}
584}
585
586// IsEmpty returns true if the ListResult contains no values.
587func (aaoalr AzureADOnlyAuthListResult) IsEmpty() bool {
588	return aaoalr.Value == nil || len(*aaoalr.Value) == 0
589}
590
591// hasNextLink returns true if the NextLink is not empty.
592func (aaoalr AzureADOnlyAuthListResult) hasNextLink() bool {
593	return aaoalr.NextLink != nil && len(*aaoalr.NextLink) != 0
594}
595
596// azureADOnlyAuthListResultPreparer prepares a request to retrieve the next set of results.
597// It returns nil if no more results exist.
598func (aaoalr AzureADOnlyAuthListResult) azureADOnlyAuthListResultPreparer(ctx context.Context) (*http.Request, error) {
599	if !aaoalr.hasNextLink() {
600		return nil, nil
601	}
602	return autorest.Prepare((&http.Request{}).WithContext(ctx),
603		autorest.AsJSON(),
604		autorest.AsGet(),
605		autorest.WithBaseURL(to.String(aaoalr.NextLink)))
606}
607
608// AzureADOnlyAuthListResultPage contains a page of ServerAzureADOnlyAuthentication values.
609type AzureADOnlyAuthListResultPage struct {
610	fn     func(context.Context, AzureADOnlyAuthListResult) (AzureADOnlyAuthListResult, error)
611	aaoalr AzureADOnlyAuthListResult
612}
613
614// NextWithContext advances to the next page of values.  If there was an error making
615// the request the page does not advance and the error is returned.
616func (page *AzureADOnlyAuthListResultPage) NextWithContext(ctx context.Context) (err error) {
617	if tracing.IsEnabled() {
618		ctx = tracing.StartSpan(ctx, fqdn+"/AzureADOnlyAuthListResultPage.NextWithContext")
619		defer func() {
620			sc := -1
621			if page.Response().Response.Response != nil {
622				sc = page.Response().Response.Response.StatusCode
623			}
624			tracing.EndSpan(ctx, sc, err)
625		}()
626	}
627	for {
628		next, err := page.fn(ctx, page.aaoalr)
629		if err != nil {
630			return err
631		}
632		page.aaoalr = next
633		if !next.hasNextLink() || !next.IsEmpty() {
634			break
635		}
636	}
637	return nil
638}
639
640// Next advances to the next page of values.  If there was an error making
641// the request the page does not advance and the error is returned.
642// Deprecated: Use NextWithContext() instead.
643func (page *AzureADOnlyAuthListResultPage) Next() error {
644	return page.NextWithContext(context.Background())
645}
646
647// NotDone returns true if the page enumeration should be started or is not yet complete.
648func (page AzureADOnlyAuthListResultPage) NotDone() bool {
649	return !page.aaoalr.IsEmpty()
650}
651
652// Response returns the raw server response from the last page request.
653func (page AzureADOnlyAuthListResultPage) Response() AzureADOnlyAuthListResult {
654	return page.aaoalr
655}
656
657// Values returns the slice of values for the current page or nil if there are no values.
658func (page AzureADOnlyAuthListResultPage) Values() []ServerAzureADOnlyAuthentication {
659	if page.aaoalr.IsEmpty() {
660		return nil
661	}
662	return *page.aaoalr.Value
663}
664
665// Creates a new instance of the AzureADOnlyAuthListResultPage type.
666func NewAzureADOnlyAuthListResultPage(cur AzureADOnlyAuthListResult, getNextPage func(context.Context, AzureADOnlyAuthListResult) (AzureADOnlyAuthListResult, error)) AzureADOnlyAuthListResultPage {
667	return AzureADOnlyAuthListResultPage{
668		fn:     getNextPage,
669		aaoalr: cur,
670	}
671}
672
673// AzureADOnlyAuthProperties properties of a active directory only authentication.
674type AzureADOnlyAuthProperties struct {
675	// AzureADOnlyAuthentication - Azure Active Directory only Authentication enabled.
676	AzureADOnlyAuthentication *bool `json:"azureADOnlyAuthentication,omitempty"`
677}
678
679// BackupShortTermRetentionPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the
680// results of a long-running operation.
681type BackupShortTermRetentionPoliciesCreateOrUpdateFuture struct {
682	azure.FutureAPI
683	// Result returns the result of the asynchronous operation.
684	// If the operation has not completed it will return an error.
685	Result func(BackupShortTermRetentionPoliciesClient) (BackupShortTermRetentionPolicy, error)
686}
687
688// UnmarshalJSON is the custom unmarshaller for CreateFuture.
689func (future *BackupShortTermRetentionPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
690	var azFuture azure.Future
691	if err := json.Unmarshal(body, &azFuture); err != nil {
692		return err
693	}
694	future.FutureAPI = &azFuture
695	future.Result = future.result
696	return nil
697}
698
699// result is the default implementation for BackupShortTermRetentionPoliciesCreateOrUpdateFuture.Result.
700func (future *BackupShortTermRetentionPoliciesCreateOrUpdateFuture) result(client BackupShortTermRetentionPoliciesClient) (bstrp BackupShortTermRetentionPolicy, err error) {
701	var done bool
702	done, err = future.DoneWithContext(context.Background(), client)
703	if err != nil {
704		err = autorest.NewErrorWithError(err, "sql.BackupShortTermRetentionPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
705		return
706	}
707	if !done {
708		bstrp.Response.Response = future.Response()
709		err = azure.NewAsyncOpIncompleteError("sql.BackupShortTermRetentionPoliciesCreateOrUpdateFuture")
710		return
711	}
712	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
713	if bstrp.Response.Response, err = future.GetResult(sender); err == nil && bstrp.Response.Response.StatusCode != http.StatusNoContent {
714		bstrp, err = client.CreateOrUpdateResponder(bstrp.Response.Response)
715		if err != nil {
716			err = autorest.NewErrorWithError(err, "sql.BackupShortTermRetentionPoliciesCreateOrUpdateFuture", "Result", bstrp.Response.Response, "Failure responding to request")
717		}
718	}
719	return
720}
721
722// BackupShortTermRetentionPoliciesUpdateFuture an abstraction for monitoring and retrieving the results of
723// a long-running operation.
724type BackupShortTermRetentionPoliciesUpdateFuture struct {
725	azure.FutureAPI
726	// Result returns the result of the asynchronous operation.
727	// If the operation has not completed it will return an error.
728	Result func(BackupShortTermRetentionPoliciesClient) (BackupShortTermRetentionPolicy, error)
729}
730
731// UnmarshalJSON is the custom unmarshaller for CreateFuture.
732func (future *BackupShortTermRetentionPoliciesUpdateFuture) UnmarshalJSON(body []byte) error {
733	var azFuture azure.Future
734	if err := json.Unmarshal(body, &azFuture); err != nil {
735		return err
736	}
737	future.FutureAPI = &azFuture
738	future.Result = future.result
739	return nil
740}
741
742// result is the default implementation for BackupShortTermRetentionPoliciesUpdateFuture.Result.
743func (future *BackupShortTermRetentionPoliciesUpdateFuture) result(client BackupShortTermRetentionPoliciesClient) (bstrp BackupShortTermRetentionPolicy, err error) {
744	var done bool
745	done, err = future.DoneWithContext(context.Background(), client)
746	if err != nil {
747		err = autorest.NewErrorWithError(err, "sql.BackupShortTermRetentionPoliciesUpdateFuture", "Result", future.Response(), "Polling failure")
748		return
749	}
750	if !done {
751		bstrp.Response.Response = future.Response()
752		err = azure.NewAsyncOpIncompleteError("sql.BackupShortTermRetentionPoliciesUpdateFuture")
753		return
754	}
755	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
756	if bstrp.Response.Response, err = future.GetResult(sender); err == nil && bstrp.Response.Response.StatusCode != http.StatusNoContent {
757		bstrp, err = client.UpdateResponder(bstrp.Response.Response)
758		if err != nil {
759			err = autorest.NewErrorWithError(err, "sql.BackupShortTermRetentionPoliciesUpdateFuture", "Result", bstrp.Response.Response, "Failure responding to request")
760		}
761	}
762	return
763}
764
765// BackupShortTermRetentionPolicy a short term retention policy.
766type BackupShortTermRetentionPolicy struct {
767	autorest.Response `json:"-"`
768	// BackupShortTermRetentionPolicyProperties - Resource properties.
769	*BackupShortTermRetentionPolicyProperties `json:"properties,omitempty"`
770	// ID - READ-ONLY; Resource ID.
771	ID *string `json:"id,omitempty"`
772	// Name - READ-ONLY; Resource name.
773	Name *string `json:"name,omitempty"`
774	// Type - READ-ONLY; Resource type.
775	Type *string `json:"type,omitempty"`
776}
777
778// MarshalJSON is the custom marshaler for BackupShortTermRetentionPolicy.
779func (bstrp BackupShortTermRetentionPolicy) MarshalJSON() ([]byte, error) {
780	objectMap := make(map[string]interface{})
781	if bstrp.BackupShortTermRetentionPolicyProperties != nil {
782		objectMap["properties"] = bstrp.BackupShortTermRetentionPolicyProperties
783	}
784	return json.Marshal(objectMap)
785}
786
787// UnmarshalJSON is the custom unmarshaler for BackupShortTermRetentionPolicy struct.
788func (bstrp *BackupShortTermRetentionPolicy) UnmarshalJSON(body []byte) error {
789	var m map[string]*json.RawMessage
790	err := json.Unmarshal(body, &m)
791	if err != nil {
792		return err
793	}
794	for k, v := range m {
795		switch k {
796		case "properties":
797			if v != nil {
798				var backupShortTermRetentionPolicyProperties BackupShortTermRetentionPolicyProperties
799				err = json.Unmarshal(*v, &backupShortTermRetentionPolicyProperties)
800				if err != nil {
801					return err
802				}
803				bstrp.BackupShortTermRetentionPolicyProperties = &backupShortTermRetentionPolicyProperties
804			}
805		case "id":
806			if v != nil {
807				var ID string
808				err = json.Unmarshal(*v, &ID)
809				if err != nil {
810					return err
811				}
812				bstrp.ID = &ID
813			}
814		case "name":
815			if v != nil {
816				var name string
817				err = json.Unmarshal(*v, &name)
818				if err != nil {
819					return err
820				}
821				bstrp.Name = &name
822			}
823		case "type":
824			if v != nil {
825				var typeVar string
826				err = json.Unmarshal(*v, &typeVar)
827				if err != nil {
828					return err
829				}
830				bstrp.Type = &typeVar
831			}
832		}
833	}
834
835	return nil
836}
837
838// BackupShortTermRetentionPolicyListResult a list of short term retention policies.
839type BackupShortTermRetentionPolicyListResult struct {
840	autorest.Response `json:"-"`
841	// Value - READ-ONLY; Array of results.
842	Value *[]BackupShortTermRetentionPolicy `json:"value,omitempty"`
843	// NextLink - READ-ONLY; Link to retrieve next page of results.
844	NextLink *string `json:"nextLink,omitempty"`
845}
846
847// MarshalJSON is the custom marshaler for BackupShortTermRetentionPolicyListResult.
848func (bstrplr BackupShortTermRetentionPolicyListResult) MarshalJSON() ([]byte, error) {
849	objectMap := make(map[string]interface{})
850	return json.Marshal(objectMap)
851}
852
853// BackupShortTermRetentionPolicyListResultIterator provides access to a complete listing of
854// BackupShortTermRetentionPolicy values.
855type BackupShortTermRetentionPolicyListResultIterator struct {
856	i    int
857	page BackupShortTermRetentionPolicyListResultPage
858}
859
860// NextWithContext advances to the next value.  If there was an error making
861// the request the iterator does not advance and the error is returned.
862func (iter *BackupShortTermRetentionPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
863	if tracing.IsEnabled() {
864		ctx = tracing.StartSpan(ctx, fqdn+"/BackupShortTermRetentionPolicyListResultIterator.NextWithContext")
865		defer func() {
866			sc := -1
867			if iter.Response().Response.Response != nil {
868				sc = iter.Response().Response.Response.StatusCode
869			}
870			tracing.EndSpan(ctx, sc, err)
871		}()
872	}
873	iter.i++
874	if iter.i < len(iter.page.Values()) {
875		return nil
876	}
877	err = iter.page.NextWithContext(ctx)
878	if err != nil {
879		iter.i--
880		return err
881	}
882	iter.i = 0
883	return nil
884}
885
886// Next advances to the next value.  If there was an error making
887// the request the iterator does not advance and the error is returned.
888// Deprecated: Use NextWithContext() instead.
889func (iter *BackupShortTermRetentionPolicyListResultIterator) Next() error {
890	return iter.NextWithContext(context.Background())
891}
892
893// NotDone returns true if the enumeration should be started or is not yet complete.
894func (iter BackupShortTermRetentionPolicyListResultIterator) NotDone() bool {
895	return iter.page.NotDone() && iter.i < len(iter.page.Values())
896}
897
898// Response returns the raw server response from the last page request.
899func (iter BackupShortTermRetentionPolicyListResultIterator) Response() BackupShortTermRetentionPolicyListResult {
900	return iter.page.Response()
901}
902
903// Value returns the current value or a zero-initialized value if the
904// iterator has advanced beyond the end of the collection.
905func (iter BackupShortTermRetentionPolicyListResultIterator) Value() BackupShortTermRetentionPolicy {
906	if !iter.page.NotDone() {
907		return BackupShortTermRetentionPolicy{}
908	}
909	return iter.page.Values()[iter.i]
910}
911
912// Creates a new instance of the BackupShortTermRetentionPolicyListResultIterator type.
913func NewBackupShortTermRetentionPolicyListResultIterator(page BackupShortTermRetentionPolicyListResultPage) BackupShortTermRetentionPolicyListResultIterator {
914	return BackupShortTermRetentionPolicyListResultIterator{page: page}
915}
916
917// IsEmpty returns true if the ListResult contains no values.
918func (bstrplr BackupShortTermRetentionPolicyListResult) IsEmpty() bool {
919	return bstrplr.Value == nil || len(*bstrplr.Value) == 0
920}
921
922// hasNextLink returns true if the NextLink is not empty.
923func (bstrplr BackupShortTermRetentionPolicyListResult) hasNextLink() bool {
924	return bstrplr.NextLink != nil && len(*bstrplr.NextLink) != 0
925}
926
927// backupShortTermRetentionPolicyListResultPreparer prepares a request to retrieve the next set of results.
928// It returns nil if no more results exist.
929func (bstrplr BackupShortTermRetentionPolicyListResult) backupShortTermRetentionPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
930	if !bstrplr.hasNextLink() {
931		return nil, nil
932	}
933	return autorest.Prepare((&http.Request{}).WithContext(ctx),
934		autorest.AsJSON(),
935		autorest.AsGet(),
936		autorest.WithBaseURL(to.String(bstrplr.NextLink)))
937}
938
939// BackupShortTermRetentionPolicyListResultPage contains a page of BackupShortTermRetentionPolicy values.
940type BackupShortTermRetentionPolicyListResultPage struct {
941	fn      func(context.Context, BackupShortTermRetentionPolicyListResult) (BackupShortTermRetentionPolicyListResult, error)
942	bstrplr BackupShortTermRetentionPolicyListResult
943}
944
945// NextWithContext advances to the next page of values.  If there was an error making
946// the request the page does not advance and the error is returned.
947func (page *BackupShortTermRetentionPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
948	if tracing.IsEnabled() {
949		ctx = tracing.StartSpan(ctx, fqdn+"/BackupShortTermRetentionPolicyListResultPage.NextWithContext")
950		defer func() {
951			sc := -1
952			if page.Response().Response.Response != nil {
953				sc = page.Response().Response.Response.StatusCode
954			}
955			tracing.EndSpan(ctx, sc, err)
956		}()
957	}
958	for {
959		next, err := page.fn(ctx, page.bstrplr)
960		if err != nil {
961			return err
962		}
963		page.bstrplr = next
964		if !next.hasNextLink() || !next.IsEmpty() {
965			break
966		}
967	}
968	return nil
969}
970
971// Next advances to the next page of values.  If there was an error making
972// the request the page does not advance and the error is returned.
973// Deprecated: Use NextWithContext() instead.
974func (page *BackupShortTermRetentionPolicyListResultPage) Next() error {
975	return page.NextWithContext(context.Background())
976}
977
978// NotDone returns true if the page enumeration should be started or is not yet complete.
979func (page BackupShortTermRetentionPolicyListResultPage) NotDone() bool {
980	return !page.bstrplr.IsEmpty()
981}
982
983// Response returns the raw server response from the last page request.
984func (page BackupShortTermRetentionPolicyListResultPage) Response() BackupShortTermRetentionPolicyListResult {
985	return page.bstrplr
986}
987
988// Values returns the slice of values for the current page or nil if there are no values.
989func (page BackupShortTermRetentionPolicyListResultPage) Values() []BackupShortTermRetentionPolicy {
990	if page.bstrplr.IsEmpty() {
991		return nil
992	}
993	return *page.bstrplr.Value
994}
995
996// Creates a new instance of the BackupShortTermRetentionPolicyListResultPage type.
997func NewBackupShortTermRetentionPolicyListResultPage(cur BackupShortTermRetentionPolicyListResult, getNextPage func(context.Context, BackupShortTermRetentionPolicyListResult) (BackupShortTermRetentionPolicyListResult, error)) BackupShortTermRetentionPolicyListResultPage {
998	return BackupShortTermRetentionPolicyListResultPage{
999		fn:      getNextPage,
1000		bstrplr: cur,
1001	}
1002}
1003
1004// BackupShortTermRetentionPolicyProperties properties of a short term retention policy
1005type BackupShortTermRetentionPolicyProperties struct {
1006	// RetentionDays - The backup retention period in days. This is how many days Point-in-Time Restore will be supported.
1007	RetentionDays *int32 `json:"retentionDays,omitempty"`
1008	// DiffBackupIntervalInHours - The differential backup interval in hours. This is how many interval hours between each differential backup will be supported. This is only applicable to live databases but not dropped databases.
1009	DiffBackupIntervalInHours *int32 `json:"diffBackupIntervalInHours,omitempty"`
1010}
1011
1012// BaseLongTermRetentionPolicyProperties properties of a long term retention policy
1013type BaseLongTermRetentionPolicyProperties struct {
1014	// WeeklyRetention - The weekly retention policy for an LTR backup in an ISO 8601 format.
1015	WeeklyRetention *string `json:"weeklyRetention,omitempty"`
1016	// MonthlyRetention - The monthly retention policy for an LTR backup in an ISO 8601 format.
1017	MonthlyRetention *string `json:"monthlyRetention,omitempty"`
1018	// YearlyRetention - The yearly retention policy for an LTR backup in an ISO 8601 format.
1019	YearlyRetention *string `json:"yearlyRetention,omitempty"`
1020	// WeekOfYear - The week of year to take the yearly backup in an ISO 8601 format.
1021	WeekOfYear *int32 `json:"weekOfYear,omitempty"`
1022}
1023
1024// CheckNameAvailabilityRequest a request to check whether the specified name for a resource is available.
1025type CheckNameAvailabilityRequest struct {
1026	Name *string `json:"name,omitempty"`
1027	Type *string `json:"type,omitempty"`
1028}
1029
1030// CheckNameAvailabilityResponse the result of a name availability check.
1031type CheckNameAvailabilityResponse struct {
1032	autorest.Response `json:"-"`
1033	// Name - READ-ONLY; The name whose availability was checked.
1034	Name *string `json:"name,omitempty"`
1035	// Available - READ-ONLY; True if the name is available, otherwise false.
1036	Available *bool `json:"available,omitempty"`
1037	// Reason - READ-ONLY; The reason code explaining why the name is unavailable. Will be undefined if the name is available. Possible values include: 'CheckNameAvailabilityReasonInvalid', 'CheckNameAvailabilityReasonAlreadyExists'
1038	Reason CheckNameAvailabilityReason `json:"reason,omitempty"`
1039	// Message - READ-ONLY; A message explaining why the name is unavailable. Will be undefined if the name is available.
1040	Message *string `json:"message,omitempty"`
1041}
1042
1043// MarshalJSON is the custom marshaler for CheckNameAvailabilityResponse.
1044func (cnar CheckNameAvailabilityResponse) MarshalJSON() ([]byte, error) {
1045	objectMap := make(map[string]interface{})
1046	return json.Marshal(objectMap)
1047}
1048
1049// CompleteDatabaseRestoreDefinition contains the information necessary to perform a complete database
1050// restore operation.
1051type CompleteDatabaseRestoreDefinition struct {
1052	// LastBackupName - The last backup name to apply
1053	LastBackupName *string `json:"lastBackupName,omitempty"`
1054}
1055
1056// CopyLongTermRetentionBackupParameters contains the information necessary to perform long term retention
1057// backup copy operation.
1058type CopyLongTermRetentionBackupParameters struct {
1059	// CopyLongTermRetentionBackupParametersProperties - Resource properties.
1060	*CopyLongTermRetentionBackupParametersProperties `json:"properties,omitempty"`
1061}
1062
1063// MarshalJSON is the custom marshaler for CopyLongTermRetentionBackupParameters.
1064func (cltrbp CopyLongTermRetentionBackupParameters) MarshalJSON() ([]byte, error) {
1065	objectMap := make(map[string]interface{})
1066	if cltrbp.CopyLongTermRetentionBackupParametersProperties != nil {
1067		objectMap["properties"] = cltrbp.CopyLongTermRetentionBackupParametersProperties
1068	}
1069	return json.Marshal(objectMap)
1070}
1071
1072// UnmarshalJSON is the custom unmarshaler for CopyLongTermRetentionBackupParameters struct.
1073func (cltrbp *CopyLongTermRetentionBackupParameters) UnmarshalJSON(body []byte) error {
1074	var m map[string]*json.RawMessage
1075	err := json.Unmarshal(body, &m)
1076	if err != nil {
1077		return err
1078	}
1079	for k, v := range m {
1080		switch k {
1081		case "properties":
1082			if v != nil {
1083				var copyLongTermRetentionBackupParametersProperties CopyLongTermRetentionBackupParametersProperties
1084				err = json.Unmarshal(*v, &copyLongTermRetentionBackupParametersProperties)
1085				if err != nil {
1086					return err
1087				}
1088				cltrbp.CopyLongTermRetentionBackupParametersProperties = &copyLongTermRetentionBackupParametersProperties
1089			}
1090		}
1091	}
1092
1093	return nil
1094}
1095
1096// CopyLongTermRetentionBackupParametersProperties contains the properties to perform long term retention
1097// backup copy operation.
1098type CopyLongTermRetentionBackupParametersProperties struct {
1099	// TargetSubscriptionID - The subscription that owns the target server
1100	TargetSubscriptionID *string `json:"targetSubscriptionId,omitempty"`
1101	// TargetResourceGroup - The resource group that owns the target server
1102	TargetResourceGroup *string `json:"targetResourceGroup,omitempty"`
1103	// TargetServerResourceID - The resource Id of the target server that owns the database
1104	TargetServerResourceID *string `json:"targetServerResourceId,omitempty"`
1105	// TargetServerFullyQualifiedDomainName - The fully qualified domain name of the target server
1106	TargetServerFullyQualifiedDomainName *string `json:"targetServerFullyQualifiedDomainName,omitempty"`
1107	// TargetDatabaseName - The name of the database owns the copied backup.
1108	TargetDatabaseName *string `json:"targetDatabaseName,omitempty"`
1109	// TargetBackupStorageRedundancy - The storage redundancy type of the copied backup. Possible values include: 'TargetBackupStorageRedundancyGeo', 'TargetBackupStorageRedundancyLocal', 'TargetBackupStorageRedundancyZone'
1110	TargetBackupStorageRedundancy TargetBackupStorageRedundancy `json:"targetBackupStorageRedundancy,omitempty"`
1111}
1112
1113// CreateDatabaseRestorePointDefinition contains the information necessary to perform a create database
1114// restore point operation.
1115type CreateDatabaseRestorePointDefinition struct {
1116	// RestorePointLabel - The restore point label to apply
1117	RestorePointLabel *string `json:"restorePointLabel,omitempty"`
1118}
1119
1120// Database a database resource.
1121type Database struct {
1122	autorest.Response `json:"-"`
1123	// Sku - The database SKU.
1124	//
1125	// The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API or one of the following commands:
1126	//
1127	// ```azurecli
1128	// az sql db list-editions -l <location> -o table
1129	// ````
1130	//
1131	// ```powershell
1132	// Get-AzSqlServerServiceObjective -Location <location>
1133	// ````
1134	Sku *Sku `json:"sku,omitempty"`
1135	// Kind - READ-ONLY; Kind of database. This is metadata used for the Azure portal experience.
1136	Kind *string `json:"kind,omitempty"`
1137	// ManagedBy - READ-ONLY; Resource that manages the database.
1138	ManagedBy *string `json:"managedBy,omitempty"`
1139	// DatabaseProperties - Resource properties.
1140	*DatabaseProperties `json:"properties,omitempty"`
1141	// Location - Resource location.
1142	Location *string `json:"location,omitempty"`
1143	// Tags - Resource tags.
1144	Tags map[string]*string `json:"tags"`
1145	// ID - READ-ONLY; Resource ID.
1146	ID *string `json:"id,omitempty"`
1147	// Name - READ-ONLY; Resource name.
1148	Name *string `json:"name,omitempty"`
1149	// Type - READ-ONLY; Resource type.
1150	Type *string `json:"type,omitempty"`
1151}
1152
1153// MarshalJSON is the custom marshaler for Database.
1154func (d Database) MarshalJSON() ([]byte, error) {
1155	objectMap := make(map[string]interface{})
1156	if d.Sku != nil {
1157		objectMap["sku"] = d.Sku
1158	}
1159	if d.DatabaseProperties != nil {
1160		objectMap["properties"] = d.DatabaseProperties
1161	}
1162	if d.Location != nil {
1163		objectMap["location"] = d.Location
1164	}
1165	if d.Tags != nil {
1166		objectMap["tags"] = d.Tags
1167	}
1168	return json.Marshal(objectMap)
1169}
1170
1171// UnmarshalJSON is the custom unmarshaler for Database struct.
1172func (d *Database) UnmarshalJSON(body []byte) error {
1173	var m map[string]*json.RawMessage
1174	err := json.Unmarshal(body, &m)
1175	if err != nil {
1176		return err
1177	}
1178	for k, v := range m {
1179		switch k {
1180		case "sku":
1181			if v != nil {
1182				var sku Sku
1183				err = json.Unmarshal(*v, &sku)
1184				if err != nil {
1185					return err
1186				}
1187				d.Sku = &sku
1188			}
1189		case "kind":
1190			if v != nil {
1191				var kind string
1192				err = json.Unmarshal(*v, &kind)
1193				if err != nil {
1194					return err
1195				}
1196				d.Kind = &kind
1197			}
1198		case "managedBy":
1199			if v != nil {
1200				var managedBy string
1201				err = json.Unmarshal(*v, &managedBy)
1202				if err != nil {
1203					return err
1204				}
1205				d.ManagedBy = &managedBy
1206			}
1207		case "properties":
1208			if v != nil {
1209				var databaseProperties DatabaseProperties
1210				err = json.Unmarshal(*v, &databaseProperties)
1211				if err != nil {
1212					return err
1213				}
1214				d.DatabaseProperties = &databaseProperties
1215			}
1216		case "location":
1217			if v != nil {
1218				var location string
1219				err = json.Unmarshal(*v, &location)
1220				if err != nil {
1221					return err
1222				}
1223				d.Location = &location
1224			}
1225		case "tags":
1226			if v != nil {
1227				var tags map[string]*string
1228				err = json.Unmarshal(*v, &tags)
1229				if err != nil {
1230					return err
1231				}
1232				d.Tags = tags
1233			}
1234		case "id":
1235			if v != nil {
1236				var ID string
1237				err = json.Unmarshal(*v, &ID)
1238				if err != nil {
1239					return err
1240				}
1241				d.ID = &ID
1242			}
1243		case "name":
1244			if v != nil {
1245				var name string
1246				err = json.Unmarshal(*v, &name)
1247				if err != nil {
1248					return err
1249				}
1250				d.Name = &name
1251			}
1252		case "type":
1253			if v != nil {
1254				var typeVar string
1255				err = json.Unmarshal(*v, &typeVar)
1256				if err != nil {
1257					return err
1258				}
1259				d.Type = &typeVar
1260			}
1261		}
1262	}
1263
1264	return nil
1265}
1266
1267// DatabaseAutomaticTuning database-level Automatic Tuning.
1268type DatabaseAutomaticTuning struct {
1269	autorest.Response `json:"-"`
1270	// DatabaseAutomaticTuningProperties - Resource properties.
1271	*DatabaseAutomaticTuningProperties `json:"properties,omitempty"`
1272	// ID - READ-ONLY; Resource ID.
1273	ID *string `json:"id,omitempty"`
1274	// Name - READ-ONLY; Resource name.
1275	Name *string `json:"name,omitempty"`
1276	// Type - READ-ONLY; Resource type.
1277	Type *string `json:"type,omitempty"`
1278}
1279
1280// MarshalJSON is the custom marshaler for DatabaseAutomaticTuning.
1281func (dat DatabaseAutomaticTuning) MarshalJSON() ([]byte, error) {
1282	objectMap := make(map[string]interface{})
1283	if dat.DatabaseAutomaticTuningProperties != nil {
1284		objectMap["properties"] = dat.DatabaseAutomaticTuningProperties
1285	}
1286	return json.Marshal(objectMap)
1287}
1288
1289// UnmarshalJSON is the custom unmarshaler for DatabaseAutomaticTuning struct.
1290func (dat *DatabaseAutomaticTuning) UnmarshalJSON(body []byte) error {
1291	var m map[string]*json.RawMessage
1292	err := json.Unmarshal(body, &m)
1293	if err != nil {
1294		return err
1295	}
1296	for k, v := range m {
1297		switch k {
1298		case "properties":
1299			if v != nil {
1300				var databaseAutomaticTuningProperties DatabaseAutomaticTuningProperties
1301				err = json.Unmarshal(*v, &databaseAutomaticTuningProperties)
1302				if err != nil {
1303					return err
1304				}
1305				dat.DatabaseAutomaticTuningProperties = &databaseAutomaticTuningProperties
1306			}
1307		case "id":
1308			if v != nil {
1309				var ID string
1310				err = json.Unmarshal(*v, &ID)
1311				if err != nil {
1312					return err
1313				}
1314				dat.ID = &ID
1315			}
1316		case "name":
1317			if v != nil {
1318				var name string
1319				err = json.Unmarshal(*v, &name)
1320				if err != nil {
1321					return err
1322				}
1323				dat.Name = &name
1324			}
1325		case "type":
1326			if v != nil {
1327				var typeVar string
1328				err = json.Unmarshal(*v, &typeVar)
1329				if err != nil {
1330					return err
1331				}
1332				dat.Type = &typeVar
1333			}
1334		}
1335	}
1336
1337	return nil
1338}
1339
1340// DatabaseAutomaticTuningProperties database-level Automatic Tuning properties.
1341type DatabaseAutomaticTuningProperties struct {
1342	// DesiredState - Automatic tuning desired state. Possible values include: 'AutomaticTuningModeInherit', 'AutomaticTuningModeCustom', 'AutomaticTuningModeAuto', 'AutomaticTuningModeUnspecified'
1343	DesiredState AutomaticTuningMode `json:"desiredState,omitempty"`
1344	// ActualState - READ-ONLY; Automatic tuning actual state. Possible values include: 'AutomaticTuningModeInherit', 'AutomaticTuningModeCustom', 'AutomaticTuningModeAuto', 'AutomaticTuningModeUnspecified'
1345	ActualState AutomaticTuningMode `json:"actualState,omitempty"`
1346	// Options - Automatic tuning options definition.
1347	Options map[string]*AutomaticTuningOptions `json:"options"`
1348}
1349
1350// MarshalJSON is the custom marshaler for DatabaseAutomaticTuningProperties.
1351func (datp DatabaseAutomaticTuningProperties) MarshalJSON() ([]byte, error) {
1352	objectMap := make(map[string]interface{})
1353	if datp.DesiredState != "" {
1354		objectMap["desiredState"] = datp.DesiredState
1355	}
1356	if datp.Options != nil {
1357		objectMap["options"] = datp.Options
1358	}
1359	return json.Marshal(objectMap)
1360}
1361
1362// DatabaseBlobAuditingPolicy a database blob auditing policy.
1363type DatabaseBlobAuditingPolicy struct {
1364	autorest.Response `json:"-"`
1365	// Kind - READ-ONLY; Resource kind.
1366	Kind *string `json:"kind,omitempty"`
1367	// DatabaseBlobAuditingPolicyProperties - Resource properties.
1368	*DatabaseBlobAuditingPolicyProperties `json:"properties,omitempty"`
1369	// ID - READ-ONLY; Resource ID.
1370	ID *string `json:"id,omitempty"`
1371	// Name - READ-ONLY; Resource name.
1372	Name *string `json:"name,omitempty"`
1373	// Type - READ-ONLY; Resource type.
1374	Type *string `json:"type,omitempty"`
1375}
1376
1377// MarshalJSON is the custom marshaler for DatabaseBlobAuditingPolicy.
1378func (dbap DatabaseBlobAuditingPolicy) MarshalJSON() ([]byte, error) {
1379	objectMap := make(map[string]interface{})
1380	if dbap.DatabaseBlobAuditingPolicyProperties != nil {
1381		objectMap["properties"] = dbap.DatabaseBlobAuditingPolicyProperties
1382	}
1383	return json.Marshal(objectMap)
1384}
1385
1386// UnmarshalJSON is the custom unmarshaler for DatabaseBlobAuditingPolicy struct.
1387func (dbap *DatabaseBlobAuditingPolicy) UnmarshalJSON(body []byte) error {
1388	var m map[string]*json.RawMessage
1389	err := json.Unmarshal(body, &m)
1390	if err != nil {
1391		return err
1392	}
1393	for k, v := range m {
1394		switch k {
1395		case "kind":
1396			if v != nil {
1397				var kind string
1398				err = json.Unmarshal(*v, &kind)
1399				if err != nil {
1400					return err
1401				}
1402				dbap.Kind = &kind
1403			}
1404		case "properties":
1405			if v != nil {
1406				var databaseBlobAuditingPolicyProperties DatabaseBlobAuditingPolicyProperties
1407				err = json.Unmarshal(*v, &databaseBlobAuditingPolicyProperties)
1408				if err != nil {
1409					return err
1410				}
1411				dbap.DatabaseBlobAuditingPolicyProperties = &databaseBlobAuditingPolicyProperties
1412			}
1413		case "id":
1414			if v != nil {
1415				var ID string
1416				err = json.Unmarshal(*v, &ID)
1417				if err != nil {
1418					return err
1419				}
1420				dbap.ID = &ID
1421			}
1422		case "name":
1423			if v != nil {
1424				var name string
1425				err = json.Unmarshal(*v, &name)
1426				if err != nil {
1427					return err
1428				}
1429				dbap.Name = &name
1430			}
1431		case "type":
1432			if v != nil {
1433				var typeVar string
1434				err = json.Unmarshal(*v, &typeVar)
1435				if err != nil {
1436					return err
1437				}
1438				dbap.Type = &typeVar
1439			}
1440		}
1441	}
1442
1443	return nil
1444}
1445
1446// DatabaseBlobAuditingPolicyListResult a list of database auditing settings.
1447type DatabaseBlobAuditingPolicyListResult struct {
1448	autorest.Response `json:"-"`
1449	// Value - READ-ONLY; Array of results.
1450	Value *[]DatabaseBlobAuditingPolicy `json:"value,omitempty"`
1451	// NextLink - READ-ONLY; Link to retrieve next page of results.
1452	NextLink *string `json:"nextLink,omitempty"`
1453}
1454
1455// MarshalJSON is the custom marshaler for DatabaseBlobAuditingPolicyListResult.
1456func (dbaplr DatabaseBlobAuditingPolicyListResult) MarshalJSON() ([]byte, error) {
1457	objectMap := make(map[string]interface{})
1458	return json.Marshal(objectMap)
1459}
1460
1461// DatabaseBlobAuditingPolicyListResultIterator provides access to a complete listing of
1462// DatabaseBlobAuditingPolicy values.
1463type DatabaseBlobAuditingPolicyListResultIterator struct {
1464	i    int
1465	page DatabaseBlobAuditingPolicyListResultPage
1466}
1467
1468// NextWithContext advances to the next value.  If there was an error making
1469// the request the iterator does not advance and the error is returned.
1470func (iter *DatabaseBlobAuditingPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
1471	if tracing.IsEnabled() {
1472		ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseBlobAuditingPolicyListResultIterator.NextWithContext")
1473		defer func() {
1474			sc := -1
1475			if iter.Response().Response.Response != nil {
1476				sc = iter.Response().Response.Response.StatusCode
1477			}
1478			tracing.EndSpan(ctx, sc, err)
1479		}()
1480	}
1481	iter.i++
1482	if iter.i < len(iter.page.Values()) {
1483		return nil
1484	}
1485	err = iter.page.NextWithContext(ctx)
1486	if err != nil {
1487		iter.i--
1488		return err
1489	}
1490	iter.i = 0
1491	return nil
1492}
1493
1494// Next advances to the next value.  If there was an error making
1495// the request the iterator does not advance and the error is returned.
1496// Deprecated: Use NextWithContext() instead.
1497func (iter *DatabaseBlobAuditingPolicyListResultIterator) Next() error {
1498	return iter.NextWithContext(context.Background())
1499}
1500
1501// NotDone returns true if the enumeration should be started or is not yet complete.
1502func (iter DatabaseBlobAuditingPolicyListResultIterator) NotDone() bool {
1503	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1504}
1505
1506// Response returns the raw server response from the last page request.
1507func (iter DatabaseBlobAuditingPolicyListResultIterator) Response() DatabaseBlobAuditingPolicyListResult {
1508	return iter.page.Response()
1509}
1510
1511// Value returns the current value or a zero-initialized value if the
1512// iterator has advanced beyond the end of the collection.
1513func (iter DatabaseBlobAuditingPolicyListResultIterator) Value() DatabaseBlobAuditingPolicy {
1514	if !iter.page.NotDone() {
1515		return DatabaseBlobAuditingPolicy{}
1516	}
1517	return iter.page.Values()[iter.i]
1518}
1519
1520// Creates a new instance of the DatabaseBlobAuditingPolicyListResultIterator type.
1521func NewDatabaseBlobAuditingPolicyListResultIterator(page DatabaseBlobAuditingPolicyListResultPage) DatabaseBlobAuditingPolicyListResultIterator {
1522	return DatabaseBlobAuditingPolicyListResultIterator{page: page}
1523}
1524
1525// IsEmpty returns true if the ListResult contains no values.
1526func (dbaplr DatabaseBlobAuditingPolicyListResult) IsEmpty() bool {
1527	return dbaplr.Value == nil || len(*dbaplr.Value) == 0
1528}
1529
1530// hasNextLink returns true if the NextLink is not empty.
1531func (dbaplr DatabaseBlobAuditingPolicyListResult) hasNextLink() bool {
1532	return dbaplr.NextLink != nil && len(*dbaplr.NextLink) != 0
1533}
1534
1535// databaseBlobAuditingPolicyListResultPreparer prepares a request to retrieve the next set of results.
1536// It returns nil if no more results exist.
1537func (dbaplr DatabaseBlobAuditingPolicyListResult) databaseBlobAuditingPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
1538	if !dbaplr.hasNextLink() {
1539		return nil, nil
1540	}
1541	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1542		autorest.AsJSON(),
1543		autorest.AsGet(),
1544		autorest.WithBaseURL(to.String(dbaplr.NextLink)))
1545}
1546
1547// DatabaseBlobAuditingPolicyListResultPage contains a page of DatabaseBlobAuditingPolicy values.
1548type DatabaseBlobAuditingPolicyListResultPage struct {
1549	fn     func(context.Context, DatabaseBlobAuditingPolicyListResult) (DatabaseBlobAuditingPolicyListResult, error)
1550	dbaplr DatabaseBlobAuditingPolicyListResult
1551}
1552
1553// NextWithContext advances to the next page of values.  If there was an error making
1554// the request the page does not advance and the error is returned.
1555func (page *DatabaseBlobAuditingPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
1556	if tracing.IsEnabled() {
1557		ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseBlobAuditingPolicyListResultPage.NextWithContext")
1558		defer func() {
1559			sc := -1
1560			if page.Response().Response.Response != nil {
1561				sc = page.Response().Response.Response.StatusCode
1562			}
1563			tracing.EndSpan(ctx, sc, err)
1564		}()
1565	}
1566	for {
1567		next, err := page.fn(ctx, page.dbaplr)
1568		if err != nil {
1569			return err
1570		}
1571		page.dbaplr = next
1572		if !next.hasNextLink() || !next.IsEmpty() {
1573			break
1574		}
1575	}
1576	return nil
1577}
1578
1579// Next advances to the next page of values.  If there was an error making
1580// the request the page does not advance and the error is returned.
1581// Deprecated: Use NextWithContext() instead.
1582func (page *DatabaseBlobAuditingPolicyListResultPage) Next() error {
1583	return page.NextWithContext(context.Background())
1584}
1585
1586// NotDone returns true if the page enumeration should be started or is not yet complete.
1587func (page DatabaseBlobAuditingPolicyListResultPage) NotDone() bool {
1588	return !page.dbaplr.IsEmpty()
1589}
1590
1591// Response returns the raw server response from the last page request.
1592func (page DatabaseBlobAuditingPolicyListResultPage) Response() DatabaseBlobAuditingPolicyListResult {
1593	return page.dbaplr
1594}
1595
1596// Values returns the slice of values for the current page or nil if there are no values.
1597func (page DatabaseBlobAuditingPolicyListResultPage) Values() []DatabaseBlobAuditingPolicy {
1598	if page.dbaplr.IsEmpty() {
1599		return nil
1600	}
1601	return *page.dbaplr.Value
1602}
1603
1604// Creates a new instance of the DatabaseBlobAuditingPolicyListResultPage type.
1605func NewDatabaseBlobAuditingPolicyListResultPage(cur DatabaseBlobAuditingPolicyListResult, getNextPage func(context.Context, DatabaseBlobAuditingPolicyListResult) (DatabaseBlobAuditingPolicyListResult, error)) DatabaseBlobAuditingPolicyListResultPage {
1606	return DatabaseBlobAuditingPolicyListResultPage{
1607		fn:     getNextPage,
1608		dbaplr: cur,
1609	}
1610}
1611
1612// DatabaseBlobAuditingPolicyProperties properties of a database blob auditing policy.
1613type DatabaseBlobAuditingPolicyProperties struct {
1614	// RetentionDays - Specifies the number of days to keep in the audit logs in the storage account.
1615	RetentionDays *int32 `json:"retentionDays,omitempty"`
1616	// AuditActionsAndGroups - Specifies the Actions-Groups and Actions to audit.
1617	//
1618	// 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:
1619	//
1620	// BATCH_COMPLETED_GROUP,
1621	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP,
1622	// FAILED_DATABASE_AUTHENTICATION_GROUP.
1623	//
1624	// This above combination is also the set that is configured by default when enabling auditing from the Azure portal.
1625	//
1626	// 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):
1627	//
1628	// APPLICATION_ROLE_CHANGE_PASSWORD_GROUP
1629	// BACKUP_RESTORE_GROUP
1630	// DATABASE_LOGOUT_GROUP
1631	// DATABASE_OBJECT_CHANGE_GROUP
1632	// DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP
1633	// DATABASE_OBJECT_PERMISSION_CHANGE_GROUP
1634	// DATABASE_OPERATION_GROUP
1635	// DATABASE_PERMISSION_CHANGE_GROUP
1636	// DATABASE_PRINCIPAL_CHANGE_GROUP
1637	// DATABASE_PRINCIPAL_IMPERSONATION_GROUP
1638	// DATABASE_ROLE_MEMBER_CHANGE_GROUP
1639	// FAILED_DATABASE_AUTHENTICATION_GROUP
1640	// SCHEMA_OBJECT_ACCESS_GROUP
1641	// SCHEMA_OBJECT_CHANGE_GROUP
1642	// SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP
1643	// SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP
1644	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP
1645	// USER_CHANGE_PASSWORD_GROUP
1646	// BATCH_STARTED_GROUP
1647	// BATCH_COMPLETED_GROUP
1648	//
1649	// 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.
1650	//
1651	// 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).
1652	//
1653	// 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:
1654	// SELECT
1655	// UPDATE
1656	// INSERT
1657	// DELETE
1658	// EXECUTE
1659	// RECEIVE
1660	// REFERENCES
1661	//
1662	// The general form for defining an action to be audited is:
1663	// {action} ON {object} BY {principal}
1664	//
1665	// 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.
1666	//
1667	// For example:
1668	// SELECT on dbo.myTable by public
1669	// SELECT on DATABASE::myDatabase by public
1670	// SELECT on SCHEMA::mySchema by public
1671	//
1672	// 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)
1673	AuditActionsAndGroups *[]string `json:"auditActionsAndGroups,omitempty"`
1674	// IsStorageSecondaryKeyInUse - Specifies whether storageAccountAccessKey value is the storage's secondary key.
1675	IsStorageSecondaryKeyInUse *bool `json:"isStorageSecondaryKeyInUse,omitempty"`
1676	// IsAzureMonitorTargetEnabled - Specifies whether audit events are sent to Azure Monitor.
1677	// In order to send the events to Azure Monitor, specify 'State' as 'Enabled' and 'IsAzureMonitorTargetEnabled' as true.
1678	//
1679	// When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created.
1680	// Note that for server level audit you should use the 'master' database as {databaseName}.
1681	//
1682	// Diagnostic Settings URI format:
1683	// PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview
1684	//
1685	// For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207)
1686	// or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)
1687	IsAzureMonitorTargetEnabled *bool `json:"isAzureMonitorTargetEnabled,omitempty"`
1688	// QueueDelayMs - Specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed.
1689	// The default minimum value is 1000 (1 second). The maximum is 2,147,483,647.
1690	QueueDelayMs *int32 `json:"queueDelayMs,omitempty"`
1691	// State - Specifies the state of the audit. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. Possible values include: 'BlobAuditingPolicyStateEnabled', 'BlobAuditingPolicyStateDisabled'
1692	State BlobAuditingPolicyState `json:"state,omitempty"`
1693	// StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required.
1694	StorageEndpoint *string `json:"storageEndpoint,omitempty"`
1695	// StorageAccountAccessKey - Specifies the identifier key of the auditing storage account.
1696	// If state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage.
1697	// Prerequisites for using managed identity authentication:
1698	// 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD).
1699	// 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity.
1700	// For more information, see [Auditing to storage using Managed Identity authentication](https://go.microsoft.com/fwlink/?linkid=2114355)
1701	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
1702	// StorageAccountSubscriptionID - Specifies the blob storage subscription Id.
1703	StorageAccountSubscriptionID *uuid.UUID `json:"storageAccountSubscriptionId,omitempty"`
1704}
1705
1706// DatabaseColumn a database column resource.
1707type DatabaseColumn struct {
1708	autorest.Response `json:"-"`
1709	// DatabaseColumnProperties - Resource properties.
1710	*DatabaseColumnProperties `json:"properties,omitempty"`
1711	// ID - READ-ONLY; Resource ID.
1712	ID *string `json:"id,omitempty"`
1713	// Name - READ-ONLY; Resource name.
1714	Name *string `json:"name,omitempty"`
1715	// Type - READ-ONLY; Resource type.
1716	Type *string `json:"type,omitempty"`
1717}
1718
1719// MarshalJSON is the custom marshaler for DatabaseColumn.
1720func (dc DatabaseColumn) MarshalJSON() ([]byte, error) {
1721	objectMap := make(map[string]interface{})
1722	if dc.DatabaseColumnProperties != nil {
1723		objectMap["properties"] = dc.DatabaseColumnProperties
1724	}
1725	return json.Marshal(objectMap)
1726}
1727
1728// UnmarshalJSON is the custom unmarshaler for DatabaseColumn struct.
1729func (dc *DatabaseColumn) UnmarshalJSON(body []byte) error {
1730	var m map[string]*json.RawMessage
1731	err := json.Unmarshal(body, &m)
1732	if err != nil {
1733		return err
1734	}
1735	for k, v := range m {
1736		switch k {
1737		case "properties":
1738			if v != nil {
1739				var databaseColumnProperties DatabaseColumnProperties
1740				err = json.Unmarshal(*v, &databaseColumnProperties)
1741				if err != nil {
1742					return err
1743				}
1744				dc.DatabaseColumnProperties = &databaseColumnProperties
1745			}
1746		case "id":
1747			if v != nil {
1748				var ID string
1749				err = json.Unmarshal(*v, &ID)
1750				if err != nil {
1751					return err
1752				}
1753				dc.ID = &ID
1754			}
1755		case "name":
1756			if v != nil {
1757				var name string
1758				err = json.Unmarshal(*v, &name)
1759				if err != nil {
1760					return err
1761				}
1762				dc.Name = &name
1763			}
1764		case "type":
1765			if v != nil {
1766				var typeVar string
1767				err = json.Unmarshal(*v, &typeVar)
1768				if err != nil {
1769					return err
1770				}
1771				dc.Type = &typeVar
1772			}
1773		}
1774	}
1775
1776	return nil
1777}
1778
1779// DatabaseColumnListResult a list of database columns.
1780type DatabaseColumnListResult struct {
1781	autorest.Response `json:"-"`
1782	// Value - READ-ONLY; Array of results.
1783	Value *[]DatabaseColumn `json:"value,omitempty"`
1784	// NextLink - READ-ONLY; Link to retrieve next page of results.
1785	NextLink *string `json:"nextLink,omitempty"`
1786}
1787
1788// MarshalJSON is the custom marshaler for DatabaseColumnListResult.
1789func (dclr DatabaseColumnListResult) MarshalJSON() ([]byte, error) {
1790	objectMap := make(map[string]interface{})
1791	return json.Marshal(objectMap)
1792}
1793
1794// DatabaseColumnListResultIterator provides access to a complete listing of DatabaseColumn values.
1795type DatabaseColumnListResultIterator struct {
1796	i    int
1797	page DatabaseColumnListResultPage
1798}
1799
1800// NextWithContext advances to the next value.  If there was an error making
1801// the request the iterator does not advance and the error is returned.
1802func (iter *DatabaseColumnListResultIterator) NextWithContext(ctx context.Context) (err error) {
1803	if tracing.IsEnabled() {
1804		ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseColumnListResultIterator.NextWithContext")
1805		defer func() {
1806			sc := -1
1807			if iter.Response().Response.Response != nil {
1808				sc = iter.Response().Response.Response.StatusCode
1809			}
1810			tracing.EndSpan(ctx, sc, err)
1811		}()
1812	}
1813	iter.i++
1814	if iter.i < len(iter.page.Values()) {
1815		return nil
1816	}
1817	err = iter.page.NextWithContext(ctx)
1818	if err != nil {
1819		iter.i--
1820		return err
1821	}
1822	iter.i = 0
1823	return nil
1824}
1825
1826// Next advances to the next value.  If there was an error making
1827// the request the iterator does not advance and the error is returned.
1828// Deprecated: Use NextWithContext() instead.
1829func (iter *DatabaseColumnListResultIterator) Next() error {
1830	return iter.NextWithContext(context.Background())
1831}
1832
1833// NotDone returns true if the enumeration should be started or is not yet complete.
1834func (iter DatabaseColumnListResultIterator) NotDone() bool {
1835	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1836}
1837
1838// Response returns the raw server response from the last page request.
1839func (iter DatabaseColumnListResultIterator) Response() DatabaseColumnListResult {
1840	return iter.page.Response()
1841}
1842
1843// Value returns the current value or a zero-initialized value if the
1844// iterator has advanced beyond the end of the collection.
1845func (iter DatabaseColumnListResultIterator) Value() DatabaseColumn {
1846	if !iter.page.NotDone() {
1847		return DatabaseColumn{}
1848	}
1849	return iter.page.Values()[iter.i]
1850}
1851
1852// Creates a new instance of the DatabaseColumnListResultIterator type.
1853func NewDatabaseColumnListResultIterator(page DatabaseColumnListResultPage) DatabaseColumnListResultIterator {
1854	return DatabaseColumnListResultIterator{page: page}
1855}
1856
1857// IsEmpty returns true if the ListResult contains no values.
1858func (dclr DatabaseColumnListResult) IsEmpty() bool {
1859	return dclr.Value == nil || len(*dclr.Value) == 0
1860}
1861
1862// hasNextLink returns true if the NextLink is not empty.
1863func (dclr DatabaseColumnListResult) hasNextLink() bool {
1864	return dclr.NextLink != nil && len(*dclr.NextLink) != 0
1865}
1866
1867// databaseColumnListResultPreparer prepares a request to retrieve the next set of results.
1868// It returns nil if no more results exist.
1869func (dclr DatabaseColumnListResult) databaseColumnListResultPreparer(ctx context.Context) (*http.Request, error) {
1870	if !dclr.hasNextLink() {
1871		return nil, nil
1872	}
1873	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1874		autorest.AsJSON(),
1875		autorest.AsGet(),
1876		autorest.WithBaseURL(to.String(dclr.NextLink)))
1877}
1878
1879// DatabaseColumnListResultPage contains a page of DatabaseColumn values.
1880type DatabaseColumnListResultPage struct {
1881	fn   func(context.Context, DatabaseColumnListResult) (DatabaseColumnListResult, error)
1882	dclr DatabaseColumnListResult
1883}
1884
1885// NextWithContext advances to the next page of values.  If there was an error making
1886// the request the page does not advance and the error is returned.
1887func (page *DatabaseColumnListResultPage) NextWithContext(ctx context.Context) (err error) {
1888	if tracing.IsEnabled() {
1889		ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseColumnListResultPage.NextWithContext")
1890		defer func() {
1891			sc := -1
1892			if page.Response().Response.Response != nil {
1893				sc = page.Response().Response.Response.StatusCode
1894			}
1895			tracing.EndSpan(ctx, sc, err)
1896		}()
1897	}
1898	for {
1899		next, err := page.fn(ctx, page.dclr)
1900		if err != nil {
1901			return err
1902		}
1903		page.dclr = next
1904		if !next.hasNextLink() || !next.IsEmpty() {
1905			break
1906		}
1907	}
1908	return nil
1909}
1910
1911// Next advances to the next page of values.  If there was an error making
1912// the request the page does not advance and the error is returned.
1913// Deprecated: Use NextWithContext() instead.
1914func (page *DatabaseColumnListResultPage) Next() error {
1915	return page.NextWithContext(context.Background())
1916}
1917
1918// NotDone returns true if the page enumeration should be started or is not yet complete.
1919func (page DatabaseColumnListResultPage) NotDone() bool {
1920	return !page.dclr.IsEmpty()
1921}
1922
1923// Response returns the raw server response from the last page request.
1924func (page DatabaseColumnListResultPage) Response() DatabaseColumnListResult {
1925	return page.dclr
1926}
1927
1928// Values returns the slice of values for the current page or nil if there are no values.
1929func (page DatabaseColumnListResultPage) Values() []DatabaseColumn {
1930	if page.dclr.IsEmpty() {
1931		return nil
1932	}
1933	return *page.dclr.Value
1934}
1935
1936// Creates a new instance of the DatabaseColumnListResultPage type.
1937func NewDatabaseColumnListResultPage(cur DatabaseColumnListResult, getNextPage func(context.Context, DatabaseColumnListResult) (DatabaseColumnListResult, error)) DatabaseColumnListResultPage {
1938	return DatabaseColumnListResultPage{
1939		fn:   getNextPage,
1940		dclr: cur,
1941	}
1942}
1943
1944// DatabaseColumnProperties database column properties.
1945type DatabaseColumnProperties struct {
1946	// ColumnType - The column data type. Possible values include: 'ColumnDataTypeImage', 'ColumnDataTypeText', 'ColumnDataTypeUniqueidentifier', 'ColumnDataTypeDate', 'ColumnDataTypeTime', 'ColumnDataTypeDatetime2', 'ColumnDataTypeDatetimeoffset', 'ColumnDataTypeTinyint', 'ColumnDataTypeSmallint', 'ColumnDataTypeInt', 'ColumnDataTypeSmalldatetime', 'ColumnDataTypeReal', 'ColumnDataTypeMoney', 'ColumnDataTypeDatetime', 'ColumnDataTypeFloat', 'ColumnDataTypeSQLVariant', 'ColumnDataTypeNtext', 'ColumnDataTypeBit', 'ColumnDataTypeDecimal', 'ColumnDataTypeNumeric', 'ColumnDataTypeSmallmoney', 'ColumnDataTypeBigint', 'ColumnDataTypeHierarchyid', 'ColumnDataTypeGeometry', 'ColumnDataTypeGeography', 'ColumnDataTypeVarbinary', 'ColumnDataTypeVarchar', 'ColumnDataTypeBinary', 'ColumnDataTypeChar', 'ColumnDataTypeTimestamp', 'ColumnDataTypeNvarchar', 'ColumnDataTypeNchar', 'ColumnDataTypeXML', 'ColumnDataTypeSysname'
1947	ColumnType ColumnDataType `json:"columnType,omitempty"`
1948	// TemporalType - The table temporal type. Possible values include: 'TableTemporalTypeNonTemporalTable', 'TableTemporalTypeHistoryTable', 'TableTemporalTypeSystemVersionedTemporalTable'
1949	TemporalType TableTemporalType `json:"temporalType,omitempty"`
1950	// MemoryOptimized - Whether or not the column belongs to a memory optimized table.
1951	MemoryOptimized *bool `json:"memoryOptimized,omitempty"`
1952	// IsComputed - Whether or not the column is computed.
1953	IsComputed *bool `json:"isComputed,omitempty"`
1954}
1955
1956// DatabaseExtensions an export managed database operation result resource.
1957type DatabaseExtensions struct {
1958	// DatabaseExtensionsProperties - Resource properties.
1959	*DatabaseExtensionsProperties `json:"properties,omitempty"`
1960	// ID - READ-ONLY; Resource ID.
1961	ID *string `json:"id,omitempty"`
1962	// Name - READ-ONLY; Resource name.
1963	Name *string `json:"name,omitempty"`
1964	// Type - READ-ONLY; Resource type.
1965	Type *string `json:"type,omitempty"`
1966}
1967
1968// MarshalJSON is the custom marshaler for DatabaseExtensions.
1969func (de DatabaseExtensions) MarshalJSON() ([]byte, error) {
1970	objectMap := make(map[string]interface{})
1971	if de.DatabaseExtensionsProperties != nil {
1972		objectMap["properties"] = de.DatabaseExtensionsProperties
1973	}
1974	return json.Marshal(objectMap)
1975}
1976
1977// UnmarshalJSON is the custom unmarshaler for DatabaseExtensions struct.
1978func (de *DatabaseExtensions) UnmarshalJSON(body []byte) error {
1979	var m map[string]*json.RawMessage
1980	err := json.Unmarshal(body, &m)
1981	if err != nil {
1982		return err
1983	}
1984	for k, v := range m {
1985		switch k {
1986		case "properties":
1987			if v != nil {
1988				var databaseExtensionsProperties DatabaseExtensionsProperties
1989				err = json.Unmarshal(*v, &databaseExtensionsProperties)
1990				if err != nil {
1991					return err
1992				}
1993				de.DatabaseExtensionsProperties = &databaseExtensionsProperties
1994			}
1995		case "id":
1996			if v != nil {
1997				var ID string
1998				err = json.Unmarshal(*v, &ID)
1999				if err != nil {
2000					return err
2001				}
2002				de.ID = &ID
2003			}
2004		case "name":
2005			if v != nil {
2006				var name string
2007				err = json.Unmarshal(*v, &name)
2008				if err != nil {
2009					return err
2010				}
2011				de.Name = &name
2012			}
2013		case "type":
2014			if v != nil {
2015				var typeVar string
2016				err = json.Unmarshal(*v, &typeVar)
2017				if err != nil {
2018					return err
2019				}
2020				de.Type = &typeVar
2021			}
2022		}
2023	}
2024
2025	return nil
2026}
2027
2028// DatabaseExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
2029// long-running operation.
2030type DatabaseExtensionsCreateOrUpdateFuture struct {
2031	azure.FutureAPI
2032	// Result returns the result of the asynchronous operation.
2033	// If the operation has not completed it will return an error.
2034	Result func(DatabaseExtensionsClient) (ImportExportExtensionsOperationResult, error)
2035}
2036
2037// UnmarshalJSON is the custom unmarshaller for CreateFuture.
2038func (future *DatabaseExtensionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
2039	var azFuture azure.Future
2040	if err := json.Unmarshal(body, &azFuture); err != nil {
2041		return err
2042	}
2043	future.FutureAPI = &azFuture
2044	future.Result = future.result
2045	return nil
2046}
2047
2048// result is the default implementation for DatabaseExtensionsCreateOrUpdateFuture.Result.
2049func (future *DatabaseExtensionsCreateOrUpdateFuture) result(client DatabaseExtensionsClient) (ieeor ImportExportExtensionsOperationResult, err error) {
2050	var done bool
2051	done, err = future.DoneWithContext(context.Background(), client)
2052	if err != nil {
2053		err = autorest.NewErrorWithError(err, "sql.DatabaseExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
2054		return
2055	}
2056	if !done {
2057		ieeor.Response.Response = future.Response()
2058		err = azure.NewAsyncOpIncompleteError("sql.DatabaseExtensionsCreateOrUpdateFuture")
2059		return
2060	}
2061	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2062	if ieeor.Response.Response, err = future.GetResult(sender); err == nil && ieeor.Response.Response.StatusCode != http.StatusNoContent {
2063		ieeor, err = client.CreateOrUpdateResponder(ieeor.Response.Response)
2064		if err != nil {
2065			err = autorest.NewErrorWithError(err, "sql.DatabaseExtensionsCreateOrUpdateFuture", "Result", ieeor.Response.Response, "Failure responding to request")
2066		}
2067	}
2068	return
2069}
2070
2071// DatabaseExtensionsProperties contains the database information after successful export.
2072type DatabaseExtensionsProperties struct {
2073	// OperationMode - Operation Mode.
2074	OperationMode *string `json:"operationMode,omitempty"`
2075	// StorageKeyType - Storage key type. Possible values include: 'StorageKeyTypeSharedAccessKey', 'StorageKeyTypeStorageAccessKey'
2076	StorageKeyType StorageKeyType `json:"storageKeyType,omitempty"`
2077	// StorageKey - Storage key.
2078	StorageKey *string `json:"storageKey,omitempty"`
2079	// StorageURI - Storage Uri.
2080	StorageURI *string `json:"storageUri,omitempty"`
2081}
2082
2083// DatabaseListResult a list of databases.
2084type DatabaseListResult struct {
2085	autorest.Response `json:"-"`
2086	// Value - READ-ONLY; Array of results.
2087	Value *[]Database `json:"value,omitempty"`
2088	// NextLink - READ-ONLY; Link to retrieve next page of results.
2089	NextLink *string `json:"nextLink,omitempty"`
2090}
2091
2092// MarshalJSON is the custom marshaler for DatabaseListResult.
2093func (dlr DatabaseListResult) MarshalJSON() ([]byte, error) {
2094	objectMap := make(map[string]interface{})
2095	return json.Marshal(objectMap)
2096}
2097
2098// DatabaseListResultIterator provides access to a complete listing of Database values.
2099type DatabaseListResultIterator struct {
2100	i    int
2101	page DatabaseListResultPage
2102}
2103
2104// NextWithContext advances to the next value.  If there was an error making
2105// the request the iterator does not advance and the error is returned.
2106func (iter *DatabaseListResultIterator) NextWithContext(ctx context.Context) (err error) {
2107	if tracing.IsEnabled() {
2108		ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseListResultIterator.NextWithContext")
2109		defer func() {
2110			sc := -1
2111			if iter.Response().Response.Response != nil {
2112				sc = iter.Response().Response.Response.StatusCode
2113			}
2114			tracing.EndSpan(ctx, sc, err)
2115		}()
2116	}
2117	iter.i++
2118	if iter.i < len(iter.page.Values()) {
2119		return nil
2120	}
2121	err = iter.page.NextWithContext(ctx)
2122	if err != nil {
2123		iter.i--
2124		return err
2125	}
2126	iter.i = 0
2127	return nil
2128}
2129
2130// Next advances to the next value.  If there was an error making
2131// the request the iterator does not advance and the error is returned.
2132// Deprecated: Use NextWithContext() instead.
2133func (iter *DatabaseListResultIterator) Next() error {
2134	return iter.NextWithContext(context.Background())
2135}
2136
2137// NotDone returns true if the enumeration should be started or is not yet complete.
2138func (iter DatabaseListResultIterator) NotDone() bool {
2139	return iter.page.NotDone() && iter.i < len(iter.page.Values())
2140}
2141
2142// Response returns the raw server response from the last page request.
2143func (iter DatabaseListResultIterator) Response() DatabaseListResult {
2144	return iter.page.Response()
2145}
2146
2147// Value returns the current value or a zero-initialized value if the
2148// iterator has advanced beyond the end of the collection.
2149func (iter DatabaseListResultIterator) Value() Database {
2150	if !iter.page.NotDone() {
2151		return Database{}
2152	}
2153	return iter.page.Values()[iter.i]
2154}
2155
2156// Creates a new instance of the DatabaseListResultIterator type.
2157func NewDatabaseListResultIterator(page DatabaseListResultPage) DatabaseListResultIterator {
2158	return DatabaseListResultIterator{page: page}
2159}
2160
2161// IsEmpty returns true if the ListResult contains no values.
2162func (dlr DatabaseListResult) IsEmpty() bool {
2163	return dlr.Value == nil || len(*dlr.Value) == 0
2164}
2165
2166// hasNextLink returns true if the NextLink is not empty.
2167func (dlr DatabaseListResult) hasNextLink() bool {
2168	return dlr.NextLink != nil && len(*dlr.NextLink) != 0
2169}
2170
2171// databaseListResultPreparer prepares a request to retrieve the next set of results.
2172// It returns nil if no more results exist.
2173func (dlr DatabaseListResult) databaseListResultPreparer(ctx context.Context) (*http.Request, error) {
2174	if !dlr.hasNextLink() {
2175		return nil, nil
2176	}
2177	return autorest.Prepare((&http.Request{}).WithContext(ctx),
2178		autorest.AsJSON(),
2179		autorest.AsGet(),
2180		autorest.WithBaseURL(to.String(dlr.NextLink)))
2181}
2182
2183// DatabaseListResultPage contains a page of Database values.
2184type DatabaseListResultPage struct {
2185	fn  func(context.Context, DatabaseListResult) (DatabaseListResult, error)
2186	dlr DatabaseListResult
2187}
2188
2189// NextWithContext advances to the next page of values.  If there was an error making
2190// the request the page does not advance and the error is returned.
2191func (page *DatabaseListResultPage) NextWithContext(ctx context.Context) (err error) {
2192	if tracing.IsEnabled() {
2193		ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseListResultPage.NextWithContext")
2194		defer func() {
2195			sc := -1
2196			if page.Response().Response.Response != nil {
2197				sc = page.Response().Response.Response.StatusCode
2198			}
2199			tracing.EndSpan(ctx, sc, err)
2200		}()
2201	}
2202	for {
2203		next, err := page.fn(ctx, page.dlr)
2204		if err != nil {
2205			return err
2206		}
2207		page.dlr = next
2208		if !next.hasNextLink() || !next.IsEmpty() {
2209			break
2210		}
2211	}
2212	return nil
2213}
2214
2215// Next advances to the next page of values.  If there was an error making
2216// the request the page does not advance and the error is returned.
2217// Deprecated: Use NextWithContext() instead.
2218func (page *DatabaseListResultPage) Next() error {
2219	return page.NextWithContext(context.Background())
2220}
2221
2222// NotDone returns true if the page enumeration should be started or is not yet complete.
2223func (page DatabaseListResultPage) NotDone() bool {
2224	return !page.dlr.IsEmpty()
2225}
2226
2227// Response returns the raw server response from the last page request.
2228func (page DatabaseListResultPage) Response() DatabaseListResult {
2229	return page.dlr
2230}
2231
2232// Values returns the slice of values for the current page or nil if there are no values.
2233func (page DatabaseListResultPage) Values() []Database {
2234	if page.dlr.IsEmpty() {
2235		return nil
2236	}
2237	return *page.dlr.Value
2238}
2239
2240// Creates a new instance of the DatabaseListResultPage type.
2241func NewDatabaseListResultPage(cur DatabaseListResult, getNextPage func(context.Context, DatabaseListResult) (DatabaseListResult, error)) DatabaseListResultPage {
2242	return DatabaseListResultPage{
2243		fn:  getNextPage,
2244		dlr: cur,
2245	}
2246}
2247
2248// DatabaseOperation a database operation.
2249type DatabaseOperation struct {
2250	// DatabaseOperationProperties - Resource properties.
2251	*DatabaseOperationProperties `json:"properties,omitempty"`
2252	// ID - READ-ONLY; Resource ID.
2253	ID *string `json:"id,omitempty"`
2254	// Name - READ-ONLY; Resource name.
2255	Name *string `json:"name,omitempty"`
2256	// Type - READ-ONLY; Resource type.
2257	Type *string `json:"type,omitempty"`
2258}
2259
2260// MarshalJSON is the custom marshaler for DatabaseOperation.
2261func (do DatabaseOperation) MarshalJSON() ([]byte, error) {
2262	objectMap := make(map[string]interface{})
2263	if do.DatabaseOperationProperties != nil {
2264		objectMap["properties"] = do.DatabaseOperationProperties
2265	}
2266	return json.Marshal(objectMap)
2267}
2268
2269// UnmarshalJSON is the custom unmarshaler for DatabaseOperation struct.
2270func (do *DatabaseOperation) UnmarshalJSON(body []byte) error {
2271	var m map[string]*json.RawMessage
2272	err := json.Unmarshal(body, &m)
2273	if err != nil {
2274		return err
2275	}
2276	for k, v := range m {
2277		switch k {
2278		case "properties":
2279			if v != nil {
2280				var databaseOperationProperties DatabaseOperationProperties
2281				err = json.Unmarshal(*v, &databaseOperationProperties)
2282				if err != nil {
2283					return err
2284				}
2285				do.DatabaseOperationProperties = &databaseOperationProperties
2286			}
2287		case "id":
2288			if v != nil {
2289				var ID string
2290				err = json.Unmarshal(*v, &ID)
2291				if err != nil {
2292					return err
2293				}
2294				do.ID = &ID
2295			}
2296		case "name":
2297			if v != nil {
2298				var name string
2299				err = json.Unmarshal(*v, &name)
2300				if err != nil {
2301					return err
2302				}
2303				do.Name = &name
2304			}
2305		case "type":
2306			if v != nil {
2307				var typeVar string
2308				err = json.Unmarshal(*v, &typeVar)
2309				if err != nil {
2310					return err
2311				}
2312				do.Type = &typeVar
2313			}
2314		}
2315	}
2316
2317	return nil
2318}
2319
2320// DatabaseOperationListResult the response to a list database operations request
2321type DatabaseOperationListResult struct {
2322	autorest.Response `json:"-"`
2323	// Value - READ-ONLY; Array of results.
2324	Value *[]DatabaseOperation `json:"value,omitempty"`
2325	// NextLink - READ-ONLY; Link to retrieve next page of results.
2326	NextLink *string `json:"nextLink,omitempty"`
2327}
2328
2329// MarshalJSON is the custom marshaler for DatabaseOperationListResult.
2330func (dolr DatabaseOperationListResult) MarshalJSON() ([]byte, error) {
2331	objectMap := make(map[string]interface{})
2332	return json.Marshal(objectMap)
2333}
2334
2335// DatabaseOperationListResultIterator provides access to a complete listing of DatabaseOperation values.
2336type DatabaseOperationListResultIterator struct {
2337	i    int
2338	page DatabaseOperationListResultPage
2339}
2340
2341// NextWithContext advances to the next value.  If there was an error making
2342// the request the iterator does not advance and the error is returned.
2343func (iter *DatabaseOperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
2344	if tracing.IsEnabled() {
2345		ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseOperationListResultIterator.NextWithContext")
2346		defer func() {
2347			sc := -1
2348			if iter.Response().Response.Response != nil {
2349				sc = iter.Response().Response.Response.StatusCode
2350			}
2351			tracing.EndSpan(ctx, sc, err)
2352		}()
2353	}
2354	iter.i++
2355	if iter.i < len(iter.page.Values()) {
2356		return nil
2357	}
2358	err = iter.page.NextWithContext(ctx)
2359	if err != nil {
2360		iter.i--
2361		return err
2362	}
2363	iter.i = 0
2364	return nil
2365}
2366
2367// Next advances to the next value.  If there was an error making
2368// the request the iterator does not advance and the error is returned.
2369// Deprecated: Use NextWithContext() instead.
2370func (iter *DatabaseOperationListResultIterator) Next() error {
2371	return iter.NextWithContext(context.Background())
2372}
2373
2374// NotDone returns true if the enumeration should be started or is not yet complete.
2375func (iter DatabaseOperationListResultIterator) NotDone() bool {
2376	return iter.page.NotDone() && iter.i < len(iter.page.Values())
2377}
2378
2379// Response returns the raw server response from the last page request.
2380func (iter DatabaseOperationListResultIterator) Response() DatabaseOperationListResult {
2381	return iter.page.Response()
2382}
2383
2384// Value returns the current value or a zero-initialized value if the
2385// iterator has advanced beyond the end of the collection.
2386func (iter DatabaseOperationListResultIterator) Value() DatabaseOperation {
2387	if !iter.page.NotDone() {
2388		return DatabaseOperation{}
2389	}
2390	return iter.page.Values()[iter.i]
2391}
2392
2393// Creates a new instance of the DatabaseOperationListResultIterator type.
2394func NewDatabaseOperationListResultIterator(page DatabaseOperationListResultPage) DatabaseOperationListResultIterator {
2395	return DatabaseOperationListResultIterator{page: page}
2396}
2397
2398// IsEmpty returns true if the ListResult contains no values.
2399func (dolr DatabaseOperationListResult) IsEmpty() bool {
2400	return dolr.Value == nil || len(*dolr.Value) == 0
2401}
2402
2403// hasNextLink returns true if the NextLink is not empty.
2404func (dolr DatabaseOperationListResult) hasNextLink() bool {
2405	return dolr.NextLink != nil && len(*dolr.NextLink) != 0
2406}
2407
2408// databaseOperationListResultPreparer prepares a request to retrieve the next set of results.
2409// It returns nil if no more results exist.
2410func (dolr DatabaseOperationListResult) databaseOperationListResultPreparer(ctx context.Context) (*http.Request, error) {
2411	if !dolr.hasNextLink() {
2412		return nil, nil
2413	}
2414	return autorest.Prepare((&http.Request{}).WithContext(ctx),
2415		autorest.AsJSON(),
2416		autorest.AsGet(),
2417		autorest.WithBaseURL(to.String(dolr.NextLink)))
2418}
2419
2420// DatabaseOperationListResultPage contains a page of DatabaseOperation values.
2421type DatabaseOperationListResultPage struct {
2422	fn   func(context.Context, DatabaseOperationListResult) (DatabaseOperationListResult, error)
2423	dolr DatabaseOperationListResult
2424}
2425
2426// NextWithContext advances to the next page of values.  If there was an error making
2427// the request the page does not advance and the error is returned.
2428func (page *DatabaseOperationListResultPage) NextWithContext(ctx context.Context) (err error) {
2429	if tracing.IsEnabled() {
2430		ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseOperationListResultPage.NextWithContext")
2431		defer func() {
2432			sc := -1
2433			if page.Response().Response.Response != nil {
2434				sc = page.Response().Response.Response.StatusCode
2435			}
2436			tracing.EndSpan(ctx, sc, err)
2437		}()
2438	}
2439	for {
2440		next, err := page.fn(ctx, page.dolr)
2441		if err != nil {
2442			return err
2443		}
2444		page.dolr = next
2445		if !next.hasNextLink() || !next.IsEmpty() {
2446			break
2447		}
2448	}
2449	return nil
2450}
2451
2452// Next advances to the next page of values.  If there was an error making
2453// the request the page does not advance and the error is returned.
2454// Deprecated: Use NextWithContext() instead.
2455func (page *DatabaseOperationListResultPage) Next() error {
2456	return page.NextWithContext(context.Background())
2457}
2458
2459// NotDone returns true if the page enumeration should be started or is not yet complete.
2460func (page DatabaseOperationListResultPage) NotDone() bool {
2461	return !page.dolr.IsEmpty()
2462}
2463
2464// Response returns the raw server response from the last page request.
2465func (page DatabaseOperationListResultPage) Response() DatabaseOperationListResult {
2466	return page.dolr
2467}
2468
2469// Values returns the slice of values for the current page or nil if there are no values.
2470func (page DatabaseOperationListResultPage) Values() []DatabaseOperation {
2471	if page.dolr.IsEmpty() {
2472		return nil
2473	}
2474	return *page.dolr.Value
2475}
2476
2477// Creates a new instance of the DatabaseOperationListResultPage type.
2478func NewDatabaseOperationListResultPage(cur DatabaseOperationListResult, getNextPage func(context.Context, DatabaseOperationListResult) (DatabaseOperationListResult, error)) DatabaseOperationListResultPage {
2479	return DatabaseOperationListResultPage{
2480		fn:   getNextPage,
2481		dolr: cur,
2482	}
2483}
2484
2485// DatabaseOperationProperties the properties of a database operation.
2486type DatabaseOperationProperties struct {
2487	// DatabaseName - READ-ONLY; The name of the database the operation is being performed on.
2488	DatabaseName *string `json:"databaseName,omitempty"`
2489	// Operation - READ-ONLY; The name of operation.
2490	Operation *string `json:"operation,omitempty"`
2491	// OperationFriendlyName - READ-ONLY; The friendly name of operation.
2492	OperationFriendlyName *string `json:"operationFriendlyName,omitempty"`
2493	// PercentComplete - READ-ONLY; The percentage of the operation completed.
2494	PercentComplete *int32 `json:"percentComplete,omitempty"`
2495	// ServerName - READ-ONLY; The name of the server.
2496	ServerName *string `json:"serverName,omitempty"`
2497	// StartTime - READ-ONLY; The operation start time.
2498	StartTime *date.Time `json:"startTime,omitempty"`
2499	// State - READ-ONLY; The operation state. Possible values include: 'ManagementOperationStatePending', 'ManagementOperationStateInProgress', 'ManagementOperationStateSucceeded', 'ManagementOperationStateFailed', 'ManagementOperationStateCancelInProgress', 'ManagementOperationStateCancelled'
2500	State ManagementOperationState `json:"state,omitempty"`
2501	// ErrorCode - READ-ONLY; The operation error code.
2502	ErrorCode *int32 `json:"errorCode,omitempty"`
2503	// ErrorDescription - READ-ONLY; The operation error description.
2504	ErrorDescription *string `json:"errorDescription,omitempty"`
2505	// ErrorSeverity - READ-ONLY; The operation error severity.
2506	ErrorSeverity *int32 `json:"errorSeverity,omitempty"`
2507	// IsUserError - READ-ONLY; Whether or not the error is a user error.
2508	IsUserError *bool `json:"isUserError,omitempty"`
2509	// EstimatedCompletionTime - READ-ONLY; The estimated completion time of the operation.
2510	EstimatedCompletionTime *date.Time `json:"estimatedCompletionTime,omitempty"`
2511	// Description - READ-ONLY; The operation description.
2512	Description *string `json:"description,omitempty"`
2513	// IsCancellable - READ-ONLY; Whether the operation can be cancelled.
2514	IsCancellable *bool `json:"isCancellable,omitempty"`
2515}
2516
2517// MarshalJSON is the custom marshaler for DatabaseOperationProperties.
2518func (dop DatabaseOperationProperties) MarshalJSON() ([]byte, error) {
2519	objectMap := make(map[string]interface{})
2520	return json.Marshal(objectMap)
2521}
2522
2523// DatabaseProperties the database's properties.
2524type DatabaseProperties struct {
2525	// CreateMode - Specifies the mode of database creation.
2526	//
2527	// Default: regular database creation.
2528	//
2529	// Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified as the resource ID of the source database.
2530	//
2531	// Secondary: creates a database as a secondary replica of an existing database. sourceDatabaseId must be specified as the resource ID of the existing primary database.
2532	//
2533	// 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.
2534	//
2535	// Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be specified as the recoverable database resource ID to restore.
2536	//
2537	// 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.
2538	//
2539	// RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention vault. recoveryServicesRecoveryPointResourceId must be specified as the recovery point resource ID.
2540	//
2541	// Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. Possible values include: 'CreateModeDefault', 'CreateModeCopy', 'CreateModeSecondary', 'CreateModePointInTimeRestore', 'CreateModeRestore', 'CreateModeRecovery', 'CreateModeRestoreExternalBackup', 'CreateModeRestoreExternalBackupSecondary', 'CreateModeRestoreLongTermRetentionBackup', 'CreateModeOnlineSecondary'
2542	CreateMode CreateMode `json:"createMode,omitempty"`
2543	// Collation - The collation of the database.
2544	Collation *string `json:"collation,omitempty"`
2545	// MaxSizeBytes - The max size of the database expressed in bytes.
2546	MaxSizeBytes *int64 `json:"maxSizeBytes,omitempty"`
2547	// SampleName - The name of the sample schema to apply when creating this database. Possible values include: 'SampleNameAdventureWorksLT', 'SampleNameWideWorldImportersStd', 'SampleNameWideWorldImportersFull'
2548	SampleName SampleName `json:"sampleName,omitempty"`
2549	// ElasticPoolID - The resource identifier of the elastic pool containing this database.
2550	ElasticPoolID *string `json:"elasticPoolId,omitempty"`
2551	// SourceDatabaseID - The resource identifier of the source database associated with create operation of this database.
2552	SourceDatabaseID *string `json:"sourceDatabaseId,omitempty"`
2553	// Status - READ-ONLY; The status of the database. Possible values include: 'DatabaseStatusOnline', 'DatabaseStatusRestoring', 'DatabaseStatusRecoveryPending', 'DatabaseStatusRecovering', 'DatabaseStatusSuspect', 'DatabaseStatusOffline', 'DatabaseStatusStandby', 'DatabaseStatusShutdown', 'DatabaseStatusEmergencyMode', 'DatabaseStatusAutoClosed', 'DatabaseStatusCopying', 'DatabaseStatusCreating', 'DatabaseStatusInaccessible', 'DatabaseStatusOfflineSecondary', 'DatabaseStatusPausing', 'DatabaseStatusPaused', 'DatabaseStatusResuming', 'DatabaseStatusScaling', 'DatabaseStatusOfflineChangingDwPerformanceTiers', 'DatabaseStatusOnlineChangingDwPerformanceTiers', 'DatabaseStatusDisabled'
2554	Status DatabaseStatus `json:"status,omitempty"`
2555	// DatabaseID - READ-ONLY; The ID of the database.
2556	DatabaseID *uuid.UUID `json:"databaseId,omitempty"`
2557	// CreationDate - READ-ONLY; The creation date of the database (ISO8601 format).
2558	CreationDate *date.Time `json:"creationDate,omitempty"`
2559	// CurrentServiceObjectiveName - READ-ONLY; The current service level objective name of the database.
2560	CurrentServiceObjectiveName *string `json:"currentServiceObjectiveName,omitempty"`
2561	// RequestedServiceObjectiveName - READ-ONLY; The requested service level objective name of the database.
2562	RequestedServiceObjectiveName *string `json:"requestedServiceObjectiveName,omitempty"`
2563	// DefaultSecondaryLocation - READ-ONLY; The default secondary region for this database.
2564	DefaultSecondaryLocation *string `json:"defaultSecondaryLocation,omitempty"`
2565	// FailoverGroupID - READ-ONLY; Failover Group resource identifier that this database belongs to.
2566	FailoverGroupID *string `json:"failoverGroupId,omitempty"`
2567	// RestorePointInTime - Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database.
2568	RestorePointInTime *date.Time `json:"restorePointInTime,omitempty"`
2569	// SourceDatabaseDeletionDate - Specifies the time that the database was deleted.
2570	SourceDatabaseDeletionDate *date.Time `json:"sourceDatabaseDeletionDate,omitempty"`
2571	// RecoveryServicesRecoveryPointID - The resource identifier of the recovery point associated with create operation of this database.
2572	RecoveryServicesRecoveryPointID *string `json:"recoveryServicesRecoveryPointId,omitempty"`
2573	// LongTermRetentionBackupResourceID - The resource identifier of the long term retention backup associated with create operation of this database.
2574	LongTermRetentionBackupResourceID *string `json:"longTermRetentionBackupResourceId,omitempty"`
2575	// RecoverableDatabaseID - The resource identifier of the recoverable database associated with create operation of this database.
2576	RecoverableDatabaseID *string `json:"recoverableDatabaseId,omitempty"`
2577	// RestorableDroppedDatabaseID - The resource identifier of the restorable dropped database associated with create operation of this database.
2578	RestorableDroppedDatabaseID *string `json:"restorableDroppedDatabaseId,omitempty"`
2579	// CatalogCollation - Collation of the metadata catalog. Possible values include: 'CatalogCollationTypeDATABASEDEFAULT', 'CatalogCollationTypeSQLLatin1GeneralCP1CIAS'
2580	CatalogCollation CatalogCollationType `json:"catalogCollation,omitempty"`
2581	// ZoneRedundant - Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones.
2582	ZoneRedundant *bool `json:"zoneRedundant,omitempty"`
2583	// LicenseType - The license type to apply for this database. `LicenseIncluded` if you need a license, or `BasePrice` if you have a license and are eligible for the Azure Hybrid Benefit. Possible values include: 'DatabaseLicenseTypeLicenseIncluded', 'DatabaseLicenseTypeBasePrice'
2584	LicenseType DatabaseLicenseType `json:"licenseType,omitempty"`
2585	// MaxLogSizeBytes - READ-ONLY; The max log size for this database.
2586	MaxLogSizeBytes *int64 `json:"maxLogSizeBytes,omitempty"`
2587	// EarliestRestoreDate - READ-ONLY; This records the earliest start date and time that restore is available for this database (ISO8601 format).
2588	EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"`
2589	// ReadScale - The state of read-only routing. If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica in the same region. Possible values include: 'DatabaseReadScaleEnabled', 'DatabaseReadScaleDisabled'
2590	ReadScale DatabaseReadScale `json:"readScale,omitempty"`
2591	// HighAvailabilityReplicaCount - The number of secondary replicas associated with the database that are used to provide high availability.
2592	HighAvailabilityReplicaCount *int32 `json:"highAvailabilityReplicaCount,omitempty"`
2593	// SecondaryType - The secondary type of the database if it is a secondary.  Valid values are Geo and Named. Possible values include: 'SecondaryTypeGeo', 'SecondaryTypeNamed'
2594	SecondaryType SecondaryType `json:"secondaryType,omitempty"`
2595	// CurrentSku - READ-ONLY; The name and tier of the SKU.
2596	CurrentSku *Sku `json:"currentSku,omitempty"`
2597	// AutoPauseDelay - Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled
2598	AutoPauseDelay *int32 `json:"autoPauseDelay,omitempty"`
2599	// CurrentBackupStorageRedundancy - READ-ONLY; The storage account type used to store backups for this database. Possible values include: 'CurrentBackupStorageRedundancyGeo', 'CurrentBackupStorageRedundancyLocal', 'CurrentBackupStorageRedundancyZone'
2600	CurrentBackupStorageRedundancy CurrentBackupStorageRedundancy `json:"currentBackupStorageRedundancy,omitempty"`
2601	// RequestedBackupStorageRedundancy - The storage account type to be used to store backups for this database. Possible values include: 'RequestedBackupStorageRedundancyGeo', 'RequestedBackupStorageRedundancyLocal', 'RequestedBackupStorageRedundancyZone'
2602	RequestedBackupStorageRedundancy RequestedBackupStorageRedundancy `json:"requestedBackupStorageRedundancy,omitempty"`
2603	// MinCapacity - Minimal capacity that database will always have allocated, if not paused
2604	MinCapacity *float64 `json:"minCapacity,omitempty"`
2605	// PausedDate - READ-ONLY; The date when database was paused by user configuration or action(ISO8601 format). Null if the database is ready.
2606	PausedDate *date.Time `json:"pausedDate,omitempty"`
2607	// ResumedDate - READ-ONLY; The date when database was resumed by user action or database login (ISO8601 format). Null if the database is paused.
2608	ResumedDate *date.Time `json:"resumedDate,omitempty"`
2609	// MaintenanceConfigurationID - Maintenance configuration id assigned to the database. This configuration defines the period when the maintenance updates will occur.
2610	MaintenanceConfigurationID *string `json:"maintenanceConfigurationId,omitempty"`
2611	// IsLedgerOn - Whether or not this database is a ledger database, which means all tables in the database are ledger tables. Note: the value of this property cannot be changed after the database has been created.
2612	IsLedgerOn *bool `json:"isLedgerOn,omitempty"`
2613	// IsInfraEncryptionEnabled - READ-ONLY; Infra encryption is enabled for this database.
2614	IsInfraEncryptionEnabled *bool `json:"isInfraEncryptionEnabled,omitempty"`
2615}
2616
2617// MarshalJSON is the custom marshaler for DatabaseProperties.
2618func (dp DatabaseProperties) MarshalJSON() ([]byte, error) {
2619	objectMap := make(map[string]interface{})
2620	if dp.CreateMode != "" {
2621		objectMap["createMode"] = dp.CreateMode
2622	}
2623	if dp.Collation != nil {
2624		objectMap["collation"] = dp.Collation
2625	}
2626	if dp.MaxSizeBytes != nil {
2627		objectMap["maxSizeBytes"] = dp.MaxSizeBytes
2628	}
2629	if dp.SampleName != "" {
2630		objectMap["sampleName"] = dp.SampleName
2631	}
2632	if dp.ElasticPoolID != nil {
2633		objectMap["elasticPoolId"] = dp.ElasticPoolID
2634	}
2635	if dp.SourceDatabaseID != nil {
2636		objectMap["sourceDatabaseId"] = dp.SourceDatabaseID
2637	}
2638	if dp.RestorePointInTime != nil {
2639		objectMap["restorePointInTime"] = dp.RestorePointInTime
2640	}
2641	if dp.SourceDatabaseDeletionDate != nil {
2642		objectMap["sourceDatabaseDeletionDate"] = dp.SourceDatabaseDeletionDate
2643	}
2644	if dp.RecoveryServicesRecoveryPointID != nil {
2645		objectMap["recoveryServicesRecoveryPointId"] = dp.RecoveryServicesRecoveryPointID
2646	}
2647	if dp.LongTermRetentionBackupResourceID != nil {
2648		objectMap["longTermRetentionBackupResourceId"] = dp.LongTermRetentionBackupResourceID
2649	}
2650	if dp.RecoverableDatabaseID != nil {
2651		objectMap["recoverableDatabaseId"] = dp.RecoverableDatabaseID
2652	}
2653	if dp.RestorableDroppedDatabaseID != nil {
2654		objectMap["restorableDroppedDatabaseId"] = dp.RestorableDroppedDatabaseID
2655	}
2656	if dp.CatalogCollation != "" {
2657		objectMap["catalogCollation"] = dp.CatalogCollation
2658	}
2659	if dp.ZoneRedundant != nil {
2660		objectMap["zoneRedundant"] = dp.ZoneRedundant
2661	}
2662	if dp.LicenseType != "" {
2663		objectMap["licenseType"] = dp.LicenseType
2664	}
2665	if dp.ReadScale != "" {
2666		objectMap["readScale"] = dp.ReadScale
2667	}
2668	if dp.HighAvailabilityReplicaCount != nil {
2669		objectMap["highAvailabilityReplicaCount"] = dp.HighAvailabilityReplicaCount
2670	}
2671	if dp.SecondaryType != "" {
2672		objectMap["secondaryType"] = dp.SecondaryType
2673	}
2674	if dp.AutoPauseDelay != nil {
2675		objectMap["autoPauseDelay"] = dp.AutoPauseDelay
2676	}
2677	if dp.RequestedBackupStorageRedundancy != "" {
2678		objectMap["requestedBackupStorageRedundancy"] = dp.RequestedBackupStorageRedundancy
2679	}
2680	if dp.MinCapacity != nil {
2681		objectMap["minCapacity"] = dp.MinCapacity
2682	}
2683	if dp.MaintenanceConfigurationID != nil {
2684		objectMap["maintenanceConfigurationId"] = dp.MaintenanceConfigurationID
2685	}
2686	if dp.IsLedgerOn != nil {
2687		objectMap["isLedgerOn"] = dp.IsLedgerOn
2688	}
2689	return json.Marshal(objectMap)
2690}
2691
2692// DatabaseSchema a database schema resource.
2693type DatabaseSchema struct {
2694	autorest.Response `json:"-"`
2695	// ID - READ-ONLY; Resource ID.
2696	ID *string `json:"id,omitempty"`
2697	// Name - READ-ONLY; Resource name.
2698	Name *string `json:"name,omitempty"`
2699	// Type - READ-ONLY; Resource type.
2700	Type *string `json:"type,omitempty"`
2701}
2702
2703// MarshalJSON is the custom marshaler for DatabaseSchema.
2704func (ds DatabaseSchema) MarshalJSON() ([]byte, error) {
2705	objectMap := make(map[string]interface{})
2706	return json.Marshal(objectMap)
2707}
2708
2709// DatabaseSchemaListResult a list of database schemas.
2710type DatabaseSchemaListResult struct {
2711	autorest.Response `json:"-"`
2712	// Value - READ-ONLY; Array of results.
2713	Value *[]DatabaseSchema `json:"value,omitempty"`
2714	// NextLink - READ-ONLY; Link to retrieve next page of results.
2715	NextLink *string `json:"nextLink,omitempty"`
2716}
2717
2718// MarshalJSON is the custom marshaler for DatabaseSchemaListResult.
2719func (dslr DatabaseSchemaListResult) MarshalJSON() ([]byte, error) {
2720	objectMap := make(map[string]interface{})
2721	return json.Marshal(objectMap)
2722}
2723
2724// DatabaseSchemaListResultIterator provides access to a complete listing of DatabaseSchema values.
2725type DatabaseSchemaListResultIterator struct {
2726	i    int
2727	page DatabaseSchemaListResultPage
2728}
2729
2730// NextWithContext advances to the next value.  If there was an error making
2731// the request the iterator does not advance and the error is returned.
2732func (iter *DatabaseSchemaListResultIterator) NextWithContext(ctx context.Context) (err error) {
2733	if tracing.IsEnabled() {
2734		ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseSchemaListResultIterator.NextWithContext")
2735		defer func() {
2736			sc := -1
2737			if iter.Response().Response.Response != nil {
2738				sc = iter.Response().Response.Response.StatusCode
2739			}
2740			tracing.EndSpan(ctx, sc, err)
2741		}()
2742	}
2743	iter.i++
2744	if iter.i < len(iter.page.Values()) {
2745		return nil
2746	}
2747	err = iter.page.NextWithContext(ctx)
2748	if err != nil {
2749		iter.i--
2750		return err
2751	}
2752	iter.i = 0
2753	return nil
2754}
2755
2756// Next advances to the next value.  If there was an error making
2757// the request the iterator does not advance and the error is returned.
2758// Deprecated: Use NextWithContext() instead.
2759func (iter *DatabaseSchemaListResultIterator) Next() error {
2760	return iter.NextWithContext(context.Background())
2761}
2762
2763// NotDone returns true if the enumeration should be started or is not yet complete.
2764func (iter DatabaseSchemaListResultIterator) NotDone() bool {
2765	return iter.page.NotDone() && iter.i < len(iter.page.Values())
2766}
2767
2768// Response returns the raw server response from the last page request.
2769func (iter DatabaseSchemaListResultIterator) Response() DatabaseSchemaListResult {
2770	return iter.page.Response()
2771}
2772
2773// Value returns the current value or a zero-initialized value if the
2774// iterator has advanced beyond the end of the collection.
2775func (iter DatabaseSchemaListResultIterator) Value() DatabaseSchema {
2776	if !iter.page.NotDone() {
2777		return DatabaseSchema{}
2778	}
2779	return iter.page.Values()[iter.i]
2780}
2781
2782// Creates a new instance of the DatabaseSchemaListResultIterator type.
2783func NewDatabaseSchemaListResultIterator(page DatabaseSchemaListResultPage) DatabaseSchemaListResultIterator {
2784	return DatabaseSchemaListResultIterator{page: page}
2785}
2786
2787// IsEmpty returns true if the ListResult contains no values.
2788func (dslr DatabaseSchemaListResult) IsEmpty() bool {
2789	return dslr.Value == nil || len(*dslr.Value) == 0
2790}
2791
2792// hasNextLink returns true if the NextLink is not empty.
2793func (dslr DatabaseSchemaListResult) hasNextLink() bool {
2794	return dslr.NextLink != nil && len(*dslr.NextLink) != 0
2795}
2796
2797// databaseSchemaListResultPreparer prepares a request to retrieve the next set of results.
2798// It returns nil if no more results exist.
2799func (dslr DatabaseSchemaListResult) databaseSchemaListResultPreparer(ctx context.Context) (*http.Request, error) {
2800	if !dslr.hasNextLink() {
2801		return nil, nil
2802	}
2803	return autorest.Prepare((&http.Request{}).WithContext(ctx),
2804		autorest.AsJSON(),
2805		autorest.AsGet(),
2806		autorest.WithBaseURL(to.String(dslr.NextLink)))
2807}
2808
2809// DatabaseSchemaListResultPage contains a page of DatabaseSchema values.
2810type DatabaseSchemaListResultPage struct {
2811	fn   func(context.Context, DatabaseSchemaListResult) (DatabaseSchemaListResult, error)
2812	dslr DatabaseSchemaListResult
2813}
2814
2815// NextWithContext advances to the next page of values.  If there was an error making
2816// the request the page does not advance and the error is returned.
2817func (page *DatabaseSchemaListResultPage) NextWithContext(ctx context.Context) (err error) {
2818	if tracing.IsEnabled() {
2819		ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseSchemaListResultPage.NextWithContext")
2820		defer func() {
2821			sc := -1
2822			if page.Response().Response.Response != nil {
2823				sc = page.Response().Response.Response.StatusCode
2824			}
2825			tracing.EndSpan(ctx, sc, err)
2826		}()
2827	}
2828	for {
2829		next, err := page.fn(ctx, page.dslr)
2830		if err != nil {
2831			return err
2832		}
2833		page.dslr = next
2834		if !next.hasNextLink() || !next.IsEmpty() {
2835			break
2836		}
2837	}
2838	return nil
2839}
2840
2841// Next advances to the next page of values.  If there was an error making
2842// the request the page does not advance and the error is returned.
2843// Deprecated: Use NextWithContext() instead.
2844func (page *DatabaseSchemaListResultPage) Next() error {
2845	return page.NextWithContext(context.Background())
2846}
2847
2848// NotDone returns true if the page enumeration should be started or is not yet complete.
2849func (page DatabaseSchemaListResultPage) NotDone() bool {
2850	return !page.dslr.IsEmpty()
2851}
2852
2853// Response returns the raw server response from the last page request.
2854func (page DatabaseSchemaListResultPage) Response() DatabaseSchemaListResult {
2855	return page.dslr
2856}
2857
2858// Values returns the slice of values for the current page or nil if there are no values.
2859func (page DatabaseSchemaListResultPage) Values() []DatabaseSchema {
2860	if page.dslr.IsEmpty() {
2861		return nil
2862	}
2863	return *page.dslr.Value
2864}
2865
2866// Creates a new instance of the DatabaseSchemaListResultPage type.
2867func NewDatabaseSchemaListResultPage(cur DatabaseSchemaListResult, getNextPage func(context.Context, DatabaseSchemaListResult) (DatabaseSchemaListResult, error)) DatabaseSchemaListResultPage {
2868	return DatabaseSchemaListResultPage{
2869		fn:   getNextPage,
2870		dslr: cur,
2871	}
2872}
2873
2874// DatabasesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
2875// operation.
2876type DatabasesCreateOrUpdateFuture struct {
2877	azure.FutureAPI
2878	// Result returns the result of the asynchronous operation.
2879	// If the operation has not completed it will return an error.
2880	Result func(DatabasesClient) (Database, error)
2881}
2882
2883// UnmarshalJSON is the custom unmarshaller for CreateFuture.
2884func (future *DatabasesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
2885	var azFuture azure.Future
2886	if err := json.Unmarshal(body, &azFuture); err != nil {
2887		return err
2888	}
2889	future.FutureAPI = &azFuture
2890	future.Result = future.result
2891	return nil
2892}
2893
2894// result is the default implementation for DatabasesCreateOrUpdateFuture.Result.
2895func (future *DatabasesCreateOrUpdateFuture) result(client DatabasesClient) (d Database, err error) {
2896	var done bool
2897	done, err = future.DoneWithContext(context.Background(), client)
2898	if err != nil {
2899		err = autorest.NewErrorWithError(err, "sql.DatabasesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
2900		return
2901	}
2902	if !done {
2903		d.Response.Response = future.Response()
2904		err = azure.NewAsyncOpIncompleteError("sql.DatabasesCreateOrUpdateFuture")
2905		return
2906	}
2907	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2908	if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent {
2909		d, err = client.CreateOrUpdateResponder(d.Response.Response)
2910		if err != nil {
2911			err = autorest.NewErrorWithError(err, "sql.DatabasesCreateOrUpdateFuture", "Result", d.Response.Response, "Failure responding to request")
2912		}
2913	}
2914	return
2915}
2916
2917// DatabasesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
2918// operation.
2919type DatabasesDeleteFuture struct {
2920	azure.FutureAPI
2921	// Result returns the result of the asynchronous operation.
2922	// If the operation has not completed it will return an error.
2923	Result func(DatabasesClient) (autorest.Response, error)
2924}
2925
2926// UnmarshalJSON is the custom unmarshaller for CreateFuture.
2927func (future *DatabasesDeleteFuture) UnmarshalJSON(body []byte) error {
2928	var azFuture azure.Future
2929	if err := json.Unmarshal(body, &azFuture); err != nil {
2930		return err
2931	}
2932	future.FutureAPI = &azFuture
2933	future.Result = future.result
2934	return nil
2935}
2936
2937// result is the default implementation for DatabasesDeleteFuture.Result.
2938func (future *DatabasesDeleteFuture) result(client DatabasesClient) (ar autorest.Response, err error) {
2939	var done bool
2940	done, err = future.DoneWithContext(context.Background(), client)
2941	if err != nil {
2942		err = autorest.NewErrorWithError(err, "sql.DatabasesDeleteFuture", "Result", future.Response(), "Polling failure")
2943		return
2944	}
2945	if !done {
2946		ar.Response = future.Response()
2947		err = azure.NewAsyncOpIncompleteError("sql.DatabasesDeleteFuture")
2948		return
2949	}
2950	ar.Response = future.Response()
2951	return
2952}
2953
2954// DatabaseSecurityAlertListResult a list of the database's security alert policies.
2955type DatabaseSecurityAlertListResult struct {
2956	autorest.Response `json:"-"`
2957	// Value - READ-ONLY; Array of results.
2958	Value *[]DatabaseSecurityAlertPolicy `json:"value,omitempty"`
2959	// NextLink - READ-ONLY; Link to retrieve next page of results.
2960	NextLink *string `json:"nextLink,omitempty"`
2961}
2962
2963// MarshalJSON is the custom marshaler for DatabaseSecurityAlertListResult.
2964func (dsalr DatabaseSecurityAlertListResult) MarshalJSON() ([]byte, error) {
2965	objectMap := make(map[string]interface{})
2966	return json.Marshal(objectMap)
2967}
2968
2969// DatabaseSecurityAlertListResultIterator provides access to a complete listing of
2970// DatabaseSecurityAlertPolicy values.
2971type DatabaseSecurityAlertListResultIterator struct {
2972	i    int
2973	page DatabaseSecurityAlertListResultPage
2974}
2975
2976// NextWithContext advances to the next value.  If there was an error making
2977// the request the iterator does not advance and the error is returned.
2978func (iter *DatabaseSecurityAlertListResultIterator) NextWithContext(ctx context.Context) (err error) {
2979	if tracing.IsEnabled() {
2980		ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseSecurityAlertListResultIterator.NextWithContext")
2981		defer func() {
2982			sc := -1
2983			if iter.Response().Response.Response != nil {
2984				sc = iter.Response().Response.Response.StatusCode
2985			}
2986			tracing.EndSpan(ctx, sc, err)
2987		}()
2988	}
2989	iter.i++
2990	if iter.i < len(iter.page.Values()) {
2991		return nil
2992	}
2993	err = iter.page.NextWithContext(ctx)
2994	if err != nil {
2995		iter.i--
2996		return err
2997	}
2998	iter.i = 0
2999	return nil
3000}
3001
3002// Next advances to the next value.  If there was an error making
3003// the request the iterator does not advance and the error is returned.
3004// Deprecated: Use NextWithContext() instead.
3005func (iter *DatabaseSecurityAlertListResultIterator) Next() error {
3006	return iter.NextWithContext(context.Background())
3007}
3008
3009// NotDone returns true if the enumeration should be started or is not yet complete.
3010func (iter DatabaseSecurityAlertListResultIterator) NotDone() bool {
3011	return iter.page.NotDone() && iter.i < len(iter.page.Values())
3012}
3013
3014// Response returns the raw server response from the last page request.
3015func (iter DatabaseSecurityAlertListResultIterator) Response() DatabaseSecurityAlertListResult {
3016	return iter.page.Response()
3017}
3018
3019// Value returns the current value or a zero-initialized value if the
3020// iterator has advanced beyond the end of the collection.
3021func (iter DatabaseSecurityAlertListResultIterator) Value() DatabaseSecurityAlertPolicy {
3022	if !iter.page.NotDone() {
3023		return DatabaseSecurityAlertPolicy{}
3024	}
3025	return iter.page.Values()[iter.i]
3026}
3027
3028// Creates a new instance of the DatabaseSecurityAlertListResultIterator type.
3029func NewDatabaseSecurityAlertListResultIterator(page DatabaseSecurityAlertListResultPage) DatabaseSecurityAlertListResultIterator {
3030	return DatabaseSecurityAlertListResultIterator{page: page}
3031}
3032
3033// IsEmpty returns true if the ListResult contains no values.
3034func (dsalr DatabaseSecurityAlertListResult) IsEmpty() bool {
3035	return dsalr.Value == nil || len(*dsalr.Value) == 0
3036}
3037
3038// hasNextLink returns true if the NextLink is not empty.
3039func (dsalr DatabaseSecurityAlertListResult) hasNextLink() bool {
3040	return dsalr.NextLink != nil && len(*dsalr.NextLink) != 0
3041}
3042
3043// databaseSecurityAlertListResultPreparer prepares a request to retrieve the next set of results.
3044// It returns nil if no more results exist.
3045func (dsalr DatabaseSecurityAlertListResult) databaseSecurityAlertListResultPreparer(ctx context.Context) (*http.Request, error) {
3046	if !dsalr.hasNextLink() {
3047		return nil, nil
3048	}
3049	return autorest.Prepare((&http.Request{}).WithContext(ctx),
3050		autorest.AsJSON(),
3051		autorest.AsGet(),
3052		autorest.WithBaseURL(to.String(dsalr.NextLink)))
3053}
3054
3055// DatabaseSecurityAlertListResultPage contains a page of DatabaseSecurityAlertPolicy values.
3056type DatabaseSecurityAlertListResultPage struct {
3057	fn    func(context.Context, DatabaseSecurityAlertListResult) (DatabaseSecurityAlertListResult, error)
3058	dsalr DatabaseSecurityAlertListResult
3059}
3060
3061// NextWithContext advances to the next page of values.  If there was an error making
3062// the request the page does not advance and the error is returned.
3063func (page *DatabaseSecurityAlertListResultPage) NextWithContext(ctx context.Context) (err error) {
3064	if tracing.IsEnabled() {
3065		ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseSecurityAlertListResultPage.NextWithContext")
3066		defer func() {
3067			sc := -1
3068			if page.Response().Response.Response != nil {
3069				sc = page.Response().Response.Response.StatusCode
3070			}
3071			tracing.EndSpan(ctx, sc, err)
3072		}()
3073	}
3074	for {
3075		next, err := page.fn(ctx, page.dsalr)
3076		if err != nil {
3077			return err
3078		}
3079		page.dsalr = next
3080		if !next.hasNextLink() || !next.IsEmpty() {
3081			break
3082		}
3083	}
3084	return nil
3085}
3086
3087// Next advances to the next page of values.  If there was an error making
3088// the request the page does not advance and the error is returned.
3089// Deprecated: Use NextWithContext() instead.
3090func (page *DatabaseSecurityAlertListResultPage) Next() error {
3091	return page.NextWithContext(context.Background())
3092}
3093
3094// NotDone returns true if the page enumeration should be started or is not yet complete.
3095func (page DatabaseSecurityAlertListResultPage) NotDone() bool {
3096	return !page.dsalr.IsEmpty()
3097}
3098
3099// Response returns the raw server response from the last page request.
3100func (page DatabaseSecurityAlertListResultPage) Response() DatabaseSecurityAlertListResult {
3101	return page.dsalr
3102}
3103
3104// Values returns the slice of values for the current page or nil if there are no values.
3105func (page DatabaseSecurityAlertListResultPage) Values() []DatabaseSecurityAlertPolicy {
3106	if page.dsalr.IsEmpty() {
3107		return nil
3108	}
3109	return *page.dsalr.Value
3110}
3111
3112// Creates a new instance of the DatabaseSecurityAlertListResultPage type.
3113func NewDatabaseSecurityAlertListResultPage(cur DatabaseSecurityAlertListResult, getNextPage func(context.Context, DatabaseSecurityAlertListResult) (DatabaseSecurityAlertListResult, error)) DatabaseSecurityAlertListResultPage {
3114	return DatabaseSecurityAlertListResultPage{
3115		fn:    getNextPage,
3116		dsalr: cur,
3117	}
3118}
3119
3120// DatabaseSecurityAlertPolicy a database security alert policy.
3121type DatabaseSecurityAlertPolicy struct {
3122	autorest.Response `json:"-"`
3123	// SystemData - READ-ONLY; SystemData of SecurityAlertPolicyResource.
3124	SystemData *SystemData `json:"systemData,omitempty"`
3125	// SecurityAlertsPolicyProperties - Resource properties.
3126	*SecurityAlertsPolicyProperties `json:"properties,omitempty"`
3127	// ID - READ-ONLY; Resource ID.
3128	ID *string `json:"id,omitempty"`
3129	// Name - READ-ONLY; Resource name.
3130	Name *string `json:"name,omitempty"`
3131	// Type - READ-ONLY; Resource type.
3132	Type *string `json:"type,omitempty"`
3133}
3134
3135// MarshalJSON is the custom marshaler for DatabaseSecurityAlertPolicy.
3136func (dsap DatabaseSecurityAlertPolicy) MarshalJSON() ([]byte, error) {
3137	objectMap := make(map[string]interface{})
3138	if dsap.SecurityAlertsPolicyProperties != nil {
3139		objectMap["properties"] = dsap.SecurityAlertsPolicyProperties
3140	}
3141	return json.Marshal(objectMap)
3142}
3143
3144// UnmarshalJSON is the custom unmarshaler for DatabaseSecurityAlertPolicy struct.
3145func (dsap *DatabaseSecurityAlertPolicy) UnmarshalJSON(body []byte) error {
3146	var m map[string]*json.RawMessage
3147	err := json.Unmarshal(body, &m)
3148	if err != nil {
3149		return err
3150	}
3151	for k, v := range m {
3152		switch k {
3153		case "systemData":
3154			if v != nil {
3155				var systemData SystemData
3156				err = json.Unmarshal(*v, &systemData)
3157				if err != nil {
3158					return err
3159				}
3160				dsap.SystemData = &systemData
3161			}
3162		case "properties":
3163			if v != nil {
3164				var securityAlertsPolicyProperties SecurityAlertsPolicyProperties
3165				err = json.Unmarshal(*v, &securityAlertsPolicyProperties)
3166				if err != nil {
3167					return err
3168				}
3169				dsap.SecurityAlertsPolicyProperties = &securityAlertsPolicyProperties
3170			}
3171		case "id":
3172			if v != nil {
3173				var ID string
3174				err = json.Unmarshal(*v, &ID)
3175				if err != nil {
3176					return err
3177				}
3178				dsap.ID = &ID
3179			}
3180		case "name":
3181			if v != nil {
3182				var name string
3183				err = json.Unmarshal(*v, &name)
3184				if err != nil {
3185					return err
3186				}
3187				dsap.Name = &name
3188			}
3189		case "type":
3190			if v != nil {
3191				var typeVar string
3192				err = json.Unmarshal(*v, &typeVar)
3193				if err != nil {
3194					return err
3195				}
3196				dsap.Type = &typeVar
3197			}
3198		}
3199	}
3200
3201	return nil
3202}
3203
3204// DatabasesExportFuture an abstraction for monitoring and retrieving the results of a long-running
3205// operation.
3206type DatabasesExportFuture struct {
3207	azure.FutureAPI
3208	// Result returns the result of the asynchronous operation.
3209	// If the operation has not completed it will return an error.
3210	Result func(DatabasesClient) (ImportExportOperationResult, error)
3211}
3212
3213// UnmarshalJSON is the custom unmarshaller for CreateFuture.
3214func (future *DatabasesExportFuture) UnmarshalJSON(body []byte) error {
3215	var azFuture azure.Future
3216	if err := json.Unmarshal(body, &azFuture); err != nil {
3217		return err
3218	}
3219	future.FutureAPI = &azFuture
3220	future.Result = future.result
3221	return nil
3222}
3223
3224// result is the default implementation for DatabasesExportFuture.Result.
3225func (future *DatabasesExportFuture) result(client DatabasesClient) (ieor ImportExportOperationResult, err error) {
3226	var done bool
3227	done, err = future.DoneWithContext(context.Background(), client)
3228	if err != nil {
3229		err = autorest.NewErrorWithError(err, "sql.DatabasesExportFuture", "Result", future.Response(), "Polling failure")
3230		return
3231	}
3232	if !done {
3233		ieor.Response.Response = future.Response()
3234		err = azure.NewAsyncOpIncompleteError("sql.DatabasesExportFuture")
3235		return
3236	}
3237	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3238	if ieor.Response.Response, err = future.GetResult(sender); err == nil && ieor.Response.Response.StatusCode != http.StatusNoContent {
3239		ieor, err = client.ExportResponder(ieor.Response.Response)
3240		if err != nil {
3241			err = autorest.NewErrorWithError(err, "sql.DatabasesExportFuture", "Result", ieor.Response.Response, "Failure responding to request")
3242		}
3243	}
3244	return
3245}
3246
3247// DatabasesFailoverFuture an abstraction for monitoring and retrieving the results of a long-running
3248// operation.
3249type DatabasesFailoverFuture struct {
3250	azure.FutureAPI
3251	// Result returns the result of the asynchronous operation.
3252	// If the operation has not completed it will return an error.
3253	Result func(DatabasesClient) (autorest.Response, error)
3254}
3255
3256// UnmarshalJSON is the custom unmarshaller for CreateFuture.
3257func (future *DatabasesFailoverFuture) UnmarshalJSON(body []byte) error {
3258	var azFuture azure.Future
3259	if err := json.Unmarshal(body, &azFuture); err != nil {
3260		return err
3261	}
3262	future.FutureAPI = &azFuture
3263	future.Result = future.result
3264	return nil
3265}
3266
3267// result is the default implementation for DatabasesFailoverFuture.Result.
3268func (future *DatabasesFailoverFuture) result(client DatabasesClient) (ar autorest.Response, err error) {
3269	var done bool
3270	done, err = future.DoneWithContext(context.Background(), client)
3271	if err != nil {
3272		err = autorest.NewErrorWithError(err, "sql.DatabasesFailoverFuture", "Result", future.Response(), "Polling failure")
3273		return
3274	}
3275	if !done {
3276		ar.Response = future.Response()
3277		err = azure.NewAsyncOpIncompleteError("sql.DatabasesFailoverFuture")
3278		return
3279	}
3280	ar.Response = future.Response()
3281	return
3282}
3283
3284// DatabasesImportFuture an abstraction for monitoring and retrieving the results of a long-running
3285// operation.
3286type DatabasesImportFuture struct {
3287	azure.FutureAPI
3288	// Result returns the result of the asynchronous operation.
3289	// If the operation has not completed it will return an error.
3290	Result func(DatabasesClient) (ImportExportOperationResult, error)
3291}
3292
3293// UnmarshalJSON is the custom unmarshaller for CreateFuture.
3294func (future *DatabasesImportFuture) UnmarshalJSON(body []byte) error {
3295	var azFuture azure.Future
3296	if err := json.Unmarshal(body, &azFuture); err != nil {
3297		return err
3298	}
3299	future.FutureAPI = &azFuture
3300	future.Result = future.result
3301	return nil
3302}
3303
3304// result is the default implementation for DatabasesImportFuture.Result.
3305func (future *DatabasesImportFuture) result(client DatabasesClient) (ieor ImportExportOperationResult, err error) {
3306	var done bool
3307	done, err = future.DoneWithContext(context.Background(), client)
3308	if err != nil {
3309		err = autorest.NewErrorWithError(err, "sql.DatabasesImportFuture", "Result", future.Response(), "Polling failure")
3310		return
3311	}
3312	if !done {
3313		ieor.Response.Response = future.Response()
3314		err = azure.NewAsyncOpIncompleteError("sql.DatabasesImportFuture")
3315		return
3316	}
3317	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3318	if ieor.Response.Response, err = future.GetResult(sender); err == nil && ieor.Response.Response.StatusCode != http.StatusNoContent {
3319		ieor, err = client.ImportResponder(ieor.Response.Response)
3320		if err != nil {
3321			err = autorest.NewErrorWithError(err, "sql.DatabasesImportFuture", "Result", ieor.Response.Response, "Failure responding to request")
3322		}
3323	}
3324	return
3325}
3326
3327// DatabasesPauseFuture an abstraction for monitoring and retrieving the results of a long-running
3328// operation.
3329type DatabasesPauseFuture struct {
3330	azure.FutureAPI
3331	// Result returns the result of the asynchronous operation.
3332	// If the operation has not completed it will return an error.
3333	Result func(DatabasesClient) (Database, error)
3334}
3335
3336// UnmarshalJSON is the custom unmarshaller for CreateFuture.
3337func (future *DatabasesPauseFuture) UnmarshalJSON(body []byte) error {
3338	var azFuture azure.Future
3339	if err := json.Unmarshal(body, &azFuture); err != nil {
3340		return err
3341	}
3342	future.FutureAPI = &azFuture
3343	future.Result = future.result
3344	return nil
3345}
3346
3347// result is the default implementation for DatabasesPauseFuture.Result.
3348func (future *DatabasesPauseFuture) result(client DatabasesClient) (d Database, err error) {
3349	var done bool
3350	done, err = future.DoneWithContext(context.Background(), client)
3351	if err != nil {
3352		err = autorest.NewErrorWithError(err, "sql.DatabasesPauseFuture", "Result", future.Response(), "Polling failure")
3353		return
3354	}
3355	if !done {
3356		d.Response.Response = future.Response()
3357		err = azure.NewAsyncOpIncompleteError("sql.DatabasesPauseFuture")
3358		return
3359	}
3360	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3361	if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent {
3362		d, err = client.PauseResponder(d.Response.Response)
3363		if err != nil {
3364			err = autorest.NewErrorWithError(err, "sql.DatabasesPauseFuture", "Result", d.Response.Response, "Failure responding to request")
3365		}
3366	}
3367	return
3368}
3369
3370// DatabasesResumeFuture an abstraction for monitoring and retrieving the results of a long-running
3371// operation.
3372type DatabasesResumeFuture struct {
3373	azure.FutureAPI
3374	// Result returns the result of the asynchronous operation.
3375	// If the operation has not completed it will return an error.
3376	Result func(DatabasesClient) (Database, error)
3377}
3378
3379// UnmarshalJSON is the custom unmarshaller for CreateFuture.
3380func (future *DatabasesResumeFuture) UnmarshalJSON(body []byte) error {
3381	var azFuture azure.Future
3382	if err := json.Unmarshal(body, &azFuture); err != nil {
3383		return err
3384	}
3385	future.FutureAPI = &azFuture
3386	future.Result = future.result
3387	return nil
3388}
3389
3390// result is the default implementation for DatabasesResumeFuture.Result.
3391func (future *DatabasesResumeFuture) result(client DatabasesClient) (d Database, err error) {
3392	var done bool
3393	done, err = future.DoneWithContext(context.Background(), client)
3394	if err != nil {
3395		err = autorest.NewErrorWithError(err, "sql.DatabasesResumeFuture", "Result", future.Response(), "Polling failure")
3396		return
3397	}
3398	if !done {
3399		d.Response.Response = future.Response()
3400		err = azure.NewAsyncOpIncompleteError("sql.DatabasesResumeFuture")
3401		return
3402	}
3403	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3404	if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent {
3405		d, err = client.ResumeResponder(d.Response.Response)
3406		if err != nil {
3407			err = autorest.NewErrorWithError(err, "sql.DatabasesResumeFuture", "Result", d.Response.Response, "Failure responding to request")
3408		}
3409	}
3410	return
3411}
3412
3413// DatabasesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
3414// operation.
3415type DatabasesUpdateFuture struct {
3416	azure.FutureAPI
3417	// Result returns the result of the asynchronous operation.
3418	// If the operation has not completed it will return an error.
3419	Result func(DatabasesClient) (Database, error)
3420}
3421
3422// UnmarshalJSON is the custom unmarshaller for CreateFuture.
3423func (future *DatabasesUpdateFuture) UnmarshalJSON(body []byte) error {
3424	var azFuture azure.Future
3425	if err := json.Unmarshal(body, &azFuture); err != nil {
3426		return err
3427	}
3428	future.FutureAPI = &azFuture
3429	future.Result = future.result
3430	return nil
3431}
3432
3433// result is the default implementation for DatabasesUpdateFuture.Result.
3434func (future *DatabasesUpdateFuture) result(client DatabasesClient) (d Database, err error) {
3435	var done bool
3436	done, err = future.DoneWithContext(context.Background(), client)
3437	if err != nil {
3438		err = autorest.NewErrorWithError(err, "sql.DatabasesUpdateFuture", "Result", future.Response(), "Polling failure")
3439		return
3440	}
3441	if !done {
3442		d.Response.Response = future.Response()
3443		err = azure.NewAsyncOpIncompleteError("sql.DatabasesUpdateFuture")
3444		return
3445	}
3446	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3447	if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent {
3448		d, err = client.UpdateResponder(d.Response.Response)
3449		if err != nil {
3450			err = autorest.NewErrorWithError(err, "sql.DatabasesUpdateFuture", "Result", d.Response.Response, "Failure responding to request")
3451		}
3452	}
3453	return
3454}
3455
3456// DatabasesUpgradeDataWarehouseFuture an abstraction for monitoring and retrieving the results of a
3457// long-running operation.
3458type DatabasesUpgradeDataWarehouseFuture struct {
3459	azure.FutureAPI
3460	// Result returns the result of the asynchronous operation.
3461	// If the operation has not completed it will return an error.
3462	Result func(DatabasesClient) (autorest.Response, error)
3463}
3464
3465// UnmarshalJSON is the custom unmarshaller for CreateFuture.
3466func (future *DatabasesUpgradeDataWarehouseFuture) UnmarshalJSON(body []byte) error {
3467	var azFuture azure.Future
3468	if err := json.Unmarshal(body, &azFuture); err != nil {
3469		return err
3470	}
3471	future.FutureAPI = &azFuture
3472	future.Result = future.result
3473	return nil
3474}
3475
3476// result is the default implementation for DatabasesUpgradeDataWarehouseFuture.Result.
3477func (future *DatabasesUpgradeDataWarehouseFuture) result(client DatabasesClient) (ar autorest.Response, err error) {
3478	var done bool
3479	done, err = future.DoneWithContext(context.Background(), client)
3480	if err != nil {
3481		err = autorest.NewErrorWithError(err, "sql.DatabasesUpgradeDataWarehouseFuture", "Result", future.Response(), "Polling failure")
3482		return
3483	}
3484	if !done {
3485		ar.Response = future.Response()
3486		err = azure.NewAsyncOpIncompleteError("sql.DatabasesUpgradeDataWarehouseFuture")
3487		return
3488	}
3489	ar.Response = future.Response()
3490	return
3491}
3492
3493// DatabaseTable a database table resource.
3494type DatabaseTable struct {
3495	autorest.Response `json:"-"`
3496	// DatabaseTableProperties - Resource properties.
3497	*DatabaseTableProperties `json:"properties,omitempty"`
3498	// ID - READ-ONLY; Resource ID.
3499	ID *string `json:"id,omitempty"`
3500	// Name - READ-ONLY; Resource name.
3501	Name *string `json:"name,omitempty"`
3502	// Type - READ-ONLY; Resource type.
3503	Type *string `json:"type,omitempty"`
3504}
3505
3506// MarshalJSON is the custom marshaler for DatabaseTable.
3507func (dt DatabaseTable) MarshalJSON() ([]byte, error) {
3508	objectMap := make(map[string]interface{})
3509	if dt.DatabaseTableProperties != nil {
3510		objectMap["properties"] = dt.DatabaseTableProperties
3511	}
3512	return json.Marshal(objectMap)
3513}
3514
3515// UnmarshalJSON is the custom unmarshaler for DatabaseTable struct.
3516func (dt *DatabaseTable) UnmarshalJSON(body []byte) error {
3517	var m map[string]*json.RawMessage
3518	err := json.Unmarshal(body, &m)
3519	if err != nil {
3520		return err
3521	}
3522	for k, v := range m {
3523		switch k {
3524		case "properties":
3525			if v != nil {
3526				var databaseTableProperties DatabaseTableProperties
3527				err = json.Unmarshal(*v, &databaseTableProperties)
3528				if err != nil {
3529					return err
3530				}
3531				dt.DatabaseTableProperties = &databaseTableProperties
3532			}
3533		case "id":
3534			if v != nil {
3535				var ID string
3536				err = json.Unmarshal(*v, &ID)
3537				if err != nil {
3538					return err
3539				}
3540				dt.ID = &ID
3541			}
3542		case "name":
3543			if v != nil {
3544				var name string
3545				err = json.Unmarshal(*v, &name)
3546				if err != nil {
3547					return err
3548				}
3549				dt.Name = &name
3550			}
3551		case "type":
3552			if v != nil {
3553				var typeVar string
3554				err = json.Unmarshal(*v, &typeVar)
3555				if err != nil {
3556					return err
3557				}
3558				dt.Type = &typeVar
3559			}
3560		}
3561	}
3562
3563	return nil
3564}
3565
3566// DatabaseTableListResult a list of database tables.
3567type DatabaseTableListResult struct {
3568	autorest.Response `json:"-"`
3569	// Value - READ-ONLY; Array of results.
3570	Value *[]DatabaseTable `json:"value,omitempty"`
3571	// NextLink - READ-ONLY; Link to retrieve next page of results.
3572	NextLink *string `json:"nextLink,omitempty"`
3573}
3574
3575// MarshalJSON is the custom marshaler for DatabaseTableListResult.
3576func (dtlr DatabaseTableListResult) MarshalJSON() ([]byte, error) {
3577	objectMap := make(map[string]interface{})
3578	return json.Marshal(objectMap)
3579}
3580
3581// DatabaseTableListResultIterator provides access to a complete listing of DatabaseTable values.
3582type DatabaseTableListResultIterator struct {
3583	i    int
3584	page DatabaseTableListResultPage
3585}
3586
3587// NextWithContext advances to the next value.  If there was an error making
3588// the request the iterator does not advance and the error is returned.
3589func (iter *DatabaseTableListResultIterator) NextWithContext(ctx context.Context) (err error) {
3590	if tracing.IsEnabled() {
3591		ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseTableListResultIterator.NextWithContext")
3592		defer func() {
3593			sc := -1
3594			if iter.Response().Response.Response != nil {
3595				sc = iter.Response().Response.Response.StatusCode
3596			}
3597			tracing.EndSpan(ctx, sc, err)
3598		}()
3599	}
3600	iter.i++
3601	if iter.i < len(iter.page.Values()) {
3602		return nil
3603	}
3604	err = iter.page.NextWithContext(ctx)
3605	if err != nil {
3606		iter.i--
3607		return err
3608	}
3609	iter.i = 0
3610	return nil
3611}
3612
3613// Next advances to the next value.  If there was an error making
3614// the request the iterator does not advance and the error is returned.
3615// Deprecated: Use NextWithContext() instead.
3616func (iter *DatabaseTableListResultIterator) Next() error {
3617	return iter.NextWithContext(context.Background())
3618}
3619
3620// NotDone returns true if the enumeration should be started or is not yet complete.
3621func (iter DatabaseTableListResultIterator) NotDone() bool {
3622	return iter.page.NotDone() && iter.i < len(iter.page.Values())
3623}
3624
3625// Response returns the raw server response from the last page request.
3626func (iter DatabaseTableListResultIterator) Response() DatabaseTableListResult {
3627	return iter.page.Response()
3628}
3629
3630// Value returns the current value or a zero-initialized value if the
3631// iterator has advanced beyond the end of the collection.
3632func (iter DatabaseTableListResultIterator) Value() DatabaseTable {
3633	if !iter.page.NotDone() {
3634		return DatabaseTable{}
3635	}
3636	return iter.page.Values()[iter.i]
3637}
3638
3639// Creates a new instance of the DatabaseTableListResultIterator type.
3640func NewDatabaseTableListResultIterator(page DatabaseTableListResultPage) DatabaseTableListResultIterator {
3641	return DatabaseTableListResultIterator{page: page}
3642}
3643
3644// IsEmpty returns true if the ListResult contains no values.
3645func (dtlr DatabaseTableListResult) IsEmpty() bool {
3646	return dtlr.Value == nil || len(*dtlr.Value) == 0
3647}
3648
3649// hasNextLink returns true if the NextLink is not empty.
3650func (dtlr DatabaseTableListResult) hasNextLink() bool {
3651	return dtlr.NextLink != nil && len(*dtlr.NextLink) != 0
3652}
3653
3654// databaseTableListResultPreparer prepares a request to retrieve the next set of results.
3655// It returns nil if no more results exist.
3656func (dtlr DatabaseTableListResult) databaseTableListResultPreparer(ctx context.Context) (*http.Request, error) {
3657	if !dtlr.hasNextLink() {
3658		return nil, nil
3659	}
3660	return autorest.Prepare((&http.Request{}).WithContext(ctx),
3661		autorest.AsJSON(),
3662		autorest.AsGet(),
3663		autorest.WithBaseURL(to.String(dtlr.NextLink)))
3664}
3665
3666// DatabaseTableListResultPage contains a page of DatabaseTable values.
3667type DatabaseTableListResultPage struct {
3668	fn   func(context.Context, DatabaseTableListResult) (DatabaseTableListResult, error)
3669	dtlr DatabaseTableListResult
3670}
3671
3672// NextWithContext advances to the next page of values.  If there was an error making
3673// the request the page does not advance and the error is returned.
3674func (page *DatabaseTableListResultPage) NextWithContext(ctx context.Context) (err error) {
3675	if tracing.IsEnabled() {
3676		ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseTableListResultPage.NextWithContext")
3677		defer func() {
3678			sc := -1
3679			if page.Response().Response.Response != nil {
3680				sc = page.Response().Response.Response.StatusCode
3681			}
3682			tracing.EndSpan(ctx, sc, err)
3683		}()
3684	}
3685	for {
3686		next, err := page.fn(ctx, page.dtlr)
3687		if err != nil {
3688			return err
3689		}
3690		page.dtlr = next
3691		if !next.hasNextLink() || !next.IsEmpty() {
3692			break
3693		}
3694	}
3695	return nil
3696}
3697
3698// Next advances to the next page of values.  If there was an error making
3699// the request the page does not advance and the error is returned.
3700// Deprecated: Use NextWithContext() instead.
3701func (page *DatabaseTableListResultPage) Next() error {
3702	return page.NextWithContext(context.Background())
3703}
3704
3705// NotDone returns true if the page enumeration should be started or is not yet complete.
3706func (page DatabaseTableListResultPage) NotDone() bool {
3707	return !page.dtlr.IsEmpty()
3708}
3709
3710// Response returns the raw server response from the last page request.
3711func (page DatabaseTableListResultPage) Response() DatabaseTableListResult {
3712	return page.dtlr
3713}
3714
3715// Values returns the slice of values for the current page or nil if there are no values.
3716func (page DatabaseTableListResultPage) Values() []DatabaseTable {
3717	if page.dtlr.IsEmpty() {
3718		return nil
3719	}
3720	return *page.dtlr.Value
3721}
3722
3723// Creates a new instance of the DatabaseTableListResultPage type.
3724func NewDatabaseTableListResultPage(cur DatabaseTableListResult, getNextPage func(context.Context, DatabaseTableListResult) (DatabaseTableListResult, error)) DatabaseTableListResultPage {
3725	return DatabaseTableListResultPage{
3726		fn:   getNextPage,
3727		dtlr: cur,
3728	}
3729}
3730
3731// DatabaseTableProperties database table properties.
3732type DatabaseTableProperties struct {
3733	// TemporalType - The table temporal type. Possible values include: 'TableTemporalTypeNonTemporalTable', 'TableTemporalTypeHistoryTable', 'TableTemporalTypeSystemVersionedTemporalTable'
3734	TemporalType TableTemporalType `json:"temporalType,omitempty"`
3735	// MemoryOptimized - Whether or not the table is memory optimized.
3736	MemoryOptimized *bool `json:"memoryOptimized,omitempty"`
3737}
3738
3739// DatabaseUpdate a database resource.
3740type DatabaseUpdate struct {
3741	// Sku - The name and tier of the SKU.
3742	Sku *Sku `json:"sku,omitempty"`
3743	// DatabaseProperties - Resource properties.
3744	*DatabaseProperties `json:"properties,omitempty"`
3745	// Tags - Resource tags.
3746	Tags map[string]*string `json:"tags"`
3747}
3748
3749// MarshalJSON is the custom marshaler for DatabaseUpdate.
3750func (du DatabaseUpdate) MarshalJSON() ([]byte, error) {
3751	objectMap := make(map[string]interface{})
3752	if du.Sku != nil {
3753		objectMap["sku"] = du.Sku
3754	}
3755	if du.DatabaseProperties != nil {
3756		objectMap["properties"] = du.DatabaseProperties
3757	}
3758	if du.Tags != nil {
3759		objectMap["tags"] = du.Tags
3760	}
3761	return json.Marshal(objectMap)
3762}
3763
3764// UnmarshalJSON is the custom unmarshaler for DatabaseUpdate struct.
3765func (du *DatabaseUpdate) UnmarshalJSON(body []byte) error {
3766	var m map[string]*json.RawMessage
3767	err := json.Unmarshal(body, &m)
3768	if err != nil {
3769		return err
3770	}
3771	for k, v := range m {
3772		switch k {
3773		case "sku":
3774			if v != nil {
3775				var sku Sku
3776				err = json.Unmarshal(*v, &sku)
3777				if err != nil {
3778					return err
3779				}
3780				du.Sku = &sku
3781			}
3782		case "properties":
3783			if v != nil {
3784				var databaseProperties DatabaseProperties
3785				err = json.Unmarshal(*v, &databaseProperties)
3786				if err != nil {
3787					return err
3788				}
3789				du.DatabaseProperties = &databaseProperties
3790			}
3791		case "tags":
3792			if v != nil {
3793				var tags map[string]*string
3794				err = json.Unmarshal(*v, &tags)
3795				if err != nil {
3796					return err
3797				}
3798				du.Tags = tags
3799			}
3800		}
3801	}
3802
3803	return nil
3804}
3805
3806// DatabaseUsage usage metric of a database.
3807type DatabaseUsage struct {
3808	// DatabaseUsageProperties - Resource properties.
3809	*DatabaseUsageProperties `json:"properties,omitempty"`
3810	// ID - READ-ONLY; Resource ID.
3811	ID *string `json:"id,omitempty"`
3812	// Name - READ-ONLY; Resource name.
3813	Name *string `json:"name,omitempty"`
3814	// Type - READ-ONLY; Resource type.
3815	Type *string `json:"type,omitempty"`
3816}
3817
3818// MarshalJSON is the custom marshaler for DatabaseUsage.
3819func (du DatabaseUsage) MarshalJSON() ([]byte, error) {
3820	objectMap := make(map[string]interface{})
3821	if du.DatabaseUsageProperties != nil {
3822		objectMap["properties"] = du.DatabaseUsageProperties
3823	}
3824	return json.Marshal(objectMap)
3825}
3826
3827// UnmarshalJSON is the custom unmarshaler for DatabaseUsage struct.
3828func (du *DatabaseUsage) UnmarshalJSON(body []byte) error {
3829	var m map[string]*json.RawMessage
3830	err := json.Unmarshal(body, &m)
3831	if err != nil {
3832		return err
3833	}
3834	for k, v := range m {
3835		switch k {
3836		case "properties":
3837			if v != nil {
3838				var databaseUsageProperties DatabaseUsageProperties
3839				err = json.Unmarshal(*v, &databaseUsageProperties)
3840				if err != nil {
3841					return err
3842				}
3843				du.DatabaseUsageProperties = &databaseUsageProperties
3844			}
3845		case "id":
3846			if v != nil {
3847				var ID string
3848				err = json.Unmarshal(*v, &ID)
3849				if err != nil {
3850					return err
3851				}
3852				du.ID = &ID
3853			}
3854		case "name":
3855			if v != nil {
3856				var name string
3857				err = json.Unmarshal(*v, &name)
3858				if err != nil {
3859					return err
3860				}
3861				du.Name = &name
3862			}
3863		case "type":
3864			if v != nil {
3865				var typeVar string
3866				err = json.Unmarshal(*v, &typeVar)
3867				if err != nil {
3868					return err
3869				}
3870				du.Type = &typeVar
3871			}
3872		}
3873	}
3874
3875	return nil
3876}
3877
3878// DatabaseUsageListResult a list of database usage metrics.
3879type DatabaseUsageListResult struct {
3880	autorest.Response `json:"-"`
3881	// Value - READ-ONLY; Array of results.
3882	Value *[]DatabaseUsage `json:"value,omitempty"`
3883	// NextLink - READ-ONLY; Link to retrieve next page of results.
3884	NextLink *string `json:"nextLink,omitempty"`
3885}
3886
3887// MarshalJSON is the custom marshaler for DatabaseUsageListResult.
3888func (dulr DatabaseUsageListResult) MarshalJSON() ([]byte, error) {
3889	objectMap := make(map[string]interface{})
3890	return json.Marshal(objectMap)
3891}
3892
3893// DatabaseUsageListResultIterator provides access to a complete listing of DatabaseUsage values.
3894type DatabaseUsageListResultIterator struct {
3895	i    int
3896	page DatabaseUsageListResultPage
3897}
3898
3899// NextWithContext advances to the next value.  If there was an error making
3900// the request the iterator does not advance and the error is returned.
3901func (iter *DatabaseUsageListResultIterator) NextWithContext(ctx context.Context) (err error) {
3902	if tracing.IsEnabled() {
3903		ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseUsageListResultIterator.NextWithContext")
3904		defer func() {
3905			sc := -1
3906			if iter.Response().Response.Response != nil {
3907				sc = iter.Response().Response.Response.StatusCode
3908			}
3909			tracing.EndSpan(ctx, sc, err)
3910		}()
3911	}
3912	iter.i++
3913	if iter.i < len(iter.page.Values()) {
3914		return nil
3915	}
3916	err = iter.page.NextWithContext(ctx)
3917	if err != nil {
3918		iter.i--
3919		return err
3920	}
3921	iter.i = 0
3922	return nil
3923}
3924
3925// Next advances to the next value.  If there was an error making
3926// the request the iterator does not advance and the error is returned.
3927// Deprecated: Use NextWithContext() instead.
3928func (iter *DatabaseUsageListResultIterator) Next() error {
3929	return iter.NextWithContext(context.Background())
3930}
3931
3932// NotDone returns true if the enumeration should be started or is not yet complete.
3933func (iter DatabaseUsageListResultIterator) NotDone() bool {
3934	return iter.page.NotDone() && iter.i < len(iter.page.Values())
3935}
3936
3937// Response returns the raw server response from the last page request.
3938func (iter DatabaseUsageListResultIterator) Response() DatabaseUsageListResult {
3939	return iter.page.Response()
3940}
3941
3942// Value returns the current value or a zero-initialized value if the
3943// iterator has advanced beyond the end of the collection.
3944func (iter DatabaseUsageListResultIterator) Value() DatabaseUsage {
3945	if !iter.page.NotDone() {
3946		return DatabaseUsage{}
3947	}
3948	return iter.page.Values()[iter.i]
3949}
3950
3951// Creates a new instance of the DatabaseUsageListResultIterator type.
3952func NewDatabaseUsageListResultIterator(page DatabaseUsageListResultPage) DatabaseUsageListResultIterator {
3953	return DatabaseUsageListResultIterator{page: page}
3954}
3955
3956// IsEmpty returns true if the ListResult contains no values.
3957func (dulr DatabaseUsageListResult) IsEmpty() bool {
3958	return dulr.Value == nil || len(*dulr.Value) == 0
3959}
3960
3961// hasNextLink returns true if the NextLink is not empty.
3962func (dulr DatabaseUsageListResult) hasNextLink() bool {
3963	return dulr.NextLink != nil && len(*dulr.NextLink) != 0
3964}
3965
3966// databaseUsageListResultPreparer prepares a request to retrieve the next set of results.
3967// It returns nil if no more results exist.
3968func (dulr DatabaseUsageListResult) databaseUsageListResultPreparer(ctx context.Context) (*http.Request, error) {
3969	if !dulr.hasNextLink() {
3970		return nil, nil
3971	}
3972	return autorest.Prepare((&http.Request{}).WithContext(ctx),
3973		autorest.AsJSON(),
3974		autorest.AsGet(),
3975		autorest.WithBaseURL(to.String(dulr.NextLink)))
3976}
3977
3978// DatabaseUsageListResultPage contains a page of DatabaseUsage values.
3979type DatabaseUsageListResultPage struct {
3980	fn   func(context.Context, DatabaseUsageListResult) (DatabaseUsageListResult, error)
3981	dulr DatabaseUsageListResult
3982}
3983
3984// NextWithContext advances to the next page of values.  If there was an error making
3985// the request the page does not advance and the error is returned.
3986func (page *DatabaseUsageListResultPage) NextWithContext(ctx context.Context) (err error) {
3987	if tracing.IsEnabled() {
3988		ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseUsageListResultPage.NextWithContext")
3989		defer func() {
3990			sc := -1
3991			if page.Response().Response.Response != nil {
3992				sc = page.Response().Response.Response.StatusCode
3993			}
3994			tracing.EndSpan(ctx, sc, err)
3995		}()
3996	}
3997	for {
3998		next, err := page.fn(ctx, page.dulr)
3999		if err != nil {
4000			return err
4001		}
4002		page.dulr = next
4003		if !next.hasNextLink() || !next.IsEmpty() {
4004			break
4005		}
4006	}
4007	return nil
4008}
4009
4010// Next advances to the next page of values.  If there was an error making
4011// the request the page does not advance and the error is returned.
4012// Deprecated: Use NextWithContext() instead.
4013func (page *DatabaseUsageListResultPage) Next() error {
4014	return page.NextWithContext(context.Background())
4015}
4016
4017// NotDone returns true if the page enumeration should be started or is not yet complete.
4018func (page DatabaseUsageListResultPage) NotDone() bool {
4019	return !page.dulr.IsEmpty()
4020}
4021
4022// Response returns the raw server response from the last page request.
4023func (page DatabaseUsageListResultPage) Response() DatabaseUsageListResult {
4024	return page.dulr
4025}
4026
4027// Values returns the slice of values for the current page or nil if there are no values.
4028func (page DatabaseUsageListResultPage) Values() []DatabaseUsage {
4029	if page.dulr.IsEmpty() {
4030		return nil
4031	}
4032	return *page.dulr.Value
4033}
4034
4035// Creates a new instance of the DatabaseUsageListResultPage type.
4036func NewDatabaseUsageListResultPage(cur DatabaseUsageListResult, getNextPage func(context.Context, DatabaseUsageListResult) (DatabaseUsageListResult, error)) DatabaseUsageListResultPage {
4037	return DatabaseUsageListResultPage{
4038		fn:   getNextPage,
4039		dulr: cur,
4040	}
4041}
4042
4043// DatabaseUsageProperties properties of a database usage.
4044type DatabaseUsageProperties struct {
4045	// DisplayName - READ-ONLY; User-readable name of the metric.
4046	DisplayName *string `json:"displayName,omitempty"`
4047	// CurrentValue - READ-ONLY; Current value of the metric.
4048	CurrentValue *float64 `json:"currentValue,omitempty"`
4049	// Limit - READ-ONLY; Boundary value of the metric.
4050	Limit *float64 `json:"limit,omitempty"`
4051	// Unit - READ-ONLY; Unit of the metric.
4052	Unit *string `json:"unit,omitempty"`
4053}
4054
4055// MarshalJSON is the custom marshaler for DatabaseUsageProperties.
4056func (dup DatabaseUsageProperties) MarshalJSON() ([]byte, error) {
4057	objectMap := make(map[string]interface{})
4058	return json.Marshal(objectMap)
4059}
4060
4061// DatabaseVulnerabilityAssessment a database vulnerability assessment.
4062type DatabaseVulnerabilityAssessment struct {
4063	autorest.Response `json:"-"`
4064	// DatabaseVulnerabilityAssessmentProperties - Resource properties.
4065	*DatabaseVulnerabilityAssessmentProperties `json:"properties,omitempty"`
4066	// ID - READ-ONLY; Resource ID.
4067	ID *string `json:"id,omitempty"`
4068	// Name - READ-ONLY; Resource name.
4069	Name *string `json:"name,omitempty"`
4070	// Type - READ-ONLY; Resource type.
4071	Type *string `json:"type,omitempty"`
4072}
4073
4074// MarshalJSON is the custom marshaler for DatabaseVulnerabilityAssessment.
4075func (dva DatabaseVulnerabilityAssessment) MarshalJSON() ([]byte, error) {
4076	objectMap := make(map[string]interface{})
4077	if dva.DatabaseVulnerabilityAssessmentProperties != nil {
4078		objectMap["properties"] = dva.DatabaseVulnerabilityAssessmentProperties
4079	}
4080	return json.Marshal(objectMap)
4081}
4082
4083// UnmarshalJSON is the custom unmarshaler for DatabaseVulnerabilityAssessment struct.
4084func (dva *DatabaseVulnerabilityAssessment) UnmarshalJSON(body []byte) error {
4085	var m map[string]*json.RawMessage
4086	err := json.Unmarshal(body, &m)
4087	if err != nil {
4088		return err
4089	}
4090	for k, v := range m {
4091		switch k {
4092		case "properties":
4093			if v != nil {
4094				var databaseVulnerabilityAssessmentProperties DatabaseVulnerabilityAssessmentProperties
4095				err = json.Unmarshal(*v, &databaseVulnerabilityAssessmentProperties)
4096				if err != nil {
4097					return err
4098				}
4099				dva.DatabaseVulnerabilityAssessmentProperties = &databaseVulnerabilityAssessmentProperties
4100			}
4101		case "id":
4102			if v != nil {
4103				var ID string
4104				err = json.Unmarshal(*v, &ID)
4105				if err != nil {
4106					return err
4107				}
4108				dva.ID = &ID
4109			}
4110		case "name":
4111			if v != nil {
4112				var name string
4113				err = json.Unmarshal(*v, &name)
4114				if err != nil {
4115					return err
4116				}
4117				dva.Name = &name
4118			}
4119		case "type":
4120			if v != nil {
4121				var typeVar string
4122				err = json.Unmarshal(*v, &typeVar)
4123				if err != nil {
4124					return err
4125				}
4126				dva.Type = &typeVar
4127			}
4128		}
4129	}
4130
4131	return nil
4132}
4133
4134// DatabaseVulnerabilityAssessmentListResult a list of the database's vulnerability assessments.
4135type DatabaseVulnerabilityAssessmentListResult struct {
4136	autorest.Response `json:"-"`
4137	// Value - READ-ONLY; Array of results.
4138	Value *[]DatabaseVulnerabilityAssessment `json:"value,omitempty"`
4139	// NextLink - READ-ONLY; Link to retrieve next page of results.
4140	NextLink *string `json:"nextLink,omitempty"`
4141}
4142
4143// MarshalJSON is the custom marshaler for DatabaseVulnerabilityAssessmentListResult.
4144func (dvalr DatabaseVulnerabilityAssessmentListResult) MarshalJSON() ([]byte, error) {
4145	objectMap := make(map[string]interface{})
4146	return json.Marshal(objectMap)
4147}
4148
4149// DatabaseVulnerabilityAssessmentListResultIterator provides access to a complete listing of
4150// DatabaseVulnerabilityAssessment values.
4151type DatabaseVulnerabilityAssessmentListResultIterator struct {
4152	i    int
4153	page DatabaseVulnerabilityAssessmentListResultPage
4154}
4155
4156// NextWithContext advances to the next value.  If there was an error making
4157// the request the iterator does not advance and the error is returned.
4158func (iter *DatabaseVulnerabilityAssessmentListResultIterator) NextWithContext(ctx context.Context) (err error) {
4159	if tracing.IsEnabled() {
4160		ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseVulnerabilityAssessmentListResultIterator.NextWithContext")
4161		defer func() {
4162			sc := -1
4163			if iter.Response().Response.Response != nil {
4164				sc = iter.Response().Response.Response.StatusCode
4165			}
4166			tracing.EndSpan(ctx, sc, err)
4167		}()
4168	}
4169	iter.i++
4170	if iter.i < len(iter.page.Values()) {
4171		return nil
4172	}
4173	err = iter.page.NextWithContext(ctx)
4174	if err != nil {
4175		iter.i--
4176		return err
4177	}
4178	iter.i = 0
4179	return nil
4180}
4181
4182// Next advances to the next value.  If there was an error making
4183// the request the iterator does not advance and the error is returned.
4184// Deprecated: Use NextWithContext() instead.
4185func (iter *DatabaseVulnerabilityAssessmentListResultIterator) Next() error {
4186	return iter.NextWithContext(context.Background())
4187}
4188
4189// NotDone returns true if the enumeration should be started or is not yet complete.
4190func (iter DatabaseVulnerabilityAssessmentListResultIterator) NotDone() bool {
4191	return iter.page.NotDone() && iter.i < len(iter.page.Values())
4192}
4193
4194// Response returns the raw server response from the last page request.
4195func (iter DatabaseVulnerabilityAssessmentListResultIterator) Response() DatabaseVulnerabilityAssessmentListResult {
4196	return iter.page.Response()
4197}
4198
4199// Value returns the current value or a zero-initialized value if the
4200// iterator has advanced beyond the end of the collection.
4201func (iter DatabaseVulnerabilityAssessmentListResultIterator) Value() DatabaseVulnerabilityAssessment {
4202	if !iter.page.NotDone() {
4203		return DatabaseVulnerabilityAssessment{}
4204	}
4205	return iter.page.Values()[iter.i]
4206}
4207
4208// Creates a new instance of the DatabaseVulnerabilityAssessmentListResultIterator type.
4209func NewDatabaseVulnerabilityAssessmentListResultIterator(page DatabaseVulnerabilityAssessmentListResultPage) DatabaseVulnerabilityAssessmentListResultIterator {
4210	return DatabaseVulnerabilityAssessmentListResultIterator{page: page}
4211}
4212
4213// IsEmpty returns true if the ListResult contains no values.
4214func (dvalr DatabaseVulnerabilityAssessmentListResult) IsEmpty() bool {
4215	return dvalr.Value == nil || len(*dvalr.Value) == 0
4216}
4217
4218// hasNextLink returns true if the NextLink is not empty.
4219func (dvalr DatabaseVulnerabilityAssessmentListResult) hasNextLink() bool {
4220	return dvalr.NextLink != nil && len(*dvalr.NextLink) != 0
4221}
4222
4223// databaseVulnerabilityAssessmentListResultPreparer prepares a request to retrieve the next set of results.
4224// It returns nil if no more results exist.
4225func (dvalr DatabaseVulnerabilityAssessmentListResult) databaseVulnerabilityAssessmentListResultPreparer(ctx context.Context) (*http.Request, error) {
4226	if !dvalr.hasNextLink() {
4227		return nil, nil
4228	}
4229	return autorest.Prepare((&http.Request{}).WithContext(ctx),
4230		autorest.AsJSON(),
4231		autorest.AsGet(),
4232		autorest.WithBaseURL(to.String(dvalr.NextLink)))
4233}
4234
4235// DatabaseVulnerabilityAssessmentListResultPage contains a page of DatabaseVulnerabilityAssessment values.
4236type DatabaseVulnerabilityAssessmentListResultPage struct {
4237	fn    func(context.Context, DatabaseVulnerabilityAssessmentListResult) (DatabaseVulnerabilityAssessmentListResult, error)
4238	dvalr DatabaseVulnerabilityAssessmentListResult
4239}
4240
4241// NextWithContext advances to the next page of values.  If there was an error making
4242// the request the page does not advance and the error is returned.
4243func (page *DatabaseVulnerabilityAssessmentListResultPage) NextWithContext(ctx context.Context) (err error) {
4244	if tracing.IsEnabled() {
4245		ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseVulnerabilityAssessmentListResultPage.NextWithContext")
4246		defer func() {
4247			sc := -1
4248			if page.Response().Response.Response != nil {
4249				sc = page.Response().Response.Response.StatusCode
4250			}
4251			tracing.EndSpan(ctx, sc, err)
4252		}()
4253	}
4254	for {
4255		next, err := page.fn(ctx, page.dvalr)
4256		if err != nil {
4257			return err
4258		}
4259		page.dvalr = next
4260		if !next.hasNextLink() || !next.IsEmpty() {
4261			break
4262		}
4263	}
4264	return nil
4265}
4266
4267// Next advances to the next page of values.  If there was an error making
4268// the request the page does not advance and the error is returned.
4269// Deprecated: Use NextWithContext() instead.
4270func (page *DatabaseVulnerabilityAssessmentListResultPage) Next() error {
4271	return page.NextWithContext(context.Background())
4272}
4273
4274// NotDone returns true if the page enumeration should be started or is not yet complete.
4275func (page DatabaseVulnerabilityAssessmentListResultPage) NotDone() bool {
4276	return !page.dvalr.IsEmpty()
4277}
4278
4279// Response returns the raw server response from the last page request.
4280func (page DatabaseVulnerabilityAssessmentListResultPage) Response() DatabaseVulnerabilityAssessmentListResult {
4281	return page.dvalr
4282}
4283
4284// Values returns the slice of values for the current page or nil if there are no values.
4285func (page DatabaseVulnerabilityAssessmentListResultPage) Values() []DatabaseVulnerabilityAssessment {
4286	if page.dvalr.IsEmpty() {
4287		return nil
4288	}
4289	return *page.dvalr.Value
4290}
4291
4292// Creates a new instance of the DatabaseVulnerabilityAssessmentListResultPage type.
4293func NewDatabaseVulnerabilityAssessmentListResultPage(cur DatabaseVulnerabilityAssessmentListResult, getNextPage func(context.Context, DatabaseVulnerabilityAssessmentListResult) (DatabaseVulnerabilityAssessmentListResult, error)) DatabaseVulnerabilityAssessmentListResultPage {
4294	return DatabaseVulnerabilityAssessmentListResultPage{
4295		fn:    getNextPage,
4296		dvalr: cur,
4297	}
4298}
4299
4300// DatabaseVulnerabilityAssessmentProperties properties of a database Vulnerability Assessment.
4301type DatabaseVulnerabilityAssessmentProperties struct {
4302	// StorageContainerPath - A blob storage container path to hold the scan results (e.g. https://myStorage.blob.core.windows.net/VaScans/).  It is required if server level vulnerability assessment policy doesn't set
4303	StorageContainerPath *string `json:"storageContainerPath,omitempty"`
4304	// 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.
4305	StorageContainerSasKey *string `json:"storageContainerSasKey,omitempty"`
4306	// StorageAccountAccessKey - Specifies the identifier key of the storage account for vulnerability assessment scan results. If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is required.
4307	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
4308	// RecurringScans - The recurring scans settings
4309	RecurringScans *VulnerabilityAssessmentRecurringScansProperties `json:"recurringScans,omitempty"`
4310}
4311
4312// DatabaseVulnerabilityAssessmentRuleBaseline a database vulnerability assessment rule baseline.
4313type DatabaseVulnerabilityAssessmentRuleBaseline struct {
4314	autorest.Response `json:"-"`
4315	// DatabaseVulnerabilityAssessmentRuleBaselineProperties - Resource properties.
4316	*DatabaseVulnerabilityAssessmentRuleBaselineProperties `json:"properties,omitempty"`
4317	// ID - READ-ONLY; Resource ID.
4318	ID *string `json:"id,omitempty"`
4319	// Name - READ-ONLY; Resource name.
4320	Name *string `json:"name,omitempty"`
4321	// Type - READ-ONLY; Resource type.
4322	Type *string `json:"type,omitempty"`
4323}
4324
4325// MarshalJSON is the custom marshaler for DatabaseVulnerabilityAssessmentRuleBaseline.
4326func (dvarb DatabaseVulnerabilityAssessmentRuleBaseline) MarshalJSON() ([]byte, error) {
4327	objectMap := make(map[string]interface{})
4328	if dvarb.DatabaseVulnerabilityAssessmentRuleBaselineProperties != nil {
4329		objectMap["properties"] = dvarb.DatabaseVulnerabilityAssessmentRuleBaselineProperties
4330	}
4331	return json.Marshal(objectMap)
4332}
4333
4334// UnmarshalJSON is the custom unmarshaler for DatabaseVulnerabilityAssessmentRuleBaseline struct.
4335func (dvarb *DatabaseVulnerabilityAssessmentRuleBaseline) UnmarshalJSON(body []byte) error {
4336	var m map[string]*json.RawMessage
4337	err := json.Unmarshal(body, &m)
4338	if err != nil {
4339		return err
4340	}
4341	for k, v := range m {
4342		switch k {
4343		case "properties":
4344			if v != nil {
4345				var databaseVulnerabilityAssessmentRuleBaselineProperties DatabaseVulnerabilityAssessmentRuleBaselineProperties
4346				err = json.Unmarshal(*v, &databaseVulnerabilityAssessmentRuleBaselineProperties)
4347				if err != nil {
4348					return err
4349				}
4350				dvarb.DatabaseVulnerabilityAssessmentRuleBaselineProperties = &databaseVulnerabilityAssessmentRuleBaselineProperties
4351			}
4352		case "id":
4353			if v != nil {
4354				var ID string
4355				err = json.Unmarshal(*v, &ID)
4356				if err != nil {
4357					return err
4358				}
4359				dvarb.ID = &ID
4360			}
4361		case "name":
4362			if v != nil {
4363				var name string
4364				err = json.Unmarshal(*v, &name)
4365				if err != nil {
4366					return err
4367				}
4368				dvarb.Name = &name
4369			}
4370		case "type":
4371			if v != nil {
4372				var typeVar string
4373				err = json.Unmarshal(*v, &typeVar)
4374				if err != nil {
4375					return err
4376				}
4377				dvarb.Type = &typeVar
4378			}
4379		}
4380	}
4381
4382	return nil
4383}
4384
4385// DatabaseVulnerabilityAssessmentRuleBaselineItem properties for an Azure SQL Database Vulnerability
4386// Assessment rule baseline's result.
4387type DatabaseVulnerabilityAssessmentRuleBaselineItem struct {
4388	// Result - The rule baseline result
4389	Result *[]string `json:"result,omitempty"`
4390}
4391
4392// DatabaseVulnerabilityAssessmentRuleBaselineProperties properties of a database Vulnerability Assessment
4393// rule baseline.
4394type DatabaseVulnerabilityAssessmentRuleBaselineProperties struct {
4395	// BaselineResults - The rule baseline result
4396	BaselineResults *[]DatabaseVulnerabilityAssessmentRuleBaselineItem `json:"baselineResults,omitempty"`
4397}
4398
4399// DatabaseVulnerabilityAssessmentScanExportProperties properties of the export operation's result.
4400type DatabaseVulnerabilityAssessmentScanExportProperties struct {
4401	// ExportedReportLocation - READ-ONLY; Location of the exported report (e.g. https://myStorage.blob.core.windows.net/VaScans/scans/serverName/databaseName/scan_scanId.xlsx).
4402	ExportedReportLocation *string `json:"exportedReportLocation,omitempty"`
4403}
4404
4405// MarshalJSON is the custom marshaler for DatabaseVulnerabilityAssessmentScanExportProperties.
4406func (dvasep DatabaseVulnerabilityAssessmentScanExportProperties) MarshalJSON() ([]byte, error) {
4407	objectMap := make(map[string]interface{})
4408	return json.Marshal(objectMap)
4409}
4410
4411// DatabaseVulnerabilityAssessmentScansExport a database Vulnerability Assessment scan export resource.
4412type DatabaseVulnerabilityAssessmentScansExport struct {
4413	autorest.Response `json:"-"`
4414	// DatabaseVulnerabilityAssessmentScanExportProperties - Resource properties.
4415	*DatabaseVulnerabilityAssessmentScanExportProperties `json:"properties,omitempty"`
4416	// ID - READ-ONLY; Resource ID.
4417	ID *string `json:"id,omitempty"`
4418	// Name - READ-ONLY; Resource name.
4419	Name *string `json:"name,omitempty"`
4420	// Type - READ-ONLY; Resource type.
4421	Type *string `json:"type,omitempty"`
4422}
4423
4424// MarshalJSON is the custom marshaler for DatabaseVulnerabilityAssessmentScansExport.
4425func (dvase DatabaseVulnerabilityAssessmentScansExport) MarshalJSON() ([]byte, error) {
4426	objectMap := make(map[string]interface{})
4427	if dvase.DatabaseVulnerabilityAssessmentScanExportProperties != nil {
4428		objectMap["properties"] = dvase.DatabaseVulnerabilityAssessmentScanExportProperties
4429	}
4430	return json.Marshal(objectMap)
4431}
4432
4433// UnmarshalJSON is the custom unmarshaler for DatabaseVulnerabilityAssessmentScansExport struct.
4434func (dvase *DatabaseVulnerabilityAssessmentScansExport) UnmarshalJSON(body []byte) error {
4435	var m map[string]*json.RawMessage
4436	err := json.Unmarshal(body, &m)
4437	if err != nil {
4438		return err
4439	}
4440	for k, v := range m {
4441		switch k {
4442		case "properties":
4443			if v != nil {
4444				var databaseVulnerabilityAssessmentScanExportProperties DatabaseVulnerabilityAssessmentScanExportProperties
4445				err = json.Unmarshal(*v, &databaseVulnerabilityAssessmentScanExportProperties)
4446				if err != nil {
4447					return err
4448				}
4449				dvase.DatabaseVulnerabilityAssessmentScanExportProperties = &databaseVulnerabilityAssessmentScanExportProperties
4450			}
4451		case "id":
4452			if v != nil {
4453				var ID string
4454				err = json.Unmarshal(*v, &ID)
4455				if err != nil {
4456					return err
4457				}
4458				dvase.ID = &ID
4459			}
4460		case "name":
4461			if v != nil {
4462				var name string
4463				err = json.Unmarshal(*v, &name)
4464				if err != nil {
4465					return err
4466				}
4467				dvase.Name = &name
4468			}
4469		case "type":
4470			if v != nil {
4471				var typeVar string
4472				err = json.Unmarshal(*v, &typeVar)
4473				if err != nil {
4474					return err
4475				}
4476				dvase.Type = &typeVar
4477			}
4478		}
4479	}
4480
4481	return nil
4482}
4483
4484// DatabaseVulnerabilityAssessmentScansInitiateScanFuture an abstraction for monitoring and retrieving the
4485// results of a long-running operation.
4486type DatabaseVulnerabilityAssessmentScansInitiateScanFuture struct {
4487	azure.FutureAPI
4488	// Result returns the result of the asynchronous operation.
4489	// If the operation has not completed it will return an error.
4490	Result func(DatabaseVulnerabilityAssessmentScansClient) (autorest.Response, error)
4491}
4492
4493// UnmarshalJSON is the custom unmarshaller for CreateFuture.
4494func (future *DatabaseVulnerabilityAssessmentScansInitiateScanFuture) UnmarshalJSON(body []byte) error {
4495	var azFuture azure.Future
4496	if err := json.Unmarshal(body, &azFuture); err != nil {
4497		return err
4498	}
4499	future.FutureAPI = &azFuture
4500	future.Result = future.result
4501	return nil
4502}
4503
4504// result is the default implementation for DatabaseVulnerabilityAssessmentScansInitiateScanFuture.Result.
4505func (future *DatabaseVulnerabilityAssessmentScansInitiateScanFuture) result(client DatabaseVulnerabilityAssessmentScansClient) (ar autorest.Response, err error) {
4506	var done bool
4507	done, err = future.DoneWithContext(context.Background(), client)
4508	if err != nil {
4509		err = autorest.NewErrorWithError(err, "sql.DatabaseVulnerabilityAssessmentScansInitiateScanFuture", "Result", future.Response(), "Polling failure")
4510		return
4511	}
4512	if !done {
4513		ar.Response = future.Response()
4514		err = azure.NewAsyncOpIncompleteError("sql.DatabaseVulnerabilityAssessmentScansInitiateScanFuture")
4515		return
4516	}
4517	ar.Response = future.Response()
4518	return
4519}
4520
4521// DataMaskingPolicy represents a database data masking policy.
4522type DataMaskingPolicy struct {
4523	autorest.Response `json:"-"`
4524	// DataMaskingPolicyProperties - The properties of the data masking policy.
4525	*DataMaskingPolicyProperties `json:"properties,omitempty"`
4526	// Location - READ-ONLY; The location of the data masking policy.
4527	Location *string `json:"location,omitempty"`
4528	// Kind - READ-ONLY; The kind of data masking policy. Metadata, used for Azure portal.
4529	Kind *string `json:"kind,omitempty"`
4530	// ID - READ-ONLY; Resource ID.
4531	ID *string `json:"id,omitempty"`
4532	// Name - READ-ONLY; Resource name.
4533	Name *string `json:"name,omitempty"`
4534	// Type - READ-ONLY; Resource type.
4535	Type *string `json:"type,omitempty"`
4536}
4537
4538// MarshalJSON is the custom marshaler for DataMaskingPolicy.
4539func (dmp DataMaskingPolicy) MarshalJSON() ([]byte, error) {
4540	objectMap := make(map[string]interface{})
4541	if dmp.DataMaskingPolicyProperties != nil {
4542		objectMap["properties"] = dmp.DataMaskingPolicyProperties
4543	}
4544	return json.Marshal(objectMap)
4545}
4546
4547// UnmarshalJSON is the custom unmarshaler for DataMaskingPolicy struct.
4548func (dmp *DataMaskingPolicy) UnmarshalJSON(body []byte) error {
4549	var m map[string]*json.RawMessage
4550	err := json.Unmarshal(body, &m)
4551	if err != nil {
4552		return err
4553	}
4554	for k, v := range m {
4555		switch k {
4556		case "properties":
4557			if v != nil {
4558				var dataMaskingPolicyProperties DataMaskingPolicyProperties
4559				err = json.Unmarshal(*v, &dataMaskingPolicyProperties)
4560				if err != nil {
4561					return err
4562				}
4563				dmp.DataMaskingPolicyProperties = &dataMaskingPolicyProperties
4564			}
4565		case "location":
4566			if v != nil {
4567				var location string
4568				err = json.Unmarshal(*v, &location)
4569				if err != nil {
4570					return err
4571				}
4572				dmp.Location = &location
4573			}
4574		case "kind":
4575			if v != nil {
4576				var kind string
4577				err = json.Unmarshal(*v, &kind)
4578				if err != nil {
4579					return err
4580				}
4581				dmp.Kind = &kind
4582			}
4583		case "id":
4584			if v != nil {
4585				var ID string
4586				err = json.Unmarshal(*v, &ID)
4587				if err != nil {
4588					return err
4589				}
4590				dmp.ID = &ID
4591			}
4592		case "name":
4593			if v != nil {
4594				var name string
4595				err = json.Unmarshal(*v, &name)
4596				if err != nil {
4597					return err
4598				}
4599				dmp.Name = &name
4600			}
4601		case "type":
4602			if v != nil {
4603				var typeVar string
4604				err = json.Unmarshal(*v, &typeVar)
4605				if err != nil {
4606					return err
4607				}
4608				dmp.Type = &typeVar
4609			}
4610		}
4611	}
4612
4613	return nil
4614}
4615
4616// DataMaskingPolicyProperties the properties of a database data masking policy.
4617type DataMaskingPolicyProperties struct {
4618	// DataMaskingState - The state of the data masking policy. Possible values include: 'DataMaskingStateDisabled', 'DataMaskingStateEnabled'
4619	DataMaskingState DataMaskingState `json:"dataMaskingState,omitempty"`
4620	// 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.
4621	ExemptPrincipals *string `json:"exemptPrincipals,omitempty"`
4622	// ApplicationPrincipals - READ-ONLY; The list of the application principals. This is a legacy parameter and is no longer used.
4623	ApplicationPrincipals *string `json:"applicationPrincipals,omitempty"`
4624	// MaskingLevel - READ-ONLY; The masking level. This is a legacy parameter and is no longer used.
4625	MaskingLevel *string `json:"maskingLevel,omitempty"`
4626}
4627
4628// MarshalJSON is the custom marshaler for DataMaskingPolicyProperties.
4629func (dmpp DataMaskingPolicyProperties) MarshalJSON() ([]byte, error) {
4630	objectMap := make(map[string]interface{})
4631	if dmpp.DataMaskingState != "" {
4632		objectMap["dataMaskingState"] = dmpp.DataMaskingState
4633	}
4634	if dmpp.ExemptPrincipals != nil {
4635		objectMap["exemptPrincipals"] = dmpp.ExemptPrincipals
4636	}
4637	return json.Marshal(objectMap)
4638}
4639
4640// DataMaskingRule represents a database data masking rule.
4641type DataMaskingRule struct {
4642	autorest.Response `json:"-"`
4643	// DataMaskingRuleProperties - The properties of the resource.
4644	*DataMaskingRuleProperties `json:"properties,omitempty"`
4645	// Location - READ-ONLY; The location of the data masking rule.
4646	Location *string `json:"location,omitempty"`
4647	// Kind - READ-ONLY; The kind of Data Masking Rule. Metadata, used for Azure portal.
4648	Kind *string `json:"kind,omitempty"`
4649	// ID - READ-ONLY; Resource ID.
4650	ID *string `json:"id,omitempty"`
4651	// Name - READ-ONLY; Resource name.
4652	Name *string `json:"name,omitempty"`
4653	// Type - READ-ONLY; Resource type.
4654	Type *string `json:"type,omitempty"`
4655}
4656
4657// MarshalJSON is the custom marshaler for DataMaskingRule.
4658func (dmr DataMaskingRule) MarshalJSON() ([]byte, error) {
4659	objectMap := make(map[string]interface{})
4660	if dmr.DataMaskingRuleProperties != nil {
4661		objectMap["properties"] = dmr.DataMaskingRuleProperties
4662	}
4663	return json.Marshal(objectMap)
4664}
4665
4666// UnmarshalJSON is the custom unmarshaler for DataMaskingRule struct.
4667func (dmr *DataMaskingRule) UnmarshalJSON(body []byte) error {
4668	var m map[string]*json.RawMessage
4669	err := json.Unmarshal(body, &m)
4670	if err != nil {
4671		return err
4672	}
4673	for k, v := range m {
4674		switch k {
4675		case "properties":
4676			if v != nil {
4677				var dataMaskingRuleProperties DataMaskingRuleProperties
4678				err = json.Unmarshal(*v, &dataMaskingRuleProperties)
4679				if err != nil {
4680					return err
4681				}
4682				dmr.DataMaskingRuleProperties = &dataMaskingRuleProperties
4683			}
4684		case "location":
4685			if v != nil {
4686				var location string
4687				err = json.Unmarshal(*v, &location)
4688				if err != nil {
4689					return err
4690				}
4691				dmr.Location = &location
4692			}
4693		case "kind":
4694			if v != nil {
4695				var kind string
4696				err = json.Unmarshal(*v, &kind)
4697				if err != nil {
4698					return err
4699				}
4700				dmr.Kind = &kind
4701			}
4702		case "id":
4703			if v != nil {
4704				var ID string
4705				err = json.Unmarshal(*v, &ID)
4706				if err != nil {
4707					return err
4708				}
4709				dmr.ID = &ID
4710			}
4711		case "name":
4712			if v != nil {
4713				var name string
4714				err = json.Unmarshal(*v, &name)
4715				if err != nil {
4716					return err
4717				}
4718				dmr.Name = &name
4719			}
4720		case "type":
4721			if v != nil {
4722				var typeVar string
4723				err = json.Unmarshal(*v, &typeVar)
4724				if err != nil {
4725					return err
4726				}
4727				dmr.Type = &typeVar
4728			}
4729		}
4730	}
4731
4732	return nil
4733}
4734
4735// DataMaskingRuleListResult the response to a list data masking rules request.
4736type DataMaskingRuleListResult struct {
4737	autorest.Response `json:"-"`
4738	// Value - The list of database data masking rules.
4739	Value *[]DataMaskingRule `json:"value,omitempty"`
4740}
4741
4742// DataMaskingRuleProperties the properties of a database data masking rule.
4743type DataMaskingRuleProperties struct {
4744	// ID - READ-ONLY; The rule Id.
4745	ID *string `json:"id,omitempty"`
4746	// AliasName - The alias name. This is a legacy parameter and is no longer used.
4747	AliasName *string `json:"aliasName,omitempty"`
4748	// 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'
4749	RuleState DataMaskingRuleState `json:"ruleState,omitempty"`
4750	// SchemaName - The schema name on which the data masking rule is applied.
4751	SchemaName *string `json:"schemaName,omitempty"`
4752	// TableName - The table name on which the data masking rule is applied.
4753	TableName *string `json:"tableName,omitempty"`
4754	// ColumnName - The column name on which the data masking rule is applied.
4755	ColumnName *string `json:"columnName,omitempty"`
4756	// MaskingFunction - The masking function that is used for the data masking rule. Possible values include: 'DataMaskingFunctionDefault', 'DataMaskingFunctionCCN', 'DataMaskingFunctionEmail', 'DataMaskingFunctionNumber', 'DataMaskingFunctionSSN', 'DataMaskingFunctionText'
4757	MaskingFunction DataMaskingFunction `json:"maskingFunction,omitempty"`
4758	// NumberFrom - The numberFrom property of the masking rule. Required if maskingFunction is set to Number, otherwise this parameter will be ignored.
4759	NumberFrom *string `json:"numberFrom,omitempty"`
4760	// NumberTo - The numberTo property of the data masking rule. Required if maskingFunction is set to Number, otherwise this parameter will be ignored.
4761	NumberTo *string `json:"numberTo,omitempty"`
4762	// 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.
4763	PrefixSize *string `json:"prefixSize,omitempty"`
4764	// 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.
4765	SuffixSize *string `json:"suffixSize,omitempty"`
4766	// 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.
4767	ReplacementString *string `json:"replacementString,omitempty"`
4768}
4769
4770// MarshalJSON is the custom marshaler for DataMaskingRuleProperties.
4771func (dmrp DataMaskingRuleProperties) MarshalJSON() ([]byte, error) {
4772	objectMap := make(map[string]interface{})
4773	if dmrp.AliasName != nil {
4774		objectMap["aliasName"] = dmrp.AliasName
4775	}
4776	if dmrp.RuleState != "" {
4777		objectMap["ruleState"] = dmrp.RuleState
4778	}
4779	if dmrp.SchemaName != nil {
4780		objectMap["schemaName"] = dmrp.SchemaName
4781	}
4782	if dmrp.TableName != nil {
4783		objectMap["tableName"] = dmrp.TableName
4784	}
4785	if dmrp.ColumnName != nil {
4786		objectMap["columnName"] = dmrp.ColumnName
4787	}
4788	if dmrp.MaskingFunction != "" {
4789		objectMap["maskingFunction"] = dmrp.MaskingFunction
4790	}
4791	if dmrp.NumberFrom != nil {
4792		objectMap["numberFrom"] = dmrp.NumberFrom
4793	}
4794	if dmrp.NumberTo != nil {
4795		objectMap["numberTo"] = dmrp.NumberTo
4796	}
4797	if dmrp.PrefixSize != nil {
4798		objectMap["prefixSize"] = dmrp.PrefixSize
4799	}
4800	if dmrp.SuffixSize != nil {
4801		objectMap["suffixSize"] = dmrp.SuffixSize
4802	}
4803	if dmrp.ReplacementString != nil {
4804		objectMap["replacementString"] = dmrp.ReplacementString
4805	}
4806	return json.Marshal(objectMap)
4807}
4808
4809// DataWarehouseUserActivities user activities of a data warehouse
4810type DataWarehouseUserActivities struct {
4811	autorest.Response `json:"-"`
4812	// DataWarehouseUserActivitiesProperties - Resource properties.
4813	*DataWarehouseUserActivitiesProperties `json:"properties,omitempty"`
4814	// ID - READ-ONLY; Resource ID.
4815	ID *string `json:"id,omitempty"`
4816	// Name - READ-ONLY; Resource name.
4817	Name *string `json:"name,omitempty"`
4818	// Type - READ-ONLY; Resource type.
4819	Type *string `json:"type,omitempty"`
4820}
4821
4822// MarshalJSON is the custom marshaler for DataWarehouseUserActivities.
4823func (dwua DataWarehouseUserActivities) MarshalJSON() ([]byte, error) {
4824	objectMap := make(map[string]interface{})
4825	if dwua.DataWarehouseUserActivitiesProperties != nil {
4826		objectMap["properties"] = dwua.DataWarehouseUserActivitiesProperties
4827	}
4828	return json.Marshal(objectMap)
4829}
4830
4831// UnmarshalJSON is the custom unmarshaler for DataWarehouseUserActivities struct.
4832func (dwua *DataWarehouseUserActivities) UnmarshalJSON(body []byte) error {
4833	var m map[string]*json.RawMessage
4834	err := json.Unmarshal(body, &m)
4835	if err != nil {
4836		return err
4837	}
4838	for k, v := range m {
4839		switch k {
4840		case "properties":
4841			if v != nil {
4842				var dataWarehouseUserActivitiesProperties DataWarehouseUserActivitiesProperties
4843				err = json.Unmarshal(*v, &dataWarehouseUserActivitiesProperties)
4844				if err != nil {
4845					return err
4846				}
4847				dwua.DataWarehouseUserActivitiesProperties = &dataWarehouseUserActivitiesProperties
4848			}
4849		case "id":
4850			if v != nil {
4851				var ID string
4852				err = json.Unmarshal(*v, &ID)
4853				if err != nil {
4854					return err
4855				}
4856				dwua.ID = &ID
4857			}
4858		case "name":
4859			if v != nil {
4860				var name string
4861				err = json.Unmarshal(*v, &name)
4862				if err != nil {
4863					return err
4864				}
4865				dwua.Name = &name
4866			}
4867		case "type":
4868			if v != nil {
4869				var typeVar string
4870				err = json.Unmarshal(*v, &typeVar)
4871				if err != nil {
4872					return err
4873				}
4874				dwua.Type = &typeVar
4875			}
4876		}
4877	}
4878
4879	return nil
4880}
4881
4882// DataWarehouseUserActivitiesListResult user activities of a data warehouse
4883type DataWarehouseUserActivitiesListResult struct {
4884	autorest.Response `json:"-"`
4885	// Value - READ-ONLY; Array of results.
4886	Value *[]DataWarehouseUserActivities `json:"value,omitempty"`
4887	// NextLink - READ-ONLY; Link to retrieve next page of results.
4888	NextLink *string `json:"nextLink,omitempty"`
4889}
4890
4891// MarshalJSON is the custom marshaler for DataWarehouseUserActivitiesListResult.
4892func (dwualr DataWarehouseUserActivitiesListResult) MarshalJSON() ([]byte, error) {
4893	objectMap := make(map[string]interface{})
4894	return json.Marshal(objectMap)
4895}
4896
4897// DataWarehouseUserActivitiesListResultIterator provides access to a complete listing of
4898// DataWarehouseUserActivities values.
4899type DataWarehouseUserActivitiesListResultIterator struct {
4900	i    int
4901	page DataWarehouseUserActivitiesListResultPage
4902}
4903
4904// NextWithContext advances to the next value.  If there was an error making
4905// the request the iterator does not advance and the error is returned.
4906func (iter *DataWarehouseUserActivitiesListResultIterator) NextWithContext(ctx context.Context) (err error) {
4907	if tracing.IsEnabled() {
4908		ctx = tracing.StartSpan(ctx, fqdn+"/DataWarehouseUserActivitiesListResultIterator.NextWithContext")
4909		defer func() {
4910			sc := -1
4911			if iter.Response().Response.Response != nil {
4912				sc = iter.Response().Response.Response.StatusCode
4913			}
4914			tracing.EndSpan(ctx, sc, err)
4915		}()
4916	}
4917	iter.i++
4918	if iter.i < len(iter.page.Values()) {
4919		return nil
4920	}
4921	err = iter.page.NextWithContext(ctx)
4922	if err != nil {
4923		iter.i--
4924		return err
4925	}
4926	iter.i = 0
4927	return nil
4928}
4929
4930// Next advances to the next value.  If there was an error making
4931// the request the iterator does not advance and the error is returned.
4932// Deprecated: Use NextWithContext() instead.
4933func (iter *DataWarehouseUserActivitiesListResultIterator) Next() error {
4934	return iter.NextWithContext(context.Background())
4935}
4936
4937// NotDone returns true if the enumeration should be started or is not yet complete.
4938func (iter DataWarehouseUserActivitiesListResultIterator) NotDone() bool {
4939	return iter.page.NotDone() && iter.i < len(iter.page.Values())
4940}
4941
4942// Response returns the raw server response from the last page request.
4943func (iter DataWarehouseUserActivitiesListResultIterator) Response() DataWarehouseUserActivitiesListResult {
4944	return iter.page.Response()
4945}
4946
4947// Value returns the current value or a zero-initialized value if the
4948// iterator has advanced beyond the end of the collection.
4949func (iter DataWarehouseUserActivitiesListResultIterator) Value() DataWarehouseUserActivities {
4950	if !iter.page.NotDone() {
4951		return DataWarehouseUserActivities{}
4952	}
4953	return iter.page.Values()[iter.i]
4954}
4955
4956// Creates a new instance of the DataWarehouseUserActivitiesListResultIterator type.
4957func NewDataWarehouseUserActivitiesListResultIterator(page DataWarehouseUserActivitiesListResultPage) DataWarehouseUserActivitiesListResultIterator {
4958	return DataWarehouseUserActivitiesListResultIterator{page: page}
4959}
4960
4961// IsEmpty returns true if the ListResult contains no values.
4962func (dwualr DataWarehouseUserActivitiesListResult) IsEmpty() bool {
4963	return dwualr.Value == nil || len(*dwualr.Value) == 0
4964}
4965
4966// hasNextLink returns true if the NextLink is not empty.
4967func (dwualr DataWarehouseUserActivitiesListResult) hasNextLink() bool {
4968	return dwualr.NextLink != nil && len(*dwualr.NextLink) != 0
4969}
4970
4971// dataWarehouseUserActivitiesListResultPreparer prepares a request to retrieve the next set of results.
4972// It returns nil if no more results exist.
4973func (dwualr DataWarehouseUserActivitiesListResult) dataWarehouseUserActivitiesListResultPreparer(ctx context.Context) (*http.Request, error) {
4974	if !dwualr.hasNextLink() {
4975		return nil, nil
4976	}
4977	return autorest.Prepare((&http.Request{}).WithContext(ctx),
4978		autorest.AsJSON(),
4979		autorest.AsGet(),
4980		autorest.WithBaseURL(to.String(dwualr.NextLink)))
4981}
4982
4983// DataWarehouseUserActivitiesListResultPage contains a page of DataWarehouseUserActivities values.
4984type DataWarehouseUserActivitiesListResultPage struct {
4985	fn     func(context.Context, DataWarehouseUserActivitiesListResult) (DataWarehouseUserActivitiesListResult, error)
4986	dwualr DataWarehouseUserActivitiesListResult
4987}
4988
4989// NextWithContext advances to the next page of values.  If there was an error making
4990// the request the page does not advance and the error is returned.
4991func (page *DataWarehouseUserActivitiesListResultPage) NextWithContext(ctx context.Context) (err error) {
4992	if tracing.IsEnabled() {
4993		ctx = tracing.StartSpan(ctx, fqdn+"/DataWarehouseUserActivitiesListResultPage.NextWithContext")
4994		defer func() {
4995			sc := -1
4996			if page.Response().Response.Response != nil {
4997				sc = page.Response().Response.Response.StatusCode
4998			}
4999			tracing.EndSpan(ctx, sc, err)
5000		}()
5001	}
5002	for {
5003		next, err := page.fn(ctx, page.dwualr)
5004		if err != nil {
5005			return err
5006		}
5007		page.dwualr = next
5008		if !next.hasNextLink() || !next.IsEmpty() {
5009			break
5010		}
5011	}
5012	return nil
5013}
5014
5015// Next advances to the next page of values.  If there was an error making
5016// the request the page does not advance and the error is returned.
5017// Deprecated: Use NextWithContext() instead.
5018func (page *DataWarehouseUserActivitiesListResultPage) Next() error {
5019	return page.NextWithContext(context.Background())
5020}
5021
5022// NotDone returns true if the page enumeration should be started or is not yet complete.
5023func (page DataWarehouseUserActivitiesListResultPage) NotDone() bool {
5024	return !page.dwualr.IsEmpty()
5025}
5026
5027// Response returns the raw server response from the last page request.
5028func (page DataWarehouseUserActivitiesListResultPage) Response() DataWarehouseUserActivitiesListResult {
5029	return page.dwualr
5030}
5031
5032// Values returns the slice of values for the current page or nil if there are no values.
5033func (page DataWarehouseUserActivitiesListResultPage) Values() []DataWarehouseUserActivities {
5034	if page.dwualr.IsEmpty() {
5035		return nil
5036	}
5037	return *page.dwualr.Value
5038}
5039
5040// Creates a new instance of the DataWarehouseUserActivitiesListResultPage type.
5041func NewDataWarehouseUserActivitiesListResultPage(cur DataWarehouseUserActivitiesListResult, getNextPage func(context.Context, DataWarehouseUserActivitiesListResult) (DataWarehouseUserActivitiesListResult, error)) DataWarehouseUserActivitiesListResultPage {
5042	return DataWarehouseUserActivitiesListResultPage{
5043		fn:     getNextPage,
5044		dwualr: cur,
5045	}
5046}
5047
5048// DataWarehouseUserActivitiesProperties user activities of a data warehouse. This currently includes the
5049// count of running or suspended queries. For more information, please view the sys.dm_pdw_exec_requests
5050// dynamic management view (DMV).
5051type DataWarehouseUserActivitiesProperties struct {
5052	// ActiveQueriesCount - READ-ONLY; Count of running and suspended queries.
5053	ActiveQueriesCount *int32 `json:"activeQueriesCount,omitempty"`
5054}
5055
5056// MarshalJSON is the custom marshaler for DataWarehouseUserActivitiesProperties.
5057func (dwuap DataWarehouseUserActivitiesProperties) MarshalJSON() ([]byte, error) {
5058	objectMap := make(map[string]interface{})
5059	return json.Marshal(objectMap)
5060}
5061
5062// DeletedServer a deleted server.
5063type DeletedServer struct {
5064	autorest.Response `json:"-"`
5065	// DeletedServerProperties - Resource properties.
5066	*DeletedServerProperties `json:"properties,omitempty"`
5067	// ID - READ-ONLY; Resource ID.
5068	ID *string `json:"id,omitempty"`
5069	// Name - READ-ONLY; Resource name.
5070	Name *string `json:"name,omitempty"`
5071	// Type - READ-ONLY; Resource type.
5072	Type *string `json:"type,omitempty"`
5073}
5074
5075// MarshalJSON is the custom marshaler for DeletedServer.
5076func (ds DeletedServer) MarshalJSON() ([]byte, error) {
5077	objectMap := make(map[string]interface{})
5078	if ds.DeletedServerProperties != nil {
5079		objectMap["properties"] = ds.DeletedServerProperties
5080	}
5081	return json.Marshal(objectMap)
5082}
5083
5084// UnmarshalJSON is the custom unmarshaler for DeletedServer struct.
5085func (ds *DeletedServer) UnmarshalJSON(body []byte) error {
5086	var m map[string]*json.RawMessage
5087	err := json.Unmarshal(body, &m)
5088	if err != nil {
5089		return err
5090	}
5091	for k, v := range m {
5092		switch k {
5093		case "properties":
5094			if v != nil {
5095				var deletedServerProperties DeletedServerProperties
5096				err = json.Unmarshal(*v, &deletedServerProperties)
5097				if err != nil {
5098					return err
5099				}
5100				ds.DeletedServerProperties = &deletedServerProperties
5101			}
5102		case "id":
5103			if v != nil {
5104				var ID string
5105				err = json.Unmarshal(*v, &ID)
5106				if err != nil {
5107					return err
5108				}
5109				ds.ID = &ID
5110			}
5111		case "name":
5112			if v != nil {
5113				var name string
5114				err = json.Unmarshal(*v, &name)
5115				if err != nil {
5116					return err
5117				}
5118				ds.Name = &name
5119			}
5120		case "type":
5121			if v != nil {
5122				var typeVar string
5123				err = json.Unmarshal(*v, &typeVar)
5124				if err != nil {
5125					return err
5126				}
5127				ds.Type = &typeVar
5128			}
5129		}
5130	}
5131
5132	return nil
5133}
5134
5135// DeletedServerListResult a list of deleted servers.
5136type DeletedServerListResult struct {
5137	autorest.Response `json:"-"`
5138	// Value - READ-ONLY; Array of results.
5139	Value *[]DeletedServer `json:"value,omitempty"`
5140	// NextLink - READ-ONLY; Link to retrieve next page of results.
5141	NextLink *string `json:"nextLink,omitempty"`
5142}
5143
5144// MarshalJSON is the custom marshaler for DeletedServerListResult.
5145func (dslr DeletedServerListResult) MarshalJSON() ([]byte, error) {
5146	objectMap := make(map[string]interface{})
5147	return json.Marshal(objectMap)
5148}
5149
5150// DeletedServerListResultIterator provides access to a complete listing of DeletedServer values.
5151type DeletedServerListResultIterator struct {
5152	i    int
5153	page DeletedServerListResultPage
5154}
5155
5156// NextWithContext advances to the next value.  If there was an error making
5157// the request the iterator does not advance and the error is returned.
5158func (iter *DeletedServerListResultIterator) NextWithContext(ctx context.Context) (err error) {
5159	if tracing.IsEnabled() {
5160		ctx = tracing.StartSpan(ctx, fqdn+"/DeletedServerListResultIterator.NextWithContext")
5161		defer func() {
5162			sc := -1
5163			if iter.Response().Response.Response != nil {
5164				sc = iter.Response().Response.Response.StatusCode
5165			}
5166			tracing.EndSpan(ctx, sc, err)
5167		}()
5168	}
5169	iter.i++
5170	if iter.i < len(iter.page.Values()) {
5171		return nil
5172	}
5173	err = iter.page.NextWithContext(ctx)
5174	if err != nil {
5175		iter.i--
5176		return err
5177	}
5178	iter.i = 0
5179	return nil
5180}
5181
5182// Next advances to the next value.  If there was an error making
5183// the request the iterator does not advance and the error is returned.
5184// Deprecated: Use NextWithContext() instead.
5185func (iter *DeletedServerListResultIterator) Next() error {
5186	return iter.NextWithContext(context.Background())
5187}
5188
5189// NotDone returns true if the enumeration should be started or is not yet complete.
5190func (iter DeletedServerListResultIterator) NotDone() bool {
5191	return iter.page.NotDone() && iter.i < len(iter.page.Values())
5192}
5193
5194// Response returns the raw server response from the last page request.
5195func (iter DeletedServerListResultIterator) Response() DeletedServerListResult {
5196	return iter.page.Response()
5197}
5198
5199// Value returns the current value or a zero-initialized value if the
5200// iterator has advanced beyond the end of the collection.
5201func (iter DeletedServerListResultIterator) Value() DeletedServer {
5202	if !iter.page.NotDone() {
5203		return DeletedServer{}
5204	}
5205	return iter.page.Values()[iter.i]
5206}
5207
5208// Creates a new instance of the DeletedServerListResultIterator type.
5209func NewDeletedServerListResultIterator(page DeletedServerListResultPage) DeletedServerListResultIterator {
5210	return DeletedServerListResultIterator{page: page}
5211}
5212
5213// IsEmpty returns true if the ListResult contains no values.
5214func (dslr DeletedServerListResult) IsEmpty() bool {
5215	return dslr.Value == nil || len(*dslr.Value) == 0
5216}
5217
5218// hasNextLink returns true if the NextLink is not empty.
5219func (dslr DeletedServerListResult) hasNextLink() bool {
5220	return dslr.NextLink != nil && len(*dslr.NextLink) != 0
5221}
5222
5223// deletedServerListResultPreparer prepares a request to retrieve the next set of results.
5224// It returns nil if no more results exist.
5225func (dslr DeletedServerListResult) deletedServerListResultPreparer(ctx context.Context) (*http.Request, error) {
5226	if !dslr.hasNextLink() {
5227		return nil, nil
5228	}
5229	return autorest.Prepare((&http.Request{}).WithContext(ctx),
5230		autorest.AsJSON(),
5231		autorest.AsGet(),
5232		autorest.WithBaseURL(to.String(dslr.NextLink)))
5233}
5234
5235// DeletedServerListResultPage contains a page of DeletedServer values.
5236type DeletedServerListResultPage struct {
5237	fn   func(context.Context, DeletedServerListResult) (DeletedServerListResult, error)
5238	dslr DeletedServerListResult
5239}
5240
5241// NextWithContext advances to the next page of values.  If there was an error making
5242// the request the page does not advance and the error is returned.
5243func (page *DeletedServerListResultPage) NextWithContext(ctx context.Context) (err error) {
5244	if tracing.IsEnabled() {
5245		ctx = tracing.StartSpan(ctx, fqdn+"/DeletedServerListResultPage.NextWithContext")
5246		defer func() {
5247			sc := -1
5248			if page.Response().Response.Response != nil {
5249				sc = page.Response().Response.Response.StatusCode
5250			}
5251			tracing.EndSpan(ctx, sc, err)
5252		}()
5253	}
5254	for {
5255		next, err := page.fn(ctx, page.dslr)
5256		if err != nil {
5257			return err
5258		}
5259		page.dslr = next
5260		if !next.hasNextLink() || !next.IsEmpty() {
5261			break
5262		}
5263	}
5264	return nil
5265}
5266
5267// Next advances to the next page of values.  If there was an error making
5268// the request the page does not advance and the error is returned.
5269// Deprecated: Use NextWithContext() instead.
5270func (page *DeletedServerListResultPage) Next() error {
5271	return page.NextWithContext(context.Background())
5272}
5273
5274// NotDone returns true if the page enumeration should be started or is not yet complete.
5275func (page DeletedServerListResultPage) NotDone() bool {
5276	return !page.dslr.IsEmpty()
5277}
5278
5279// Response returns the raw server response from the last page request.
5280func (page DeletedServerListResultPage) Response() DeletedServerListResult {
5281	return page.dslr
5282}
5283
5284// Values returns the slice of values for the current page or nil if there are no values.
5285func (page DeletedServerListResultPage) Values() []DeletedServer {
5286	if page.dslr.IsEmpty() {
5287		return nil
5288	}
5289	return *page.dslr.Value
5290}
5291
5292// Creates a new instance of the DeletedServerListResultPage type.
5293func NewDeletedServerListResultPage(cur DeletedServerListResult, getNextPage func(context.Context, DeletedServerListResult) (DeletedServerListResult, error)) DeletedServerListResultPage {
5294	return DeletedServerListResultPage{
5295		fn:   getNextPage,
5296		dslr: cur,
5297	}
5298}
5299
5300// DeletedServerProperties the properties of a deleted server.
5301type DeletedServerProperties struct {
5302	// Version - READ-ONLY; The version of the deleted server.
5303	Version *string `json:"version,omitempty"`
5304	// DeletionTime - READ-ONLY; The deletion time of the deleted server.
5305	DeletionTime *date.Time `json:"deletionTime,omitempty"`
5306	// OriginalID - READ-ONLY; The original ID of the server before deletion.
5307	OriginalID *string `json:"originalId,omitempty"`
5308	// FullyQualifiedDomainName - READ-ONLY; The fully qualified domain name of the server.
5309	FullyQualifiedDomainName *string `json:"fullyQualifiedDomainName,omitempty"`
5310}
5311
5312// MarshalJSON is the custom marshaler for DeletedServerProperties.
5313func (dsp DeletedServerProperties) MarshalJSON() ([]byte, error) {
5314	objectMap := make(map[string]interface{})
5315	return json.Marshal(objectMap)
5316}
5317
5318// DeletedServersRecoverFuture an abstraction for monitoring and retrieving the results of a long-running
5319// operation.
5320type DeletedServersRecoverFuture struct {
5321	azure.FutureAPI
5322	// Result returns the result of the asynchronous operation.
5323	// If the operation has not completed it will return an error.
5324	Result func(DeletedServersClient) (DeletedServer, error)
5325}
5326
5327// UnmarshalJSON is the custom unmarshaller for CreateFuture.
5328func (future *DeletedServersRecoverFuture) UnmarshalJSON(body []byte) error {
5329	var azFuture azure.Future
5330	if err := json.Unmarshal(body, &azFuture); err != nil {
5331		return err
5332	}
5333	future.FutureAPI = &azFuture
5334	future.Result = future.result
5335	return nil
5336}
5337
5338// result is the default implementation for DeletedServersRecoverFuture.Result.
5339func (future *DeletedServersRecoverFuture) result(client DeletedServersClient) (ds DeletedServer, err error) {
5340	var done bool
5341	done, err = future.DoneWithContext(context.Background(), client)
5342	if err != nil {
5343		err = autorest.NewErrorWithError(err, "sql.DeletedServersRecoverFuture", "Result", future.Response(), "Polling failure")
5344		return
5345	}
5346	if !done {
5347		ds.Response.Response = future.Response()
5348		err = azure.NewAsyncOpIncompleteError("sql.DeletedServersRecoverFuture")
5349		return
5350	}
5351	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5352	if ds.Response.Response, err = future.GetResult(sender); err == nil && ds.Response.Response.StatusCode != http.StatusNoContent {
5353		ds, err = client.RecoverResponder(ds.Response.Response)
5354		if err != nil {
5355			err = autorest.NewErrorWithError(err, "sql.DeletedServersRecoverFuture", "Result", ds.Response.Response, "Failure responding to request")
5356		}
5357	}
5358	return
5359}
5360
5361// DNSRefreshConfigurationProperties DNS refresh configuration properties.
5362type DNSRefreshConfigurationProperties struct {
5363	// Status - READ-ONLY; The status of the DNS refresh operation. Possible values include: 'Status1Succeeded', 'Status1Failed'
5364	Status Status1 `json:"status,omitempty"`
5365}
5366
5367// MarshalJSON is the custom marshaler for DNSRefreshConfigurationProperties.
5368func (drcp DNSRefreshConfigurationProperties) MarshalJSON() ([]byte, error) {
5369	objectMap := make(map[string]interface{})
5370	return json.Marshal(objectMap)
5371}
5372
5373// EditionCapability the edition capability.
5374type EditionCapability struct {
5375	// Name - READ-ONLY; The database edition name.
5376	Name *string `json:"name,omitempty"`
5377	// SupportedServiceLevelObjectives - READ-ONLY; The list of supported service objectives for the edition.
5378	SupportedServiceLevelObjectives *[]ServiceObjectiveCapability `json:"supportedServiceLevelObjectives,omitempty"`
5379	// ZoneRedundant - READ-ONLY; Whether or not zone redundancy is supported for the edition.
5380	ZoneRedundant *bool `json:"zoneRedundant,omitempty"`
5381	// ReadScale - READ-ONLY; The read scale capability for the edition.
5382	ReadScale *ReadScaleCapability `json:"readScale,omitempty"`
5383	// SupportedStorageCapabilities - READ-ONLY; The list of supported storage capabilities for this edition
5384	SupportedStorageCapabilities *[]StorageCapability `json:"supportedStorageCapabilities,omitempty"`
5385	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
5386	Status CapabilityStatus `json:"status,omitempty"`
5387	// Reason - The reason for the capability not being available.
5388	Reason *string `json:"reason,omitempty"`
5389}
5390
5391// MarshalJSON is the custom marshaler for EditionCapability.
5392func (ec EditionCapability) MarshalJSON() ([]byte, error) {
5393	objectMap := make(map[string]interface{})
5394	if ec.Reason != nil {
5395		objectMap["reason"] = ec.Reason
5396	}
5397	return json.Marshal(objectMap)
5398}
5399
5400// ElasticPool an elastic pool.
5401type ElasticPool struct {
5402	autorest.Response `json:"-"`
5403	// Sku - The elastic pool SKU.
5404	//
5405	// The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API or the following command:
5406	//
5407	// ```azurecli
5408	// az sql elastic-pool list-editions -l <location> -o table
5409	// ````
5410	Sku *Sku `json:"sku,omitempty"`
5411	// Kind - READ-ONLY; Kind of elastic pool. This is metadata used for the Azure portal experience.
5412	Kind *string `json:"kind,omitempty"`
5413	// ElasticPoolProperties - Resource properties.
5414	*ElasticPoolProperties `json:"properties,omitempty"`
5415	// Location - Resource location.
5416	Location *string `json:"location,omitempty"`
5417	// Tags - Resource tags.
5418	Tags map[string]*string `json:"tags"`
5419	// ID - READ-ONLY; Resource ID.
5420	ID *string `json:"id,omitempty"`
5421	// Name - READ-ONLY; Resource name.
5422	Name *string `json:"name,omitempty"`
5423	// Type - READ-ONLY; Resource type.
5424	Type *string `json:"type,omitempty"`
5425}
5426
5427// MarshalJSON is the custom marshaler for ElasticPool.
5428func (ep ElasticPool) MarshalJSON() ([]byte, error) {
5429	objectMap := make(map[string]interface{})
5430	if ep.Sku != nil {
5431		objectMap["sku"] = ep.Sku
5432	}
5433	if ep.ElasticPoolProperties != nil {
5434		objectMap["properties"] = ep.ElasticPoolProperties
5435	}
5436	if ep.Location != nil {
5437		objectMap["location"] = ep.Location
5438	}
5439	if ep.Tags != nil {
5440		objectMap["tags"] = ep.Tags
5441	}
5442	return json.Marshal(objectMap)
5443}
5444
5445// UnmarshalJSON is the custom unmarshaler for ElasticPool struct.
5446func (ep *ElasticPool) UnmarshalJSON(body []byte) error {
5447	var m map[string]*json.RawMessage
5448	err := json.Unmarshal(body, &m)
5449	if err != nil {
5450		return err
5451	}
5452	for k, v := range m {
5453		switch k {
5454		case "sku":
5455			if v != nil {
5456				var sku Sku
5457				err = json.Unmarshal(*v, &sku)
5458				if err != nil {
5459					return err
5460				}
5461				ep.Sku = &sku
5462			}
5463		case "kind":
5464			if v != nil {
5465				var kind string
5466				err = json.Unmarshal(*v, &kind)
5467				if err != nil {
5468					return err
5469				}
5470				ep.Kind = &kind
5471			}
5472		case "properties":
5473			if v != nil {
5474				var elasticPoolProperties ElasticPoolProperties
5475				err = json.Unmarshal(*v, &elasticPoolProperties)
5476				if err != nil {
5477					return err
5478				}
5479				ep.ElasticPoolProperties = &elasticPoolProperties
5480			}
5481		case "location":
5482			if v != nil {
5483				var location string
5484				err = json.Unmarshal(*v, &location)
5485				if err != nil {
5486					return err
5487				}
5488				ep.Location = &location
5489			}
5490		case "tags":
5491			if v != nil {
5492				var tags map[string]*string
5493				err = json.Unmarshal(*v, &tags)
5494				if err != nil {
5495					return err
5496				}
5497				ep.Tags = tags
5498			}
5499		case "id":
5500			if v != nil {
5501				var ID string
5502				err = json.Unmarshal(*v, &ID)
5503				if err != nil {
5504					return err
5505				}
5506				ep.ID = &ID
5507			}
5508		case "name":
5509			if v != nil {
5510				var name string
5511				err = json.Unmarshal(*v, &name)
5512				if err != nil {
5513					return err
5514				}
5515				ep.Name = &name
5516			}
5517		case "type":
5518			if v != nil {
5519				var typeVar string
5520				err = json.Unmarshal(*v, &typeVar)
5521				if err != nil {
5522					return err
5523				}
5524				ep.Type = &typeVar
5525			}
5526		}
5527	}
5528
5529	return nil
5530}
5531
5532// ElasticPoolActivity represents the activity on an elastic pool.
5533type ElasticPoolActivity struct {
5534	// Location - The geo-location where the resource lives
5535	Location *string `json:"location,omitempty"`
5536	// ElasticPoolActivityProperties - The properties representing the resource.
5537	*ElasticPoolActivityProperties `json:"properties,omitempty"`
5538	// ID - READ-ONLY; Resource ID.
5539	ID *string `json:"id,omitempty"`
5540	// Name - READ-ONLY; Resource name.
5541	Name *string `json:"name,omitempty"`
5542	// Type - READ-ONLY; Resource type.
5543	Type *string `json:"type,omitempty"`
5544}
5545
5546// MarshalJSON is the custom marshaler for ElasticPoolActivity.
5547func (epa ElasticPoolActivity) MarshalJSON() ([]byte, error) {
5548	objectMap := make(map[string]interface{})
5549	if epa.Location != nil {
5550		objectMap["location"] = epa.Location
5551	}
5552	if epa.ElasticPoolActivityProperties != nil {
5553		objectMap["properties"] = epa.ElasticPoolActivityProperties
5554	}
5555	return json.Marshal(objectMap)
5556}
5557
5558// UnmarshalJSON is the custom unmarshaler for ElasticPoolActivity struct.
5559func (epa *ElasticPoolActivity) UnmarshalJSON(body []byte) error {
5560	var m map[string]*json.RawMessage
5561	err := json.Unmarshal(body, &m)
5562	if err != nil {
5563		return err
5564	}
5565	for k, v := range m {
5566		switch k {
5567		case "location":
5568			if v != nil {
5569				var location string
5570				err = json.Unmarshal(*v, &location)
5571				if err != nil {
5572					return err
5573				}
5574				epa.Location = &location
5575			}
5576		case "properties":
5577			if v != nil {
5578				var elasticPoolActivityProperties ElasticPoolActivityProperties
5579				err = json.Unmarshal(*v, &elasticPoolActivityProperties)
5580				if err != nil {
5581					return err
5582				}
5583				epa.ElasticPoolActivityProperties = &elasticPoolActivityProperties
5584			}
5585		case "id":
5586			if v != nil {
5587				var ID string
5588				err = json.Unmarshal(*v, &ID)
5589				if err != nil {
5590					return err
5591				}
5592				epa.ID = &ID
5593			}
5594		case "name":
5595			if v != nil {
5596				var name string
5597				err = json.Unmarshal(*v, &name)
5598				if err != nil {
5599					return err
5600				}
5601				epa.Name = &name
5602			}
5603		case "type":
5604			if v != nil {
5605				var typeVar string
5606				err = json.Unmarshal(*v, &typeVar)
5607				if err != nil {
5608					return err
5609				}
5610				epa.Type = &typeVar
5611			}
5612		}
5613	}
5614
5615	return nil
5616}
5617
5618// ElasticPoolActivityListResult represents the response to a list elastic pool activity request.
5619type ElasticPoolActivityListResult struct {
5620	autorest.Response `json:"-"`
5621	// Value - The list of elastic pool activities.
5622	Value *[]ElasticPoolActivity `json:"value,omitempty"`
5623}
5624
5625// ElasticPoolActivityProperties represents the properties of an elastic pool.
5626type ElasticPoolActivityProperties struct {
5627	// EndTime - READ-ONLY; The time the operation finished (ISO8601 format).
5628	EndTime *date.Time `json:"endTime,omitempty"`
5629	// ErrorCode - READ-ONLY; The error code if available.
5630	ErrorCode *int32 `json:"errorCode,omitempty"`
5631	// ErrorMessage - READ-ONLY; The error message if available.
5632	ErrorMessage *string `json:"errorMessage,omitempty"`
5633	// ErrorSeverity - READ-ONLY; The error severity if available.
5634	ErrorSeverity *int32 `json:"errorSeverity,omitempty"`
5635	// Operation - READ-ONLY; The operation name.
5636	Operation *string `json:"operation,omitempty"`
5637	// OperationID - READ-ONLY; The unique operation ID.
5638	OperationID *uuid.UUID `json:"operationId,omitempty"`
5639	// PercentComplete - READ-ONLY; The percentage complete if available.
5640	PercentComplete *int32 `json:"percentComplete,omitempty"`
5641	// RequestedDatabaseDtuMax - READ-ONLY; The requested max DTU per database if available.
5642	RequestedDatabaseDtuMax *int32 `json:"requestedDatabaseDtuMax,omitempty"`
5643	// RequestedDatabaseDtuMin - READ-ONLY; The requested min DTU per database if available.
5644	RequestedDatabaseDtuMin *int32 `json:"requestedDatabaseDtuMin,omitempty"`
5645	// RequestedDtu - READ-ONLY; The requested DTU for the pool if available.
5646	RequestedDtu *int32 `json:"requestedDtu,omitempty"`
5647	// RequestedElasticPoolName - READ-ONLY; The requested name for the elastic pool if available.
5648	RequestedElasticPoolName *string `json:"requestedElasticPoolName,omitempty"`
5649	// RequestedStorageLimitInGB - READ-ONLY; The requested storage limit for the pool in GB if available.
5650	RequestedStorageLimitInGB *int64 `json:"requestedStorageLimitInGB,omitempty"`
5651	// ElasticPoolName - READ-ONLY; The name of the elastic pool.
5652	ElasticPoolName *string `json:"elasticPoolName,omitempty"`
5653	// ServerName - READ-ONLY; The name of the server the elastic pool is in.
5654	ServerName *string `json:"serverName,omitempty"`
5655	// StartTime - READ-ONLY; The time the operation started (ISO8601 format).
5656	StartTime *date.Time `json:"startTime,omitempty"`
5657	// State - READ-ONLY; The current state of the operation.
5658	State *string `json:"state,omitempty"`
5659	// RequestedStorageLimitInMB - READ-ONLY; The requested storage limit in MB.
5660	RequestedStorageLimitInMB *int32 `json:"requestedStorageLimitInMB,omitempty"`
5661	// RequestedDatabaseDtuGuarantee - READ-ONLY; The requested per database DTU guarantee.
5662	RequestedDatabaseDtuGuarantee *int32 `json:"requestedDatabaseDtuGuarantee,omitempty"`
5663	// RequestedDatabaseDtuCap - READ-ONLY; The requested per database DTU cap.
5664	RequestedDatabaseDtuCap *int32 `json:"requestedDatabaseDtuCap,omitempty"`
5665	// RequestedDtuGuarantee - READ-ONLY; The requested DTU guarantee.
5666	RequestedDtuGuarantee *int32 `json:"requestedDtuGuarantee,omitempty"`
5667}
5668
5669// MarshalJSON is the custom marshaler for ElasticPoolActivityProperties.
5670func (epap ElasticPoolActivityProperties) MarshalJSON() ([]byte, error) {
5671	objectMap := make(map[string]interface{})
5672	return json.Marshal(objectMap)
5673}
5674
5675// ElasticPoolDatabaseActivity represents the activity on an elastic pool.
5676type ElasticPoolDatabaseActivity struct {
5677	// Location - The geo-location where the resource lives
5678	Location *string `json:"location,omitempty"`
5679	// ElasticPoolDatabaseActivityProperties - The properties representing the resource.
5680	*ElasticPoolDatabaseActivityProperties `json:"properties,omitempty"`
5681	// ID - READ-ONLY; Resource ID.
5682	ID *string `json:"id,omitempty"`
5683	// Name - READ-ONLY; Resource name.
5684	Name *string `json:"name,omitempty"`
5685	// Type - READ-ONLY; Resource type.
5686	Type *string `json:"type,omitempty"`
5687}
5688
5689// MarshalJSON is the custom marshaler for ElasticPoolDatabaseActivity.
5690func (epda ElasticPoolDatabaseActivity) MarshalJSON() ([]byte, error) {
5691	objectMap := make(map[string]interface{})
5692	if epda.Location != nil {
5693		objectMap["location"] = epda.Location
5694	}
5695	if epda.ElasticPoolDatabaseActivityProperties != nil {
5696		objectMap["properties"] = epda.ElasticPoolDatabaseActivityProperties
5697	}
5698	return json.Marshal(objectMap)
5699}
5700
5701// UnmarshalJSON is the custom unmarshaler for ElasticPoolDatabaseActivity struct.
5702func (epda *ElasticPoolDatabaseActivity) UnmarshalJSON(body []byte) error {
5703	var m map[string]*json.RawMessage
5704	err := json.Unmarshal(body, &m)
5705	if err != nil {
5706		return err
5707	}
5708	for k, v := range m {
5709		switch k {
5710		case "location":
5711			if v != nil {
5712				var location string
5713				err = json.Unmarshal(*v, &location)
5714				if err != nil {
5715					return err
5716				}
5717				epda.Location = &location
5718			}
5719		case "properties":
5720			if v != nil {
5721				var elasticPoolDatabaseActivityProperties ElasticPoolDatabaseActivityProperties
5722				err = json.Unmarshal(*v, &elasticPoolDatabaseActivityProperties)
5723				if err != nil {
5724					return err
5725				}
5726				epda.ElasticPoolDatabaseActivityProperties = &elasticPoolDatabaseActivityProperties
5727			}
5728		case "id":
5729			if v != nil {
5730				var ID string
5731				err = json.Unmarshal(*v, &ID)
5732				if err != nil {
5733					return err
5734				}
5735				epda.ID = &ID
5736			}
5737		case "name":
5738			if v != nil {
5739				var name string
5740				err = json.Unmarshal(*v, &name)
5741				if err != nil {
5742					return err
5743				}
5744				epda.Name = &name
5745			}
5746		case "type":
5747			if v != nil {
5748				var typeVar string
5749				err = json.Unmarshal(*v, &typeVar)
5750				if err != nil {
5751					return err
5752				}
5753				epda.Type = &typeVar
5754			}
5755		}
5756	}
5757
5758	return nil
5759}
5760
5761// ElasticPoolDatabaseActivityListResult represents the response to a list elastic pool database activity
5762// request.
5763type ElasticPoolDatabaseActivityListResult struct {
5764	autorest.Response `json:"-"`
5765	// Value - The list of elastic pool database activities.
5766	Value *[]ElasticPoolDatabaseActivity `json:"value,omitempty"`
5767}
5768
5769// ElasticPoolDatabaseActivityProperties represents the properties of an elastic pool database activity.
5770type ElasticPoolDatabaseActivityProperties struct {
5771	// DatabaseName - READ-ONLY; The database name.
5772	DatabaseName *string `json:"databaseName,omitempty"`
5773	// EndTime - READ-ONLY; The time the operation finished (ISO8601 format).
5774	EndTime *date.Time `json:"endTime,omitempty"`
5775	// ErrorCode - READ-ONLY; The error code if available.
5776	ErrorCode *int32 `json:"errorCode,omitempty"`
5777	// ErrorMessage - READ-ONLY; The error message if available.
5778	ErrorMessage *string `json:"errorMessage,omitempty"`
5779	// ErrorSeverity - READ-ONLY; The error severity if available.
5780	ErrorSeverity *int32 `json:"errorSeverity,omitempty"`
5781	// Operation - READ-ONLY; The operation name.
5782	Operation *string `json:"operation,omitempty"`
5783	// OperationID - READ-ONLY; The unique operation ID.
5784	OperationID *uuid.UUID `json:"operationId,omitempty"`
5785	// PercentComplete - READ-ONLY; The percentage complete if available.
5786	PercentComplete *int32 `json:"percentComplete,omitempty"`
5787	// RequestedElasticPoolName - READ-ONLY; The name for the elastic pool the database is moving into if available.
5788	RequestedElasticPoolName *string `json:"requestedElasticPoolName,omitempty"`
5789	// CurrentElasticPoolName - READ-ONLY; The name of the current elastic pool the database is in if available.
5790	CurrentElasticPoolName *string `json:"currentElasticPoolName,omitempty"`
5791	// CurrentServiceObjective - READ-ONLY; The name of the current service objective if available.
5792	CurrentServiceObjective *string `json:"currentServiceObjective,omitempty"`
5793	// RequestedServiceObjective - READ-ONLY; The name of the requested service objective if available.
5794	RequestedServiceObjective *string `json:"requestedServiceObjective,omitempty"`
5795	// ServerName - READ-ONLY; The name of the server the elastic pool is in.
5796	ServerName *string `json:"serverName,omitempty"`
5797	// StartTime - READ-ONLY; The time the operation started (ISO8601 format).
5798	StartTime *date.Time `json:"startTime,omitempty"`
5799	// State - READ-ONLY; The current state of the operation.
5800	State *string `json:"state,omitempty"`
5801}
5802
5803// MarshalJSON is the custom marshaler for ElasticPoolDatabaseActivityProperties.
5804func (epdap ElasticPoolDatabaseActivityProperties) MarshalJSON() ([]byte, error) {
5805	objectMap := make(map[string]interface{})
5806	return json.Marshal(objectMap)
5807}
5808
5809// ElasticPoolEditionCapability the elastic pool edition capability.
5810type ElasticPoolEditionCapability struct {
5811	// Name - READ-ONLY; The elastic pool edition name.
5812	Name *string `json:"name,omitempty"`
5813	// SupportedElasticPoolPerformanceLevels - READ-ONLY; The list of supported elastic pool DTU levels for the edition.
5814	SupportedElasticPoolPerformanceLevels *[]ElasticPoolPerformanceLevelCapability `json:"supportedElasticPoolPerformanceLevels,omitempty"`
5815	// ZoneRedundant - READ-ONLY; Whether or not zone redundancy is supported for the edition.
5816	ZoneRedundant *bool `json:"zoneRedundant,omitempty"`
5817	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
5818	Status CapabilityStatus `json:"status,omitempty"`
5819	// Reason - The reason for the capability not being available.
5820	Reason *string `json:"reason,omitempty"`
5821}
5822
5823// MarshalJSON is the custom marshaler for ElasticPoolEditionCapability.
5824func (epec ElasticPoolEditionCapability) MarshalJSON() ([]byte, error) {
5825	objectMap := make(map[string]interface{})
5826	if epec.Reason != nil {
5827		objectMap["reason"] = epec.Reason
5828	}
5829	return json.Marshal(objectMap)
5830}
5831
5832// ElasticPoolListResult the result of an elastic pool list request.
5833type ElasticPoolListResult struct {
5834	autorest.Response `json:"-"`
5835	// Value - READ-ONLY; Array of results.
5836	Value *[]ElasticPool `json:"value,omitempty"`
5837	// NextLink - READ-ONLY; Link to retrieve next page of results.
5838	NextLink *string `json:"nextLink,omitempty"`
5839}
5840
5841// MarshalJSON is the custom marshaler for ElasticPoolListResult.
5842func (eplr ElasticPoolListResult) MarshalJSON() ([]byte, error) {
5843	objectMap := make(map[string]interface{})
5844	return json.Marshal(objectMap)
5845}
5846
5847// ElasticPoolListResultIterator provides access to a complete listing of ElasticPool values.
5848type ElasticPoolListResultIterator struct {
5849	i    int
5850	page ElasticPoolListResultPage
5851}
5852
5853// NextWithContext advances to the next value.  If there was an error making
5854// the request the iterator does not advance and the error is returned.
5855func (iter *ElasticPoolListResultIterator) NextWithContext(ctx context.Context) (err error) {
5856	if tracing.IsEnabled() {
5857		ctx = tracing.StartSpan(ctx, fqdn+"/ElasticPoolListResultIterator.NextWithContext")
5858		defer func() {
5859			sc := -1
5860			if iter.Response().Response.Response != nil {
5861				sc = iter.Response().Response.Response.StatusCode
5862			}
5863			tracing.EndSpan(ctx, sc, err)
5864		}()
5865	}
5866	iter.i++
5867	if iter.i < len(iter.page.Values()) {
5868		return nil
5869	}
5870	err = iter.page.NextWithContext(ctx)
5871	if err != nil {
5872		iter.i--
5873		return err
5874	}
5875	iter.i = 0
5876	return nil
5877}
5878
5879// Next advances to the next value.  If there was an error making
5880// the request the iterator does not advance and the error is returned.
5881// Deprecated: Use NextWithContext() instead.
5882func (iter *ElasticPoolListResultIterator) Next() error {
5883	return iter.NextWithContext(context.Background())
5884}
5885
5886// NotDone returns true if the enumeration should be started or is not yet complete.
5887func (iter ElasticPoolListResultIterator) NotDone() bool {
5888	return iter.page.NotDone() && iter.i < len(iter.page.Values())
5889}
5890
5891// Response returns the raw server response from the last page request.
5892func (iter ElasticPoolListResultIterator) Response() ElasticPoolListResult {
5893	return iter.page.Response()
5894}
5895
5896// Value returns the current value or a zero-initialized value if the
5897// iterator has advanced beyond the end of the collection.
5898func (iter ElasticPoolListResultIterator) Value() ElasticPool {
5899	if !iter.page.NotDone() {
5900		return ElasticPool{}
5901	}
5902	return iter.page.Values()[iter.i]
5903}
5904
5905// Creates a new instance of the ElasticPoolListResultIterator type.
5906func NewElasticPoolListResultIterator(page ElasticPoolListResultPage) ElasticPoolListResultIterator {
5907	return ElasticPoolListResultIterator{page: page}
5908}
5909
5910// IsEmpty returns true if the ListResult contains no values.
5911func (eplr ElasticPoolListResult) IsEmpty() bool {
5912	return eplr.Value == nil || len(*eplr.Value) == 0
5913}
5914
5915// hasNextLink returns true if the NextLink is not empty.
5916func (eplr ElasticPoolListResult) hasNextLink() bool {
5917	return eplr.NextLink != nil && len(*eplr.NextLink) != 0
5918}
5919
5920// elasticPoolListResultPreparer prepares a request to retrieve the next set of results.
5921// It returns nil if no more results exist.
5922func (eplr ElasticPoolListResult) elasticPoolListResultPreparer(ctx context.Context) (*http.Request, error) {
5923	if !eplr.hasNextLink() {
5924		return nil, nil
5925	}
5926	return autorest.Prepare((&http.Request{}).WithContext(ctx),
5927		autorest.AsJSON(),
5928		autorest.AsGet(),
5929		autorest.WithBaseURL(to.String(eplr.NextLink)))
5930}
5931
5932// ElasticPoolListResultPage contains a page of ElasticPool values.
5933type ElasticPoolListResultPage struct {
5934	fn   func(context.Context, ElasticPoolListResult) (ElasticPoolListResult, error)
5935	eplr ElasticPoolListResult
5936}
5937
5938// NextWithContext advances to the next page of values.  If there was an error making
5939// the request the page does not advance and the error is returned.
5940func (page *ElasticPoolListResultPage) NextWithContext(ctx context.Context) (err error) {
5941	if tracing.IsEnabled() {
5942		ctx = tracing.StartSpan(ctx, fqdn+"/ElasticPoolListResultPage.NextWithContext")
5943		defer func() {
5944			sc := -1
5945			if page.Response().Response.Response != nil {
5946				sc = page.Response().Response.Response.StatusCode
5947			}
5948			tracing.EndSpan(ctx, sc, err)
5949		}()
5950	}
5951	for {
5952		next, err := page.fn(ctx, page.eplr)
5953		if err != nil {
5954			return err
5955		}
5956		page.eplr = next
5957		if !next.hasNextLink() || !next.IsEmpty() {
5958			break
5959		}
5960	}
5961	return nil
5962}
5963
5964// Next advances to the next page of values.  If there was an error making
5965// the request the page does not advance and the error is returned.
5966// Deprecated: Use NextWithContext() instead.
5967func (page *ElasticPoolListResultPage) Next() error {
5968	return page.NextWithContext(context.Background())
5969}
5970
5971// NotDone returns true if the page enumeration should be started or is not yet complete.
5972func (page ElasticPoolListResultPage) NotDone() bool {
5973	return !page.eplr.IsEmpty()
5974}
5975
5976// Response returns the raw server response from the last page request.
5977func (page ElasticPoolListResultPage) Response() ElasticPoolListResult {
5978	return page.eplr
5979}
5980
5981// Values returns the slice of values for the current page or nil if there are no values.
5982func (page ElasticPoolListResultPage) Values() []ElasticPool {
5983	if page.eplr.IsEmpty() {
5984		return nil
5985	}
5986	return *page.eplr.Value
5987}
5988
5989// Creates a new instance of the ElasticPoolListResultPage type.
5990func NewElasticPoolListResultPage(cur ElasticPoolListResult, getNextPage func(context.Context, ElasticPoolListResult) (ElasticPoolListResult, error)) ElasticPoolListResultPage {
5991	return ElasticPoolListResultPage{
5992		fn:   getNextPage,
5993		eplr: cur,
5994	}
5995}
5996
5997// ElasticPoolOperation a elastic pool operation.
5998type ElasticPoolOperation struct {
5999	// ElasticPoolOperationProperties - Resource properties.
6000	*ElasticPoolOperationProperties `json:"properties,omitempty"`
6001	// ID - READ-ONLY; Resource ID.
6002	ID *string `json:"id,omitempty"`
6003	// Name - READ-ONLY; Resource name.
6004	Name *string `json:"name,omitempty"`
6005	// Type - READ-ONLY; Resource type.
6006	Type *string `json:"type,omitempty"`
6007}
6008
6009// MarshalJSON is the custom marshaler for ElasticPoolOperation.
6010func (epo ElasticPoolOperation) MarshalJSON() ([]byte, error) {
6011	objectMap := make(map[string]interface{})
6012	if epo.ElasticPoolOperationProperties != nil {
6013		objectMap["properties"] = epo.ElasticPoolOperationProperties
6014	}
6015	return json.Marshal(objectMap)
6016}
6017
6018// UnmarshalJSON is the custom unmarshaler for ElasticPoolOperation struct.
6019func (epo *ElasticPoolOperation) UnmarshalJSON(body []byte) error {
6020	var m map[string]*json.RawMessage
6021	err := json.Unmarshal(body, &m)
6022	if err != nil {
6023		return err
6024	}
6025	for k, v := range m {
6026		switch k {
6027		case "properties":
6028			if v != nil {
6029				var elasticPoolOperationProperties ElasticPoolOperationProperties
6030				err = json.Unmarshal(*v, &elasticPoolOperationProperties)
6031				if err != nil {
6032					return err
6033				}
6034				epo.ElasticPoolOperationProperties = &elasticPoolOperationProperties
6035			}
6036		case "id":
6037			if v != nil {
6038				var ID string
6039				err = json.Unmarshal(*v, &ID)
6040				if err != nil {
6041					return err
6042				}
6043				epo.ID = &ID
6044			}
6045		case "name":
6046			if v != nil {
6047				var name string
6048				err = json.Unmarshal(*v, &name)
6049				if err != nil {
6050					return err
6051				}
6052				epo.Name = &name
6053			}
6054		case "type":
6055			if v != nil {
6056				var typeVar string
6057				err = json.Unmarshal(*v, &typeVar)
6058				if err != nil {
6059					return err
6060				}
6061				epo.Type = &typeVar
6062			}
6063		}
6064	}
6065
6066	return nil
6067}
6068
6069// ElasticPoolOperationListResult the response to a list elastic pool operations request
6070type ElasticPoolOperationListResult struct {
6071	autorest.Response `json:"-"`
6072	// Value - READ-ONLY; Array of results.
6073	Value *[]ElasticPoolOperation `json:"value,omitempty"`
6074	// NextLink - READ-ONLY; Link to retrieve next page of results.
6075	NextLink *string `json:"nextLink,omitempty"`
6076}
6077
6078// MarshalJSON is the custom marshaler for ElasticPoolOperationListResult.
6079func (epolr ElasticPoolOperationListResult) MarshalJSON() ([]byte, error) {
6080	objectMap := make(map[string]interface{})
6081	return json.Marshal(objectMap)
6082}
6083
6084// ElasticPoolOperationListResultIterator provides access to a complete listing of ElasticPoolOperation
6085// values.
6086type ElasticPoolOperationListResultIterator struct {
6087	i    int
6088	page ElasticPoolOperationListResultPage
6089}
6090
6091// NextWithContext advances to the next value.  If there was an error making
6092// the request the iterator does not advance and the error is returned.
6093func (iter *ElasticPoolOperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
6094	if tracing.IsEnabled() {
6095		ctx = tracing.StartSpan(ctx, fqdn+"/ElasticPoolOperationListResultIterator.NextWithContext")
6096		defer func() {
6097			sc := -1
6098			if iter.Response().Response.Response != nil {
6099				sc = iter.Response().Response.Response.StatusCode
6100			}
6101			tracing.EndSpan(ctx, sc, err)
6102		}()
6103	}
6104	iter.i++
6105	if iter.i < len(iter.page.Values()) {
6106		return nil
6107	}
6108	err = iter.page.NextWithContext(ctx)
6109	if err != nil {
6110		iter.i--
6111		return err
6112	}
6113	iter.i = 0
6114	return nil
6115}
6116
6117// Next advances to the next value.  If there was an error making
6118// the request the iterator does not advance and the error is returned.
6119// Deprecated: Use NextWithContext() instead.
6120func (iter *ElasticPoolOperationListResultIterator) Next() error {
6121	return iter.NextWithContext(context.Background())
6122}
6123
6124// NotDone returns true if the enumeration should be started or is not yet complete.
6125func (iter ElasticPoolOperationListResultIterator) NotDone() bool {
6126	return iter.page.NotDone() && iter.i < len(iter.page.Values())
6127}
6128
6129// Response returns the raw server response from the last page request.
6130func (iter ElasticPoolOperationListResultIterator) Response() ElasticPoolOperationListResult {
6131	return iter.page.Response()
6132}
6133
6134// Value returns the current value or a zero-initialized value if the
6135// iterator has advanced beyond the end of the collection.
6136func (iter ElasticPoolOperationListResultIterator) Value() ElasticPoolOperation {
6137	if !iter.page.NotDone() {
6138		return ElasticPoolOperation{}
6139	}
6140	return iter.page.Values()[iter.i]
6141}
6142
6143// Creates a new instance of the ElasticPoolOperationListResultIterator type.
6144func NewElasticPoolOperationListResultIterator(page ElasticPoolOperationListResultPage) ElasticPoolOperationListResultIterator {
6145	return ElasticPoolOperationListResultIterator{page: page}
6146}
6147
6148// IsEmpty returns true if the ListResult contains no values.
6149func (epolr ElasticPoolOperationListResult) IsEmpty() bool {
6150	return epolr.Value == nil || len(*epolr.Value) == 0
6151}
6152
6153// hasNextLink returns true if the NextLink is not empty.
6154func (epolr ElasticPoolOperationListResult) hasNextLink() bool {
6155	return epolr.NextLink != nil && len(*epolr.NextLink) != 0
6156}
6157
6158// elasticPoolOperationListResultPreparer prepares a request to retrieve the next set of results.
6159// It returns nil if no more results exist.
6160func (epolr ElasticPoolOperationListResult) elasticPoolOperationListResultPreparer(ctx context.Context) (*http.Request, error) {
6161	if !epolr.hasNextLink() {
6162		return nil, nil
6163	}
6164	return autorest.Prepare((&http.Request{}).WithContext(ctx),
6165		autorest.AsJSON(),
6166		autorest.AsGet(),
6167		autorest.WithBaseURL(to.String(epolr.NextLink)))
6168}
6169
6170// ElasticPoolOperationListResultPage contains a page of ElasticPoolOperation values.
6171type ElasticPoolOperationListResultPage struct {
6172	fn    func(context.Context, ElasticPoolOperationListResult) (ElasticPoolOperationListResult, error)
6173	epolr ElasticPoolOperationListResult
6174}
6175
6176// NextWithContext advances to the next page of values.  If there was an error making
6177// the request the page does not advance and the error is returned.
6178func (page *ElasticPoolOperationListResultPage) NextWithContext(ctx context.Context) (err error) {
6179	if tracing.IsEnabled() {
6180		ctx = tracing.StartSpan(ctx, fqdn+"/ElasticPoolOperationListResultPage.NextWithContext")
6181		defer func() {
6182			sc := -1
6183			if page.Response().Response.Response != nil {
6184				sc = page.Response().Response.Response.StatusCode
6185			}
6186			tracing.EndSpan(ctx, sc, err)
6187		}()
6188	}
6189	for {
6190		next, err := page.fn(ctx, page.epolr)
6191		if err != nil {
6192			return err
6193		}
6194		page.epolr = next
6195		if !next.hasNextLink() || !next.IsEmpty() {
6196			break
6197		}
6198	}
6199	return nil
6200}
6201
6202// Next advances to the next page of values.  If there was an error making
6203// the request the page does not advance and the error is returned.
6204// Deprecated: Use NextWithContext() instead.
6205func (page *ElasticPoolOperationListResultPage) Next() error {
6206	return page.NextWithContext(context.Background())
6207}
6208
6209// NotDone returns true if the page enumeration should be started or is not yet complete.
6210func (page ElasticPoolOperationListResultPage) NotDone() bool {
6211	return !page.epolr.IsEmpty()
6212}
6213
6214// Response returns the raw server response from the last page request.
6215func (page ElasticPoolOperationListResultPage) Response() ElasticPoolOperationListResult {
6216	return page.epolr
6217}
6218
6219// Values returns the slice of values for the current page or nil if there are no values.
6220func (page ElasticPoolOperationListResultPage) Values() []ElasticPoolOperation {
6221	if page.epolr.IsEmpty() {
6222		return nil
6223	}
6224	return *page.epolr.Value
6225}
6226
6227// Creates a new instance of the ElasticPoolOperationListResultPage type.
6228func NewElasticPoolOperationListResultPage(cur ElasticPoolOperationListResult, getNextPage func(context.Context, ElasticPoolOperationListResult) (ElasticPoolOperationListResult, error)) ElasticPoolOperationListResultPage {
6229	return ElasticPoolOperationListResultPage{
6230		fn:    getNextPage,
6231		epolr: cur,
6232	}
6233}
6234
6235// ElasticPoolOperationProperties the properties of a elastic pool operation.
6236type ElasticPoolOperationProperties struct {
6237	// ElasticPoolName - READ-ONLY; The name of the elastic pool the operation is being performed on.
6238	ElasticPoolName *string `json:"elasticPoolName,omitempty"`
6239	// Operation - READ-ONLY; The name of operation.
6240	Operation *string `json:"operation,omitempty"`
6241	// OperationFriendlyName - READ-ONLY; The friendly name of operation.
6242	OperationFriendlyName *string `json:"operationFriendlyName,omitempty"`
6243	// PercentComplete - READ-ONLY; The percentage of the operation completed.
6244	PercentComplete *int32 `json:"percentComplete,omitempty"`
6245	// ServerName - READ-ONLY; The name of the server.
6246	ServerName *string `json:"serverName,omitempty"`
6247	// StartTime - READ-ONLY; The operation start time.
6248	StartTime *date.Time `json:"startTime,omitempty"`
6249	// State - READ-ONLY; The operation state.
6250	State *string `json:"state,omitempty"`
6251	// ErrorCode - READ-ONLY; The operation error code.
6252	ErrorCode *int32 `json:"errorCode,omitempty"`
6253	// ErrorDescription - READ-ONLY; The operation error description.
6254	ErrorDescription *string `json:"errorDescription,omitempty"`
6255	// ErrorSeverity - READ-ONLY; The operation error severity.
6256	ErrorSeverity *int32 `json:"errorSeverity,omitempty"`
6257	// IsUserError - READ-ONLY; Whether or not the error is a user error.
6258	IsUserError *bool `json:"isUserError,omitempty"`
6259	// EstimatedCompletionTime - READ-ONLY; The estimated completion time of the operation.
6260	EstimatedCompletionTime *date.Time `json:"estimatedCompletionTime,omitempty"`
6261	// Description - READ-ONLY; The operation description.
6262	Description *string `json:"description,omitempty"`
6263	// IsCancellable - READ-ONLY; Whether the operation can be cancelled.
6264	IsCancellable *bool `json:"isCancellable,omitempty"`
6265}
6266
6267// MarshalJSON is the custom marshaler for ElasticPoolOperationProperties.
6268func (epop ElasticPoolOperationProperties) MarshalJSON() ([]byte, error) {
6269	objectMap := make(map[string]interface{})
6270	return json.Marshal(objectMap)
6271}
6272
6273// ElasticPoolPerDatabaseMaxPerformanceLevelCapability the max per-database performance level capability.
6274type ElasticPoolPerDatabaseMaxPerformanceLevelCapability struct {
6275	// Limit - READ-ONLY; The maximum performance level per database.
6276	Limit *float64 `json:"limit,omitempty"`
6277	// Unit - READ-ONLY; Unit type used to measure performance level. Possible values include: 'PerformanceLevelUnitDTU', 'PerformanceLevelUnitVCores'
6278	Unit PerformanceLevelUnit `json:"unit,omitempty"`
6279	// SupportedPerDatabaseMinPerformanceLevels - READ-ONLY; The list of supported min database performance levels.
6280	SupportedPerDatabaseMinPerformanceLevels *[]ElasticPoolPerDatabaseMinPerformanceLevelCapability `json:"supportedPerDatabaseMinPerformanceLevels,omitempty"`
6281	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
6282	Status CapabilityStatus `json:"status,omitempty"`
6283	// Reason - The reason for the capability not being available.
6284	Reason *string `json:"reason,omitempty"`
6285}
6286
6287// MarshalJSON is the custom marshaler for ElasticPoolPerDatabaseMaxPerformanceLevelCapability.
6288func (eppdmplc ElasticPoolPerDatabaseMaxPerformanceLevelCapability) MarshalJSON() ([]byte, error) {
6289	objectMap := make(map[string]interface{})
6290	if eppdmplc.Reason != nil {
6291		objectMap["reason"] = eppdmplc.Reason
6292	}
6293	return json.Marshal(objectMap)
6294}
6295
6296// ElasticPoolPerDatabaseMinPerformanceLevelCapability the minimum per-database performance level
6297// capability.
6298type ElasticPoolPerDatabaseMinPerformanceLevelCapability struct {
6299	// Limit - READ-ONLY; The minimum performance level per database.
6300	Limit *float64 `json:"limit,omitempty"`
6301	// Unit - READ-ONLY; Unit type used to measure performance level. Possible values include: 'PerformanceLevelUnitDTU', 'PerformanceLevelUnitVCores'
6302	Unit PerformanceLevelUnit `json:"unit,omitempty"`
6303	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
6304	Status CapabilityStatus `json:"status,omitempty"`
6305	// Reason - The reason for the capability not being available.
6306	Reason *string `json:"reason,omitempty"`
6307}
6308
6309// MarshalJSON is the custom marshaler for ElasticPoolPerDatabaseMinPerformanceLevelCapability.
6310func (eppdmplc ElasticPoolPerDatabaseMinPerformanceLevelCapability) MarshalJSON() ([]byte, error) {
6311	objectMap := make(map[string]interface{})
6312	if eppdmplc.Reason != nil {
6313		objectMap["reason"] = eppdmplc.Reason
6314	}
6315	return json.Marshal(objectMap)
6316}
6317
6318// ElasticPoolPerDatabaseSettings per database settings of an elastic pool.
6319type ElasticPoolPerDatabaseSettings struct {
6320	// MinCapacity - The minimum capacity all databases are guaranteed.
6321	MinCapacity *float64 `json:"minCapacity,omitempty"`
6322	// MaxCapacity - The maximum capacity any one database can consume.
6323	MaxCapacity *float64 `json:"maxCapacity,omitempty"`
6324}
6325
6326// ElasticPoolPerformanceLevelCapability the Elastic Pool performance level capability.
6327type ElasticPoolPerformanceLevelCapability struct {
6328	// PerformanceLevel - READ-ONLY; The performance level for the pool.
6329	PerformanceLevel *PerformanceLevelCapability `json:"performanceLevel,omitempty"`
6330	// Sku - READ-ONLY; The sku.
6331	Sku *Sku `json:"sku,omitempty"`
6332	// SupportedLicenseTypes - READ-ONLY; List of supported license types.
6333	SupportedLicenseTypes *[]LicenseTypeCapability `json:"supportedLicenseTypes,omitempty"`
6334	// MaxDatabaseCount - READ-ONLY; The maximum number of databases supported.
6335	MaxDatabaseCount *int32 `json:"maxDatabaseCount,omitempty"`
6336	// IncludedMaxSize - READ-ONLY; The included (free) max size for this performance level.
6337	IncludedMaxSize *MaxSizeCapability `json:"includedMaxSize,omitempty"`
6338	// SupportedMaxSizes - READ-ONLY; The list of supported max sizes.
6339	SupportedMaxSizes *[]MaxSizeRangeCapability `json:"supportedMaxSizes,omitempty"`
6340	// SupportedPerDatabaseMaxSizes - READ-ONLY; The list of supported per database max sizes.
6341	SupportedPerDatabaseMaxSizes *[]MaxSizeRangeCapability `json:"supportedPerDatabaseMaxSizes,omitempty"`
6342	// SupportedPerDatabaseMaxPerformanceLevels - READ-ONLY; The list of supported per database max performance levels.
6343	SupportedPerDatabaseMaxPerformanceLevels *[]ElasticPoolPerDatabaseMaxPerformanceLevelCapability `json:"supportedPerDatabaseMaxPerformanceLevels,omitempty"`
6344	// ZoneRedundant - READ-ONLY; Whether or not zone redundancy is supported for the performance level.
6345	ZoneRedundant *bool `json:"zoneRedundant,omitempty"`
6346	// SupportedMaintenanceConfigurations - READ-ONLY; List of supported maintenance configurations
6347	SupportedMaintenanceConfigurations *[]MaintenanceConfigurationCapability `json:"supportedMaintenanceConfigurations,omitempty"`
6348	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
6349	Status CapabilityStatus `json:"status,omitempty"`
6350	// Reason - The reason for the capability not being available.
6351	Reason *string `json:"reason,omitempty"`
6352}
6353
6354// MarshalJSON is the custom marshaler for ElasticPoolPerformanceLevelCapability.
6355func (epplc ElasticPoolPerformanceLevelCapability) MarshalJSON() ([]byte, error) {
6356	objectMap := make(map[string]interface{})
6357	if epplc.Reason != nil {
6358		objectMap["reason"] = epplc.Reason
6359	}
6360	return json.Marshal(objectMap)
6361}
6362
6363// ElasticPoolProperties properties of an elastic pool
6364type ElasticPoolProperties struct {
6365	// State - READ-ONLY; The state of the elastic pool. Possible values include: 'ElasticPoolStateCreating', 'ElasticPoolStateReady', 'ElasticPoolStateDisabled'
6366	State ElasticPoolState `json:"state,omitempty"`
6367	// CreationDate - READ-ONLY; The creation date of the elastic pool (ISO8601 format).
6368	CreationDate *date.Time `json:"creationDate,omitempty"`
6369	// MaxSizeBytes - The storage limit for the database elastic pool in bytes.
6370	MaxSizeBytes *int64 `json:"maxSizeBytes,omitempty"`
6371	// PerDatabaseSettings - The per database settings for the elastic pool.
6372	PerDatabaseSettings *ElasticPoolPerDatabaseSettings `json:"perDatabaseSettings,omitempty"`
6373	// ZoneRedundant - Whether or not this elastic pool is zone redundant, which means the replicas of this elastic pool will be spread across multiple availability zones.
6374	ZoneRedundant *bool `json:"zoneRedundant,omitempty"`
6375	// LicenseType - The license type to apply for this elastic pool. Possible values include: 'ElasticPoolLicenseTypeLicenseIncluded', 'ElasticPoolLicenseTypeBasePrice'
6376	LicenseType ElasticPoolLicenseType `json:"licenseType,omitempty"`
6377	// MaintenanceConfigurationID - Maintenance configuration id assigned to the elastic pool. This configuration defines the period when the maintenance updates will will occur.
6378	MaintenanceConfigurationID *string `json:"maintenanceConfigurationId,omitempty"`
6379}
6380
6381// MarshalJSON is the custom marshaler for ElasticPoolProperties.
6382func (epp ElasticPoolProperties) MarshalJSON() ([]byte, error) {
6383	objectMap := make(map[string]interface{})
6384	if epp.MaxSizeBytes != nil {
6385		objectMap["maxSizeBytes"] = epp.MaxSizeBytes
6386	}
6387	if epp.PerDatabaseSettings != nil {
6388		objectMap["perDatabaseSettings"] = epp.PerDatabaseSettings
6389	}
6390	if epp.ZoneRedundant != nil {
6391		objectMap["zoneRedundant"] = epp.ZoneRedundant
6392	}
6393	if epp.LicenseType != "" {
6394		objectMap["licenseType"] = epp.LicenseType
6395	}
6396	if epp.MaintenanceConfigurationID != nil {
6397		objectMap["maintenanceConfigurationId"] = epp.MaintenanceConfigurationID
6398	}
6399	return json.Marshal(objectMap)
6400}
6401
6402// ElasticPoolsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
6403// long-running operation.
6404type ElasticPoolsCreateOrUpdateFuture struct {
6405	azure.FutureAPI
6406	// Result returns the result of the asynchronous operation.
6407	// If the operation has not completed it will return an error.
6408	Result func(ElasticPoolsClient) (ElasticPool, error)
6409}
6410
6411// UnmarshalJSON is the custom unmarshaller for CreateFuture.
6412func (future *ElasticPoolsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
6413	var azFuture azure.Future
6414	if err := json.Unmarshal(body, &azFuture); err != nil {
6415		return err
6416	}
6417	future.FutureAPI = &azFuture
6418	future.Result = future.result
6419	return nil
6420}
6421
6422// result is the default implementation for ElasticPoolsCreateOrUpdateFuture.Result.
6423func (future *ElasticPoolsCreateOrUpdateFuture) result(client ElasticPoolsClient) (ep ElasticPool, err error) {
6424	var done bool
6425	done, err = future.DoneWithContext(context.Background(), client)
6426	if err != nil {
6427		err = autorest.NewErrorWithError(err, "sql.ElasticPoolsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
6428		return
6429	}
6430	if !done {
6431		ep.Response.Response = future.Response()
6432		err = azure.NewAsyncOpIncompleteError("sql.ElasticPoolsCreateOrUpdateFuture")
6433		return
6434	}
6435	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6436	if ep.Response.Response, err = future.GetResult(sender); err == nil && ep.Response.Response.StatusCode != http.StatusNoContent {
6437		ep, err = client.CreateOrUpdateResponder(ep.Response.Response)
6438		if err != nil {
6439			err = autorest.NewErrorWithError(err, "sql.ElasticPoolsCreateOrUpdateFuture", "Result", ep.Response.Response, "Failure responding to request")
6440		}
6441	}
6442	return
6443}
6444
6445// ElasticPoolsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
6446// operation.
6447type ElasticPoolsDeleteFuture struct {
6448	azure.FutureAPI
6449	// Result returns the result of the asynchronous operation.
6450	// If the operation has not completed it will return an error.
6451	Result func(ElasticPoolsClient) (autorest.Response, error)
6452}
6453
6454// UnmarshalJSON is the custom unmarshaller for CreateFuture.
6455func (future *ElasticPoolsDeleteFuture) UnmarshalJSON(body []byte) error {
6456	var azFuture azure.Future
6457	if err := json.Unmarshal(body, &azFuture); err != nil {
6458		return err
6459	}
6460	future.FutureAPI = &azFuture
6461	future.Result = future.result
6462	return nil
6463}
6464
6465// result is the default implementation for ElasticPoolsDeleteFuture.Result.
6466func (future *ElasticPoolsDeleteFuture) result(client ElasticPoolsClient) (ar autorest.Response, err error) {
6467	var done bool
6468	done, err = future.DoneWithContext(context.Background(), client)
6469	if err != nil {
6470		err = autorest.NewErrorWithError(err, "sql.ElasticPoolsDeleteFuture", "Result", future.Response(), "Polling failure")
6471		return
6472	}
6473	if !done {
6474		ar.Response = future.Response()
6475		err = azure.NewAsyncOpIncompleteError("sql.ElasticPoolsDeleteFuture")
6476		return
6477	}
6478	ar.Response = future.Response()
6479	return
6480}
6481
6482// ElasticPoolsFailoverFuture an abstraction for monitoring and retrieving the results of a long-running
6483// operation.
6484type ElasticPoolsFailoverFuture struct {
6485	azure.FutureAPI
6486	// Result returns the result of the asynchronous operation.
6487	// If the operation has not completed it will return an error.
6488	Result func(ElasticPoolsClient) (autorest.Response, error)
6489}
6490
6491// UnmarshalJSON is the custom unmarshaller for CreateFuture.
6492func (future *ElasticPoolsFailoverFuture) UnmarshalJSON(body []byte) error {
6493	var azFuture azure.Future
6494	if err := json.Unmarshal(body, &azFuture); err != nil {
6495		return err
6496	}
6497	future.FutureAPI = &azFuture
6498	future.Result = future.result
6499	return nil
6500}
6501
6502// result is the default implementation for ElasticPoolsFailoverFuture.Result.
6503func (future *ElasticPoolsFailoverFuture) result(client ElasticPoolsClient) (ar autorest.Response, err error) {
6504	var done bool
6505	done, err = future.DoneWithContext(context.Background(), client)
6506	if err != nil {
6507		err = autorest.NewErrorWithError(err, "sql.ElasticPoolsFailoverFuture", "Result", future.Response(), "Polling failure")
6508		return
6509	}
6510	if !done {
6511		ar.Response = future.Response()
6512		err = azure.NewAsyncOpIncompleteError("sql.ElasticPoolsFailoverFuture")
6513		return
6514	}
6515	ar.Response = future.Response()
6516	return
6517}
6518
6519// ElasticPoolsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
6520// operation.
6521type ElasticPoolsUpdateFuture struct {
6522	azure.FutureAPI
6523	// Result returns the result of the asynchronous operation.
6524	// If the operation has not completed it will return an error.
6525	Result func(ElasticPoolsClient) (ElasticPool, error)
6526}
6527
6528// UnmarshalJSON is the custom unmarshaller for CreateFuture.
6529func (future *ElasticPoolsUpdateFuture) UnmarshalJSON(body []byte) error {
6530	var azFuture azure.Future
6531	if err := json.Unmarshal(body, &azFuture); err != nil {
6532		return err
6533	}
6534	future.FutureAPI = &azFuture
6535	future.Result = future.result
6536	return nil
6537}
6538
6539// result is the default implementation for ElasticPoolsUpdateFuture.Result.
6540func (future *ElasticPoolsUpdateFuture) result(client ElasticPoolsClient) (ep ElasticPool, err error) {
6541	var done bool
6542	done, err = future.DoneWithContext(context.Background(), client)
6543	if err != nil {
6544		err = autorest.NewErrorWithError(err, "sql.ElasticPoolsUpdateFuture", "Result", future.Response(), "Polling failure")
6545		return
6546	}
6547	if !done {
6548		ep.Response.Response = future.Response()
6549		err = azure.NewAsyncOpIncompleteError("sql.ElasticPoolsUpdateFuture")
6550		return
6551	}
6552	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6553	if ep.Response.Response, err = future.GetResult(sender); err == nil && ep.Response.Response.StatusCode != http.StatusNoContent {
6554		ep, err = client.UpdateResponder(ep.Response.Response)
6555		if err != nil {
6556			err = autorest.NewErrorWithError(err, "sql.ElasticPoolsUpdateFuture", "Result", ep.Response.Response, "Failure responding to request")
6557		}
6558	}
6559	return
6560}
6561
6562// ElasticPoolUpdate an elastic pool update.
6563type ElasticPoolUpdate struct {
6564	Sku *Sku `json:"sku,omitempty"`
6565	// ElasticPoolUpdateProperties - Resource properties.
6566	*ElasticPoolUpdateProperties `json:"properties,omitempty"`
6567	// Tags - Resource tags.
6568	Tags map[string]*string `json:"tags"`
6569}
6570
6571// MarshalJSON is the custom marshaler for ElasticPoolUpdate.
6572func (epu ElasticPoolUpdate) MarshalJSON() ([]byte, error) {
6573	objectMap := make(map[string]interface{})
6574	if epu.Sku != nil {
6575		objectMap["sku"] = epu.Sku
6576	}
6577	if epu.ElasticPoolUpdateProperties != nil {
6578		objectMap["properties"] = epu.ElasticPoolUpdateProperties
6579	}
6580	if epu.Tags != nil {
6581		objectMap["tags"] = epu.Tags
6582	}
6583	return json.Marshal(objectMap)
6584}
6585
6586// UnmarshalJSON is the custom unmarshaler for ElasticPoolUpdate struct.
6587func (epu *ElasticPoolUpdate) UnmarshalJSON(body []byte) error {
6588	var m map[string]*json.RawMessage
6589	err := json.Unmarshal(body, &m)
6590	if err != nil {
6591		return err
6592	}
6593	for k, v := range m {
6594		switch k {
6595		case "sku":
6596			if v != nil {
6597				var sku Sku
6598				err = json.Unmarshal(*v, &sku)
6599				if err != nil {
6600					return err
6601				}
6602				epu.Sku = &sku
6603			}
6604		case "properties":
6605			if v != nil {
6606				var elasticPoolUpdateProperties ElasticPoolUpdateProperties
6607				err = json.Unmarshal(*v, &elasticPoolUpdateProperties)
6608				if err != nil {
6609					return err
6610				}
6611				epu.ElasticPoolUpdateProperties = &elasticPoolUpdateProperties
6612			}
6613		case "tags":
6614			if v != nil {
6615				var tags map[string]*string
6616				err = json.Unmarshal(*v, &tags)
6617				if err != nil {
6618					return err
6619				}
6620				epu.Tags = tags
6621			}
6622		}
6623	}
6624
6625	return nil
6626}
6627
6628// ElasticPoolUpdateProperties properties of an elastic pool
6629type ElasticPoolUpdateProperties struct {
6630	// MaxSizeBytes - The storage limit for the database elastic pool in bytes.
6631	MaxSizeBytes *int64 `json:"maxSizeBytes,omitempty"`
6632	// PerDatabaseSettings - The per database settings for the elastic pool.
6633	PerDatabaseSettings *ElasticPoolPerDatabaseSettings `json:"perDatabaseSettings,omitempty"`
6634	// ZoneRedundant - Whether or not this elastic pool is zone redundant, which means the replicas of this elastic pool will be spread across multiple availability zones.
6635	ZoneRedundant *bool `json:"zoneRedundant,omitempty"`
6636	// LicenseType - The license type to apply for this elastic pool. Possible values include: 'ElasticPoolLicenseTypeLicenseIncluded', 'ElasticPoolLicenseTypeBasePrice'
6637	LicenseType ElasticPoolLicenseType `json:"licenseType,omitempty"`
6638	// MaintenanceConfigurationID - Maintenance configuration id assigned to the elastic pool. This configuration defines the period when the maintenance updates will will occur.
6639	MaintenanceConfigurationID *string `json:"maintenanceConfigurationId,omitempty"`
6640}
6641
6642// EncryptionProtector the server encryption protector.
6643type EncryptionProtector struct {
6644	autorest.Response `json:"-"`
6645	// Kind - READ-ONLY; Kind of encryption protector. This is metadata used for the Azure portal experience.
6646	Kind *string `json:"kind,omitempty"`
6647	// Location - READ-ONLY; Resource location.
6648	Location *string `json:"location,omitempty"`
6649	// EncryptionProtectorProperties - Resource properties.
6650	*EncryptionProtectorProperties `json:"properties,omitempty"`
6651	// ID - READ-ONLY; Resource ID.
6652	ID *string `json:"id,omitempty"`
6653	// Name - READ-ONLY; Resource name.
6654	Name *string `json:"name,omitempty"`
6655	// Type - READ-ONLY; Resource type.
6656	Type *string `json:"type,omitempty"`
6657}
6658
6659// MarshalJSON is the custom marshaler for EncryptionProtector.
6660func (ep EncryptionProtector) MarshalJSON() ([]byte, error) {
6661	objectMap := make(map[string]interface{})
6662	if ep.EncryptionProtectorProperties != nil {
6663		objectMap["properties"] = ep.EncryptionProtectorProperties
6664	}
6665	return json.Marshal(objectMap)
6666}
6667
6668// UnmarshalJSON is the custom unmarshaler for EncryptionProtector struct.
6669func (ep *EncryptionProtector) UnmarshalJSON(body []byte) error {
6670	var m map[string]*json.RawMessage
6671	err := json.Unmarshal(body, &m)
6672	if err != nil {
6673		return err
6674	}
6675	for k, v := range m {
6676		switch k {
6677		case "kind":
6678			if v != nil {
6679				var kind string
6680				err = json.Unmarshal(*v, &kind)
6681				if err != nil {
6682					return err
6683				}
6684				ep.Kind = &kind
6685			}
6686		case "location":
6687			if v != nil {
6688				var location string
6689				err = json.Unmarshal(*v, &location)
6690				if err != nil {
6691					return err
6692				}
6693				ep.Location = &location
6694			}
6695		case "properties":
6696			if v != nil {
6697				var encryptionProtectorProperties EncryptionProtectorProperties
6698				err = json.Unmarshal(*v, &encryptionProtectorProperties)
6699				if err != nil {
6700					return err
6701				}
6702				ep.EncryptionProtectorProperties = &encryptionProtectorProperties
6703			}
6704		case "id":
6705			if v != nil {
6706				var ID string
6707				err = json.Unmarshal(*v, &ID)
6708				if err != nil {
6709					return err
6710				}
6711				ep.ID = &ID
6712			}
6713		case "name":
6714			if v != nil {
6715				var name string
6716				err = json.Unmarshal(*v, &name)
6717				if err != nil {
6718					return err
6719				}
6720				ep.Name = &name
6721			}
6722		case "type":
6723			if v != nil {
6724				var typeVar string
6725				err = json.Unmarshal(*v, &typeVar)
6726				if err != nil {
6727					return err
6728				}
6729				ep.Type = &typeVar
6730			}
6731		}
6732	}
6733
6734	return nil
6735}
6736
6737// EncryptionProtectorListResult a list of server encryption protectors.
6738type EncryptionProtectorListResult struct {
6739	autorest.Response `json:"-"`
6740	// Value - READ-ONLY; Array of results.
6741	Value *[]EncryptionProtector `json:"value,omitempty"`
6742	// NextLink - READ-ONLY; Link to retrieve next page of results.
6743	NextLink *string `json:"nextLink,omitempty"`
6744}
6745
6746// MarshalJSON is the custom marshaler for EncryptionProtectorListResult.
6747func (eplr EncryptionProtectorListResult) MarshalJSON() ([]byte, error) {
6748	objectMap := make(map[string]interface{})
6749	return json.Marshal(objectMap)
6750}
6751
6752// EncryptionProtectorListResultIterator provides access to a complete listing of EncryptionProtector
6753// values.
6754type EncryptionProtectorListResultIterator struct {
6755	i    int
6756	page EncryptionProtectorListResultPage
6757}
6758
6759// NextWithContext advances to the next value.  If there was an error making
6760// the request the iterator does not advance and the error is returned.
6761func (iter *EncryptionProtectorListResultIterator) NextWithContext(ctx context.Context) (err error) {
6762	if tracing.IsEnabled() {
6763		ctx = tracing.StartSpan(ctx, fqdn+"/EncryptionProtectorListResultIterator.NextWithContext")
6764		defer func() {
6765			sc := -1
6766			if iter.Response().Response.Response != nil {
6767				sc = iter.Response().Response.Response.StatusCode
6768			}
6769			tracing.EndSpan(ctx, sc, err)
6770		}()
6771	}
6772	iter.i++
6773	if iter.i < len(iter.page.Values()) {
6774		return nil
6775	}
6776	err = iter.page.NextWithContext(ctx)
6777	if err != nil {
6778		iter.i--
6779		return err
6780	}
6781	iter.i = 0
6782	return nil
6783}
6784
6785// Next advances to the next value.  If there was an error making
6786// the request the iterator does not advance and the error is returned.
6787// Deprecated: Use NextWithContext() instead.
6788func (iter *EncryptionProtectorListResultIterator) Next() error {
6789	return iter.NextWithContext(context.Background())
6790}
6791
6792// NotDone returns true if the enumeration should be started or is not yet complete.
6793func (iter EncryptionProtectorListResultIterator) NotDone() bool {
6794	return iter.page.NotDone() && iter.i < len(iter.page.Values())
6795}
6796
6797// Response returns the raw server response from the last page request.
6798func (iter EncryptionProtectorListResultIterator) Response() EncryptionProtectorListResult {
6799	return iter.page.Response()
6800}
6801
6802// Value returns the current value or a zero-initialized value if the
6803// iterator has advanced beyond the end of the collection.
6804func (iter EncryptionProtectorListResultIterator) Value() EncryptionProtector {
6805	if !iter.page.NotDone() {
6806		return EncryptionProtector{}
6807	}
6808	return iter.page.Values()[iter.i]
6809}
6810
6811// Creates a new instance of the EncryptionProtectorListResultIterator type.
6812func NewEncryptionProtectorListResultIterator(page EncryptionProtectorListResultPage) EncryptionProtectorListResultIterator {
6813	return EncryptionProtectorListResultIterator{page: page}
6814}
6815
6816// IsEmpty returns true if the ListResult contains no values.
6817func (eplr EncryptionProtectorListResult) IsEmpty() bool {
6818	return eplr.Value == nil || len(*eplr.Value) == 0
6819}
6820
6821// hasNextLink returns true if the NextLink is not empty.
6822func (eplr EncryptionProtectorListResult) hasNextLink() bool {
6823	return eplr.NextLink != nil && len(*eplr.NextLink) != 0
6824}
6825
6826// encryptionProtectorListResultPreparer prepares a request to retrieve the next set of results.
6827// It returns nil if no more results exist.
6828func (eplr EncryptionProtectorListResult) encryptionProtectorListResultPreparer(ctx context.Context) (*http.Request, error) {
6829	if !eplr.hasNextLink() {
6830		return nil, nil
6831	}
6832	return autorest.Prepare((&http.Request{}).WithContext(ctx),
6833		autorest.AsJSON(),
6834		autorest.AsGet(),
6835		autorest.WithBaseURL(to.String(eplr.NextLink)))
6836}
6837
6838// EncryptionProtectorListResultPage contains a page of EncryptionProtector values.
6839type EncryptionProtectorListResultPage struct {
6840	fn   func(context.Context, EncryptionProtectorListResult) (EncryptionProtectorListResult, error)
6841	eplr EncryptionProtectorListResult
6842}
6843
6844// NextWithContext advances to the next page of values.  If there was an error making
6845// the request the page does not advance and the error is returned.
6846func (page *EncryptionProtectorListResultPage) NextWithContext(ctx context.Context) (err error) {
6847	if tracing.IsEnabled() {
6848		ctx = tracing.StartSpan(ctx, fqdn+"/EncryptionProtectorListResultPage.NextWithContext")
6849		defer func() {
6850			sc := -1
6851			if page.Response().Response.Response != nil {
6852				sc = page.Response().Response.Response.StatusCode
6853			}
6854			tracing.EndSpan(ctx, sc, err)
6855		}()
6856	}
6857	for {
6858		next, err := page.fn(ctx, page.eplr)
6859		if err != nil {
6860			return err
6861		}
6862		page.eplr = next
6863		if !next.hasNextLink() || !next.IsEmpty() {
6864			break
6865		}
6866	}
6867	return nil
6868}
6869
6870// Next advances to the next page of values.  If there was an error making
6871// the request the page does not advance and the error is returned.
6872// Deprecated: Use NextWithContext() instead.
6873func (page *EncryptionProtectorListResultPage) Next() error {
6874	return page.NextWithContext(context.Background())
6875}
6876
6877// NotDone returns true if the page enumeration should be started or is not yet complete.
6878func (page EncryptionProtectorListResultPage) NotDone() bool {
6879	return !page.eplr.IsEmpty()
6880}
6881
6882// Response returns the raw server response from the last page request.
6883func (page EncryptionProtectorListResultPage) Response() EncryptionProtectorListResult {
6884	return page.eplr
6885}
6886
6887// Values returns the slice of values for the current page or nil if there are no values.
6888func (page EncryptionProtectorListResultPage) Values() []EncryptionProtector {
6889	if page.eplr.IsEmpty() {
6890		return nil
6891	}
6892	return *page.eplr.Value
6893}
6894
6895// Creates a new instance of the EncryptionProtectorListResultPage type.
6896func NewEncryptionProtectorListResultPage(cur EncryptionProtectorListResult, getNextPage func(context.Context, EncryptionProtectorListResult) (EncryptionProtectorListResult, error)) EncryptionProtectorListResultPage {
6897	return EncryptionProtectorListResultPage{
6898		fn:   getNextPage,
6899		eplr: cur,
6900	}
6901}
6902
6903// EncryptionProtectorProperties properties for an encryption protector execution.
6904type EncryptionProtectorProperties struct {
6905	// Subregion - READ-ONLY; Subregion of the encryption protector.
6906	Subregion *string `json:"subregion,omitempty"`
6907	// ServerKeyName - The name of the server key.
6908	ServerKeyName *string `json:"serverKeyName,omitempty"`
6909	// ServerKeyType - The encryption protector type like 'ServiceManaged', 'AzureKeyVault'. Possible values include: 'ServerKeyTypeServiceManaged', 'ServerKeyTypeAzureKeyVault'
6910	ServerKeyType ServerKeyType `json:"serverKeyType,omitempty"`
6911	// URI - READ-ONLY; The URI of the server key.
6912	URI *string `json:"uri,omitempty"`
6913	// Thumbprint - READ-ONLY; Thumbprint of the server key.
6914	Thumbprint *string `json:"thumbprint,omitempty"`
6915	// AutoRotationEnabled - Key auto rotation opt-in flag. Either true or false.
6916	AutoRotationEnabled *bool `json:"autoRotationEnabled,omitempty"`
6917}
6918
6919// MarshalJSON is the custom marshaler for EncryptionProtectorProperties.
6920func (epp EncryptionProtectorProperties) MarshalJSON() ([]byte, error) {
6921	objectMap := make(map[string]interface{})
6922	if epp.ServerKeyName != nil {
6923		objectMap["serverKeyName"] = epp.ServerKeyName
6924	}
6925	if epp.ServerKeyType != "" {
6926		objectMap["serverKeyType"] = epp.ServerKeyType
6927	}
6928	if epp.AutoRotationEnabled != nil {
6929		objectMap["autoRotationEnabled"] = epp.AutoRotationEnabled
6930	}
6931	return json.Marshal(objectMap)
6932}
6933
6934// EncryptionProtectorsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
6935// long-running operation.
6936type EncryptionProtectorsCreateOrUpdateFuture struct {
6937	azure.FutureAPI
6938	// Result returns the result of the asynchronous operation.
6939	// If the operation has not completed it will return an error.
6940	Result func(EncryptionProtectorsClient) (EncryptionProtector, error)
6941}
6942
6943// UnmarshalJSON is the custom unmarshaller for CreateFuture.
6944func (future *EncryptionProtectorsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
6945	var azFuture azure.Future
6946	if err := json.Unmarshal(body, &azFuture); err != nil {
6947		return err
6948	}
6949	future.FutureAPI = &azFuture
6950	future.Result = future.result
6951	return nil
6952}
6953
6954// result is the default implementation for EncryptionProtectorsCreateOrUpdateFuture.Result.
6955func (future *EncryptionProtectorsCreateOrUpdateFuture) result(client EncryptionProtectorsClient) (ep EncryptionProtector, err error) {
6956	var done bool
6957	done, err = future.DoneWithContext(context.Background(), client)
6958	if err != nil {
6959		err = autorest.NewErrorWithError(err, "sql.EncryptionProtectorsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
6960		return
6961	}
6962	if !done {
6963		ep.Response.Response = future.Response()
6964		err = azure.NewAsyncOpIncompleteError("sql.EncryptionProtectorsCreateOrUpdateFuture")
6965		return
6966	}
6967	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6968	if ep.Response.Response, err = future.GetResult(sender); err == nil && ep.Response.Response.StatusCode != http.StatusNoContent {
6969		ep, err = client.CreateOrUpdateResponder(ep.Response.Response)
6970		if err != nil {
6971			err = autorest.NewErrorWithError(err, "sql.EncryptionProtectorsCreateOrUpdateFuture", "Result", ep.Response.Response, "Failure responding to request")
6972		}
6973	}
6974	return
6975}
6976
6977// EncryptionProtectorsRevalidateFuture an abstraction for monitoring and retrieving the results of a
6978// long-running operation.
6979type EncryptionProtectorsRevalidateFuture struct {
6980	azure.FutureAPI
6981	// Result returns the result of the asynchronous operation.
6982	// If the operation has not completed it will return an error.
6983	Result func(EncryptionProtectorsClient) (autorest.Response, error)
6984}
6985
6986// UnmarshalJSON is the custom unmarshaller for CreateFuture.
6987func (future *EncryptionProtectorsRevalidateFuture) UnmarshalJSON(body []byte) error {
6988	var azFuture azure.Future
6989	if err := json.Unmarshal(body, &azFuture); err != nil {
6990		return err
6991	}
6992	future.FutureAPI = &azFuture
6993	future.Result = future.result
6994	return nil
6995}
6996
6997// result is the default implementation for EncryptionProtectorsRevalidateFuture.Result.
6998func (future *EncryptionProtectorsRevalidateFuture) result(client EncryptionProtectorsClient) (ar autorest.Response, err error) {
6999	var done bool
7000	done, err = future.DoneWithContext(context.Background(), client)
7001	if err != nil {
7002		err = autorest.NewErrorWithError(err, "sql.EncryptionProtectorsRevalidateFuture", "Result", future.Response(), "Polling failure")
7003		return
7004	}
7005	if !done {
7006		ar.Response = future.Response()
7007		err = azure.NewAsyncOpIncompleteError("sql.EncryptionProtectorsRevalidateFuture")
7008		return
7009	}
7010	ar.Response = future.Response()
7011	return
7012}
7013
7014// ExportDatabaseDefinition contains the information necessary to perform export database operation.
7015type ExportDatabaseDefinition struct {
7016	// StorageKeyType - Storage key type. Possible values include: 'StorageKeyTypeSharedAccessKey', 'StorageKeyTypeStorageAccessKey'
7017	StorageKeyType StorageKeyType `json:"storageKeyType,omitempty"`
7018	// StorageKey - Storage key.
7019	StorageKey *string `json:"storageKey,omitempty"`
7020	// StorageURI - Storage Uri.
7021	StorageURI *string `json:"storageUri,omitempty"`
7022	// AdministratorLogin - Administrator login name.
7023	AdministratorLogin *string `json:"administratorLogin,omitempty"`
7024	// AdministratorLoginPassword - Administrator login password.
7025	AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"`
7026	// AuthenticationType - Authentication type.
7027	AuthenticationType *string `json:"authenticationType,omitempty"`
7028	// NetworkIsolation - Optional resource information to enable network isolation for request.
7029	NetworkIsolation *NetworkIsolationSettings `json:"networkIsolation,omitempty"`
7030}
7031
7032// ExtendedDatabaseBlobAuditingPolicy an extended database blob auditing policy.
7033type ExtendedDatabaseBlobAuditingPolicy struct {
7034	autorest.Response `json:"-"`
7035	// ExtendedDatabaseBlobAuditingPolicyProperties - Resource properties.
7036	*ExtendedDatabaseBlobAuditingPolicyProperties `json:"properties,omitempty"`
7037	// ID - READ-ONLY; Resource ID.
7038	ID *string `json:"id,omitempty"`
7039	// Name - READ-ONLY; Resource name.
7040	Name *string `json:"name,omitempty"`
7041	// Type - READ-ONLY; Resource type.
7042	Type *string `json:"type,omitempty"`
7043}
7044
7045// MarshalJSON is the custom marshaler for ExtendedDatabaseBlobAuditingPolicy.
7046func (edbap ExtendedDatabaseBlobAuditingPolicy) MarshalJSON() ([]byte, error) {
7047	objectMap := make(map[string]interface{})
7048	if edbap.ExtendedDatabaseBlobAuditingPolicyProperties != nil {
7049		objectMap["properties"] = edbap.ExtendedDatabaseBlobAuditingPolicyProperties
7050	}
7051	return json.Marshal(objectMap)
7052}
7053
7054// UnmarshalJSON is the custom unmarshaler for ExtendedDatabaseBlobAuditingPolicy struct.
7055func (edbap *ExtendedDatabaseBlobAuditingPolicy) UnmarshalJSON(body []byte) error {
7056	var m map[string]*json.RawMessage
7057	err := json.Unmarshal(body, &m)
7058	if err != nil {
7059		return err
7060	}
7061	for k, v := range m {
7062		switch k {
7063		case "properties":
7064			if v != nil {
7065				var extendedDatabaseBlobAuditingPolicyProperties ExtendedDatabaseBlobAuditingPolicyProperties
7066				err = json.Unmarshal(*v, &extendedDatabaseBlobAuditingPolicyProperties)
7067				if err != nil {
7068					return err
7069				}
7070				edbap.ExtendedDatabaseBlobAuditingPolicyProperties = &extendedDatabaseBlobAuditingPolicyProperties
7071			}
7072		case "id":
7073			if v != nil {
7074				var ID string
7075				err = json.Unmarshal(*v, &ID)
7076				if err != nil {
7077					return err
7078				}
7079				edbap.ID = &ID
7080			}
7081		case "name":
7082			if v != nil {
7083				var name string
7084				err = json.Unmarshal(*v, &name)
7085				if err != nil {
7086					return err
7087				}
7088				edbap.Name = &name
7089			}
7090		case "type":
7091			if v != nil {
7092				var typeVar string
7093				err = json.Unmarshal(*v, &typeVar)
7094				if err != nil {
7095					return err
7096				}
7097				edbap.Type = &typeVar
7098			}
7099		}
7100	}
7101
7102	return nil
7103}
7104
7105// ExtendedDatabaseBlobAuditingPolicyListResult a list of database extended auditing settings.
7106type ExtendedDatabaseBlobAuditingPolicyListResult struct {
7107	autorest.Response `json:"-"`
7108	// Value - READ-ONLY; Array of results.
7109	Value *[]ExtendedDatabaseBlobAuditingPolicy `json:"value,omitempty"`
7110	// NextLink - READ-ONLY; Link to retrieve next page of results.
7111	NextLink *string `json:"nextLink,omitempty"`
7112}
7113
7114// MarshalJSON is the custom marshaler for ExtendedDatabaseBlobAuditingPolicyListResult.
7115func (edbaplr ExtendedDatabaseBlobAuditingPolicyListResult) MarshalJSON() ([]byte, error) {
7116	objectMap := make(map[string]interface{})
7117	return json.Marshal(objectMap)
7118}
7119
7120// ExtendedDatabaseBlobAuditingPolicyListResultIterator provides access to a complete listing of
7121// ExtendedDatabaseBlobAuditingPolicy values.
7122type ExtendedDatabaseBlobAuditingPolicyListResultIterator struct {
7123	i    int
7124	page ExtendedDatabaseBlobAuditingPolicyListResultPage
7125}
7126
7127// NextWithContext advances to the next value.  If there was an error making
7128// the request the iterator does not advance and the error is returned.
7129func (iter *ExtendedDatabaseBlobAuditingPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
7130	if tracing.IsEnabled() {
7131		ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedDatabaseBlobAuditingPolicyListResultIterator.NextWithContext")
7132		defer func() {
7133			sc := -1
7134			if iter.Response().Response.Response != nil {
7135				sc = iter.Response().Response.Response.StatusCode
7136			}
7137			tracing.EndSpan(ctx, sc, err)
7138		}()
7139	}
7140	iter.i++
7141	if iter.i < len(iter.page.Values()) {
7142		return nil
7143	}
7144	err = iter.page.NextWithContext(ctx)
7145	if err != nil {
7146		iter.i--
7147		return err
7148	}
7149	iter.i = 0
7150	return nil
7151}
7152
7153// Next advances to the next value.  If there was an error making
7154// the request the iterator does not advance and the error is returned.
7155// Deprecated: Use NextWithContext() instead.
7156func (iter *ExtendedDatabaseBlobAuditingPolicyListResultIterator) Next() error {
7157	return iter.NextWithContext(context.Background())
7158}
7159
7160// NotDone returns true if the enumeration should be started or is not yet complete.
7161func (iter ExtendedDatabaseBlobAuditingPolicyListResultIterator) NotDone() bool {
7162	return iter.page.NotDone() && iter.i < len(iter.page.Values())
7163}
7164
7165// Response returns the raw server response from the last page request.
7166func (iter ExtendedDatabaseBlobAuditingPolicyListResultIterator) Response() ExtendedDatabaseBlobAuditingPolicyListResult {
7167	return iter.page.Response()
7168}
7169
7170// Value returns the current value or a zero-initialized value if the
7171// iterator has advanced beyond the end of the collection.
7172func (iter ExtendedDatabaseBlobAuditingPolicyListResultIterator) Value() ExtendedDatabaseBlobAuditingPolicy {
7173	if !iter.page.NotDone() {
7174		return ExtendedDatabaseBlobAuditingPolicy{}
7175	}
7176	return iter.page.Values()[iter.i]
7177}
7178
7179// Creates a new instance of the ExtendedDatabaseBlobAuditingPolicyListResultIterator type.
7180func NewExtendedDatabaseBlobAuditingPolicyListResultIterator(page ExtendedDatabaseBlobAuditingPolicyListResultPage) ExtendedDatabaseBlobAuditingPolicyListResultIterator {
7181	return ExtendedDatabaseBlobAuditingPolicyListResultIterator{page: page}
7182}
7183
7184// IsEmpty returns true if the ListResult contains no values.
7185func (edbaplr ExtendedDatabaseBlobAuditingPolicyListResult) IsEmpty() bool {
7186	return edbaplr.Value == nil || len(*edbaplr.Value) == 0
7187}
7188
7189// hasNextLink returns true if the NextLink is not empty.
7190func (edbaplr ExtendedDatabaseBlobAuditingPolicyListResult) hasNextLink() bool {
7191	return edbaplr.NextLink != nil && len(*edbaplr.NextLink) != 0
7192}
7193
7194// extendedDatabaseBlobAuditingPolicyListResultPreparer prepares a request to retrieve the next set of results.
7195// It returns nil if no more results exist.
7196func (edbaplr ExtendedDatabaseBlobAuditingPolicyListResult) extendedDatabaseBlobAuditingPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
7197	if !edbaplr.hasNextLink() {
7198		return nil, nil
7199	}
7200	return autorest.Prepare((&http.Request{}).WithContext(ctx),
7201		autorest.AsJSON(),
7202		autorest.AsGet(),
7203		autorest.WithBaseURL(to.String(edbaplr.NextLink)))
7204}
7205
7206// ExtendedDatabaseBlobAuditingPolicyListResultPage contains a page of ExtendedDatabaseBlobAuditingPolicy
7207// values.
7208type ExtendedDatabaseBlobAuditingPolicyListResultPage struct {
7209	fn      func(context.Context, ExtendedDatabaseBlobAuditingPolicyListResult) (ExtendedDatabaseBlobAuditingPolicyListResult, error)
7210	edbaplr ExtendedDatabaseBlobAuditingPolicyListResult
7211}
7212
7213// NextWithContext advances to the next page of values.  If there was an error making
7214// the request the page does not advance and the error is returned.
7215func (page *ExtendedDatabaseBlobAuditingPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
7216	if tracing.IsEnabled() {
7217		ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedDatabaseBlobAuditingPolicyListResultPage.NextWithContext")
7218		defer func() {
7219			sc := -1
7220			if page.Response().Response.Response != nil {
7221				sc = page.Response().Response.Response.StatusCode
7222			}
7223			tracing.EndSpan(ctx, sc, err)
7224		}()
7225	}
7226	for {
7227		next, err := page.fn(ctx, page.edbaplr)
7228		if err != nil {
7229			return err
7230		}
7231		page.edbaplr = next
7232		if !next.hasNextLink() || !next.IsEmpty() {
7233			break
7234		}
7235	}
7236	return nil
7237}
7238
7239// Next advances to the next page of values.  If there was an error making
7240// the request the page does not advance and the error is returned.
7241// Deprecated: Use NextWithContext() instead.
7242func (page *ExtendedDatabaseBlobAuditingPolicyListResultPage) Next() error {
7243	return page.NextWithContext(context.Background())
7244}
7245
7246// NotDone returns true if the page enumeration should be started or is not yet complete.
7247func (page ExtendedDatabaseBlobAuditingPolicyListResultPage) NotDone() bool {
7248	return !page.edbaplr.IsEmpty()
7249}
7250
7251// Response returns the raw server response from the last page request.
7252func (page ExtendedDatabaseBlobAuditingPolicyListResultPage) Response() ExtendedDatabaseBlobAuditingPolicyListResult {
7253	return page.edbaplr
7254}
7255
7256// Values returns the slice of values for the current page or nil if there are no values.
7257func (page ExtendedDatabaseBlobAuditingPolicyListResultPage) Values() []ExtendedDatabaseBlobAuditingPolicy {
7258	if page.edbaplr.IsEmpty() {
7259		return nil
7260	}
7261	return *page.edbaplr.Value
7262}
7263
7264// Creates a new instance of the ExtendedDatabaseBlobAuditingPolicyListResultPage type.
7265func NewExtendedDatabaseBlobAuditingPolicyListResultPage(cur ExtendedDatabaseBlobAuditingPolicyListResult, getNextPage func(context.Context, ExtendedDatabaseBlobAuditingPolicyListResult) (ExtendedDatabaseBlobAuditingPolicyListResult, error)) ExtendedDatabaseBlobAuditingPolicyListResultPage {
7266	return ExtendedDatabaseBlobAuditingPolicyListResultPage{
7267		fn:      getNextPage,
7268		edbaplr: cur,
7269	}
7270}
7271
7272// ExtendedDatabaseBlobAuditingPolicyProperties properties of an extended database blob auditing policy.
7273type ExtendedDatabaseBlobAuditingPolicyProperties struct {
7274	// PredicateExpression - Specifies condition of where clause when creating an audit.
7275	PredicateExpression *string `json:"predicateExpression,omitempty"`
7276	// RetentionDays - Specifies the number of days to keep in the audit logs in the storage account.
7277	RetentionDays *int32 `json:"retentionDays,omitempty"`
7278	// AuditActionsAndGroups - Specifies the Actions-Groups and Actions to audit.
7279	//
7280	// 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:
7281	//
7282	// BATCH_COMPLETED_GROUP,
7283	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP,
7284	// FAILED_DATABASE_AUTHENTICATION_GROUP.
7285	//
7286	// This above combination is also the set that is configured by default when enabling auditing from the Azure portal.
7287	//
7288	// 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):
7289	//
7290	// APPLICATION_ROLE_CHANGE_PASSWORD_GROUP
7291	// BACKUP_RESTORE_GROUP
7292	// DATABASE_LOGOUT_GROUP
7293	// DATABASE_OBJECT_CHANGE_GROUP
7294	// DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP
7295	// DATABASE_OBJECT_PERMISSION_CHANGE_GROUP
7296	// DATABASE_OPERATION_GROUP
7297	// DATABASE_PERMISSION_CHANGE_GROUP
7298	// DATABASE_PRINCIPAL_CHANGE_GROUP
7299	// DATABASE_PRINCIPAL_IMPERSONATION_GROUP
7300	// DATABASE_ROLE_MEMBER_CHANGE_GROUP
7301	// FAILED_DATABASE_AUTHENTICATION_GROUP
7302	// SCHEMA_OBJECT_ACCESS_GROUP
7303	// SCHEMA_OBJECT_CHANGE_GROUP
7304	// SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP
7305	// SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP
7306	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP
7307	// USER_CHANGE_PASSWORD_GROUP
7308	// BATCH_STARTED_GROUP
7309	// BATCH_COMPLETED_GROUP
7310	//
7311	// 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.
7312	//
7313	// 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).
7314	//
7315	// 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:
7316	// SELECT
7317	// UPDATE
7318	// INSERT
7319	// DELETE
7320	// EXECUTE
7321	// RECEIVE
7322	// REFERENCES
7323	//
7324	// The general form for defining an action to be audited is:
7325	// {action} ON {object} BY {principal}
7326	//
7327	// 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.
7328	//
7329	// For example:
7330	// SELECT on dbo.myTable by public
7331	// SELECT on DATABASE::myDatabase by public
7332	// SELECT on SCHEMA::mySchema by public
7333	//
7334	// 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)
7335	AuditActionsAndGroups *[]string `json:"auditActionsAndGroups,omitempty"`
7336	// IsStorageSecondaryKeyInUse - Specifies whether storageAccountAccessKey value is the storage's secondary key.
7337	IsStorageSecondaryKeyInUse *bool `json:"isStorageSecondaryKeyInUse,omitempty"`
7338	// IsAzureMonitorTargetEnabled - Specifies whether audit events are sent to Azure Monitor.
7339	// In order to send the events to Azure Monitor, specify 'State' as 'Enabled' and 'IsAzureMonitorTargetEnabled' as true.
7340	//
7341	// When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created.
7342	// Note that for server level audit you should use the 'master' database as {databaseName}.
7343	//
7344	// Diagnostic Settings URI format:
7345	// PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview
7346	//
7347	// For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207)
7348	// or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)
7349	IsAzureMonitorTargetEnabled *bool `json:"isAzureMonitorTargetEnabled,omitempty"`
7350	// QueueDelayMs - Specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed.
7351	// The default minimum value is 1000 (1 second). The maximum is 2,147,483,647.
7352	QueueDelayMs *int32 `json:"queueDelayMs,omitempty"`
7353	// State - Specifies the state of the audit. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. Possible values include: 'BlobAuditingPolicyStateEnabled', 'BlobAuditingPolicyStateDisabled'
7354	State BlobAuditingPolicyState `json:"state,omitempty"`
7355	// StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required.
7356	StorageEndpoint *string `json:"storageEndpoint,omitempty"`
7357	// StorageAccountAccessKey - Specifies the identifier key of the auditing storage account.
7358	// If state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage.
7359	// Prerequisites for using managed identity authentication:
7360	// 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD).
7361	// 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity.
7362	// For more information, see [Auditing to storage using Managed Identity authentication](https://go.microsoft.com/fwlink/?linkid=2114355)
7363	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
7364	// StorageAccountSubscriptionID - Specifies the blob storage subscription Id.
7365	StorageAccountSubscriptionID *uuid.UUID `json:"storageAccountSubscriptionId,omitempty"`
7366}
7367
7368// ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the
7369// results of a long-running operation.
7370type ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture struct {
7371	azure.FutureAPI
7372	// Result returns the result of the asynchronous operation.
7373	// If the operation has not completed it will return an error.
7374	Result func(ExtendedServerBlobAuditingPoliciesClient) (ExtendedServerBlobAuditingPolicy, error)
7375}
7376
7377// UnmarshalJSON is the custom unmarshaller for CreateFuture.
7378func (future *ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
7379	var azFuture azure.Future
7380	if err := json.Unmarshal(body, &azFuture); err != nil {
7381		return err
7382	}
7383	future.FutureAPI = &azFuture
7384	future.Result = future.result
7385	return nil
7386}
7387
7388// result is the default implementation for ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture.Result.
7389func (future *ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture) result(client ExtendedServerBlobAuditingPoliciesClient) (esbap ExtendedServerBlobAuditingPolicy, err error) {
7390	var done bool
7391	done, err = future.DoneWithContext(context.Background(), client)
7392	if err != nil {
7393		err = autorest.NewErrorWithError(err, "sql.ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
7394		return
7395	}
7396	if !done {
7397		esbap.Response.Response = future.Response()
7398		err = azure.NewAsyncOpIncompleteError("sql.ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture")
7399		return
7400	}
7401	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7402	if esbap.Response.Response, err = future.GetResult(sender); err == nil && esbap.Response.Response.StatusCode != http.StatusNoContent {
7403		esbap, err = client.CreateOrUpdateResponder(esbap.Response.Response)
7404		if err != nil {
7405			err = autorest.NewErrorWithError(err, "sql.ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture", "Result", esbap.Response.Response, "Failure responding to request")
7406		}
7407	}
7408	return
7409}
7410
7411// ExtendedServerBlobAuditingPolicy an extended server blob auditing policy.
7412type ExtendedServerBlobAuditingPolicy struct {
7413	autorest.Response `json:"-"`
7414	// ExtendedServerBlobAuditingPolicyProperties - Resource properties.
7415	*ExtendedServerBlobAuditingPolicyProperties `json:"properties,omitempty"`
7416	// ID - READ-ONLY; Resource ID.
7417	ID *string `json:"id,omitempty"`
7418	// Name - READ-ONLY; Resource name.
7419	Name *string `json:"name,omitempty"`
7420	// Type - READ-ONLY; Resource type.
7421	Type *string `json:"type,omitempty"`
7422}
7423
7424// MarshalJSON is the custom marshaler for ExtendedServerBlobAuditingPolicy.
7425func (esbap ExtendedServerBlobAuditingPolicy) MarshalJSON() ([]byte, error) {
7426	objectMap := make(map[string]interface{})
7427	if esbap.ExtendedServerBlobAuditingPolicyProperties != nil {
7428		objectMap["properties"] = esbap.ExtendedServerBlobAuditingPolicyProperties
7429	}
7430	return json.Marshal(objectMap)
7431}
7432
7433// UnmarshalJSON is the custom unmarshaler for ExtendedServerBlobAuditingPolicy struct.
7434func (esbap *ExtendedServerBlobAuditingPolicy) UnmarshalJSON(body []byte) error {
7435	var m map[string]*json.RawMessage
7436	err := json.Unmarshal(body, &m)
7437	if err != nil {
7438		return err
7439	}
7440	for k, v := range m {
7441		switch k {
7442		case "properties":
7443			if v != nil {
7444				var extendedServerBlobAuditingPolicyProperties ExtendedServerBlobAuditingPolicyProperties
7445				err = json.Unmarshal(*v, &extendedServerBlobAuditingPolicyProperties)
7446				if err != nil {
7447					return err
7448				}
7449				esbap.ExtendedServerBlobAuditingPolicyProperties = &extendedServerBlobAuditingPolicyProperties
7450			}
7451		case "id":
7452			if v != nil {
7453				var ID string
7454				err = json.Unmarshal(*v, &ID)
7455				if err != nil {
7456					return err
7457				}
7458				esbap.ID = &ID
7459			}
7460		case "name":
7461			if v != nil {
7462				var name string
7463				err = json.Unmarshal(*v, &name)
7464				if err != nil {
7465					return err
7466				}
7467				esbap.Name = &name
7468			}
7469		case "type":
7470			if v != nil {
7471				var typeVar string
7472				err = json.Unmarshal(*v, &typeVar)
7473				if err != nil {
7474					return err
7475				}
7476				esbap.Type = &typeVar
7477			}
7478		}
7479	}
7480
7481	return nil
7482}
7483
7484// ExtendedServerBlobAuditingPolicyListResult a list of server extended auditing settings.
7485type ExtendedServerBlobAuditingPolicyListResult struct {
7486	autorest.Response `json:"-"`
7487	// Value - READ-ONLY; Array of results.
7488	Value *[]ExtendedServerBlobAuditingPolicy `json:"value,omitempty"`
7489	// NextLink - READ-ONLY; Link to retrieve next page of results.
7490	NextLink *string `json:"nextLink,omitempty"`
7491}
7492
7493// MarshalJSON is the custom marshaler for ExtendedServerBlobAuditingPolicyListResult.
7494func (esbaplr ExtendedServerBlobAuditingPolicyListResult) MarshalJSON() ([]byte, error) {
7495	objectMap := make(map[string]interface{})
7496	return json.Marshal(objectMap)
7497}
7498
7499// ExtendedServerBlobAuditingPolicyListResultIterator provides access to a complete listing of
7500// ExtendedServerBlobAuditingPolicy values.
7501type ExtendedServerBlobAuditingPolicyListResultIterator struct {
7502	i    int
7503	page ExtendedServerBlobAuditingPolicyListResultPage
7504}
7505
7506// NextWithContext advances to the next value.  If there was an error making
7507// the request the iterator does not advance and the error is returned.
7508func (iter *ExtendedServerBlobAuditingPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
7509	if tracing.IsEnabled() {
7510		ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedServerBlobAuditingPolicyListResultIterator.NextWithContext")
7511		defer func() {
7512			sc := -1
7513			if iter.Response().Response.Response != nil {
7514				sc = iter.Response().Response.Response.StatusCode
7515			}
7516			tracing.EndSpan(ctx, sc, err)
7517		}()
7518	}
7519	iter.i++
7520	if iter.i < len(iter.page.Values()) {
7521		return nil
7522	}
7523	err = iter.page.NextWithContext(ctx)
7524	if err != nil {
7525		iter.i--
7526		return err
7527	}
7528	iter.i = 0
7529	return nil
7530}
7531
7532// Next advances to the next value.  If there was an error making
7533// the request the iterator does not advance and the error is returned.
7534// Deprecated: Use NextWithContext() instead.
7535func (iter *ExtendedServerBlobAuditingPolicyListResultIterator) Next() error {
7536	return iter.NextWithContext(context.Background())
7537}
7538
7539// NotDone returns true if the enumeration should be started or is not yet complete.
7540func (iter ExtendedServerBlobAuditingPolicyListResultIterator) NotDone() bool {
7541	return iter.page.NotDone() && iter.i < len(iter.page.Values())
7542}
7543
7544// Response returns the raw server response from the last page request.
7545func (iter ExtendedServerBlobAuditingPolicyListResultIterator) Response() ExtendedServerBlobAuditingPolicyListResult {
7546	return iter.page.Response()
7547}
7548
7549// Value returns the current value or a zero-initialized value if the
7550// iterator has advanced beyond the end of the collection.
7551func (iter ExtendedServerBlobAuditingPolicyListResultIterator) Value() ExtendedServerBlobAuditingPolicy {
7552	if !iter.page.NotDone() {
7553		return ExtendedServerBlobAuditingPolicy{}
7554	}
7555	return iter.page.Values()[iter.i]
7556}
7557
7558// Creates a new instance of the ExtendedServerBlobAuditingPolicyListResultIterator type.
7559func NewExtendedServerBlobAuditingPolicyListResultIterator(page ExtendedServerBlobAuditingPolicyListResultPage) ExtendedServerBlobAuditingPolicyListResultIterator {
7560	return ExtendedServerBlobAuditingPolicyListResultIterator{page: page}
7561}
7562
7563// IsEmpty returns true if the ListResult contains no values.
7564func (esbaplr ExtendedServerBlobAuditingPolicyListResult) IsEmpty() bool {
7565	return esbaplr.Value == nil || len(*esbaplr.Value) == 0
7566}
7567
7568// hasNextLink returns true if the NextLink is not empty.
7569func (esbaplr ExtendedServerBlobAuditingPolicyListResult) hasNextLink() bool {
7570	return esbaplr.NextLink != nil && len(*esbaplr.NextLink) != 0
7571}
7572
7573// extendedServerBlobAuditingPolicyListResultPreparer prepares a request to retrieve the next set of results.
7574// It returns nil if no more results exist.
7575func (esbaplr ExtendedServerBlobAuditingPolicyListResult) extendedServerBlobAuditingPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
7576	if !esbaplr.hasNextLink() {
7577		return nil, nil
7578	}
7579	return autorest.Prepare((&http.Request{}).WithContext(ctx),
7580		autorest.AsJSON(),
7581		autorest.AsGet(),
7582		autorest.WithBaseURL(to.String(esbaplr.NextLink)))
7583}
7584
7585// ExtendedServerBlobAuditingPolicyListResultPage contains a page of ExtendedServerBlobAuditingPolicy
7586// values.
7587type ExtendedServerBlobAuditingPolicyListResultPage struct {
7588	fn      func(context.Context, ExtendedServerBlobAuditingPolicyListResult) (ExtendedServerBlobAuditingPolicyListResult, error)
7589	esbaplr ExtendedServerBlobAuditingPolicyListResult
7590}
7591
7592// NextWithContext advances to the next page of values.  If there was an error making
7593// the request the page does not advance and the error is returned.
7594func (page *ExtendedServerBlobAuditingPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
7595	if tracing.IsEnabled() {
7596		ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedServerBlobAuditingPolicyListResultPage.NextWithContext")
7597		defer func() {
7598			sc := -1
7599			if page.Response().Response.Response != nil {
7600				sc = page.Response().Response.Response.StatusCode
7601			}
7602			tracing.EndSpan(ctx, sc, err)
7603		}()
7604	}
7605	for {
7606		next, err := page.fn(ctx, page.esbaplr)
7607		if err != nil {
7608			return err
7609		}
7610		page.esbaplr = next
7611		if !next.hasNextLink() || !next.IsEmpty() {
7612			break
7613		}
7614	}
7615	return nil
7616}
7617
7618// Next advances to the next page of values.  If there was an error making
7619// the request the page does not advance and the error is returned.
7620// Deprecated: Use NextWithContext() instead.
7621func (page *ExtendedServerBlobAuditingPolicyListResultPage) Next() error {
7622	return page.NextWithContext(context.Background())
7623}
7624
7625// NotDone returns true if the page enumeration should be started or is not yet complete.
7626func (page ExtendedServerBlobAuditingPolicyListResultPage) NotDone() bool {
7627	return !page.esbaplr.IsEmpty()
7628}
7629
7630// Response returns the raw server response from the last page request.
7631func (page ExtendedServerBlobAuditingPolicyListResultPage) Response() ExtendedServerBlobAuditingPolicyListResult {
7632	return page.esbaplr
7633}
7634
7635// Values returns the slice of values for the current page or nil if there are no values.
7636func (page ExtendedServerBlobAuditingPolicyListResultPage) Values() []ExtendedServerBlobAuditingPolicy {
7637	if page.esbaplr.IsEmpty() {
7638		return nil
7639	}
7640	return *page.esbaplr.Value
7641}
7642
7643// Creates a new instance of the ExtendedServerBlobAuditingPolicyListResultPage type.
7644func NewExtendedServerBlobAuditingPolicyListResultPage(cur ExtendedServerBlobAuditingPolicyListResult, getNextPage func(context.Context, ExtendedServerBlobAuditingPolicyListResult) (ExtendedServerBlobAuditingPolicyListResult, error)) ExtendedServerBlobAuditingPolicyListResultPage {
7645	return ExtendedServerBlobAuditingPolicyListResultPage{
7646		fn:      getNextPage,
7647		esbaplr: cur,
7648	}
7649}
7650
7651// ExtendedServerBlobAuditingPolicyProperties properties of an extended server blob auditing policy.
7652type ExtendedServerBlobAuditingPolicyProperties struct {
7653	// IsDevopsAuditEnabled - Specifies the state of devops audit. If state is Enabled, devops logs will be sent to Azure Monitor.
7654	// In order to send the events to Azure Monitor, specify 'State' as 'Enabled', 'IsAzureMonitorTargetEnabled' as true and 'IsDevopsAuditEnabled' as true
7655	//
7656	// When using REST API to configure auditing, Diagnostic Settings with 'DevOpsOperationsAudit' diagnostic logs category on the master database should also be created.
7657	//
7658	// Diagnostic Settings URI format:
7659	// PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/master/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview
7660	//
7661	// For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207)
7662	// or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)
7663	IsDevopsAuditEnabled *bool `json:"isDevopsAuditEnabled,omitempty"`
7664	// PredicateExpression - Specifies condition of where clause when creating an audit.
7665	PredicateExpression *string `json:"predicateExpression,omitempty"`
7666	// RetentionDays - Specifies the number of days to keep in the audit logs in the storage account.
7667	RetentionDays *int32 `json:"retentionDays,omitempty"`
7668	// AuditActionsAndGroups - Specifies the Actions-Groups and Actions to audit.
7669	//
7670	// 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:
7671	//
7672	// BATCH_COMPLETED_GROUP,
7673	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP,
7674	// FAILED_DATABASE_AUTHENTICATION_GROUP.
7675	//
7676	// This above combination is also the set that is configured by default when enabling auditing from the Azure portal.
7677	//
7678	// 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):
7679	//
7680	// APPLICATION_ROLE_CHANGE_PASSWORD_GROUP
7681	// BACKUP_RESTORE_GROUP
7682	// DATABASE_LOGOUT_GROUP
7683	// DATABASE_OBJECT_CHANGE_GROUP
7684	// DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP
7685	// DATABASE_OBJECT_PERMISSION_CHANGE_GROUP
7686	// DATABASE_OPERATION_GROUP
7687	// DATABASE_PERMISSION_CHANGE_GROUP
7688	// DATABASE_PRINCIPAL_CHANGE_GROUP
7689	// DATABASE_PRINCIPAL_IMPERSONATION_GROUP
7690	// DATABASE_ROLE_MEMBER_CHANGE_GROUP
7691	// FAILED_DATABASE_AUTHENTICATION_GROUP
7692	// SCHEMA_OBJECT_ACCESS_GROUP
7693	// SCHEMA_OBJECT_CHANGE_GROUP
7694	// SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP
7695	// SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP
7696	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP
7697	// USER_CHANGE_PASSWORD_GROUP
7698	// BATCH_STARTED_GROUP
7699	// BATCH_COMPLETED_GROUP
7700	//
7701	// 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.
7702	//
7703	// 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).
7704	//
7705	// 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:
7706	// SELECT
7707	// UPDATE
7708	// INSERT
7709	// DELETE
7710	// EXECUTE
7711	// RECEIVE
7712	// REFERENCES
7713	//
7714	// The general form for defining an action to be audited is:
7715	// {action} ON {object} BY {principal}
7716	//
7717	// 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.
7718	//
7719	// For example:
7720	// SELECT on dbo.myTable by public
7721	// SELECT on DATABASE::myDatabase by public
7722	// SELECT on SCHEMA::mySchema by public
7723	//
7724	// 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)
7725	AuditActionsAndGroups *[]string `json:"auditActionsAndGroups,omitempty"`
7726	// IsStorageSecondaryKeyInUse - Specifies whether storageAccountAccessKey value is the storage's secondary key.
7727	IsStorageSecondaryKeyInUse *bool `json:"isStorageSecondaryKeyInUse,omitempty"`
7728	// IsAzureMonitorTargetEnabled - Specifies whether audit events are sent to Azure Monitor.
7729	// In order to send the events to Azure Monitor, specify 'State' as 'Enabled' and 'IsAzureMonitorTargetEnabled' as true.
7730	//
7731	// When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created.
7732	// Note that for server level audit you should use the 'master' database as {databaseName}.
7733	//
7734	// Diagnostic Settings URI format:
7735	// PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview
7736	//
7737	// For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207)
7738	// or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)
7739	IsAzureMonitorTargetEnabled *bool `json:"isAzureMonitorTargetEnabled,omitempty"`
7740	// QueueDelayMs - Specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed.
7741	// The default minimum value is 1000 (1 second). The maximum is 2,147,483,647.
7742	QueueDelayMs *int32 `json:"queueDelayMs,omitempty"`
7743	// State - Specifies the state of the audit. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. Possible values include: 'BlobAuditingPolicyStateEnabled', 'BlobAuditingPolicyStateDisabled'
7744	State BlobAuditingPolicyState `json:"state,omitempty"`
7745	// StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required.
7746	StorageEndpoint *string `json:"storageEndpoint,omitempty"`
7747	// StorageAccountAccessKey - Specifies the identifier key of the auditing storage account.
7748	// If state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage.
7749	// Prerequisites for using managed identity authentication:
7750	// 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD).
7751	// 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity.
7752	// For more information, see [Auditing to storage using Managed Identity authentication](https://go.microsoft.com/fwlink/?linkid=2114355)
7753	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
7754	// StorageAccountSubscriptionID - Specifies the blob storage subscription Id.
7755	StorageAccountSubscriptionID *uuid.UUID `json:"storageAccountSubscriptionId,omitempty"`
7756}
7757
7758// FailoverGroup a failover group.
7759type FailoverGroup struct {
7760	autorest.Response `json:"-"`
7761	// Location - READ-ONLY; Resource location.
7762	Location *string `json:"location,omitempty"`
7763	// Tags - Resource tags.
7764	Tags map[string]*string `json:"tags"`
7765	// FailoverGroupProperties - Resource properties.
7766	*FailoverGroupProperties `json:"properties,omitempty"`
7767	// ID - READ-ONLY; Resource ID.
7768	ID *string `json:"id,omitempty"`
7769	// Name - READ-ONLY; Resource name.
7770	Name *string `json:"name,omitempty"`
7771	// Type - READ-ONLY; Resource type.
7772	Type *string `json:"type,omitempty"`
7773}
7774
7775// MarshalJSON is the custom marshaler for FailoverGroup.
7776func (fg FailoverGroup) MarshalJSON() ([]byte, error) {
7777	objectMap := make(map[string]interface{})
7778	if fg.Tags != nil {
7779		objectMap["tags"] = fg.Tags
7780	}
7781	if fg.FailoverGroupProperties != nil {
7782		objectMap["properties"] = fg.FailoverGroupProperties
7783	}
7784	return json.Marshal(objectMap)
7785}
7786
7787// UnmarshalJSON is the custom unmarshaler for FailoverGroup struct.
7788func (fg *FailoverGroup) UnmarshalJSON(body []byte) error {
7789	var m map[string]*json.RawMessage
7790	err := json.Unmarshal(body, &m)
7791	if err != nil {
7792		return err
7793	}
7794	for k, v := range m {
7795		switch k {
7796		case "location":
7797			if v != nil {
7798				var location string
7799				err = json.Unmarshal(*v, &location)
7800				if err != nil {
7801					return err
7802				}
7803				fg.Location = &location
7804			}
7805		case "tags":
7806			if v != nil {
7807				var tags map[string]*string
7808				err = json.Unmarshal(*v, &tags)
7809				if err != nil {
7810					return err
7811				}
7812				fg.Tags = tags
7813			}
7814		case "properties":
7815			if v != nil {
7816				var failoverGroupProperties FailoverGroupProperties
7817				err = json.Unmarshal(*v, &failoverGroupProperties)
7818				if err != nil {
7819					return err
7820				}
7821				fg.FailoverGroupProperties = &failoverGroupProperties
7822			}
7823		case "id":
7824			if v != nil {
7825				var ID string
7826				err = json.Unmarshal(*v, &ID)
7827				if err != nil {
7828					return err
7829				}
7830				fg.ID = &ID
7831			}
7832		case "name":
7833			if v != nil {
7834				var name string
7835				err = json.Unmarshal(*v, &name)
7836				if err != nil {
7837					return err
7838				}
7839				fg.Name = &name
7840			}
7841		case "type":
7842			if v != nil {
7843				var typeVar string
7844				err = json.Unmarshal(*v, &typeVar)
7845				if err != nil {
7846					return err
7847				}
7848				fg.Type = &typeVar
7849			}
7850		}
7851	}
7852
7853	return nil
7854}
7855
7856// FailoverGroupListResult a list of failover groups.
7857type FailoverGroupListResult struct {
7858	autorest.Response `json:"-"`
7859	// Value - READ-ONLY; Array of results.
7860	Value *[]FailoverGroup `json:"value,omitempty"`
7861	// NextLink - READ-ONLY; Link to retrieve next page of results.
7862	NextLink *string `json:"nextLink,omitempty"`
7863}
7864
7865// MarshalJSON is the custom marshaler for FailoverGroupListResult.
7866func (fglr FailoverGroupListResult) MarshalJSON() ([]byte, error) {
7867	objectMap := make(map[string]interface{})
7868	return json.Marshal(objectMap)
7869}
7870
7871// FailoverGroupListResultIterator provides access to a complete listing of FailoverGroup values.
7872type FailoverGroupListResultIterator struct {
7873	i    int
7874	page FailoverGroupListResultPage
7875}
7876
7877// NextWithContext advances to the next value.  If there was an error making
7878// the request the iterator does not advance and the error is returned.
7879func (iter *FailoverGroupListResultIterator) NextWithContext(ctx context.Context) (err error) {
7880	if tracing.IsEnabled() {
7881		ctx = tracing.StartSpan(ctx, fqdn+"/FailoverGroupListResultIterator.NextWithContext")
7882		defer func() {
7883			sc := -1
7884			if iter.Response().Response.Response != nil {
7885				sc = iter.Response().Response.Response.StatusCode
7886			}
7887			tracing.EndSpan(ctx, sc, err)
7888		}()
7889	}
7890	iter.i++
7891	if iter.i < len(iter.page.Values()) {
7892		return nil
7893	}
7894	err = iter.page.NextWithContext(ctx)
7895	if err != nil {
7896		iter.i--
7897		return err
7898	}
7899	iter.i = 0
7900	return nil
7901}
7902
7903// Next advances to the next value.  If there was an error making
7904// the request the iterator does not advance and the error is returned.
7905// Deprecated: Use NextWithContext() instead.
7906func (iter *FailoverGroupListResultIterator) Next() error {
7907	return iter.NextWithContext(context.Background())
7908}
7909
7910// NotDone returns true if the enumeration should be started or is not yet complete.
7911func (iter FailoverGroupListResultIterator) NotDone() bool {
7912	return iter.page.NotDone() && iter.i < len(iter.page.Values())
7913}
7914
7915// Response returns the raw server response from the last page request.
7916func (iter FailoverGroupListResultIterator) Response() FailoverGroupListResult {
7917	return iter.page.Response()
7918}
7919
7920// Value returns the current value or a zero-initialized value if the
7921// iterator has advanced beyond the end of the collection.
7922func (iter FailoverGroupListResultIterator) Value() FailoverGroup {
7923	if !iter.page.NotDone() {
7924		return FailoverGroup{}
7925	}
7926	return iter.page.Values()[iter.i]
7927}
7928
7929// Creates a new instance of the FailoverGroupListResultIterator type.
7930func NewFailoverGroupListResultIterator(page FailoverGroupListResultPage) FailoverGroupListResultIterator {
7931	return FailoverGroupListResultIterator{page: page}
7932}
7933
7934// IsEmpty returns true if the ListResult contains no values.
7935func (fglr FailoverGroupListResult) IsEmpty() bool {
7936	return fglr.Value == nil || len(*fglr.Value) == 0
7937}
7938
7939// hasNextLink returns true if the NextLink is not empty.
7940func (fglr FailoverGroupListResult) hasNextLink() bool {
7941	return fglr.NextLink != nil && len(*fglr.NextLink) != 0
7942}
7943
7944// failoverGroupListResultPreparer prepares a request to retrieve the next set of results.
7945// It returns nil if no more results exist.
7946func (fglr FailoverGroupListResult) failoverGroupListResultPreparer(ctx context.Context) (*http.Request, error) {
7947	if !fglr.hasNextLink() {
7948		return nil, nil
7949	}
7950	return autorest.Prepare((&http.Request{}).WithContext(ctx),
7951		autorest.AsJSON(),
7952		autorest.AsGet(),
7953		autorest.WithBaseURL(to.String(fglr.NextLink)))
7954}
7955
7956// FailoverGroupListResultPage contains a page of FailoverGroup values.
7957type FailoverGroupListResultPage struct {
7958	fn   func(context.Context, FailoverGroupListResult) (FailoverGroupListResult, error)
7959	fglr FailoverGroupListResult
7960}
7961
7962// NextWithContext advances to the next page of values.  If there was an error making
7963// the request the page does not advance and the error is returned.
7964func (page *FailoverGroupListResultPage) NextWithContext(ctx context.Context) (err error) {
7965	if tracing.IsEnabled() {
7966		ctx = tracing.StartSpan(ctx, fqdn+"/FailoverGroupListResultPage.NextWithContext")
7967		defer func() {
7968			sc := -1
7969			if page.Response().Response.Response != nil {
7970				sc = page.Response().Response.Response.StatusCode
7971			}
7972			tracing.EndSpan(ctx, sc, err)
7973		}()
7974	}
7975	for {
7976		next, err := page.fn(ctx, page.fglr)
7977		if err != nil {
7978			return err
7979		}
7980		page.fglr = next
7981		if !next.hasNextLink() || !next.IsEmpty() {
7982			break
7983		}
7984	}
7985	return nil
7986}
7987
7988// Next advances to the next page of values.  If there was an error making
7989// the request the page does not advance and the error is returned.
7990// Deprecated: Use NextWithContext() instead.
7991func (page *FailoverGroupListResultPage) Next() error {
7992	return page.NextWithContext(context.Background())
7993}
7994
7995// NotDone returns true if the page enumeration should be started or is not yet complete.
7996func (page FailoverGroupListResultPage) NotDone() bool {
7997	return !page.fglr.IsEmpty()
7998}
7999
8000// Response returns the raw server response from the last page request.
8001func (page FailoverGroupListResultPage) Response() FailoverGroupListResult {
8002	return page.fglr
8003}
8004
8005// Values returns the slice of values for the current page or nil if there are no values.
8006func (page FailoverGroupListResultPage) Values() []FailoverGroup {
8007	if page.fglr.IsEmpty() {
8008		return nil
8009	}
8010	return *page.fglr.Value
8011}
8012
8013// Creates a new instance of the FailoverGroupListResultPage type.
8014func NewFailoverGroupListResultPage(cur FailoverGroupListResult, getNextPage func(context.Context, FailoverGroupListResult) (FailoverGroupListResult, error)) FailoverGroupListResultPage {
8015	return FailoverGroupListResultPage{
8016		fn:   getNextPage,
8017		fglr: cur,
8018	}
8019}
8020
8021// FailoverGroupProperties properties of a failover group.
8022type FailoverGroupProperties struct {
8023	// ReadWriteEndpoint - Read-write endpoint of the failover group instance.
8024	ReadWriteEndpoint *FailoverGroupReadWriteEndpoint `json:"readWriteEndpoint,omitempty"`
8025	// ReadOnlyEndpoint - Read-only endpoint of the failover group instance.
8026	ReadOnlyEndpoint *FailoverGroupReadOnlyEndpoint `json:"readOnlyEndpoint,omitempty"`
8027	// ReplicationRole - READ-ONLY; Local replication role of the failover group instance. Possible values include: 'FailoverGroupReplicationRolePrimary', 'FailoverGroupReplicationRoleSecondary'
8028	ReplicationRole FailoverGroupReplicationRole `json:"replicationRole,omitempty"`
8029	// ReplicationState - READ-ONLY; Replication state of the failover group instance.
8030	ReplicationState *string `json:"replicationState,omitempty"`
8031	// PartnerServers - List of partner server information for the failover group.
8032	PartnerServers *[]PartnerInfo `json:"partnerServers,omitempty"`
8033	// Databases - List of databases in the failover group.
8034	Databases *[]string `json:"databases,omitempty"`
8035}
8036
8037// MarshalJSON is the custom marshaler for FailoverGroupProperties.
8038func (fgp FailoverGroupProperties) MarshalJSON() ([]byte, error) {
8039	objectMap := make(map[string]interface{})
8040	if fgp.ReadWriteEndpoint != nil {
8041		objectMap["readWriteEndpoint"] = fgp.ReadWriteEndpoint
8042	}
8043	if fgp.ReadOnlyEndpoint != nil {
8044		objectMap["readOnlyEndpoint"] = fgp.ReadOnlyEndpoint
8045	}
8046	if fgp.PartnerServers != nil {
8047		objectMap["partnerServers"] = fgp.PartnerServers
8048	}
8049	if fgp.Databases != nil {
8050		objectMap["databases"] = fgp.Databases
8051	}
8052	return json.Marshal(objectMap)
8053}
8054
8055// FailoverGroupReadOnlyEndpoint read-only endpoint of the failover group instance.
8056type FailoverGroupReadOnlyEndpoint struct {
8057	// FailoverPolicy - Failover policy of the read-only endpoint for the failover group. Possible values include: 'ReadOnlyEndpointFailoverPolicyDisabled', 'ReadOnlyEndpointFailoverPolicyEnabled'
8058	FailoverPolicy ReadOnlyEndpointFailoverPolicy `json:"failoverPolicy,omitempty"`
8059}
8060
8061// FailoverGroupReadWriteEndpoint read-write endpoint of the failover group instance.
8062type FailoverGroupReadWriteEndpoint struct {
8063	// FailoverPolicy - Failover policy of the read-write endpoint for the failover group. If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible values include: 'ReadWriteEndpointFailoverPolicyManual', 'ReadWriteEndpointFailoverPolicyAutomatic'
8064	FailoverPolicy ReadWriteEndpointFailoverPolicy `json:"failoverPolicy,omitempty"`
8065	// FailoverWithDataLossGracePeriodMinutes - Grace period before failover with data loss is attempted for the read-write endpoint. If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required.
8066	FailoverWithDataLossGracePeriodMinutes *int32 `json:"failoverWithDataLossGracePeriodMinutes,omitempty"`
8067}
8068
8069// FailoverGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
8070// long-running operation.
8071type FailoverGroupsCreateOrUpdateFuture struct {
8072	azure.FutureAPI
8073	// Result returns the result of the asynchronous operation.
8074	// If the operation has not completed it will return an error.
8075	Result func(FailoverGroupsClient) (FailoverGroup, error)
8076}
8077
8078// UnmarshalJSON is the custom unmarshaller for CreateFuture.
8079func (future *FailoverGroupsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
8080	var azFuture azure.Future
8081	if err := json.Unmarshal(body, &azFuture); err != nil {
8082		return err
8083	}
8084	future.FutureAPI = &azFuture
8085	future.Result = future.result
8086	return nil
8087}
8088
8089// result is the default implementation for FailoverGroupsCreateOrUpdateFuture.Result.
8090func (future *FailoverGroupsCreateOrUpdateFuture) result(client FailoverGroupsClient) (fg FailoverGroup, err error) {
8091	var done bool
8092	done, err = future.DoneWithContext(context.Background(), client)
8093	if err != nil {
8094		err = autorest.NewErrorWithError(err, "sql.FailoverGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
8095		return
8096	}
8097	if !done {
8098		fg.Response.Response = future.Response()
8099		err = azure.NewAsyncOpIncompleteError("sql.FailoverGroupsCreateOrUpdateFuture")
8100		return
8101	}
8102	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8103	if fg.Response.Response, err = future.GetResult(sender); err == nil && fg.Response.Response.StatusCode != http.StatusNoContent {
8104		fg, err = client.CreateOrUpdateResponder(fg.Response.Response)
8105		if err != nil {
8106			err = autorest.NewErrorWithError(err, "sql.FailoverGroupsCreateOrUpdateFuture", "Result", fg.Response.Response, "Failure responding to request")
8107		}
8108	}
8109	return
8110}
8111
8112// FailoverGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
8113// operation.
8114type FailoverGroupsDeleteFuture struct {
8115	azure.FutureAPI
8116	// Result returns the result of the asynchronous operation.
8117	// If the operation has not completed it will return an error.
8118	Result func(FailoverGroupsClient) (autorest.Response, error)
8119}
8120
8121// UnmarshalJSON is the custom unmarshaller for CreateFuture.
8122func (future *FailoverGroupsDeleteFuture) UnmarshalJSON(body []byte) error {
8123	var azFuture azure.Future
8124	if err := json.Unmarshal(body, &azFuture); err != nil {
8125		return err
8126	}
8127	future.FutureAPI = &azFuture
8128	future.Result = future.result
8129	return nil
8130}
8131
8132// result is the default implementation for FailoverGroupsDeleteFuture.Result.
8133func (future *FailoverGroupsDeleteFuture) result(client FailoverGroupsClient) (ar autorest.Response, err error) {
8134	var done bool
8135	done, err = future.DoneWithContext(context.Background(), client)
8136	if err != nil {
8137		err = autorest.NewErrorWithError(err, "sql.FailoverGroupsDeleteFuture", "Result", future.Response(), "Polling failure")
8138		return
8139	}
8140	if !done {
8141		ar.Response = future.Response()
8142		err = azure.NewAsyncOpIncompleteError("sql.FailoverGroupsDeleteFuture")
8143		return
8144	}
8145	ar.Response = future.Response()
8146	return
8147}
8148
8149// FailoverGroupsFailoverFuture an abstraction for monitoring and retrieving the results of a long-running
8150// operation.
8151type FailoverGroupsFailoverFuture struct {
8152	azure.FutureAPI
8153	// Result returns the result of the asynchronous operation.
8154	// If the operation has not completed it will return an error.
8155	Result func(FailoverGroupsClient) (FailoverGroup, error)
8156}
8157
8158// UnmarshalJSON is the custom unmarshaller for CreateFuture.
8159func (future *FailoverGroupsFailoverFuture) UnmarshalJSON(body []byte) error {
8160	var azFuture azure.Future
8161	if err := json.Unmarshal(body, &azFuture); err != nil {
8162		return err
8163	}
8164	future.FutureAPI = &azFuture
8165	future.Result = future.result
8166	return nil
8167}
8168
8169// result is the default implementation for FailoverGroupsFailoverFuture.Result.
8170func (future *FailoverGroupsFailoverFuture) result(client FailoverGroupsClient) (fg FailoverGroup, err error) {
8171	var done bool
8172	done, err = future.DoneWithContext(context.Background(), client)
8173	if err != nil {
8174		err = autorest.NewErrorWithError(err, "sql.FailoverGroupsFailoverFuture", "Result", future.Response(), "Polling failure")
8175		return
8176	}
8177	if !done {
8178		fg.Response.Response = future.Response()
8179		err = azure.NewAsyncOpIncompleteError("sql.FailoverGroupsFailoverFuture")
8180		return
8181	}
8182	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8183	if fg.Response.Response, err = future.GetResult(sender); err == nil && fg.Response.Response.StatusCode != http.StatusNoContent {
8184		fg, err = client.FailoverResponder(fg.Response.Response)
8185		if err != nil {
8186			err = autorest.NewErrorWithError(err, "sql.FailoverGroupsFailoverFuture", "Result", fg.Response.Response, "Failure responding to request")
8187		}
8188	}
8189	return
8190}
8191
8192// FailoverGroupsForceFailoverAllowDataLossFuture an abstraction for monitoring and retrieving the results
8193// of a long-running operation.
8194type FailoverGroupsForceFailoverAllowDataLossFuture struct {
8195	azure.FutureAPI
8196	// Result returns the result of the asynchronous operation.
8197	// If the operation has not completed it will return an error.
8198	Result func(FailoverGroupsClient) (FailoverGroup, error)
8199}
8200
8201// UnmarshalJSON is the custom unmarshaller for CreateFuture.
8202func (future *FailoverGroupsForceFailoverAllowDataLossFuture) UnmarshalJSON(body []byte) error {
8203	var azFuture azure.Future
8204	if err := json.Unmarshal(body, &azFuture); err != nil {
8205		return err
8206	}
8207	future.FutureAPI = &azFuture
8208	future.Result = future.result
8209	return nil
8210}
8211
8212// result is the default implementation for FailoverGroupsForceFailoverAllowDataLossFuture.Result.
8213func (future *FailoverGroupsForceFailoverAllowDataLossFuture) result(client FailoverGroupsClient) (fg FailoverGroup, err error) {
8214	var done bool
8215	done, err = future.DoneWithContext(context.Background(), client)
8216	if err != nil {
8217		err = autorest.NewErrorWithError(err, "sql.FailoverGroupsForceFailoverAllowDataLossFuture", "Result", future.Response(), "Polling failure")
8218		return
8219	}
8220	if !done {
8221		fg.Response.Response = future.Response()
8222		err = azure.NewAsyncOpIncompleteError("sql.FailoverGroupsForceFailoverAllowDataLossFuture")
8223		return
8224	}
8225	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8226	if fg.Response.Response, err = future.GetResult(sender); err == nil && fg.Response.Response.StatusCode != http.StatusNoContent {
8227		fg, err = client.ForceFailoverAllowDataLossResponder(fg.Response.Response)
8228		if err != nil {
8229			err = autorest.NewErrorWithError(err, "sql.FailoverGroupsForceFailoverAllowDataLossFuture", "Result", fg.Response.Response, "Failure responding to request")
8230		}
8231	}
8232	return
8233}
8234
8235// FailoverGroupsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
8236// operation.
8237type FailoverGroupsUpdateFuture struct {
8238	azure.FutureAPI
8239	// Result returns the result of the asynchronous operation.
8240	// If the operation has not completed it will return an error.
8241	Result func(FailoverGroupsClient) (FailoverGroup, error)
8242}
8243
8244// UnmarshalJSON is the custom unmarshaller for CreateFuture.
8245func (future *FailoverGroupsUpdateFuture) UnmarshalJSON(body []byte) error {
8246	var azFuture azure.Future
8247	if err := json.Unmarshal(body, &azFuture); err != nil {
8248		return err
8249	}
8250	future.FutureAPI = &azFuture
8251	future.Result = future.result
8252	return nil
8253}
8254
8255// result is the default implementation for FailoverGroupsUpdateFuture.Result.
8256func (future *FailoverGroupsUpdateFuture) result(client FailoverGroupsClient) (fg FailoverGroup, err error) {
8257	var done bool
8258	done, err = future.DoneWithContext(context.Background(), client)
8259	if err != nil {
8260		err = autorest.NewErrorWithError(err, "sql.FailoverGroupsUpdateFuture", "Result", future.Response(), "Polling failure")
8261		return
8262	}
8263	if !done {
8264		fg.Response.Response = future.Response()
8265		err = azure.NewAsyncOpIncompleteError("sql.FailoverGroupsUpdateFuture")
8266		return
8267	}
8268	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8269	if fg.Response.Response, err = future.GetResult(sender); err == nil && fg.Response.Response.StatusCode != http.StatusNoContent {
8270		fg, err = client.UpdateResponder(fg.Response.Response)
8271		if err != nil {
8272			err = autorest.NewErrorWithError(err, "sql.FailoverGroupsUpdateFuture", "Result", fg.Response.Response, "Failure responding to request")
8273		}
8274	}
8275	return
8276}
8277
8278// FailoverGroupUpdate a failover group update request.
8279type FailoverGroupUpdate struct {
8280	// FailoverGroupUpdateProperties - Resource properties.
8281	*FailoverGroupUpdateProperties `json:"properties,omitempty"`
8282	// Tags - Resource tags.
8283	Tags map[string]*string `json:"tags"`
8284}
8285
8286// MarshalJSON is the custom marshaler for FailoverGroupUpdate.
8287func (fgu FailoverGroupUpdate) MarshalJSON() ([]byte, error) {
8288	objectMap := make(map[string]interface{})
8289	if fgu.FailoverGroupUpdateProperties != nil {
8290		objectMap["properties"] = fgu.FailoverGroupUpdateProperties
8291	}
8292	if fgu.Tags != nil {
8293		objectMap["tags"] = fgu.Tags
8294	}
8295	return json.Marshal(objectMap)
8296}
8297
8298// UnmarshalJSON is the custom unmarshaler for FailoverGroupUpdate struct.
8299func (fgu *FailoverGroupUpdate) UnmarshalJSON(body []byte) error {
8300	var m map[string]*json.RawMessage
8301	err := json.Unmarshal(body, &m)
8302	if err != nil {
8303		return err
8304	}
8305	for k, v := range m {
8306		switch k {
8307		case "properties":
8308			if v != nil {
8309				var failoverGroupUpdateProperties FailoverGroupUpdateProperties
8310				err = json.Unmarshal(*v, &failoverGroupUpdateProperties)
8311				if err != nil {
8312					return err
8313				}
8314				fgu.FailoverGroupUpdateProperties = &failoverGroupUpdateProperties
8315			}
8316		case "tags":
8317			if v != nil {
8318				var tags map[string]*string
8319				err = json.Unmarshal(*v, &tags)
8320				if err != nil {
8321					return err
8322				}
8323				fgu.Tags = tags
8324			}
8325		}
8326	}
8327
8328	return nil
8329}
8330
8331// FailoverGroupUpdateProperties properties of a failover group update.
8332type FailoverGroupUpdateProperties struct {
8333	// ReadWriteEndpoint - Read-write endpoint of the failover group instance.
8334	ReadWriteEndpoint *FailoverGroupReadWriteEndpoint `json:"readWriteEndpoint,omitempty"`
8335	// ReadOnlyEndpoint - Read-only endpoint of the failover group instance.
8336	ReadOnlyEndpoint *FailoverGroupReadOnlyEndpoint `json:"readOnlyEndpoint,omitempty"`
8337	// Databases - List of databases in the failover group.
8338	Databases *[]string `json:"databases,omitempty"`
8339}
8340
8341// FirewallRule a server firewall rule.
8342type FirewallRule struct {
8343	autorest.Response `json:"-"`
8344	// ServerFirewallRuleProperties - Resource properties.
8345	*ServerFirewallRuleProperties `json:"properties,omitempty"`
8346	// ID - READ-ONLY; Resource ID.
8347	ID *string `json:"id,omitempty"`
8348	// Name - Resource name.
8349	Name *string `json:"name,omitempty"`
8350	// Type - READ-ONLY; Resource type.
8351	Type *string `json:"type,omitempty"`
8352}
8353
8354// MarshalJSON is the custom marshaler for FirewallRule.
8355func (fr FirewallRule) MarshalJSON() ([]byte, error) {
8356	objectMap := make(map[string]interface{})
8357	if fr.ServerFirewallRuleProperties != nil {
8358		objectMap["properties"] = fr.ServerFirewallRuleProperties
8359	}
8360	if fr.Name != nil {
8361		objectMap["name"] = fr.Name
8362	}
8363	return json.Marshal(objectMap)
8364}
8365
8366// UnmarshalJSON is the custom unmarshaler for FirewallRule struct.
8367func (fr *FirewallRule) UnmarshalJSON(body []byte) error {
8368	var m map[string]*json.RawMessage
8369	err := json.Unmarshal(body, &m)
8370	if err != nil {
8371		return err
8372	}
8373	for k, v := range m {
8374		switch k {
8375		case "properties":
8376			if v != nil {
8377				var serverFirewallRuleProperties ServerFirewallRuleProperties
8378				err = json.Unmarshal(*v, &serverFirewallRuleProperties)
8379				if err != nil {
8380					return err
8381				}
8382				fr.ServerFirewallRuleProperties = &serverFirewallRuleProperties
8383			}
8384		case "id":
8385			if v != nil {
8386				var ID string
8387				err = json.Unmarshal(*v, &ID)
8388				if err != nil {
8389					return err
8390				}
8391				fr.ID = &ID
8392			}
8393		case "name":
8394			if v != nil {
8395				var name string
8396				err = json.Unmarshal(*v, &name)
8397				if err != nil {
8398					return err
8399				}
8400				fr.Name = &name
8401			}
8402		case "type":
8403			if v != nil {
8404				var typeVar string
8405				err = json.Unmarshal(*v, &typeVar)
8406				if err != nil {
8407					return err
8408				}
8409				fr.Type = &typeVar
8410			}
8411		}
8412	}
8413
8414	return nil
8415}
8416
8417// FirewallRuleList a list of server firewall rules.
8418type FirewallRuleList struct {
8419	Values *[]FirewallRule `json:"values,omitempty"`
8420}
8421
8422// FirewallRuleListResult the response to a list firewall rules request
8423type FirewallRuleListResult struct {
8424	autorest.Response `json:"-"`
8425	// Value - READ-ONLY; Array of results.
8426	Value *[]FirewallRule `json:"value,omitempty"`
8427	// NextLink - READ-ONLY; Link to retrieve next page of results.
8428	NextLink *string `json:"nextLink,omitempty"`
8429}
8430
8431// MarshalJSON is the custom marshaler for FirewallRuleListResult.
8432func (frlr FirewallRuleListResult) MarshalJSON() ([]byte, error) {
8433	objectMap := make(map[string]interface{})
8434	return json.Marshal(objectMap)
8435}
8436
8437// FirewallRuleListResultIterator provides access to a complete listing of FirewallRule values.
8438type FirewallRuleListResultIterator struct {
8439	i    int
8440	page FirewallRuleListResultPage
8441}
8442
8443// NextWithContext advances to the next value.  If there was an error making
8444// the request the iterator does not advance and the error is returned.
8445func (iter *FirewallRuleListResultIterator) NextWithContext(ctx context.Context) (err error) {
8446	if tracing.IsEnabled() {
8447		ctx = tracing.StartSpan(ctx, fqdn+"/FirewallRuleListResultIterator.NextWithContext")
8448		defer func() {
8449			sc := -1
8450			if iter.Response().Response.Response != nil {
8451				sc = iter.Response().Response.Response.StatusCode
8452			}
8453			tracing.EndSpan(ctx, sc, err)
8454		}()
8455	}
8456	iter.i++
8457	if iter.i < len(iter.page.Values()) {
8458		return nil
8459	}
8460	err = iter.page.NextWithContext(ctx)
8461	if err != nil {
8462		iter.i--
8463		return err
8464	}
8465	iter.i = 0
8466	return nil
8467}
8468
8469// Next advances to the next value.  If there was an error making
8470// the request the iterator does not advance and the error is returned.
8471// Deprecated: Use NextWithContext() instead.
8472func (iter *FirewallRuleListResultIterator) Next() error {
8473	return iter.NextWithContext(context.Background())
8474}
8475
8476// NotDone returns true if the enumeration should be started or is not yet complete.
8477func (iter FirewallRuleListResultIterator) NotDone() bool {
8478	return iter.page.NotDone() && iter.i < len(iter.page.Values())
8479}
8480
8481// Response returns the raw server response from the last page request.
8482func (iter FirewallRuleListResultIterator) Response() FirewallRuleListResult {
8483	return iter.page.Response()
8484}
8485
8486// Value returns the current value or a zero-initialized value if the
8487// iterator has advanced beyond the end of the collection.
8488func (iter FirewallRuleListResultIterator) Value() FirewallRule {
8489	if !iter.page.NotDone() {
8490		return FirewallRule{}
8491	}
8492	return iter.page.Values()[iter.i]
8493}
8494
8495// Creates a new instance of the FirewallRuleListResultIterator type.
8496func NewFirewallRuleListResultIterator(page FirewallRuleListResultPage) FirewallRuleListResultIterator {
8497	return FirewallRuleListResultIterator{page: page}
8498}
8499
8500// IsEmpty returns true if the ListResult contains no values.
8501func (frlr FirewallRuleListResult) IsEmpty() bool {
8502	return frlr.Value == nil || len(*frlr.Value) == 0
8503}
8504
8505// hasNextLink returns true if the NextLink is not empty.
8506func (frlr FirewallRuleListResult) hasNextLink() bool {
8507	return frlr.NextLink != nil && len(*frlr.NextLink) != 0
8508}
8509
8510// firewallRuleListResultPreparer prepares a request to retrieve the next set of results.
8511// It returns nil if no more results exist.
8512func (frlr FirewallRuleListResult) firewallRuleListResultPreparer(ctx context.Context) (*http.Request, error) {
8513	if !frlr.hasNextLink() {
8514		return nil, nil
8515	}
8516	return autorest.Prepare((&http.Request{}).WithContext(ctx),
8517		autorest.AsJSON(),
8518		autorest.AsGet(),
8519		autorest.WithBaseURL(to.String(frlr.NextLink)))
8520}
8521
8522// FirewallRuleListResultPage contains a page of FirewallRule values.
8523type FirewallRuleListResultPage struct {
8524	fn   func(context.Context, FirewallRuleListResult) (FirewallRuleListResult, error)
8525	frlr FirewallRuleListResult
8526}
8527
8528// NextWithContext advances to the next page of values.  If there was an error making
8529// the request the page does not advance and the error is returned.
8530func (page *FirewallRuleListResultPage) NextWithContext(ctx context.Context) (err error) {
8531	if tracing.IsEnabled() {
8532		ctx = tracing.StartSpan(ctx, fqdn+"/FirewallRuleListResultPage.NextWithContext")
8533		defer func() {
8534			sc := -1
8535			if page.Response().Response.Response != nil {
8536				sc = page.Response().Response.Response.StatusCode
8537			}
8538			tracing.EndSpan(ctx, sc, err)
8539		}()
8540	}
8541	for {
8542		next, err := page.fn(ctx, page.frlr)
8543		if err != nil {
8544			return err
8545		}
8546		page.frlr = next
8547		if !next.hasNextLink() || !next.IsEmpty() {
8548			break
8549		}
8550	}
8551	return nil
8552}
8553
8554// Next advances to the next page of values.  If there was an error making
8555// the request the page does not advance and the error is returned.
8556// Deprecated: Use NextWithContext() instead.
8557func (page *FirewallRuleListResultPage) Next() error {
8558	return page.NextWithContext(context.Background())
8559}
8560
8561// NotDone returns true if the page enumeration should be started or is not yet complete.
8562func (page FirewallRuleListResultPage) NotDone() bool {
8563	return !page.frlr.IsEmpty()
8564}
8565
8566// Response returns the raw server response from the last page request.
8567func (page FirewallRuleListResultPage) Response() FirewallRuleListResult {
8568	return page.frlr
8569}
8570
8571// Values returns the slice of values for the current page or nil if there are no values.
8572func (page FirewallRuleListResultPage) Values() []FirewallRule {
8573	if page.frlr.IsEmpty() {
8574		return nil
8575	}
8576	return *page.frlr.Value
8577}
8578
8579// Creates a new instance of the FirewallRuleListResultPage type.
8580func NewFirewallRuleListResultPage(cur FirewallRuleListResult, getNextPage func(context.Context, FirewallRuleListResult) (FirewallRuleListResult, error)) FirewallRuleListResultPage {
8581	return FirewallRuleListResultPage{
8582		fn:   getNextPage,
8583		frlr: cur,
8584	}
8585}
8586
8587// GeoBackupPolicy a database geo backup policy.
8588type GeoBackupPolicy struct {
8589	autorest.Response `json:"-"`
8590	// GeoBackupPolicyProperties - The properties of the geo backup policy.
8591	*GeoBackupPolicyProperties `json:"properties,omitempty"`
8592	// Kind - READ-ONLY; Kind of geo backup policy.  This is metadata used for the Azure portal experience.
8593	Kind *string `json:"kind,omitempty"`
8594	// Location - READ-ONLY; Backup policy location.
8595	Location *string `json:"location,omitempty"`
8596	// ID - READ-ONLY; Resource ID.
8597	ID *string `json:"id,omitempty"`
8598	// Name - READ-ONLY; Resource name.
8599	Name *string `json:"name,omitempty"`
8600	// Type - READ-ONLY; Resource type.
8601	Type *string `json:"type,omitempty"`
8602}
8603
8604// MarshalJSON is the custom marshaler for GeoBackupPolicy.
8605func (gbp GeoBackupPolicy) MarshalJSON() ([]byte, error) {
8606	objectMap := make(map[string]interface{})
8607	if gbp.GeoBackupPolicyProperties != nil {
8608		objectMap["properties"] = gbp.GeoBackupPolicyProperties
8609	}
8610	return json.Marshal(objectMap)
8611}
8612
8613// UnmarshalJSON is the custom unmarshaler for GeoBackupPolicy struct.
8614func (gbp *GeoBackupPolicy) UnmarshalJSON(body []byte) error {
8615	var m map[string]*json.RawMessage
8616	err := json.Unmarshal(body, &m)
8617	if err != nil {
8618		return err
8619	}
8620	for k, v := range m {
8621		switch k {
8622		case "properties":
8623			if v != nil {
8624				var geoBackupPolicyProperties GeoBackupPolicyProperties
8625				err = json.Unmarshal(*v, &geoBackupPolicyProperties)
8626				if err != nil {
8627					return err
8628				}
8629				gbp.GeoBackupPolicyProperties = &geoBackupPolicyProperties
8630			}
8631		case "kind":
8632			if v != nil {
8633				var kind string
8634				err = json.Unmarshal(*v, &kind)
8635				if err != nil {
8636					return err
8637				}
8638				gbp.Kind = &kind
8639			}
8640		case "location":
8641			if v != nil {
8642				var location string
8643				err = json.Unmarshal(*v, &location)
8644				if err != nil {
8645					return err
8646				}
8647				gbp.Location = &location
8648			}
8649		case "id":
8650			if v != nil {
8651				var ID string
8652				err = json.Unmarshal(*v, &ID)
8653				if err != nil {
8654					return err
8655				}
8656				gbp.ID = &ID
8657			}
8658		case "name":
8659			if v != nil {
8660				var name string
8661				err = json.Unmarshal(*v, &name)
8662				if err != nil {
8663					return err
8664				}
8665				gbp.Name = &name
8666			}
8667		case "type":
8668			if v != nil {
8669				var typeVar string
8670				err = json.Unmarshal(*v, &typeVar)
8671				if err != nil {
8672					return err
8673				}
8674				gbp.Type = &typeVar
8675			}
8676		}
8677	}
8678
8679	return nil
8680}
8681
8682// GeoBackupPolicyListResult the response to a list geo backup policies request.
8683type GeoBackupPolicyListResult struct {
8684	autorest.Response `json:"-"`
8685	// Value - The list of geo backup policies.
8686	Value *[]GeoBackupPolicy `json:"value,omitempty"`
8687}
8688
8689// GeoBackupPolicyProperties the properties of the geo backup policy.
8690type GeoBackupPolicyProperties struct {
8691	// State - The state of the geo backup policy. Possible values include: 'GeoBackupPolicyStateDisabled', 'GeoBackupPolicyStateEnabled'
8692	State GeoBackupPolicyState `json:"state,omitempty"`
8693	// StorageType - READ-ONLY; The storage type of the geo backup policy.
8694	StorageType *string `json:"storageType,omitempty"`
8695}
8696
8697// MarshalJSON is the custom marshaler for GeoBackupPolicyProperties.
8698func (gbpp GeoBackupPolicyProperties) MarshalJSON() ([]byte, error) {
8699	objectMap := make(map[string]interface{})
8700	if gbpp.State != "" {
8701		objectMap["state"] = gbpp.State
8702	}
8703	return json.Marshal(objectMap)
8704}
8705
8706// ImportExistingDatabaseDefinition contains the information necessary to perform import operation for
8707// existing database.
8708type ImportExistingDatabaseDefinition struct {
8709	// StorageKeyType - Storage key type. Possible values include: 'StorageKeyTypeSharedAccessKey', 'StorageKeyTypeStorageAccessKey'
8710	StorageKeyType StorageKeyType `json:"storageKeyType,omitempty"`
8711	// StorageKey - Storage key.
8712	StorageKey *string `json:"storageKey,omitempty"`
8713	// StorageURI - Storage Uri.
8714	StorageURI *string `json:"storageUri,omitempty"`
8715	// AdministratorLogin - Administrator login name.
8716	AdministratorLogin *string `json:"administratorLogin,omitempty"`
8717	// AdministratorLoginPassword - Administrator login password.
8718	AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"`
8719	// AuthenticationType - Authentication type.
8720	AuthenticationType *string `json:"authenticationType,omitempty"`
8721	// NetworkIsolation - Optional resource information to enable network isolation for request.
8722	NetworkIsolation *NetworkIsolationSettings `json:"networkIsolation,omitempty"`
8723}
8724
8725// ImportExportExtensionsOperationListResult import export operation extensions list.
8726type ImportExportExtensionsOperationListResult struct {
8727	autorest.Response `json:"-"`
8728	// Value - READ-ONLY; Array of results.
8729	Value *[]ImportExportExtensionsOperationResult `json:"value,omitempty"`
8730	// NextLink - READ-ONLY; Link to retrieve next page of results.
8731	NextLink *string `json:"nextLink,omitempty"`
8732}
8733
8734// MarshalJSON is the custom marshaler for ImportExportExtensionsOperationListResult.
8735func (ieeolr ImportExportExtensionsOperationListResult) MarshalJSON() ([]byte, error) {
8736	objectMap := make(map[string]interface{})
8737	return json.Marshal(objectMap)
8738}
8739
8740// ImportExportExtensionsOperationListResultIterator provides access to a complete listing of
8741// ImportExportExtensionsOperationResult values.
8742type ImportExportExtensionsOperationListResultIterator struct {
8743	i    int
8744	page ImportExportExtensionsOperationListResultPage
8745}
8746
8747// NextWithContext advances to the next value.  If there was an error making
8748// the request the iterator does not advance and the error is returned.
8749func (iter *ImportExportExtensionsOperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
8750	if tracing.IsEnabled() {
8751		ctx = tracing.StartSpan(ctx, fqdn+"/ImportExportExtensionsOperationListResultIterator.NextWithContext")
8752		defer func() {
8753			sc := -1
8754			if iter.Response().Response.Response != nil {
8755				sc = iter.Response().Response.Response.StatusCode
8756			}
8757			tracing.EndSpan(ctx, sc, err)
8758		}()
8759	}
8760	iter.i++
8761	if iter.i < len(iter.page.Values()) {
8762		return nil
8763	}
8764	err = iter.page.NextWithContext(ctx)
8765	if err != nil {
8766		iter.i--
8767		return err
8768	}
8769	iter.i = 0
8770	return nil
8771}
8772
8773// Next advances to the next value.  If there was an error making
8774// the request the iterator does not advance and the error is returned.
8775// Deprecated: Use NextWithContext() instead.
8776func (iter *ImportExportExtensionsOperationListResultIterator) Next() error {
8777	return iter.NextWithContext(context.Background())
8778}
8779
8780// NotDone returns true if the enumeration should be started or is not yet complete.
8781func (iter ImportExportExtensionsOperationListResultIterator) NotDone() bool {
8782	return iter.page.NotDone() && iter.i < len(iter.page.Values())
8783}
8784
8785// Response returns the raw server response from the last page request.
8786func (iter ImportExportExtensionsOperationListResultIterator) Response() ImportExportExtensionsOperationListResult {
8787	return iter.page.Response()
8788}
8789
8790// Value returns the current value or a zero-initialized value if the
8791// iterator has advanced beyond the end of the collection.
8792func (iter ImportExportExtensionsOperationListResultIterator) Value() ImportExportExtensionsOperationResult {
8793	if !iter.page.NotDone() {
8794		return ImportExportExtensionsOperationResult{}
8795	}
8796	return iter.page.Values()[iter.i]
8797}
8798
8799// Creates a new instance of the ImportExportExtensionsOperationListResultIterator type.
8800func NewImportExportExtensionsOperationListResultIterator(page ImportExportExtensionsOperationListResultPage) ImportExportExtensionsOperationListResultIterator {
8801	return ImportExportExtensionsOperationListResultIterator{page: page}
8802}
8803
8804// IsEmpty returns true if the ListResult contains no values.
8805func (ieeolr ImportExportExtensionsOperationListResult) IsEmpty() bool {
8806	return ieeolr.Value == nil || len(*ieeolr.Value) == 0
8807}
8808
8809// hasNextLink returns true if the NextLink is not empty.
8810func (ieeolr ImportExportExtensionsOperationListResult) hasNextLink() bool {
8811	return ieeolr.NextLink != nil && len(*ieeolr.NextLink) != 0
8812}
8813
8814// importExportExtensionsOperationListResultPreparer prepares a request to retrieve the next set of results.
8815// It returns nil if no more results exist.
8816func (ieeolr ImportExportExtensionsOperationListResult) importExportExtensionsOperationListResultPreparer(ctx context.Context) (*http.Request, error) {
8817	if !ieeolr.hasNextLink() {
8818		return nil, nil
8819	}
8820	return autorest.Prepare((&http.Request{}).WithContext(ctx),
8821		autorest.AsJSON(),
8822		autorest.AsGet(),
8823		autorest.WithBaseURL(to.String(ieeolr.NextLink)))
8824}
8825
8826// ImportExportExtensionsOperationListResultPage contains a page of ImportExportExtensionsOperationResult
8827// values.
8828type ImportExportExtensionsOperationListResultPage struct {
8829	fn     func(context.Context, ImportExportExtensionsOperationListResult) (ImportExportExtensionsOperationListResult, error)
8830	ieeolr ImportExportExtensionsOperationListResult
8831}
8832
8833// NextWithContext advances to the next page of values.  If there was an error making
8834// the request the page does not advance and the error is returned.
8835func (page *ImportExportExtensionsOperationListResultPage) NextWithContext(ctx context.Context) (err error) {
8836	if tracing.IsEnabled() {
8837		ctx = tracing.StartSpan(ctx, fqdn+"/ImportExportExtensionsOperationListResultPage.NextWithContext")
8838		defer func() {
8839			sc := -1
8840			if page.Response().Response.Response != nil {
8841				sc = page.Response().Response.Response.StatusCode
8842			}
8843			tracing.EndSpan(ctx, sc, err)
8844		}()
8845	}
8846	for {
8847		next, err := page.fn(ctx, page.ieeolr)
8848		if err != nil {
8849			return err
8850		}
8851		page.ieeolr = next
8852		if !next.hasNextLink() || !next.IsEmpty() {
8853			break
8854		}
8855	}
8856	return nil
8857}
8858
8859// Next advances to the next page of values.  If there was an error making
8860// the request the page does not advance and the error is returned.
8861// Deprecated: Use NextWithContext() instead.
8862func (page *ImportExportExtensionsOperationListResultPage) Next() error {
8863	return page.NextWithContext(context.Background())
8864}
8865
8866// NotDone returns true if the page enumeration should be started or is not yet complete.
8867func (page ImportExportExtensionsOperationListResultPage) NotDone() bool {
8868	return !page.ieeolr.IsEmpty()
8869}
8870
8871// Response returns the raw server response from the last page request.
8872func (page ImportExportExtensionsOperationListResultPage) Response() ImportExportExtensionsOperationListResult {
8873	return page.ieeolr
8874}
8875
8876// Values returns the slice of values for the current page or nil if there are no values.
8877func (page ImportExportExtensionsOperationListResultPage) Values() []ImportExportExtensionsOperationResult {
8878	if page.ieeolr.IsEmpty() {
8879		return nil
8880	}
8881	return *page.ieeolr.Value
8882}
8883
8884// Creates a new instance of the ImportExportExtensionsOperationListResultPage type.
8885func NewImportExportExtensionsOperationListResultPage(cur ImportExportExtensionsOperationListResult, getNextPage func(context.Context, ImportExportExtensionsOperationListResult) (ImportExportExtensionsOperationListResult, error)) ImportExportExtensionsOperationListResultPage {
8886	return ImportExportExtensionsOperationListResultPage{
8887		fn:     getNextPage,
8888		ieeolr: cur,
8889	}
8890}
8891
8892// ImportExportExtensionsOperationResult an Extension operation result resource.
8893type ImportExportExtensionsOperationResult struct {
8894	autorest.Response `json:"-"`
8895	// ImportExportExtensionsOperationResultProperties - Resource properties.
8896	*ImportExportExtensionsOperationResultProperties `json:"properties,omitempty"`
8897	// ID - READ-ONLY; Resource ID.
8898	ID *string `json:"id,omitempty"`
8899	// Name - READ-ONLY; Resource name.
8900	Name *string `json:"name,omitempty"`
8901	// Type - READ-ONLY; Resource type.
8902	Type *string `json:"type,omitempty"`
8903}
8904
8905// MarshalJSON is the custom marshaler for ImportExportExtensionsOperationResult.
8906func (ieeor ImportExportExtensionsOperationResult) MarshalJSON() ([]byte, error) {
8907	objectMap := make(map[string]interface{})
8908	if ieeor.ImportExportExtensionsOperationResultProperties != nil {
8909		objectMap["properties"] = ieeor.ImportExportExtensionsOperationResultProperties
8910	}
8911	return json.Marshal(objectMap)
8912}
8913
8914// UnmarshalJSON is the custom unmarshaler for ImportExportExtensionsOperationResult struct.
8915func (ieeor *ImportExportExtensionsOperationResult) UnmarshalJSON(body []byte) error {
8916	var m map[string]*json.RawMessage
8917	err := json.Unmarshal(body, &m)
8918	if err != nil {
8919		return err
8920	}
8921	for k, v := range m {
8922		switch k {
8923		case "properties":
8924			if v != nil {
8925				var importExportExtensionsOperationResultProperties ImportExportExtensionsOperationResultProperties
8926				err = json.Unmarshal(*v, &importExportExtensionsOperationResultProperties)
8927				if err != nil {
8928					return err
8929				}
8930				ieeor.ImportExportExtensionsOperationResultProperties = &importExportExtensionsOperationResultProperties
8931			}
8932		case "id":
8933			if v != nil {
8934				var ID string
8935				err = json.Unmarshal(*v, &ID)
8936				if err != nil {
8937					return err
8938				}
8939				ieeor.ID = &ID
8940			}
8941		case "name":
8942			if v != nil {
8943				var name string
8944				err = json.Unmarshal(*v, &name)
8945				if err != nil {
8946					return err
8947				}
8948				ieeor.Name = &name
8949			}
8950		case "type":
8951			if v != nil {
8952				var typeVar string
8953				err = json.Unmarshal(*v, &typeVar)
8954				if err != nil {
8955					return err
8956				}
8957				ieeor.Type = &typeVar
8958			}
8959		}
8960	}
8961
8962	return nil
8963}
8964
8965// ImportExportExtensionsOperationResultProperties contains the operation result properties for
8966// import/export operation.
8967type ImportExportExtensionsOperationResultProperties struct {
8968	// RequestID - READ-ONLY; Request Id.
8969	RequestID *uuid.UUID `json:"requestId,omitempty"`
8970	// RequestType - READ-ONLY; Request type.
8971	RequestType *string `json:"requestType,omitempty"`
8972	// LastModifiedTime - READ-ONLY; Last modified time.
8973	LastModifiedTime *string `json:"lastModifiedTime,omitempty"`
8974	// ServerName - READ-ONLY; Server name.
8975	ServerName *string `json:"serverName,omitempty"`
8976	// DatabaseName - READ-ONLY; Database name.
8977	DatabaseName *string `json:"databaseName,omitempty"`
8978	// Status - READ-ONLY; Operation status.
8979	Status *string `json:"status,omitempty"`
8980	// ErrorMessage - READ-ONLY; Error message.
8981	ErrorMessage *string `json:"errorMessage,omitempty"`
8982}
8983
8984// MarshalJSON is the custom marshaler for ImportExportExtensionsOperationResultProperties.
8985func (ieeorp ImportExportExtensionsOperationResultProperties) MarshalJSON() ([]byte, error) {
8986	objectMap := make(map[string]interface{})
8987	return json.Marshal(objectMap)
8988}
8989
8990// ImportExportOperationResult an ImportExport operation result resource.
8991type ImportExportOperationResult struct {
8992	autorest.Response `json:"-"`
8993	// ImportExportOperationResultProperties - Resource properties.
8994	*ImportExportOperationResultProperties `json:"properties,omitempty"`
8995	// ID - READ-ONLY; Resource ID.
8996	ID *string `json:"id,omitempty"`
8997	// Name - READ-ONLY; Resource name.
8998	Name *string `json:"name,omitempty"`
8999	// Type - READ-ONLY; Resource type.
9000	Type *string `json:"type,omitempty"`
9001}
9002
9003// MarshalJSON is the custom marshaler for ImportExportOperationResult.
9004func (ieor ImportExportOperationResult) MarshalJSON() ([]byte, error) {
9005	objectMap := make(map[string]interface{})
9006	if ieor.ImportExportOperationResultProperties != nil {
9007		objectMap["properties"] = ieor.ImportExportOperationResultProperties
9008	}
9009	return json.Marshal(objectMap)
9010}
9011
9012// UnmarshalJSON is the custom unmarshaler for ImportExportOperationResult struct.
9013func (ieor *ImportExportOperationResult) UnmarshalJSON(body []byte) error {
9014	var m map[string]*json.RawMessage
9015	err := json.Unmarshal(body, &m)
9016	if err != nil {
9017		return err
9018	}
9019	for k, v := range m {
9020		switch k {
9021		case "properties":
9022			if v != nil {
9023				var importExportOperationResultProperties ImportExportOperationResultProperties
9024				err = json.Unmarshal(*v, &importExportOperationResultProperties)
9025				if err != nil {
9026					return err
9027				}
9028				ieor.ImportExportOperationResultProperties = &importExportOperationResultProperties
9029			}
9030		case "id":
9031			if v != nil {
9032				var ID string
9033				err = json.Unmarshal(*v, &ID)
9034				if err != nil {
9035					return err
9036				}
9037				ieor.ID = &ID
9038			}
9039		case "name":
9040			if v != nil {
9041				var name string
9042				err = json.Unmarshal(*v, &name)
9043				if err != nil {
9044					return err
9045				}
9046				ieor.Name = &name
9047			}
9048		case "type":
9049			if v != nil {
9050				var typeVar string
9051				err = json.Unmarshal(*v, &typeVar)
9052				if err != nil {
9053					return err
9054				}
9055				ieor.Type = &typeVar
9056			}
9057		}
9058	}
9059
9060	return nil
9061}
9062
9063// ImportExportOperationResultProperties contains the operation result properties for import/export
9064// operation.
9065type ImportExportOperationResultProperties struct {
9066	// RequestID - READ-ONLY; Request Id.
9067	RequestID *uuid.UUID `json:"requestId,omitempty"`
9068	// RequestType - READ-ONLY; Request type.
9069	RequestType *string `json:"requestType,omitempty"`
9070	// QueuedTime - READ-ONLY; Queued time.
9071	QueuedTime *string `json:"queuedTime,omitempty"`
9072	// LastModifiedTime - READ-ONLY; Last modified time.
9073	LastModifiedTime *string `json:"lastModifiedTime,omitempty"`
9074	// BlobURI - READ-ONLY; Blob Uri.
9075	BlobURI *string `json:"blobUri,omitempty"`
9076	// ServerName - READ-ONLY; Server name.
9077	ServerName *string `json:"serverName,omitempty"`
9078	// DatabaseName - READ-ONLY; Database name.
9079	DatabaseName *string `json:"databaseName,omitempty"`
9080	// Status - READ-ONLY; Operation status.
9081	Status *string `json:"status,omitempty"`
9082	// ErrorMessage - READ-ONLY; Error message.
9083	ErrorMessage *string `json:"errorMessage,omitempty"`
9084	// PrivateEndpointConnections - READ-ONLY; Gets the status of private endpoints associated with this request.
9085	PrivateEndpointConnections *[]PrivateEndpointConnectionRequestStatus `json:"privateEndpointConnections,omitempty"`
9086}
9087
9088// MarshalJSON is the custom marshaler for ImportExportOperationResultProperties.
9089func (ieorp ImportExportOperationResultProperties) MarshalJSON() ([]byte, error) {
9090	objectMap := make(map[string]interface{})
9091	return json.Marshal(objectMap)
9092}
9093
9094// ImportNewDatabaseDefinition contains the information necessary to perform import operation for new
9095// database.
9096type ImportNewDatabaseDefinition struct {
9097	// DatabaseName - Name of the import database.
9098	DatabaseName *string `json:"databaseName,omitempty"`
9099	// Edition - Edition of the import database.
9100	Edition *string `json:"edition,omitempty"`
9101	// ServiceObjectiveName - Service level objective name of the import database.
9102	ServiceObjectiveName *string `json:"serviceObjectiveName,omitempty"`
9103	// MaxSizeBytes - Max size in bytes for the import database.
9104	MaxSizeBytes *string `json:"maxSizeBytes,omitempty"`
9105	// StorageKeyType - Storage key type. Possible values include: 'StorageKeyTypeSharedAccessKey', 'StorageKeyTypeStorageAccessKey'
9106	StorageKeyType StorageKeyType `json:"storageKeyType,omitempty"`
9107	// StorageKey - Storage key.
9108	StorageKey *string `json:"storageKey,omitempty"`
9109	// StorageURI - Storage Uri.
9110	StorageURI *string `json:"storageUri,omitempty"`
9111	// AdministratorLogin - Administrator login name.
9112	AdministratorLogin *string `json:"administratorLogin,omitempty"`
9113	// AdministratorLoginPassword - Administrator login password.
9114	AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"`
9115	// AuthenticationType - Authentication type.
9116	AuthenticationType *string `json:"authenticationType,omitempty"`
9117	// NetworkIsolation - Optional resource information to enable network isolation for request.
9118	NetworkIsolation *NetworkIsolationSettings `json:"networkIsolation,omitempty"`
9119}
9120
9121// InstanceFailoverGroup an instance failover group.
9122type InstanceFailoverGroup struct {
9123	autorest.Response `json:"-"`
9124	// InstanceFailoverGroupProperties - Resource properties.
9125	*InstanceFailoverGroupProperties `json:"properties,omitempty"`
9126	// ID - READ-ONLY; Resource ID.
9127	ID *string `json:"id,omitempty"`
9128	// Name - READ-ONLY; Resource name.
9129	Name *string `json:"name,omitempty"`
9130	// Type - READ-ONLY; Resource type.
9131	Type *string `json:"type,omitempty"`
9132}
9133
9134// MarshalJSON is the custom marshaler for InstanceFailoverGroup.
9135func (ifg InstanceFailoverGroup) MarshalJSON() ([]byte, error) {
9136	objectMap := make(map[string]interface{})
9137	if ifg.InstanceFailoverGroupProperties != nil {
9138		objectMap["properties"] = ifg.InstanceFailoverGroupProperties
9139	}
9140	return json.Marshal(objectMap)
9141}
9142
9143// UnmarshalJSON is the custom unmarshaler for InstanceFailoverGroup struct.
9144func (ifg *InstanceFailoverGroup) UnmarshalJSON(body []byte) error {
9145	var m map[string]*json.RawMessage
9146	err := json.Unmarshal(body, &m)
9147	if err != nil {
9148		return err
9149	}
9150	for k, v := range m {
9151		switch k {
9152		case "properties":
9153			if v != nil {
9154				var instanceFailoverGroupProperties InstanceFailoverGroupProperties
9155				err = json.Unmarshal(*v, &instanceFailoverGroupProperties)
9156				if err != nil {
9157					return err
9158				}
9159				ifg.InstanceFailoverGroupProperties = &instanceFailoverGroupProperties
9160			}
9161		case "id":
9162			if v != nil {
9163				var ID string
9164				err = json.Unmarshal(*v, &ID)
9165				if err != nil {
9166					return err
9167				}
9168				ifg.ID = &ID
9169			}
9170		case "name":
9171			if v != nil {
9172				var name string
9173				err = json.Unmarshal(*v, &name)
9174				if err != nil {
9175					return err
9176				}
9177				ifg.Name = &name
9178			}
9179		case "type":
9180			if v != nil {
9181				var typeVar string
9182				err = json.Unmarshal(*v, &typeVar)
9183				if err != nil {
9184					return err
9185				}
9186				ifg.Type = &typeVar
9187			}
9188		}
9189	}
9190
9191	return nil
9192}
9193
9194// InstanceFailoverGroupListResult a list of instance failover groups.
9195type InstanceFailoverGroupListResult struct {
9196	autorest.Response `json:"-"`
9197	// Value - READ-ONLY; Array of results.
9198	Value *[]InstanceFailoverGroup `json:"value,omitempty"`
9199	// NextLink - READ-ONLY; Link to retrieve next page of results.
9200	NextLink *string `json:"nextLink,omitempty"`
9201}
9202
9203// MarshalJSON is the custom marshaler for InstanceFailoverGroupListResult.
9204func (ifglr InstanceFailoverGroupListResult) MarshalJSON() ([]byte, error) {
9205	objectMap := make(map[string]interface{})
9206	return json.Marshal(objectMap)
9207}
9208
9209// InstanceFailoverGroupListResultIterator provides access to a complete listing of InstanceFailoverGroup
9210// values.
9211type InstanceFailoverGroupListResultIterator struct {
9212	i    int
9213	page InstanceFailoverGroupListResultPage
9214}
9215
9216// NextWithContext advances to the next value.  If there was an error making
9217// the request the iterator does not advance and the error is returned.
9218func (iter *InstanceFailoverGroupListResultIterator) NextWithContext(ctx context.Context) (err error) {
9219	if tracing.IsEnabled() {
9220		ctx = tracing.StartSpan(ctx, fqdn+"/InstanceFailoverGroupListResultIterator.NextWithContext")
9221		defer func() {
9222			sc := -1
9223			if iter.Response().Response.Response != nil {
9224				sc = iter.Response().Response.Response.StatusCode
9225			}
9226			tracing.EndSpan(ctx, sc, err)
9227		}()
9228	}
9229	iter.i++
9230	if iter.i < len(iter.page.Values()) {
9231		return nil
9232	}
9233	err = iter.page.NextWithContext(ctx)
9234	if err != nil {
9235		iter.i--
9236		return err
9237	}
9238	iter.i = 0
9239	return nil
9240}
9241
9242// Next advances to the next value.  If there was an error making
9243// the request the iterator does not advance and the error is returned.
9244// Deprecated: Use NextWithContext() instead.
9245func (iter *InstanceFailoverGroupListResultIterator) Next() error {
9246	return iter.NextWithContext(context.Background())
9247}
9248
9249// NotDone returns true if the enumeration should be started or is not yet complete.
9250func (iter InstanceFailoverGroupListResultIterator) NotDone() bool {
9251	return iter.page.NotDone() && iter.i < len(iter.page.Values())
9252}
9253
9254// Response returns the raw server response from the last page request.
9255func (iter InstanceFailoverGroupListResultIterator) Response() InstanceFailoverGroupListResult {
9256	return iter.page.Response()
9257}
9258
9259// Value returns the current value or a zero-initialized value if the
9260// iterator has advanced beyond the end of the collection.
9261func (iter InstanceFailoverGroupListResultIterator) Value() InstanceFailoverGroup {
9262	if !iter.page.NotDone() {
9263		return InstanceFailoverGroup{}
9264	}
9265	return iter.page.Values()[iter.i]
9266}
9267
9268// Creates a new instance of the InstanceFailoverGroupListResultIterator type.
9269func NewInstanceFailoverGroupListResultIterator(page InstanceFailoverGroupListResultPage) InstanceFailoverGroupListResultIterator {
9270	return InstanceFailoverGroupListResultIterator{page: page}
9271}
9272
9273// IsEmpty returns true if the ListResult contains no values.
9274func (ifglr InstanceFailoverGroupListResult) IsEmpty() bool {
9275	return ifglr.Value == nil || len(*ifglr.Value) == 0
9276}
9277
9278// hasNextLink returns true if the NextLink is not empty.
9279func (ifglr InstanceFailoverGroupListResult) hasNextLink() bool {
9280	return ifglr.NextLink != nil && len(*ifglr.NextLink) != 0
9281}
9282
9283// instanceFailoverGroupListResultPreparer prepares a request to retrieve the next set of results.
9284// It returns nil if no more results exist.
9285func (ifglr InstanceFailoverGroupListResult) instanceFailoverGroupListResultPreparer(ctx context.Context) (*http.Request, error) {
9286	if !ifglr.hasNextLink() {
9287		return nil, nil
9288	}
9289	return autorest.Prepare((&http.Request{}).WithContext(ctx),
9290		autorest.AsJSON(),
9291		autorest.AsGet(),
9292		autorest.WithBaseURL(to.String(ifglr.NextLink)))
9293}
9294
9295// InstanceFailoverGroupListResultPage contains a page of InstanceFailoverGroup values.
9296type InstanceFailoverGroupListResultPage struct {
9297	fn    func(context.Context, InstanceFailoverGroupListResult) (InstanceFailoverGroupListResult, error)
9298	ifglr InstanceFailoverGroupListResult
9299}
9300
9301// NextWithContext advances to the next page of values.  If there was an error making
9302// the request the page does not advance and the error is returned.
9303func (page *InstanceFailoverGroupListResultPage) NextWithContext(ctx context.Context) (err error) {
9304	if tracing.IsEnabled() {
9305		ctx = tracing.StartSpan(ctx, fqdn+"/InstanceFailoverGroupListResultPage.NextWithContext")
9306		defer func() {
9307			sc := -1
9308			if page.Response().Response.Response != nil {
9309				sc = page.Response().Response.Response.StatusCode
9310			}
9311			tracing.EndSpan(ctx, sc, err)
9312		}()
9313	}
9314	for {
9315		next, err := page.fn(ctx, page.ifglr)
9316		if err != nil {
9317			return err
9318		}
9319		page.ifglr = next
9320		if !next.hasNextLink() || !next.IsEmpty() {
9321			break
9322		}
9323	}
9324	return nil
9325}
9326
9327// Next advances to the next page of values.  If there was an error making
9328// the request the page does not advance and the error is returned.
9329// Deprecated: Use NextWithContext() instead.
9330func (page *InstanceFailoverGroupListResultPage) Next() error {
9331	return page.NextWithContext(context.Background())
9332}
9333
9334// NotDone returns true if the page enumeration should be started or is not yet complete.
9335func (page InstanceFailoverGroupListResultPage) NotDone() bool {
9336	return !page.ifglr.IsEmpty()
9337}
9338
9339// Response returns the raw server response from the last page request.
9340func (page InstanceFailoverGroupListResultPage) Response() InstanceFailoverGroupListResult {
9341	return page.ifglr
9342}
9343
9344// Values returns the slice of values for the current page or nil if there are no values.
9345func (page InstanceFailoverGroupListResultPage) Values() []InstanceFailoverGroup {
9346	if page.ifglr.IsEmpty() {
9347		return nil
9348	}
9349	return *page.ifglr.Value
9350}
9351
9352// Creates a new instance of the InstanceFailoverGroupListResultPage type.
9353func NewInstanceFailoverGroupListResultPage(cur InstanceFailoverGroupListResult, getNextPage func(context.Context, InstanceFailoverGroupListResult) (InstanceFailoverGroupListResult, error)) InstanceFailoverGroupListResultPage {
9354	return InstanceFailoverGroupListResultPage{
9355		fn:    getNextPage,
9356		ifglr: cur,
9357	}
9358}
9359
9360// InstanceFailoverGroupProperties properties of a instance failover group.
9361type InstanceFailoverGroupProperties struct {
9362	// ReadWriteEndpoint - Read-write endpoint of the failover group instance.
9363	ReadWriteEndpoint *InstanceFailoverGroupReadWriteEndpoint `json:"readWriteEndpoint,omitempty"`
9364	// ReadOnlyEndpoint - Read-only endpoint of the failover group instance.
9365	ReadOnlyEndpoint *InstanceFailoverGroupReadOnlyEndpoint `json:"readOnlyEndpoint,omitempty"`
9366	// ReplicationRole - READ-ONLY; Local replication role of the failover group instance. Possible values include: 'InstanceFailoverGroupReplicationRolePrimary', 'InstanceFailoverGroupReplicationRoleSecondary'
9367	ReplicationRole InstanceFailoverGroupReplicationRole `json:"replicationRole,omitempty"`
9368	// ReplicationState - READ-ONLY; Replication state of the failover group instance.
9369	ReplicationState *string `json:"replicationState,omitempty"`
9370	// PartnerRegions - Partner region information for the failover group.
9371	PartnerRegions *[]PartnerRegionInfo `json:"partnerRegions,omitempty"`
9372	// ManagedInstancePairs - List of managed instance pairs in the failover group.
9373	ManagedInstancePairs *[]ManagedInstancePairInfo `json:"managedInstancePairs,omitempty"`
9374}
9375
9376// MarshalJSON is the custom marshaler for InstanceFailoverGroupProperties.
9377func (ifgp InstanceFailoverGroupProperties) MarshalJSON() ([]byte, error) {
9378	objectMap := make(map[string]interface{})
9379	if ifgp.ReadWriteEndpoint != nil {
9380		objectMap["readWriteEndpoint"] = ifgp.ReadWriteEndpoint
9381	}
9382	if ifgp.ReadOnlyEndpoint != nil {
9383		objectMap["readOnlyEndpoint"] = ifgp.ReadOnlyEndpoint
9384	}
9385	if ifgp.PartnerRegions != nil {
9386		objectMap["partnerRegions"] = ifgp.PartnerRegions
9387	}
9388	if ifgp.ManagedInstancePairs != nil {
9389		objectMap["managedInstancePairs"] = ifgp.ManagedInstancePairs
9390	}
9391	return json.Marshal(objectMap)
9392}
9393
9394// InstanceFailoverGroupReadOnlyEndpoint read-only endpoint of the failover group instance.
9395type InstanceFailoverGroupReadOnlyEndpoint struct {
9396	// FailoverPolicy - Failover policy of the read-only endpoint for the failover group. Possible values include: 'ReadOnlyEndpointFailoverPolicyDisabled', 'ReadOnlyEndpointFailoverPolicyEnabled'
9397	FailoverPolicy ReadOnlyEndpointFailoverPolicy `json:"failoverPolicy,omitempty"`
9398}
9399
9400// InstanceFailoverGroupReadWriteEndpoint read-write endpoint of the failover group instance.
9401type InstanceFailoverGroupReadWriteEndpoint struct {
9402	// FailoverPolicy - Failover policy of the read-write endpoint for the failover group. If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible values include: 'ReadWriteEndpointFailoverPolicyManual', 'ReadWriteEndpointFailoverPolicyAutomatic'
9403	FailoverPolicy ReadWriteEndpointFailoverPolicy `json:"failoverPolicy,omitempty"`
9404	// FailoverWithDataLossGracePeriodMinutes - Grace period before failover with data loss is attempted for the read-write endpoint. If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required.
9405	FailoverWithDataLossGracePeriodMinutes *int32 `json:"failoverWithDataLossGracePeriodMinutes,omitempty"`
9406}
9407
9408// InstanceFailoverGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
9409// long-running operation.
9410type InstanceFailoverGroupsCreateOrUpdateFuture struct {
9411	azure.FutureAPI
9412	// Result returns the result of the asynchronous operation.
9413	// If the operation has not completed it will return an error.
9414	Result func(InstanceFailoverGroupsClient) (InstanceFailoverGroup, error)
9415}
9416
9417// UnmarshalJSON is the custom unmarshaller for CreateFuture.
9418func (future *InstanceFailoverGroupsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
9419	var azFuture azure.Future
9420	if err := json.Unmarshal(body, &azFuture); err != nil {
9421		return err
9422	}
9423	future.FutureAPI = &azFuture
9424	future.Result = future.result
9425	return nil
9426}
9427
9428// result is the default implementation for InstanceFailoverGroupsCreateOrUpdateFuture.Result.
9429func (future *InstanceFailoverGroupsCreateOrUpdateFuture) result(client InstanceFailoverGroupsClient) (ifg InstanceFailoverGroup, err error) {
9430	var done bool
9431	done, err = future.DoneWithContext(context.Background(), client)
9432	if err != nil {
9433		err = autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
9434		return
9435	}
9436	if !done {
9437		ifg.Response.Response = future.Response()
9438		err = azure.NewAsyncOpIncompleteError("sql.InstanceFailoverGroupsCreateOrUpdateFuture")
9439		return
9440	}
9441	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9442	if ifg.Response.Response, err = future.GetResult(sender); err == nil && ifg.Response.Response.StatusCode != http.StatusNoContent {
9443		ifg, err = client.CreateOrUpdateResponder(ifg.Response.Response)
9444		if err != nil {
9445			err = autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsCreateOrUpdateFuture", "Result", ifg.Response.Response, "Failure responding to request")
9446		}
9447	}
9448	return
9449}
9450
9451// InstanceFailoverGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a
9452// long-running operation.
9453type InstanceFailoverGroupsDeleteFuture struct {
9454	azure.FutureAPI
9455	// Result returns the result of the asynchronous operation.
9456	// If the operation has not completed it will return an error.
9457	Result func(InstanceFailoverGroupsClient) (autorest.Response, error)
9458}
9459
9460// UnmarshalJSON is the custom unmarshaller for CreateFuture.
9461func (future *InstanceFailoverGroupsDeleteFuture) UnmarshalJSON(body []byte) error {
9462	var azFuture azure.Future
9463	if err := json.Unmarshal(body, &azFuture); err != nil {
9464		return err
9465	}
9466	future.FutureAPI = &azFuture
9467	future.Result = future.result
9468	return nil
9469}
9470
9471// result is the default implementation for InstanceFailoverGroupsDeleteFuture.Result.
9472func (future *InstanceFailoverGroupsDeleteFuture) result(client InstanceFailoverGroupsClient) (ar autorest.Response, err error) {
9473	var done bool
9474	done, err = future.DoneWithContext(context.Background(), client)
9475	if err != nil {
9476		err = autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsDeleteFuture", "Result", future.Response(), "Polling failure")
9477		return
9478	}
9479	if !done {
9480		ar.Response = future.Response()
9481		err = azure.NewAsyncOpIncompleteError("sql.InstanceFailoverGroupsDeleteFuture")
9482		return
9483	}
9484	ar.Response = future.Response()
9485	return
9486}
9487
9488// InstanceFailoverGroupsFailoverFuture an abstraction for monitoring and retrieving the results of a
9489// long-running operation.
9490type InstanceFailoverGroupsFailoverFuture struct {
9491	azure.FutureAPI
9492	// Result returns the result of the asynchronous operation.
9493	// If the operation has not completed it will return an error.
9494	Result func(InstanceFailoverGroupsClient) (InstanceFailoverGroup, error)
9495}
9496
9497// UnmarshalJSON is the custom unmarshaller for CreateFuture.
9498func (future *InstanceFailoverGroupsFailoverFuture) UnmarshalJSON(body []byte) error {
9499	var azFuture azure.Future
9500	if err := json.Unmarshal(body, &azFuture); err != nil {
9501		return err
9502	}
9503	future.FutureAPI = &azFuture
9504	future.Result = future.result
9505	return nil
9506}
9507
9508// result is the default implementation for InstanceFailoverGroupsFailoverFuture.Result.
9509func (future *InstanceFailoverGroupsFailoverFuture) result(client InstanceFailoverGroupsClient) (ifg InstanceFailoverGroup, err error) {
9510	var done bool
9511	done, err = future.DoneWithContext(context.Background(), client)
9512	if err != nil {
9513		err = autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsFailoverFuture", "Result", future.Response(), "Polling failure")
9514		return
9515	}
9516	if !done {
9517		ifg.Response.Response = future.Response()
9518		err = azure.NewAsyncOpIncompleteError("sql.InstanceFailoverGroupsFailoverFuture")
9519		return
9520	}
9521	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9522	if ifg.Response.Response, err = future.GetResult(sender); err == nil && ifg.Response.Response.StatusCode != http.StatusNoContent {
9523		ifg, err = client.FailoverResponder(ifg.Response.Response)
9524		if err != nil {
9525			err = autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsFailoverFuture", "Result", ifg.Response.Response, "Failure responding to request")
9526		}
9527	}
9528	return
9529}
9530
9531// InstanceFailoverGroupsForceFailoverAllowDataLossFuture an abstraction for monitoring and retrieving the
9532// results of a long-running operation.
9533type InstanceFailoverGroupsForceFailoverAllowDataLossFuture struct {
9534	azure.FutureAPI
9535	// Result returns the result of the asynchronous operation.
9536	// If the operation has not completed it will return an error.
9537	Result func(InstanceFailoverGroupsClient) (InstanceFailoverGroup, error)
9538}
9539
9540// UnmarshalJSON is the custom unmarshaller for CreateFuture.
9541func (future *InstanceFailoverGroupsForceFailoverAllowDataLossFuture) UnmarshalJSON(body []byte) error {
9542	var azFuture azure.Future
9543	if err := json.Unmarshal(body, &azFuture); err != nil {
9544		return err
9545	}
9546	future.FutureAPI = &azFuture
9547	future.Result = future.result
9548	return nil
9549}
9550
9551// result is the default implementation for InstanceFailoverGroupsForceFailoverAllowDataLossFuture.Result.
9552func (future *InstanceFailoverGroupsForceFailoverAllowDataLossFuture) result(client InstanceFailoverGroupsClient) (ifg InstanceFailoverGroup, err error) {
9553	var done bool
9554	done, err = future.DoneWithContext(context.Background(), client)
9555	if err != nil {
9556		err = autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsForceFailoverAllowDataLossFuture", "Result", future.Response(), "Polling failure")
9557		return
9558	}
9559	if !done {
9560		ifg.Response.Response = future.Response()
9561		err = azure.NewAsyncOpIncompleteError("sql.InstanceFailoverGroupsForceFailoverAllowDataLossFuture")
9562		return
9563	}
9564	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9565	if ifg.Response.Response, err = future.GetResult(sender); err == nil && ifg.Response.Response.StatusCode != http.StatusNoContent {
9566		ifg, err = client.ForceFailoverAllowDataLossResponder(ifg.Response.Response)
9567		if err != nil {
9568			err = autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsForceFailoverAllowDataLossFuture", "Result", ifg.Response.Response, "Failure responding to request")
9569		}
9570	}
9571	return
9572}
9573
9574// InstancePool an Azure SQL instance pool.
9575type InstancePool struct {
9576	autorest.Response `json:"-"`
9577	// Sku - The name and tier of the SKU.
9578	Sku *Sku `json:"sku,omitempty"`
9579	// InstancePoolProperties - Resource properties.
9580	*InstancePoolProperties `json:"properties,omitempty"`
9581	// Location - Resource location.
9582	Location *string `json:"location,omitempty"`
9583	// Tags - Resource tags.
9584	Tags map[string]*string `json:"tags"`
9585	// ID - READ-ONLY; Resource ID.
9586	ID *string `json:"id,omitempty"`
9587	// Name - READ-ONLY; Resource name.
9588	Name *string `json:"name,omitempty"`
9589	// Type - READ-ONLY; Resource type.
9590	Type *string `json:"type,omitempty"`
9591}
9592
9593// MarshalJSON is the custom marshaler for InstancePool.
9594func (IP InstancePool) MarshalJSON() ([]byte, error) {
9595	objectMap := make(map[string]interface{})
9596	if IP.Sku != nil {
9597		objectMap["sku"] = IP.Sku
9598	}
9599	if IP.InstancePoolProperties != nil {
9600		objectMap["properties"] = IP.InstancePoolProperties
9601	}
9602	if IP.Location != nil {
9603		objectMap["location"] = IP.Location
9604	}
9605	if IP.Tags != nil {
9606		objectMap["tags"] = IP.Tags
9607	}
9608	return json.Marshal(objectMap)
9609}
9610
9611// UnmarshalJSON is the custom unmarshaler for InstancePool struct.
9612func (IP *InstancePool) UnmarshalJSON(body []byte) error {
9613	var m map[string]*json.RawMessage
9614	err := json.Unmarshal(body, &m)
9615	if err != nil {
9616		return err
9617	}
9618	for k, v := range m {
9619		switch k {
9620		case "sku":
9621			if v != nil {
9622				var sku Sku
9623				err = json.Unmarshal(*v, &sku)
9624				if err != nil {
9625					return err
9626				}
9627				IP.Sku = &sku
9628			}
9629		case "properties":
9630			if v != nil {
9631				var instancePoolProperties InstancePoolProperties
9632				err = json.Unmarshal(*v, &instancePoolProperties)
9633				if err != nil {
9634					return err
9635				}
9636				IP.InstancePoolProperties = &instancePoolProperties
9637			}
9638		case "location":
9639			if v != nil {
9640				var location string
9641				err = json.Unmarshal(*v, &location)
9642				if err != nil {
9643					return err
9644				}
9645				IP.Location = &location
9646			}
9647		case "tags":
9648			if v != nil {
9649				var tags map[string]*string
9650				err = json.Unmarshal(*v, &tags)
9651				if err != nil {
9652					return err
9653				}
9654				IP.Tags = tags
9655			}
9656		case "id":
9657			if v != nil {
9658				var ID string
9659				err = json.Unmarshal(*v, &ID)
9660				if err != nil {
9661					return err
9662				}
9663				IP.ID = &ID
9664			}
9665		case "name":
9666			if v != nil {
9667				var name string
9668				err = json.Unmarshal(*v, &name)
9669				if err != nil {
9670					return err
9671				}
9672				IP.Name = &name
9673			}
9674		case "type":
9675			if v != nil {
9676				var typeVar string
9677				err = json.Unmarshal(*v, &typeVar)
9678				if err != nil {
9679					return err
9680				}
9681				IP.Type = &typeVar
9682			}
9683		}
9684	}
9685
9686	return nil
9687}
9688
9689// InstancePoolEditionCapability the instance pool capability
9690type InstancePoolEditionCapability struct {
9691	// Name - READ-ONLY; The instance pool version name.
9692	Name *string `json:"name,omitempty"`
9693	// SupportedFamilies - READ-ONLY; The supported families.
9694	SupportedFamilies *[]InstancePoolFamilyCapability `json:"supportedFamilies,omitempty"`
9695	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
9696	Status CapabilityStatus `json:"status,omitempty"`
9697	// Reason - The reason for the capability not being available.
9698	Reason *string `json:"reason,omitempty"`
9699}
9700
9701// MarshalJSON is the custom marshaler for InstancePoolEditionCapability.
9702func (ipec InstancePoolEditionCapability) MarshalJSON() ([]byte, error) {
9703	objectMap := make(map[string]interface{})
9704	if ipec.Reason != nil {
9705		objectMap["reason"] = ipec.Reason
9706	}
9707	return json.Marshal(objectMap)
9708}
9709
9710// InstancePoolFamilyCapability the instance pool family capability.
9711type InstancePoolFamilyCapability struct {
9712	// Name - READ-ONLY; Family name.
9713	Name *string `json:"name,omitempty"`
9714	// SupportedLicenseTypes - READ-ONLY; List of supported license types.
9715	SupportedLicenseTypes *[]LicenseTypeCapability `json:"supportedLicenseTypes,omitempty"`
9716	// SupportedVcoresValues - READ-ONLY; List of supported virtual cores values.
9717	SupportedVcoresValues *[]InstancePoolVcoresCapability `json:"supportedVcoresValues,omitempty"`
9718	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
9719	Status CapabilityStatus `json:"status,omitempty"`
9720	// Reason - The reason for the capability not being available.
9721	Reason *string `json:"reason,omitempty"`
9722}
9723
9724// MarshalJSON is the custom marshaler for InstancePoolFamilyCapability.
9725func (ipfc InstancePoolFamilyCapability) MarshalJSON() ([]byte, error) {
9726	objectMap := make(map[string]interface{})
9727	if ipfc.Reason != nil {
9728		objectMap["reason"] = ipfc.Reason
9729	}
9730	return json.Marshal(objectMap)
9731}
9732
9733// InstancePoolListResult a list of Azure SQL instance pools.
9734type InstancePoolListResult struct {
9735	autorest.Response `json:"-"`
9736	// Value - READ-ONLY; Array of results.
9737	Value *[]InstancePool `json:"value,omitempty"`
9738	// NextLink - READ-ONLY; Link to retrieve next page of results.
9739	NextLink *string `json:"nextLink,omitempty"`
9740}
9741
9742// MarshalJSON is the custom marshaler for InstancePoolListResult.
9743func (iplr InstancePoolListResult) MarshalJSON() ([]byte, error) {
9744	objectMap := make(map[string]interface{})
9745	return json.Marshal(objectMap)
9746}
9747
9748// InstancePoolListResultIterator provides access to a complete listing of InstancePool values.
9749type InstancePoolListResultIterator struct {
9750	i    int
9751	page InstancePoolListResultPage
9752}
9753
9754// NextWithContext advances to the next value.  If there was an error making
9755// the request the iterator does not advance and the error is returned.
9756func (iter *InstancePoolListResultIterator) NextWithContext(ctx context.Context) (err error) {
9757	if tracing.IsEnabled() {
9758		ctx = tracing.StartSpan(ctx, fqdn+"/InstancePoolListResultIterator.NextWithContext")
9759		defer func() {
9760			sc := -1
9761			if iter.Response().Response.Response != nil {
9762				sc = iter.Response().Response.Response.StatusCode
9763			}
9764			tracing.EndSpan(ctx, sc, err)
9765		}()
9766	}
9767	iter.i++
9768	if iter.i < len(iter.page.Values()) {
9769		return nil
9770	}
9771	err = iter.page.NextWithContext(ctx)
9772	if err != nil {
9773		iter.i--
9774		return err
9775	}
9776	iter.i = 0
9777	return nil
9778}
9779
9780// Next advances to the next value.  If there was an error making
9781// the request the iterator does not advance and the error is returned.
9782// Deprecated: Use NextWithContext() instead.
9783func (iter *InstancePoolListResultIterator) Next() error {
9784	return iter.NextWithContext(context.Background())
9785}
9786
9787// NotDone returns true if the enumeration should be started or is not yet complete.
9788func (iter InstancePoolListResultIterator) NotDone() bool {
9789	return iter.page.NotDone() && iter.i < len(iter.page.Values())
9790}
9791
9792// Response returns the raw server response from the last page request.
9793func (iter InstancePoolListResultIterator) Response() InstancePoolListResult {
9794	return iter.page.Response()
9795}
9796
9797// Value returns the current value or a zero-initialized value if the
9798// iterator has advanced beyond the end of the collection.
9799func (iter InstancePoolListResultIterator) Value() InstancePool {
9800	if !iter.page.NotDone() {
9801		return InstancePool{}
9802	}
9803	return iter.page.Values()[iter.i]
9804}
9805
9806// Creates a new instance of the InstancePoolListResultIterator type.
9807func NewInstancePoolListResultIterator(page InstancePoolListResultPage) InstancePoolListResultIterator {
9808	return InstancePoolListResultIterator{page: page}
9809}
9810
9811// IsEmpty returns true if the ListResult contains no values.
9812func (iplr InstancePoolListResult) IsEmpty() bool {
9813	return iplr.Value == nil || len(*iplr.Value) == 0
9814}
9815
9816// hasNextLink returns true if the NextLink is not empty.
9817func (iplr InstancePoolListResult) hasNextLink() bool {
9818	return iplr.NextLink != nil && len(*iplr.NextLink) != 0
9819}
9820
9821// instancePoolListResultPreparer prepares a request to retrieve the next set of results.
9822// It returns nil if no more results exist.
9823func (iplr InstancePoolListResult) instancePoolListResultPreparer(ctx context.Context) (*http.Request, error) {
9824	if !iplr.hasNextLink() {
9825		return nil, nil
9826	}
9827	return autorest.Prepare((&http.Request{}).WithContext(ctx),
9828		autorest.AsJSON(),
9829		autorest.AsGet(),
9830		autorest.WithBaseURL(to.String(iplr.NextLink)))
9831}
9832
9833// InstancePoolListResultPage contains a page of InstancePool values.
9834type InstancePoolListResultPage struct {
9835	fn   func(context.Context, InstancePoolListResult) (InstancePoolListResult, error)
9836	iplr InstancePoolListResult
9837}
9838
9839// NextWithContext advances to the next page of values.  If there was an error making
9840// the request the page does not advance and the error is returned.
9841func (page *InstancePoolListResultPage) NextWithContext(ctx context.Context) (err error) {
9842	if tracing.IsEnabled() {
9843		ctx = tracing.StartSpan(ctx, fqdn+"/InstancePoolListResultPage.NextWithContext")
9844		defer func() {
9845			sc := -1
9846			if page.Response().Response.Response != nil {
9847				sc = page.Response().Response.Response.StatusCode
9848			}
9849			tracing.EndSpan(ctx, sc, err)
9850		}()
9851	}
9852	for {
9853		next, err := page.fn(ctx, page.iplr)
9854		if err != nil {
9855			return err
9856		}
9857		page.iplr = next
9858		if !next.hasNextLink() || !next.IsEmpty() {
9859			break
9860		}
9861	}
9862	return nil
9863}
9864
9865// Next advances to the next page of values.  If there was an error making
9866// the request the page does not advance and the error is returned.
9867// Deprecated: Use NextWithContext() instead.
9868func (page *InstancePoolListResultPage) Next() error {
9869	return page.NextWithContext(context.Background())
9870}
9871
9872// NotDone returns true if the page enumeration should be started or is not yet complete.
9873func (page InstancePoolListResultPage) NotDone() bool {
9874	return !page.iplr.IsEmpty()
9875}
9876
9877// Response returns the raw server response from the last page request.
9878func (page InstancePoolListResultPage) Response() InstancePoolListResult {
9879	return page.iplr
9880}
9881
9882// Values returns the slice of values for the current page or nil if there are no values.
9883func (page InstancePoolListResultPage) Values() []InstancePool {
9884	if page.iplr.IsEmpty() {
9885		return nil
9886	}
9887	return *page.iplr.Value
9888}
9889
9890// Creates a new instance of the InstancePoolListResultPage type.
9891func NewInstancePoolListResultPage(cur InstancePoolListResult, getNextPage func(context.Context, InstancePoolListResult) (InstancePoolListResult, error)) InstancePoolListResultPage {
9892	return InstancePoolListResultPage{
9893		fn:   getNextPage,
9894		iplr: cur,
9895	}
9896}
9897
9898// InstancePoolProperties properties of an instance pool.
9899type InstancePoolProperties struct {
9900	// SubnetID - Resource ID of the subnet to place this instance pool in.
9901	SubnetID *string `json:"subnetId,omitempty"`
9902	// VCores - Count of vCores belonging to this instance pool.
9903	VCores *int32 `json:"vCores,omitempty"`
9904	// LicenseType - The license type. Possible values are 'LicenseIncluded' (price for SQL license is included) and 'BasePrice' (without SQL license price). Possible values include: 'InstancePoolLicenseTypeLicenseIncluded', 'InstancePoolLicenseTypeBasePrice'
9905	LicenseType InstancePoolLicenseType `json:"licenseType,omitempty"`
9906}
9907
9908// InstancePoolsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
9909// long-running operation.
9910type InstancePoolsCreateOrUpdateFuture struct {
9911	azure.FutureAPI
9912	// Result returns the result of the asynchronous operation.
9913	// If the operation has not completed it will return an error.
9914	Result func(InstancePoolsClient) (InstancePool, error)
9915}
9916
9917// UnmarshalJSON is the custom unmarshaller for CreateFuture.
9918func (future *InstancePoolsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
9919	var azFuture azure.Future
9920	if err := json.Unmarshal(body, &azFuture); err != nil {
9921		return err
9922	}
9923	future.FutureAPI = &azFuture
9924	future.Result = future.result
9925	return nil
9926}
9927
9928// result is the default implementation for InstancePoolsCreateOrUpdateFuture.Result.
9929func (future *InstancePoolsCreateOrUpdateFuture) result(client InstancePoolsClient) (IP InstancePool, err error) {
9930	var done bool
9931	done, err = future.DoneWithContext(context.Background(), client)
9932	if err != nil {
9933		err = autorest.NewErrorWithError(err, "sql.InstancePoolsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
9934		return
9935	}
9936	if !done {
9937		IP.Response.Response = future.Response()
9938		err = azure.NewAsyncOpIncompleteError("sql.InstancePoolsCreateOrUpdateFuture")
9939		return
9940	}
9941	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9942	if IP.Response.Response, err = future.GetResult(sender); err == nil && IP.Response.Response.StatusCode != http.StatusNoContent {
9943		IP, err = client.CreateOrUpdateResponder(IP.Response.Response)
9944		if err != nil {
9945			err = autorest.NewErrorWithError(err, "sql.InstancePoolsCreateOrUpdateFuture", "Result", IP.Response.Response, "Failure responding to request")
9946		}
9947	}
9948	return
9949}
9950
9951// InstancePoolsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
9952// operation.
9953type InstancePoolsDeleteFuture struct {
9954	azure.FutureAPI
9955	// Result returns the result of the asynchronous operation.
9956	// If the operation has not completed it will return an error.
9957	Result func(InstancePoolsClient) (autorest.Response, error)
9958}
9959
9960// UnmarshalJSON is the custom unmarshaller for CreateFuture.
9961func (future *InstancePoolsDeleteFuture) UnmarshalJSON(body []byte) error {
9962	var azFuture azure.Future
9963	if err := json.Unmarshal(body, &azFuture); err != nil {
9964		return err
9965	}
9966	future.FutureAPI = &azFuture
9967	future.Result = future.result
9968	return nil
9969}
9970
9971// result is the default implementation for InstancePoolsDeleteFuture.Result.
9972func (future *InstancePoolsDeleteFuture) result(client InstancePoolsClient) (ar autorest.Response, err error) {
9973	var done bool
9974	done, err = future.DoneWithContext(context.Background(), client)
9975	if err != nil {
9976		err = autorest.NewErrorWithError(err, "sql.InstancePoolsDeleteFuture", "Result", future.Response(), "Polling failure")
9977		return
9978	}
9979	if !done {
9980		ar.Response = future.Response()
9981		err = azure.NewAsyncOpIncompleteError("sql.InstancePoolsDeleteFuture")
9982		return
9983	}
9984	ar.Response = future.Response()
9985	return
9986}
9987
9988// InstancePoolsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
9989// operation.
9990type InstancePoolsUpdateFuture struct {
9991	azure.FutureAPI
9992	// Result returns the result of the asynchronous operation.
9993	// If the operation has not completed it will return an error.
9994	Result func(InstancePoolsClient) (InstancePool, error)
9995}
9996
9997// UnmarshalJSON is the custom unmarshaller for CreateFuture.
9998func (future *InstancePoolsUpdateFuture) UnmarshalJSON(body []byte) error {
9999	var azFuture azure.Future
10000	if err := json.Unmarshal(body, &azFuture); err != nil {
10001		return err
10002	}
10003	future.FutureAPI = &azFuture
10004	future.Result = future.result
10005	return nil
10006}
10007
10008// result is the default implementation for InstancePoolsUpdateFuture.Result.
10009func (future *InstancePoolsUpdateFuture) result(client InstancePoolsClient) (IP InstancePool, err error) {
10010	var done bool
10011	done, err = future.DoneWithContext(context.Background(), client)
10012	if err != nil {
10013		err = autorest.NewErrorWithError(err, "sql.InstancePoolsUpdateFuture", "Result", future.Response(), "Polling failure")
10014		return
10015	}
10016	if !done {
10017		IP.Response.Response = future.Response()
10018		err = azure.NewAsyncOpIncompleteError("sql.InstancePoolsUpdateFuture")
10019		return
10020	}
10021	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10022	if IP.Response.Response, err = future.GetResult(sender); err == nil && IP.Response.Response.StatusCode != http.StatusNoContent {
10023		IP, err = client.UpdateResponder(IP.Response.Response)
10024		if err != nil {
10025			err = autorest.NewErrorWithError(err, "sql.InstancePoolsUpdateFuture", "Result", IP.Response.Response, "Failure responding to request")
10026		}
10027	}
10028	return
10029}
10030
10031// InstancePoolUpdate an update to an Instance pool.
10032type InstancePoolUpdate struct {
10033	// Tags - Resource tags.
10034	Tags map[string]*string `json:"tags"`
10035}
10036
10037// MarshalJSON is the custom marshaler for InstancePoolUpdate.
10038func (ipu InstancePoolUpdate) MarshalJSON() ([]byte, error) {
10039	objectMap := make(map[string]interface{})
10040	if ipu.Tags != nil {
10041		objectMap["tags"] = ipu.Tags
10042	}
10043	return json.Marshal(objectMap)
10044}
10045
10046// InstancePoolVcoresCapability the managed instance virtual cores capability.
10047type InstancePoolVcoresCapability struct {
10048	// Name - READ-ONLY; The virtual cores identifier.
10049	Name *string `json:"name,omitempty"`
10050	// Value - READ-ONLY; The virtual cores value.
10051	Value *int32 `json:"value,omitempty"`
10052	// StorageLimit - READ-ONLY; Storage limit.
10053	StorageLimit *MaxSizeCapability `json:"storageLimit,omitempty"`
10054	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
10055	Status CapabilityStatus `json:"status,omitempty"`
10056	// Reason - The reason for the capability not being available.
10057	Reason *string `json:"reason,omitempty"`
10058}
10059
10060// MarshalJSON is the custom marshaler for InstancePoolVcoresCapability.
10061func (ipvc InstancePoolVcoresCapability) MarshalJSON() ([]byte, error) {
10062	objectMap := make(map[string]interface{})
10063	if ipvc.Reason != nil {
10064		objectMap["reason"] = ipvc.Reason
10065	}
10066	return json.Marshal(objectMap)
10067}
10068
10069// Job a job.
10070type Job struct {
10071	autorest.Response `json:"-"`
10072	// JobProperties - Resource properties.
10073	*JobProperties `json:"properties,omitempty"`
10074	// ID - READ-ONLY; Resource ID.
10075	ID *string `json:"id,omitempty"`
10076	// Name - READ-ONLY; Resource name.
10077	Name *string `json:"name,omitempty"`
10078	// Type - READ-ONLY; Resource type.
10079	Type *string `json:"type,omitempty"`
10080}
10081
10082// MarshalJSON is the custom marshaler for Job.
10083func (j Job) MarshalJSON() ([]byte, error) {
10084	objectMap := make(map[string]interface{})
10085	if j.JobProperties != nil {
10086		objectMap["properties"] = j.JobProperties
10087	}
10088	return json.Marshal(objectMap)
10089}
10090
10091// UnmarshalJSON is the custom unmarshaler for Job struct.
10092func (j *Job) UnmarshalJSON(body []byte) error {
10093	var m map[string]*json.RawMessage
10094	err := json.Unmarshal(body, &m)
10095	if err != nil {
10096		return err
10097	}
10098	for k, v := range m {
10099		switch k {
10100		case "properties":
10101			if v != nil {
10102				var jobProperties JobProperties
10103				err = json.Unmarshal(*v, &jobProperties)
10104				if err != nil {
10105					return err
10106				}
10107				j.JobProperties = &jobProperties
10108			}
10109		case "id":
10110			if v != nil {
10111				var ID string
10112				err = json.Unmarshal(*v, &ID)
10113				if err != nil {
10114					return err
10115				}
10116				j.ID = &ID
10117			}
10118		case "name":
10119			if v != nil {
10120				var name string
10121				err = json.Unmarshal(*v, &name)
10122				if err != nil {
10123					return err
10124				}
10125				j.Name = &name
10126			}
10127		case "type":
10128			if v != nil {
10129				var typeVar string
10130				err = json.Unmarshal(*v, &typeVar)
10131				if err != nil {
10132					return err
10133				}
10134				j.Type = &typeVar
10135			}
10136		}
10137	}
10138
10139	return nil
10140}
10141
10142// JobAgent an Azure SQL job agent.
10143type JobAgent struct {
10144	autorest.Response `json:"-"`
10145	// Sku - The name and tier of the SKU.
10146	Sku *Sku `json:"sku,omitempty"`
10147	// JobAgentProperties - Resource properties.
10148	*JobAgentProperties `json:"properties,omitempty"`
10149	// Location - Resource location.
10150	Location *string `json:"location,omitempty"`
10151	// Tags - Resource tags.
10152	Tags map[string]*string `json:"tags"`
10153	// ID - READ-ONLY; Resource ID.
10154	ID *string `json:"id,omitempty"`
10155	// Name - READ-ONLY; Resource name.
10156	Name *string `json:"name,omitempty"`
10157	// Type - READ-ONLY; Resource type.
10158	Type *string `json:"type,omitempty"`
10159}
10160
10161// MarshalJSON is the custom marshaler for JobAgent.
10162func (ja JobAgent) MarshalJSON() ([]byte, error) {
10163	objectMap := make(map[string]interface{})
10164	if ja.Sku != nil {
10165		objectMap["sku"] = ja.Sku
10166	}
10167	if ja.JobAgentProperties != nil {
10168		objectMap["properties"] = ja.JobAgentProperties
10169	}
10170	if ja.Location != nil {
10171		objectMap["location"] = ja.Location
10172	}
10173	if ja.Tags != nil {
10174		objectMap["tags"] = ja.Tags
10175	}
10176	return json.Marshal(objectMap)
10177}
10178
10179// UnmarshalJSON is the custom unmarshaler for JobAgent struct.
10180func (ja *JobAgent) UnmarshalJSON(body []byte) error {
10181	var m map[string]*json.RawMessage
10182	err := json.Unmarshal(body, &m)
10183	if err != nil {
10184		return err
10185	}
10186	for k, v := range m {
10187		switch k {
10188		case "sku":
10189			if v != nil {
10190				var sku Sku
10191				err = json.Unmarshal(*v, &sku)
10192				if err != nil {
10193					return err
10194				}
10195				ja.Sku = &sku
10196			}
10197		case "properties":
10198			if v != nil {
10199				var jobAgentProperties JobAgentProperties
10200				err = json.Unmarshal(*v, &jobAgentProperties)
10201				if err != nil {
10202					return err
10203				}
10204				ja.JobAgentProperties = &jobAgentProperties
10205			}
10206		case "location":
10207			if v != nil {
10208				var location string
10209				err = json.Unmarshal(*v, &location)
10210				if err != nil {
10211					return err
10212				}
10213				ja.Location = &location
10214			}
10215		case "tags":
10216			if v != nil {
10217				var tags map[string]*string
10218				err = json.Unmarshal(*v, &tags)
10219				if err != nil {
10220					return err
10221				}
10222				ja.Tags = tags
10223			}
10224		case "id":
10225			if v != nil {
10226				var ID string
10227				err = json.Unmarshal(*v, &ID)
10228				if err != nil {
10229					return err
10230				}
10231				ja.ID = &ID
10232			}
10233		case "name":
10234			if v != nil {
10235				var name string
10236				err = json.Unmarshal(*v, &name)
10237				if err != nil {
10238					return err
10239				}
10240				ja.Name = &name
10241			}
10242		case "type":
10243			if v != nil {
10244				var typeVar string
10245				err = json.Unmarshal(*v, &typeVar)
10246				if err != nil {
10247					return err
10248				}
10249				ja.Type = &typeVar
10250			}
10251		}
10252	}
10253
10254	return nil
10255}
10256
10257// JobAgentListResult a list of Azure SQL job agents.
10258type JobAgentListResult struct {
10259	autorest.Response `json:"-"`
10260	// Value - READ-ONLY; Array of results.
10261	Value *[]JobAgent `json:"value,omitempty"`
10262	// NextLink - READ-ONLY; Link to retrieve next page of results.
10263	NextLink *string `json:"nextLink,omitempty"`
10264}
10265
10266// MarshalJSON is the custom marshaler for JobAgentListResult.
10267func (jalr JobAgentListResult) MarshalJSON() ([]byte, error) {
10268	objectMap := make(map[string]interface{})
10269	return json.Marshal(objectMap)
10270}
10271
10272// JobAgentListResultIterator provides access to a complete listing of JobAgent values.
10273type JobAgentListResultIterator struct {
10274	i    int
10275	page JobAgentListResultPage
10276}
10277
10278// NextWithContext advances to the next value.  If there was an error making
10279// the request the iterator does not advance and the error is returned.
10280func (iter *JobAgentListResultIterator) NextWithContext(ctx context.Context) (err error) {
10281	if tracing.IsEnabled() {
10282		ctx = tracing.StartSpan(ctx, fqdn+"/JobAgentListResultIterator.NextWithContext")
10283		defer func() {
10284			sc := -1
10285			if iter.Response().Response.Response != nil {
10286				sc = iter.Response().Response.Response.StatusCode
10287			}
10288			tracing.EndSpan(ctx, sc, err)
10289		}()
10290	}
10291	iter.i++
10292	if iter.i < len(iter.page.Values()) {
10293		return nil
10294	}
10295	err = iter.page.NextWithContext(ctx)
10296	if err != nil {
10297		iter.i--
10298		return err
10299	}
10300	iter.i = 0
10301	return nil
10302}
10303
10304// Next advances to the next value.  If there was an error making
10305// the request the iterator does not advance and the error is returned.
10306// Deprecated: Use NextWithContext() instead.
10307func (iter *JobAgentListResultIterator) Next() error {
10308	return iter.NextWithContext(context.Background())
10309}
10310
10311// NotDone returns true if the enumeration should be started or is not yet complete.
10312func (iter JobAgentListResultIterator) NotDone() bool {
10313	return iter.page.NotDone() && iter.i < len(iter.page.Values())
10314}
10315
10316// Response returns the raw server response from the last page request.
10317func (iter JobAgentListResultIterator) Response() JobAgentListResult {
10318	return iter.page.Response()
10319}
10320
10321// Value returns the current value or a zero-initialized value if the
10322// iterator has advanced beyond the end of the collection.
10323func (iter JobAgentListResultIterator) Value() JobAgent {
10324	if !iter.page.NotDone() {
10325		return JobAgent{}
10326	}
10327	return iter.page.Values()[iter.i]
10328}
10329
10330// Creates a new instance of the JobAgentListResultIterator type.
10331func NewJobAgentListResultIterator(page JobAgentListResultPage) JobAgentListResultIterator {
10332	return JobAgentListResultIterator{page: page}
10333}
10334
10335// IsEmpty returns true if the ListResult contains no values.
10336func (jalr JobAgentListResult) IsEmpty() bool {
10337	return jalr.Value == nil || len(*jalr.Value) == 0
10338}
10339
10340// hasNextLink returns true if the NextLink is not empty.
10341func (jalr JobAgentListResult) hasNextLink() bool {
10342	return jalr.NextLink != nil && len(*jalr.NextLink) != 0
10343}
10344
10345// jobAgentListResultPreparer prepares a request to retrieve the next set of results.
10346// It returns nil if no more results exist.
10347func (jalr JobAgentListResult) jobAgentListResultPreparer(ctx context.Context) (*http.Request, error) {
10348	if !jalr.hasNextLink() {
10349		return nil, nil
10350	}
10351	return autorest.Prepare((&http.Request{}).WithContext(ctx),
10352		autorest.AsJSON(),
10353		autorest.AsGet(),
10354		autorest.WithBaseURL(to.String(jalr.NextLink)))
10355}
10356
10357// JobAgentListResultPage contains a page of JobAgent values.
10358type JobAgentListResultPage struct {
10359	fn   func(context.Context, JobAgentListResult) (JobAgentListResult, error)
10360	jalr JobAgentListResult
10361}
10362
10363// NextWithContext advances to the next page of values.  If there was an error making
10364// the request the page does not advance and the error is returned.
10365func (page *JobAgentListResultPage) NextWithContext(ctx context.Context) (err error) {
10366	if tracing.IsEnabled() {
10367		ctx = tracing.StartSpan(ctx, fqdn+"/JobAgentListResultPage.NextWithContext")
10368		defer func() {
10369			sc := -1
10370			if page.Response().Response.Response != nil {
10371				sc = page.Response().Response.Response.StatusCode
10372			}
10373			tracing.EndSpan(ctx, sc, err)
10374		}()
10375	}
10376	for {
10377		next, err := page.fn(ctx, page.jalr)
10378		if err != nil {
10379			return err
10380		}
10381		page.jalr = next
10382		if !next.hasNextLink() || !next.IsEmpty() {
10383			break
10384		}
10385	}
10386	return nil
10387}
10388
10389// Next advances to the next page of values.  If there was an error making
10390// the request the page does not advance and the error is returned.
10391// Deprecated: Use NextWithContext() instead.
10392func (page *JobAgentListResultPage) Next() error {
10393	return page.NextWithContext(context.Background())
10394}
10395
10396// NotDone returns true if the page enumeration should be started or is not yet complete.
10397func (page JobAgentListResultPage) NotDone() bool {
10398	return !page.jalr.IsEmpty()
10399}
10400
10401// Response returns the raw server response from the last page request.
10402func (page JobAgentListResultPage) Response() JobAgentListResult {
10403	return page.jalr
10404}
10405
10406// Values returns the slice of values for the current page or nil if there are no values.
10407func (page JobAgentListResultPage) Values() []JobAgent {
10408	if page.jalr.IsEmpty() {
10409		return nil
10410	}
10411	return *page.jalr.Value
10412}
10413
10414// Creates a new instance of the JobAgentListResultPage type.
10415func NewJobAgentListResultPage(cur JobAgentListResult, getNextPage func(context.Context, JobAgentListResult) (JobAgentListResult, error)) JobAgentListResultPage {
10416	return JobAgentListResultPage{
10417		fn:   getNextPage,
10418		jalr: cur,
10419	}
10420}
10421
10422// JobAgentProperties properties of a job agent.
10423type JobAgentProperties struct {
10424	// DatabaseID - Resource ID of the database to store job metadata in.
10425	DatabaseID *string `json:"databaseId,omitempty"`
10426	// State - READ-ONLY; The state of the job agent. Possible values include: 'JobAgentStateCreating', 'JobAgentStateReady', 'JobAgentStateUpdating', 'JobAgentStateDeleting', 'JobAgentStateDisabled'
10427	State JobAgentState `json:"state,omitempty"`
10428}
10429
10430// MarshalJSON is the custom marshaler for JobAgentProperties.
10431func (jap JobAgentProperties) MarshalJSON() ([]byte, error) {
10432	objectMap := make(map[string]interface{})
10433	if jap.DatabaseID != nil {
10434		objectMap["databaseId"] = jap.DatabaseID
10435	}
10436	return json.Marshal(objectMap)
10437}
10438
10439// JobAgentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
10440// operation.
10441type JobAgentsCreateOrUpdateFuture struct {
10442	azure.FutureAPI
10443	// Result returns the result of the asynchronous operation.
10444	// If the operation has not completed it will return an error.
10445	Result func(JobAgentsClient) (JobAgent, error)
10446}
10447
10448// UnmarshalJSON is the custom unmarshaller for CreateFuture.
10449func (future *JobAgentsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
10450	var azFuture azure.Future
10451	if err := json.Unmarshal(body, &azFuture); err != nil {
10452		return err
10453	}
10454	future.FutureAPI = &azFuture
10455	future.Result = future.result
10456	return nil
10457}
10458
10459// result is the default implementation for JobAgentsCreateOrUpdateFuture.Result.
10460func (future *JobAgentsCreateOrUpdateFuture) result(client JobAgentsClient) (ja JobAgent, err error) {
10461	var done bool
10462	done, err = future.DoneWithContext(context.Background(), client)
10463	if err != nil {
10464		err = autorest.NewErrorWithError(err, "sql.JobAgentsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
10465		return
10466	}
10467	if !done {
10468		ja.Response.Response = future.Response()
10469		err = azure.NewAsyncOpIncompleteError("sql.JobAgentsCreateOrUpdateFuture")
10470		return
10471	}
10472	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10473	if ja.Response.Response, err = future.GetResult(sender); err == nil && ja.Response.Response.StatusCode != http.StatusNoContent {
10474		ja, err = client.CreateOrUpdateResponder(ja.Response.Response)
10475		if err != nil {
10476			err = autorest.NewErrorWithError(err, "sql.JobAgentsCreateOrUpdateFuture", "Result", ja.Response.Response, "Failure responding to request")
10477		}
10478	}
10479	return
10480}
10481
10482// JobAgentsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
10483// operation.
10484type JobAgentsDeleteFuture struct {
10485	azure.FutureAPI
10486	// Result returns the result of the asynchronous operation.
10487	// If the operation has not completed it will return an error.
10488	Result func(JobAgentsClient) (autorest.Response, error)
10489}
10490
10491// UnmarshalJSON is the custom unmarshaller for CreateFuture.
10492func (future *JobAgentsDeleteFuture) UnmarshalJSON(body []byte) error {
10493	var azFuture azure.Future
10494	if err := json.Unmarshal(body, &azFuture); err != nil {
10495		return err
10496	}
10497	future.FutureAPI = &azFuture
10498	future.Result = future.result
10499	return nil
10500}
10501
10502// result is the default implementation for JobAgentsDeleteFuture.Result.
10503func (future *JobAgentsDeleteFuture) result(client JobAgentsClient) (ar autorest.Response, err error) {
10504	var done bool
10505	done, err = future.DoneWithContext(context.Background(), client)
10506	if err != nil {
10507		err = autorest.NewErrorWithError(err, "sql.JobAgentsDeleteFuture", "Result", future.Response(), "Polling failure")
10508		return
10509	}
10510	if !done {
10511		ar.Response = future.Response()
10512		err = azure.NewAsyncOpIncompleteError("sql.JobAgentsDeleteFuture")
10513		return
10514	}
10515	ar.Response = future.Response()
10516	return
10517}
10518
10519// JobAgentsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
10520// operation.
10521type JobAgentsUpdateFuture struct {
10522	azure.FutureAPI
10523	// Result returns the result of the asynchronous operation.
10524	// If the operation has not completed it will return an error.
10525	Result func(JobAgentsClient) (JobAgent, error)
10526}
10527
10528// UnmarshalJSON is the custom unmarshaller for CreateFuture.
10529func (future *JobAgentsUpdateFuture) UnmarshalJSON(body []byte) error {
10530	var azFuture azure.Future
10531	if err := json.Unmarshal(body, &azFuture); err != nil {
10532		return err
10533	}
10534	future.FutureAPI = &azFuture
10535	future.Result = future.result
10536	return nil
10537}
10538
10539// result is the default implementation for JobAgentsUpdateFuture.Result.
10540func (future *JobAgentsUpdateFuture) result(client JobAgentsClient) (ja JobAgent, err error) {
10541	var done bool
10542	done, err = future.DoneWithContext(context.Background(), client)
10543	if err != nil {
10544		err = autorest.NewErrorWithError(err, "sql.JobAgentsUpdateFuture", "Result", future.Response(), "Polling failure")
10545		return
10546	}
10547	if !done {
10548		ja.Response.Response = future.Response()
10549		err = azure.NewAsyncOpIncompleteError("sql.JobAgentsUpdateFuture")
10550		return
10551	}
10552	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10553	if ja.Response.Response, err = future.GetResult(sender); err == nil && ja.Response.Response.StatusCode != http.StatusNoContent {
10554		ja, err = client.UpdateResponder(ja.Response.Response)
10555		if err != nil {
10556			err = autorest.NewErrorWithError(err, "sql.JobAgentsUpdateFuture", "Result", ja.Response.Response, "Failure responding to request")
10557		}
10558	}
10559	return
10560}
10561
10562// JobAgentUpdate an update to an Azure SQL job agent.
10563type JobAgentUpdate struct {
10564	// Tags - Resource tags.
10565	Tags map[string]*string `json:"tags"`
10566}
10567
10568// MarshalJSON is the custom marshaler for JobAgentUpdate.
10569func (jau JobAgentUpdate) MarshalJSON() ([]byte, error) {
10570	objectMap := make(map[string]interface{})
10571	if jau.Tags != nil {
10572		objectMap["tags"] = jau.Tags
10573	}
10574	return json.Marshal(objectMap)
10575}
10576
10577// JobCredential a stored credential that can be used by a job to connect to target databases.
10578type JobCredential struct {
10579	autorest.Response `json:"-"`
10580	// JobCredentialProperties - Resource properties.
10581	*JobCredentialProperties `json:"properties,omitempty"`
10582	// ID - READ-ONLY; Resource ID.
10583	ID *string `json:"id,omitempty"`
10584	// Name - READ-ONLY; Resource name.
10585	Name *string `json:"name,omitempty"`
10586	// Type - READ-ONLY; Resource type.
10587	Type *string `json:"type,omitempty"`
10588}
10589
10590// MarshalJSON is the custom marshaler for JobCredential.
10591func (jc JobCredential) MarshalJSON() ([]byte, error) {
10592	objectMap := make(map[string]interface{})
10593	if jc.JobCredentialProperties != nil {
10594		objectMap["properties"] = jc.JobCredentialProperties
10595	}
10596	return json.Marshal(objectMap)
10597}
10598
10599// UnmarshalJSON is the custom unmarshaler for JobCredential struct.
10600func (jc *JobCredential) UnmarshalJSON(body []byte) error {
10601	var m map[string]*json.RawMessage
10602	err := json.Unmarshal(body, &m)
10603	if err != nil {
10604		return err
10605	}
10606	for k, v := range m {
10607		switch k {
10608		case "properties":
10609			if v != nil {
10610				var jobCredentialProperties JobCredentialProperties
10611				err = json.Unmarshal(*v, &jobCredentialProperties)
10612				if err != nil {
10613					return err
10614				}
10615				jc.JobCredentialProperties = &jobCredentialProperties
10616			}
10617		case "id":
10618			if v != nil {
10619				var ID string
10620				err = json.Unmarshal(*v, &ID)
10621				if err != nil {
10622					return err
10623				}
10624				jc.ID = &ID
10625			}
10626		case "name":
10627			if v != nil {
10628				var name string
10629				err = json.Unmarshal(*v, &name)
10630				if err != nil {
10631					return err
10632				}
10633				jc.Name = &name
10634			}
10635		case "type":
10636			if v != nil {
10637				var typeVar string
10638				err = json.Unmarshal(*v, &typeVar)
10639				if err != nil {
10640					return err
10641				}
10642				jc.Type = &typeVar
10643			}
10644		}
10645	}
10646
10647	return nil
10648}
10649
10650// JobCredentialListResult a list of job credentials.
10651type JobCredentialListResult struct {
10652	autorest.Response `json:"-"`
10653	// Value - READ-ONLY; Array of results.
10654	Value *[]JobCredential `json:"value,omitempty"`
10655	// NextLink - READ-ONLY; Link to retrieve next page of results.
10656	NextLink *string `json:"nextLink,omitempty"`
10657}
10658
10659// MarshalJSON is the custom marshaler for JobCredentialListResult.
10660func (jclr JobCredentialListResult) MarshalJSON() ([]byte, error) {
10661	objectMap := make(map[string]interface{})
10662	return json.Marshal(objectMap)
10663}
10664
10665// JobCredentialListResultIterator provides access to a complete listing of JobCredential values.
10666type JobCredentialListResultIterator struct {
10667	i    int
10668	page JobCredentialListResultPage
10669}
10670
10671// NextWithContext advances to the next value.  If there was an error making
10672// the request the iterator does not advance and the error is returned.
10673func (iter *JobCredentialListResultIterator) NextWithContext(ctx context.Context) (err error) {
10674	if tracing.IsEnabled() {
10675		ctx = tracing.StartSpan(ctx, fqdn+"/JobCredentialListResultIterator.NextWithContext")
10676		defer func() {
10677			sc := -1
10678			if iter.Response().Response.Response != nil {
10679				sc = iter.Response().Response.Response.StatusCode
10680			}
10681			tracing.EndSpan(ctx, sc, err)
10682		}()
10683	}
10684	iter.i++
10685	if iter.i < len(iter.page.Values()) {
10686		return nil
10687	}
10688	err = iter.page.NextWithContext(ctx)
10689	if err != nil {
10690		iter.i--
10691		return err
10692	}
10693	iter.i = 0
10694	return nil
10695}
10696
10697// Next advances to the next value.  If there was an error making
10698// the request the iterator does not advance and the error is returned.
10699// Deprecated: Use NextWithContext() instead.
10700func (iter *JobCredentialListResultIterator) Next() error {
10701	return iter.NextWithContext(context.Background())
10702}
10703
10704// NotDone returns true if the enumeration should be started or is not yet complete.
10705func (iter JobCredentialListResultIterator) NotDone() bool {
10706	return iter.page.NotDone() && iter.i < len(iter.page.Values())
10707}
10708
10709// Response returns the raw server response from the last page request.
10710func (iter JobCredentialListResultIterator) Response() JobCredentialListResult {
10711	return iter.page.Response()
10712}
10713
10714// Value returns the current value or a zero-initialized value if the
10715// iterator has advanced beyond the end of the collection.
10716func (iter JobCredentialListResultIterator) Value() JobCredential {
10717	if !iter.page.NotDone() {
10718		return JobCredential{}
10719	}
10720	return iter.page.Values()[iter.i]
10721}
10722
10723// Creates a new instance of the JobCredentialListResultIterator type.
10724func NewJobCredentialListResultIterator(page JobCredentialListResultPage) JobCredentialListResultIterator {
10725	return JobCredentialListResultIterator{page: page}
10726}
10727
10728// IsEmpty returns true if the ListResult contains no values.
10729func (jclr JobCredentialListResult) IsEmpty() bool {
10730	return jclr.Value == nil || len(*jclr.Value) == 0
10731}
10732
10733// hasNextLink returns true if the NextLink is not empty.
10734func (jclr JobCredentialListResult) hasNextLink() bool {
10735	return jclr.NextLink != nil && len(*jclr.NextLink) != 0
10736}
10737
10738// jobCredentialListResultPreparer prepares a request to retrieve the next set of results.
10739// It returns nil if no more results exist.
10740func (jclr JobCredentialListResult) jobCredentialListResultPreparer(ctx context.Context) (*http.Request, error) {
10741	if !jclr.hasNextLink() {
10742		return nil, nil
10743	}
10744	return autorest.Prepare((&http.Request{}).WithContext(ctx),
10745		autorest.AsJSON(),
10746		autorest.AsGet(),
10747		autorest.WithBaseURL(to.String(jclr.NextLink)))
10748}
10749
10750// JobCredentialListResultPage contains a page of JobCredential values.
10751type JobCredentialListResultPage struct {
10752	fn   func(context.Context, JobCredentialListResult) (JobCredentialListResult, error)
10753	jclr JobCredentialListResult
10754}
10755
10756// NextWithContext advances to the next page of values.  If there was an error making
10757// the request the page does not advance and the error is returned.
10758func (page *JobCredentialListResultPage) NextWithContext(ctx context.Context) (err error) {
10759	if tracing.IsEnabled() {
10760		ctx = tracing.StartSpan(ctx, fqdn+"/JobCredentialListResultPage.NextWithContext")
10761		defer func() {
10762			sc := -1
10763			if page.Response().Response.Response != nil {
10764				sc = page.Response().Response.Response.StatusCode
10765			}
10766			tracing.EndSpan(ctx, sc, err)
10767		}()
10768	}
10769	for {
10770		next, err := page.fn(ctx, page.jclr)
10771		if err != nil {
10772			return err
10773		}
10774		page.jclr = next
10775		if !next.hasNextLink() || !next.IsEmpty() {
10776			break
10777		}
10778	}
10779	return nil
10780}
10781
10782// Next advances to the next page of values.  If there was an error making
10783// the request the page does not advance and the error is returned.
10784// Deprecated: Use NextWithContext() instead.
10785func (page *JobCredentialListResultPage) Next() error {
10786	return page.NextWithContext(context.Background())
10787}
10788
10789// NotDone returns true if the page enumeration should be started or is not yet complete.
10790func (page JobCredentialListResultPage) NotDone() bool {
10791	return !page.jclr.IsEmpty()
10792}
10793
10794// Response returns the raw server response from the last page request.
10795func (page JobCredentialListResultPage) Response() JobCredentialListResult {
10796	return page.jclr
10797}
10798
10799// Values returns the slice of values for the current page or nil if there are no values.
10800func (page JobCredentialListResultPage) Values() []JobCredential {
10801	if page.jclr.IsEmpty() {
10802		return nil
10803	}
10804	return *page.jclr.Value
10805}
10806
10807// Creates a new instance of the JobCredentialListResultPage type.
10808func NewJobCredentialListResultPage(cur JobCredentialListResult, getNextPage func(context.Context, JobCredentialListResult) (JobCredentialListResult, error)) JobCredentialListResultPage {
10809	return JobCredentialListResultPage{
10810		fn:   getNextPage,
10811		jclr: cur,
10812	}
10813}
10814
10815// JobCredentialProperties properties of a job credential.
10816type JobCredentialProperties struct {
10817	// Username - The credential user name.
10818	Username *string `json:"username,omitempty"`
10819	// Password - The credential password.
10820	Password *string `json:"password,omitempty"`
10821}
10822
10823// JobExecution an execution of a job
10824type JobExecution struct {
10825	autorest.Response `json:"-"`
10826	// JobExecutionProperties - Resource properties.
10827	*JobExecutionProperties `json:"properties,omitempty"`
10828	// ID - READ-ONLY; Resource ID.
10829	ID *string `json:"id,omitempty"`
10830	// Name - READ-ONLY; Resource name.
10831	Name *string `json:"name,omitempty"`
10832	// Type - READ-ONLY; Resource type.
10833	Type *string `json:"type,omitempty"`
10834}
10835
10836// MarshalJSON is the custom marshaler for JobExecution.
10837func (je JobExecution) MarshalJSON() ([]byte, error) {
10838	objectMap := make(map[string]interface{})
10839	if je.JobExecutionProperties != nil {
10840		objectMap["properties"] = je.JobExecutionProperties
10841	}
10842	return json.Marshal(objectMap)
10843}
10844
10845// UnmarshalJSON is the custom unmarshaler for JobExecution struct.
10846func (je *JobExecution) UnmarshalJSON(body []byte) error {
10847	var m map[string]*json.RawMessage
10848	err := json.Unmarshal(body, &m)
10849	if err != nil {
10850		return err
10851	}
10852	for k, v := range m {
10853		switch k {
10854		case "properties":
10855			if v != nil {
10856				var jobExecutionProperties JobExecutionProperties
10857				err = json.Unmarshal(*v, &jobExecutionProperties)
10858				if err != nil {
10859					return err
10860				}
10861				je.JobExecutionProperties = &jobExecutionProperties
10862			}
10863		case "id":
10864			if v != nil {
10865				var ID string
10866				err = json.Unmarshal(*v, &ID)
10867				if err != nil {
10868					return err
10869				}
10870				je.ID = &ID
10871			}
10872		case "name":
10873			if v != nil {
10874				var name string
10875				err = json.Unmarshal(*v, &name)
10876				if err != nil {
10877					return err
10878				}
10879				je.Name = &name
10880			}
10881		case "type":
10882			if v != nil {
10883				var typeVar string
10884				err = json.Unmarshal(*v, &typeVar)
10885				if err != nil {
10886					return err
10887				}
10888				je.Type = &typeVar
10889			}
10890		}
10891	}
10892
10893	return nil
10894}
10895
10896// JobExecutionListResult a list of job executions.
10897type JobExecutionListResult struct {
10898	autorest.Response `json:"-"`
10899	// Value - READ-ONLY; Array of results.
10900	Value *[]JobExecution `json:"value,omitempty"`
10901	// NextLink - READ-ONLY; Link to retrieve next page of results.
10902	NextLink *string `json:"nextLink,omitempty"`
10903}
10904
10905// MarshalJSON is the custom marshaler for JobExecutionListResult.
10906func (jelr JobExecutionListResult) MarshalJSON() ([]byte, error) {
10907	objectMap := make(map[string]interface{})
10908	return json.Marshal(objectMap)
10909}
10910
10911// JobExecutionListResultIterator provides access to a complete listing of JobExecution values.
10912type JobExecutionListResultIterator struct {
10913	i    int
10914	page JobExecutionListResultPage
10915}
10916
10917// NextWithContext advances to the next value.  If there was an error making
10918// the request the iterator does not advance and the error is returned.
10919func (iter *JobExecutionListResultIterator) NextWithContext(ctx context.Context) (err error) {
10920	if tracing.IsEnabled() {
10921		ctx = tracing.StartSpan(ctx, fqdn+"/JobExecutionListResultIterator.NextWithContext")
10922		defer func() {
10923			sc := -1
10924			if iter.Response().Response.Response != nil {
10925				sc = iter.Response().Response.Response.StatusCode
10926			}
10927			tracing.EndSpan(ctx, sc, err)
10928		}()
10929	}
10930	iter.i++
10931	if iter.i < len(iter.page.Values()) {
10932		return nil
10933	}
10934	err = iter.page.NextWithContext(ctx)
10935	if err != nil {
10936		iter.i--
10937		return err
10938	}
10939	iter.i = 0
10940	return nil
10941}
10942
10943// Next advances to the next value.  If there was an error making
10944// the request the iterator does not advance and the error is returned.
10945// Deprecated: Use NextWithContext() instead.
10946func (iter *JobExecutionListResultIterator) Next() error {
10947	return iter.NextWithContext(context.Background())
10948}
10949
10950// NotDone returns true if the enumeration should be started or is not yet complete.
10951func (iter JobExecutionListResultIterator) NotDone() bool {
10952	return iter.page.NotDone() && iter.i < len(iter.page.Values())
10953}
10954
10955// Response returns the raw server response from the last page request.
10956func (iter JobExecutionListResultIterator) Response() JobExecutionListResult {
10957	return iter.page.Response()
10958}
10959
10960// Value returns the current value or a zero-initialized value if the
10961// iterator has advanced beyond the end of the collection.
10962func (iter JobExecutionListResultIterator) Value() JobExecution {
10963	if !iter.page.NotDone() {
10964		return JobExecution{}
10965	}
10966	return iter.page.Values()[iter.i]
10967}
10968
10969// Creates a new instance of the JobExecutionListResultIterator type.
10970func NewJobExecutionListResultIterator(page JobExecutionListResultPage) JobExecutionListResultIterator {
10971	return JobExecutionListResultIterator{page: page}
10972}
10973
10974// IsEmpty returns true if the ListResult contains no values.
10975func (jelr JobExecutionListResult) IsEmpty() bool {
10976	return jelr.Value == nil || len(*jelr.Value) == 0
10977}
10978
10979// hasNextLink returns true if the NextLink is not empty.
10980func (jelr JobExecutionListResult) hasNextLink() bool {
10981	return jelr.NextLink != nil && len(*jelr.NextLink) != 0
10982}
10983
10984// jobExecutionListResultPreparer prepares a request to retrieve the next set of results.
10985// It returns nil if no more results exist.
10986func (jelr JobExecutionListResult) jobExecutionListResultPreparer(ctx context.Context) (*http.Request, error) {
10987	if !jelr.hasNextLink() {
10988		return nil, nil
10989	}
10990	return autorest.Prepare((&http.Request{}).WithContext(ctx),
10991		autorest.AsJSON(),
10992		autorest.AsGet(),
10993		autorest.WithBaseURL(to.String(jelr.NextLink)))
10994}
10995
10996// JobExecutionListResultPage contains a page of JobExecution values.
10997type JobExecutionListResultPage struct {
10998	fn   func(context.Context, JobExecutionListResult) (JobExecutionListResult, error)
10999	jelr JobExecutionListResult
11000}
11001
11002// NextWithContext advances to the next page of values.  If there was an error making
11003// the request the page does not advance and the error is returned.
11004func (page *JobExecutionListResultPage) NextWithContext(ctx context.Context) (err error) {
11005	if tracing.IsEnabled() {
11006		ctx = tracing.StartSpan(ctx, fqdn+"/JobExecutionListResultPage.NextWithContext")
11007		defer func() {
11008			sc := -1
11009			if page.Response().Response.Response != nil {
11010				sc = page.Response().Response.Response.StatusCode
11011			}
11012			tracing.EndSpan(ctx, sc, err)
11013		}()
11014	}
11015	for {
11016		next, err := page.fn(ctx, page.jelr)
11017		if err != nil {
11018			return err
11019		}
11020		page.jelr = next
11021		if !next.hasNextLink() || !next.IsEmpty() {
11022			break
11023		}
11024	}
11025	return nil
11026}
11027
11028// Next advances to the next page of values.  If there was an error making
11029// the request the page does not advance and the error is returned.
11030// Deprecated: Use NextWithContext() instead.
11031func (page *JobExecutionListResultPage) Next() error {
11032	return page.NextWithContext(context.Background())
11033}
11034
11035// NotDone returns true if the page enumeration should be started or is not yet complete.
11036func (page JobExecutionListResultPage) NotDone() bool {
11037	return !page.jelr.IsEmpty()
11038}
11039
11040// Response returns the raw server response from the last page request.
11041func (page JobExecutionListResultPage) Response() JobExecutionListResult {
11042	return page.jelr
11043}
11044
11045// Values returns the slice of values for the current page or nil if there are no values.
11046func (page JobExecutionListResultPage) Values() []JobExecution {
11047	if page.jelr.IsEmpty() {
11048		return nil
11049	}
11050	return *page.jelr.Value
11051}
11052
11053// Creates a new instance of the JobExecutionListResultPage type.
11054func NewJobExecutionListResultPage(cur JobExecutionListResult, getNextPage func(context.Context, JobExecutionListResult) (JobExecutionListResult, error)) JobExecutionListResultPage {
11055	return JobExecutionListResultPage{
11056		fn:   getNextPage,
11057		jelr: cur,
11058	}
11059}
11060
11061// JobExecutionProperties properties for an Azure SQL Database Elastic job execution.
11062type JobExecutionProperties struct {
11063	// JobVersion - READ-ONLY; The job version number.
11064	JobVersion *int32 `json:"jobVersion,omitempty"`
11065	// StepName - READ-ONLY; The job step name.
11066	StepName *string `json:"stepName,omitempty"`
11067	// StepID - READ-ONLY; The job step id.
11068	StepID *int32 `json:"stepId,omitempty"`
11069	// JobExecutionID - READ-ONLY; The unique identifier of the job execution.
11070	JobExecutionID *uuid.UUID `json:"jobExecutionId,omitempty"`
11071	// Lifecycle - READ-ONLY; The detailed state of the job execution. Possible values include: 'JobExecutionLifecycleCreated', 'JobExecutionLifecycleInProgress', 'JobExecutionLifecycleWaitingForChildJobExecutions', 'JobExecutionLifecycleWaitingForRetry', 'JobExecutionLifecycleSucceeded', 'JobExecutionLifecycleSucceededWithSkipped', 'JobExecutionLifecycleFailed', 'JobExecutionLifecycleTimedOut', 'JobExecutionLifecycleCanceled', 'JobExecutionLifecycleSkipped'
11072	Lifecycle JobExecutionLifecycle `json:"lifecycle,omitempty"`
11073	// ProvisioningState - READ-ONLY; The ARM provisioning state of the job execution. Possible values include: 'ProvisioningStateCreated', 'ProvisioningStateInProgress', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled'
11074	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
11075	// CreateTime - READ-ONLY; The time that the job execution was created.
11076	CreateTime *date.Time `json:"createTime,omitempty"`
11077	// StartTime - READ-ONLY; The time that the job execution started.
11078	StartTime *date.Time `json:"startTime,omitempty"`
11079	// EndTime - READ-ONLY; The time that the job execution completed.
11080	EndTime *date.Time `json:"endTime,omitempty"`
11081	// CurrentAttempts - Number of times the job execution has been attempted.
11082	CurrentAttempts *int32 `json:"currentAttempts,omitempty"`
11083	// CurrentAttemptStartTime - READ-ONLY; Start time of the current attempt.
11084	CurrentAttemptStartTime *date.Time `json:"currentAttemptStartTime,omitempty"`
11085	// LastMessage - READ-ONLY; The last status or error message.
11086	LastMessage *string `json:"lastMessage,omitempty"`
11087	// Target - READ-ONLY; The target that this execution is executed on.
11088	Target *JobExecutionTarget `json:"target,omitempty"`
11089}
11090
11091// MarshalJSON is the custom marshaler for JobExecutionProperties.
11092func (jep JobExecutionProperties) MarshalJSON() ([]byte, error) {
11093	objectMap := make(map[string]interface{})
11094	if jep.CurrentAttempts != nil {
11095		objectMap["currentAttempts"] = jep.CurrentAttempts
11096	}
11097	return json.Marshal(objectMap)
11098}
11099
11100// JobExecutionsCreateFuture an abstraction for monitoring and retrieving the results of a long-running
11101// operation.
11102type JobExecutionsCreateFuture struct {
11103	azure.FutureAPI
11104	// Result returns the result of the asynchronous operation.
11105	// If the operation has not completed it will return an error.
11106	Result func(JobExecutionsClient) (JobExecution, error)
11107}
11108
11109// UnmarshalJSON is the custom unmarshaller for CreateFuture.
11110func (future *JobExecutionsCreateFuture) UnmarshalJSON(body []byte) error {
11111	var azFuture azure.Future
11112	if err := json.Unmarshal(body, &azFuture); err != nil {
11113		return err
11114	}
11115	future.FutureAPI = &azFuture
11116	future.Result = future.result
11117	return nil
11118}
11119
11120// result is the default implementation for JobExecutionsCreateFuture.Result.
11121func (future *JobExecutionsCreateFuture) result(client JobExecutionsClient) (je JobExecution, err error) {
11122	var done bool
11123	done, err = future.DoneWithContext(context.Background(), client)
11124	if err != nil {
11125		err = autorest.NewErrorWithError(err, "sql.JobExecutionsCreateFuture", "Result", future.Response(), "Polling failure")
11126		return
11127	}
11128	if !done {
11129		je.Response.Response = future.Response()
11130		err = azure.NewAsyncOpIncompleteError("sql.JobExecutionsCreateFuture")
11131		return
11132	}
11133	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11134	if je.Response.Response, err = future.GetResult(sender); err == nil && je.Response.Response.StatusCode != http.StatusNoContent {
11135		je, err = client.CreateResponder(je.Response.Response)
11136		if err != nil {
11137			err = autorest.NewErrorWithError(err, "sql.JobExecutionsCreateFuture", "Result", je.Response.Response, "Failure responding to request")
11138		}
11139	}
11140	return
11141}
11142
11143// JobExecutionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
11144// long-running operation.
11145type JobExecutionsCreateOrUpdateFuture struct {
11146	azure.FutureAPI
11147	// Result returns the result of the asynchronous operation.
11148	// If the operation has not completed it will return an error.
11149	Result func(JobExecutionsClient) (JobExecution, error)
11150}
11151
11152// UnmarshalJSON is the custom unmarshaller for CreateFuture.
11153func (future *JobExecutionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
11154	var azFuture azure.Future
11155	if err := json.Unmarshal(body, &azFuture); err != nil {
11156		return err
11157	}
11158	future.FutureAPI = &azFuture
11159	future.Result = future.result
11160	return nil
11161}
11162
11163// result is the default implementation for JobExecutionsCreateOrUpdateFuture.Result.
11164func (future *JobExecutionsCreateOrUpdateFuture) result(client JobExecutionsClient) (je JobExecution, err error) {
11165	var done bool
11166	done, err = future.DoneWithContext(context.Background(), client)
11167	if err != nil {
11168		err = autorest.NewErrorWithError(err, "sql.JobExecutionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
11169		return
11170	}
11171	if !done {
11172		je.Response.Response = future.Response()
11173		err = azure.NewAsyncOpIncompleteError("sql.JobExecutionsCreateOrUpdateFuture")
11174		return
11175	}
11176	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11177	if je.Response.Response, err = future.GetResult(sender); err == nil && je.Response.Response.StatusCode != http.StatusNoContent {
11178		je, err = client.CreateOrUpdateResponder(je.Response.Response)
11179		if err != nil {
11180			err = autorest.NewErrorWithError(err, "sql.JobExecutionsCreateOrUpdateFuture", "Result", je.Response.Response, "Failure responding to request")
11181		}
11182	}
11183	return
11184}
11185
11186// JobExecutionTarget the target that a job execution is executed on.
11187type JobExecutionTarget struct {
11188	// Type - READ-ONLY; The type of the target. Possible values include: 'JobTargetTypeTargetGroup', 'JobTargetTypeSQLDatabase', 'JobTargetTypeSQLElasticPool', 'JobTargetTypeSQLShardMap', 'JobTargetTypeSQLServer'
11189	Type JobTargetType `json:"type,omitempty"`
11190	// ServerName - READ-ONLY; The server name.
11191	ServerName *string `json:"serverName,omitempty"`
11192	// DatabaseName - READ-ONLY; The database name.
11193	DatabaseName *string `json:"databaseName,omitempty"`
11194}
11195
11196// MarshalJSON is the custom marshaler for JobExecutionTarget.
11197func (jet JobExecutionTarget) MarshalJSON() ([]byte, error) {
11198	objectMap := make(map[string]interface{})
11199	return json.Marshal(objectMap)
11200}
11201
11202// JobListResult a list of jobs.
11203type JobListResult struct {
11204	autorest.Response `json:"-"`
11205	// Value - READ-ONLY; Array of results.
11206	Value *[]Job `json:"value,omitempty"`
11207	// NextLink - READ-ONLY; Link to retrieve next page of results.
11208	NextLink *string `json:"nextLink,omitempty"`
11209}
11210
11211// MarshalJSON is the custom marshaler for JobListResult.
11212func (jlr JobListResult) MarshalJSON() ([]byte, error) {
11213	objectMap := make(map[string]interface{})
11214	return json.Marshal(objectMap)
11215}
11216
11217// JobListResultIterator provides access to a complete listing of Job values.
11218type JobListResultIterator struct {
11219	i    int
11220	page JobListResultPage
11221}
11222
11223// NextWithContext advances to the next value.  If there was an error making
11224// the request the iterator does not advance and the error is returned.
11225func (iter *JobListResultIterator) NextWithContext(ctx context.Context) (err error) {
11226	if tracing.IsEnabled() {
11227		ctx = tracing.StartSpan(ctx, fqdn+"/JobListResultIterator.NextWithContext")
11228		defer func() {
11229			sc := -1
11230			if iter.Response().Response.Response != nil {
11231				sc = iter.Response().Response.Response.StatusCode
11232			}
11233			tracing.EndSpan(ctx, sc, err)
11234		}()
11235	}
11236	iter.i++
11237	if iter.i < len(iter.page.Values()) {
11238		return nil
11239	}
11240	err = iter.page.NextWithContext(ctx)
11241	if err != nil {
11242		iter.i--
11243		return err
11244	}
11245	iter.i = 0
11246	return nil
11247}
11248
11249// Next advances to the next value.  If there was an error making
11250// the request the iterator does not advance and the error is returned.
11251// Deprecated: Use NextWithContext() instead.
11252func (iter *JobListResultIterator) Next() error {
11253	return iter.NextWithContext(context.Background())
11254}
11255
11256// NotDone returns true if the enumeration should be started or is not yet complete.
11257func (iter JobListResultIterator) NotDone() bool {
11258	return iter.page.NotDone() && iter.i < len(iter.page.Values())
11259}
11260
11261// Response returns the raw server response from the last page request.
11262func (iter JobListResultIterator) Response() JobListResult {
11263	return iter.page.Response()
11264}
11265
11266// Value returns the current value or a zero-initialized value if the
11267// iterator has advanced beyond the end of the collection.
11268func (iter JobListResultIterator) Value() Job {
11269	if !iter.page.NotDone() {
11270		return Job{}
11271	}
11272	return iter.page.Values()[iter.i]
11273}
11274
11275// Creates a new instance of the JobListResultIterator type.
11276func NewJobListResultIterator(page JobListResultPage) JobListResultIterator {
11277	return JobListResultIterator{page: page}
11278}
11279
11280// IsEmpty returns true if the ListResult contains no values.
11281func (jlr JobListResult) IsEmpty() bool {
11282	return jlr.Value == nil || len(*jlr.Value) == 0
11283}
11284
11285// hasNextLink returns true if the NextLink is not empty.
11286func (jlr JobListResult) hasNextLink() bool {
11287	return jlr.NextLink != nil && len(*jlr.NextLink) != 0
11288}
11289
11290// jobListResultPreparer prepares a request to retrieve the next set of results.
11291// It returns nil if no more results exist.
11292func (jlr JobListResult) jobListResultPreparer(ctx context.Context) (*http.Request, error) {
11293	if !jlr.hasNextLink() {
11294		return nil, nil
11295	}
11296	return autorest.Prepare((&http.Request{}).WithContext(ctx),
11297		autorest.AsJSON(),
11298		autorest.AsGet(),
11299		autorest.WithBaseURL(to.String(jlr.NextLink)))
11300}
11301
11302// JobListResultPage contains a page of Job values.
11303type JobListResultPage struct {
11304	fn  func(context.Context, JobListResult) (JobListResult, error)
11305	jlr JobListResult
11306}
11307
11308// NextWithContext advances to the next page of values.  If there was an error making
11309// the request the page does not advance and the error is returned.
11310func (page *JobListResultPage) NextWithContext(ctx context.Context) (err error) {
11311	if tracing.IsEnabled() {
11312		ctx = tracing.StartSpan(ctx, fqdn+"/JobListResultPage.NextWithContext")
11313		defer func() {
11314			sc := -1
11315			if page.Response().Response.Response != nil {
11316				sc = page.Response().Response.Response.StatusCode
11317			}
11318			tracing.EndSpan(ctx, sc, err)
11319		}()
11320	}
11321	for {
11322		next, err := page.fn(ctx, page.jlr)
11323		if err != nil {
11324			return err
11325		}
11326		page.jlr = next
11327		if !next.hasNextLink() || !next.IsEmpty() {
11328			break
11329		}
11330	}
11331	return nil
11332}
11333
11334// Next advances to the next page of values.  If there was an error making
11335// the request the page does not advance and the error is returned.
11336// Deprecated: Use NextWithContext() instead.
11337func (page *JobListResultPage) Next() error {
11338	return page.NextWithContext(context.Background())
11339}
11340
11341// NotDone returns true if the page enumeration should be started or is not yet complete.
11342func (page JobListResultPage) NotDone() bool {
11343	return !page.jlr.IsEmpty()
11344}
11345
11346// Response returns the raw server response from the last page request.
11347func (page JobListResultPage) Response() JobListResult {
11348	return page.jlr
11349}
11350
11351// Values returns the slice of values for the current page or nil if there are no values.
11352func (page JobListResultPage) Values() []Job {
11353	if page.jlr.IsEmpty() {
11354		return nil
11355	}
11356	return *page.jlr.Value
11357}
11358
11359// Creates a new instance of the JobListResultPage type.
11360func NewJobListResultPage(cur JobListResult, getNextPage func(context.Context, JobListResult) (JobListResult, error)) JobListResultPage {
11361	return JobListResultPage{
11362		fn:  getNextPage,
11363		jlr: cur,
11364	}
11365}
11366
11367// JobProperties properties of a job.
11368type JobProperties struct {
11369	// Description - User-defined description of the job.
11370	Description *string `json:"description,omitempty"`
11371	// Version - READ-ONLY; The job version number.
11372	Version *int32 `json:"version,omitempty"`
11373	// Schedule - Schedule properties of the job.
11374	Schedule *JobSchedule `json:"schedule,omitempty"`
11375}
11376
11377// MarshalJSON is the custom marshaler for JobProperties.
11378func (jp JobProperties) MarshalJSON() ([]byte, error) {
11379	objectMap := make(map[string]interface{})
11380	if jp.Description != nil {
11381		objectMap["description"] = jp.Description
11382	}
11383	if jp.Schedule != nil {
11384		objectMap["schedule"] = jp.Schedule
11385	}
11386	return json.Marshal(objectMap)
11387}
11388
11389// JobSchedule scheduling properties of a job.
11390type JobSchedule struct {
11391	// StartTime - Schedule start time.
11392	StartTime *date.Time `json:"startTime,omitempty"`
11393	// EndTime - Schedule end time.
11394	EndTime *date.Time `json:"endTime,omitempty"`
11395	// Type - Schedule interval type. Possible values include: 'JobScheduleTypeOnce', 'JobScheduleTypeRecurring'
11396	Type JobScheduleType `json:"type,omitempty"`
11397	// Enabled - Whether or not the schedule is enabled.
11398	Enabled *bool `json:"enabled,omitempty"`
11399	// Interval - Value of the schedule's recurring interval, if the ScheduleType is recurring. ISO8601 duration format.
11400	Interval *string `json:"interval,omitempty"`
11401}
11402
11403// JobStep a job step.
11404type JobStep struct {
11405	autorest.Response `json:"-"`
11406	// JobStepProperties - Resource properties.
11407	*JobStepProperties `json:"properties,omitempty"`
11408	// ID - READ-ONLY; Resource ID.
11409	ID *string `json:"id,omitempty"`
11410	// Name - READ-ONLY; Resource name.
11411	Name *string `json:"name,omitempty"`
11412	// Type - READ-ONLY; Resource type.
11413	Type *string `json:"type,omitempty"`
11414}
11415
11416// MarshalJSON is the custom marshaler for JobStep.
11417func (js JobStep) MarshalJSON() ([]byte, error) {
11418	objectMap := make(map[string]interface{})
11419	if js.JobStepProperties != nil {
11420		objectMap["properties"] = js.JobStepProperties
11421	}
11422	return json.Marshal(objectMap)
11423}
11424
11425// UnmarshalJSON is the custom unmarshaler for JobStep struct.
11426func (js *JobStep) UnmarshalJSON(body []byte) error {
11427	var m map[string]*json.RawMessage
11428	err := json.Unmarshal(body, &m)
11429	if err != nil {
11430		return err
11431	}
11432	for k, v := range m {
11433		switch k {
11434		case "properties":
11435			if v != nil {
11436				var jobStepProperties JobStepProperties
11437				err = json.Unmarshal(*v, &jobStepProperties)
11438				if err != nil {
11439					return err
11440				}
11441				js.JobStepProperties = &jobStepProperties
11442			}
11443		case "id":
11444			if v != nil {
11445				var ID string
11446				err = json.Unmarshal(*v, &ID)
11447				if err != nil {
11448					return err
11449				}
11450				js.ID = &ID
11451			}
11452		case "name":
11453			if v != nil {
11454				var name string
11455				err = json.Unmarshal(*v, &name)
11456				if err != nil {
11457					return err
11458				}
11459				js.Name = &name
11460			}
11461		case "type":
11462			if v != nil {
11463				var typeVar string
11464				err = json.Unmarshal(*v, &typeVar)
11465				if err != nil {
11466					return err
11467				}
11468				js.Type = &typeVar
11469			}
11470		}
11471	}
11472
11473	return nil
11474}
11475
11476// JobStepAction the action to be executed by a job step.
11477type JobStepAction struct {
11478	// Type - Type of action being executed by the job step. Possible values include: 'JobStepActionTypeTSQL'
11479	Type JobStepActionType `json:"type,omitempty"`
11480	// Source - The source of the action to execute. Possible values include: 'JobStepActionSourceInline'
11481	Source JobStepActionSource `json:"source,omitempty"`
11482	// Value - The action value, for example the text of the T-SQL script to execute.
11483	Value *string `json:"value,omitempty"`
11484}
11485
11486// JobStepExecutionOptions the execution options of a job step.
11487type JobStepExecutionOptions struct {
11488	// TimeoutSeconds - Execution timeout for the job step.
11489	TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"`
11490	// RetryAttempts - Maximum number of times the job step will be reattempted if the first attempt fails.
11491	RetryAttempts *int32 `json:"retryAttempts,omitempty"`
11492	// InitialRetryIntervalSeconds - Initial delay between retries for job step execution.
11493	InitialRetryIntervalSeconds *int32 `json:"initialRetryIntervalSeconds,omitempty"`
11494	// MaximumRetryIntervalSeconds - The maximum amount of time to wait between retries for job step execution.
11495	MaximumRetryIntervalSeconds *int32 `json:"maximumRetryIntervalSeconds,omitempty"`
11496	// RetryIntervalBackoffMultiplier - The backoff multiplier for the time between retries.
11497	RetryIntervalBackoffMultiplier *float64 `json:"retryIntervalBackoffMultiplier,omitempty"`
11498}
11499
11500// JobStepListResult a list of job steps.
11501type JobStepListResult struct {
11502	autorest.Response `json:"-"`
11503	// Value - READ-ONLY; Array of results.
11504	Value *[]JobStep `json:"value,omitempty"`
11505	// NextLink - READ-ONLY; Link to retrieve next page of results.
11506	NextLink *string `json:"nextLink,omitempty"`
11507}
11508
11509// MarshalJSON is the custom marshaler for JobStepListResult.
11510func (jslr JobStepListResult) MarshalJSON() ([]byte, error) {
11511	objectMap := make(map[string]interface{})
11512	return json.Marshal(objectMap)
11513}
11514
11515// JobStepListResultIterator provides access to a complete listing of JobStep values.
11516type JobStepListResultIterator struct {
11517	i    int
11518	page JobStepListResultPage
11519}
11520
11521// NextWithContext advances to the next value.  If there was an error making
11522// the request the iterator does not advance and the error is returned.
11523func (iter *JobStepListResultIterator) NextWithContext(ctx context.Context) (err error) {
11524	if tracing.IsEnabled() {
11525		ctx = tracing.StartSpan(ctx, fqdn+"/JobStepListResultIterator.NextWithContext")
11526		defer func() {
11527			sc := -1
11528			if iter.Response().Response.Response != nil {
11529				sc = iter.Response().Response.Response.StatusCode
11530			}
11531			tracing.EndSpan(ctx, sc, err)
11532		}()
11533	}
11534	iter.i++
11535	if iter.i < len(iter.page.Values()) {
11536		return nil
11537	}
11538	err = iter.page.NextWithContext(ctx)
11539	if err != nil {
11540		iter.i--
11541		return err
11542	}
11543	iter.i = 0
11544	return nil
11545}
11546
11547// Next advances to the next value.  If there was an error making
11548// the request the iterator does not advance and the error is returned.
11549// Deprecated: Use NextWithContext() instead.
11550func (iter *JobStepListResultIterator) Next() error {
11551	return iter.NextWithContext(context.Background())
11552}
11553
11554// NotDone returns true if the enumeration should be started or is not yet complete.
11555func (iter JobStepListResultIterator) NotDone() bool {
11556	return iter.page.NotDone() && iter.i < len(iter.page.Values())
11557}
11558
11559// Response returns the raw server response from the last page request.
11560func (iter JobStepListResultIterator) Response() JobStepListResult {
11561	return iter.page.Response()
11562}
11563
11564// Value returns the current value or a zero-initialized value if the
11565// iterator has advanced beyond the end of the collection.
11566func (iter JobStepListResultIterator) Value() JobStep {
11567	if !iter.page.NotDone() {
11568		return JobStep{}
11569	}
11570	return iter.page.Values()[iter.i]
11571}
11572
11573// Creates a new instance of the JobStepListResultIterator type.
11574func NewJobStepListResultIterator(page JobStepListResultPage) JobStepListResultIterator {
11575	return JobStepListResultIterator{page: page}
11576}
11577
11578// IsEmpty returns true if the ListResult contains no values.
11579func (jslr JobStepListResult) IsEmpty() bool {
11580	return jslr.Value == nil || len(*jslr.Value) == 0
11581}
11582
11583// hasNextLink returns true if the NextLink is not empty.
11584func (jslr JobStepListResult) hasNextLink() bool {
11585	return jslr.NextLink != nil && len(*jslr.NextLink) != 0
11586}
11587
11588// jobStepListResultPreparer prepares a request to retrieve the next set of results.
11589// It returns nil if no more results exist.
11590func (jslr JobStepListResult) jobStepListResultPreparer(ctx context.Context) (*http.Request, error) {
11591	if !jslr.hasNextLink() {
11592		return nil, nil
11593	}
11594	return autorest.Prepare((&http.Request{}).WithContext(ctx),
11595		autorest.AsJSON(),
11596		autorest.AsGet(),
11597		autorest.WithBaseURL(to.String(jslr.NextLink)))
11598}
11599
11600// JobStepListResultPage contains a page of JobStep values.
11601type JobStepListResultPage struct {
11602	fn   func(context.Context, JobStepListResult) (JobStepListResult, error)
11603	jslr JobStepListResult
11604}
11605
11606// NextWithContext advances to the next page of values.  If there was an error making
11607// the request the page does not advance and the error is returned.
11608func (page *JobStepListResultPage) NextWithContext(ctx context.Context) (err error) {
11609	if tracing.IsEnabled() {
11610		ctx = tracing.StartSpan(ctx, fqdn+"/JobStepListResultPage.NextWithContext")
11611		defer func() {
11612			sc := -1
11613			if page.Response().Response.Response != nil {
11614				sc = page.Response().Response.Response.StatusCode
11615			}
11616			tracing.EndSpan(ctx, sc, err)
11617		}()
11618	}
11619	for {
11620		next, err := page.fn(ctx, page.jslr)
11621		if err != nil {
11622			return err
11623		}
11624		page.jslr = next
11625		if !next.hasNextLink() || !next.IsEmpty() {
11626			break
11627		}
11628	}
11629	return nil
11630}
11631
11632// Next advances to the next page of values.  If there was an error making
11633// the request the page does not advance and the error is returned.
11634// Deprecated: Use NextWithContext() instead.
11635func (page *JobStepListResultPage) Next() error {
11636	return page.NextWithContext(context.Background())
11637}
11638
11639// NotDone returns true if the page enumeration should be started or is not yet complete.
11640func (page JobStepListResultPage) NotDone() bool {
11641	return !page.jslr.IsEmpty()
11642}
11643
11644// Response returns the raw server response from the last page request.
11645func (page JobStepListResultPage) Response() JobStepListResult {
11646	return page.jslr
11647}
11648
11649// Values returns the slice of values for the current page or nil if there are no values.
11650func (page JobStepListResultPage) Values() []JobStep {
11651	if page.jslr.IsEmpty() {
11652		return nil
11653	}
11654	return *page.jslr.Value
11655}
11656
11657// Creates a new instance of the JobStepListResultPage type.
11658func NewJobStepListResultPage(cur JobStepListResult, getNextPage func(context.Context, JobStepListResult) (JobStepListResult, error)) JobStepListResultPage {
11659	return JobStepListResultPage{
11660		fn:   getNextPage,
11661		jslr: cur,
11662	}
11663}
11664
11665// JobStepOutput the output configuration of a job step.
11666type JobStepOutput struct {
11667	// Type - The output destination type. Possible values include: 'JobStepOutputTypeSQLDatabase'
11668	Type JobStepOutputType `json:"type,omitempty"`
11669	// SubscriptionID - The output destination subscription id.
11670	SubscriptionID *uuid.UUID `json:"subscriptionId,omitempty"`
11671	// ResourceGroupName - The output destination resource group.
11672	ResourceGroupName *string `json:"resourceGroupName,omitempty"`
11673	// ServerName - The output destination server name.
11674	ServerName *string `json:"serverName,omitempty"`
11675	// DatabaseName - The output destination database.
11676	DatabaseName *string `json:"databaseName,omitempty"`
11677	// SchemaName - The output destination schema.
11678	SchemaName *string `json:"schemaName,omitempty"`
11679	// TableName - The output destination table.
11680	TableName *string `json:"tableName,omitempty"`
11681	// Credential - The resource ID of the credential to use to connect to the output destination.
11682	Credential *string `json:"credential,omitempty"`
11683}
11684
11685// JobStepProperties properties of a job step.
11686type JobStepProperties struct {
11687	// 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.
11688	StepID *int32 `json:"stepId,omitempty"`
11689	// TargetGroup - The resource ID of the target group that the job step will be executed on.
11690	TargetGroup *string `json:"targetGroup,omitempty"`
11691	// Credential - The resource ID of the job credential that will be used to connect to the targets.
11692	Credential *string `json:"credential,omitempty"`
11693	// Action - The action payload of the job step.
11694	Action *JobStepAction `json:"action,omitempty"`
11695	// Output - Output destination properties of the job step.
11696	Output *JobStepOutput `json:"output,omitempty"`
11697	// ExecutionOptions - Execution options for the job step.
11698	ExecutionOptions *JobStepExecutionOptions `json:"executionOptions,omitempty"`
11699}
11700
11701// JobTarget a job target, for example a specific database or a container of databases that is evaluated
11702// during job execution.
11703type JobTarget struct {
11704	// MembershipType - Whether the target is included or excluded from the group. Possible values include: 'JobTargetGroupMembershipTypeInclude', 'JobTargetGroupMembershipTypeExclude'
11705	MembershipType JobTargetGroupMembershipType `json:"membershipType,omitempty"`
11706	// Type - The target type. Possible values include: 'JobTargetTypeTargetGroup', 'JobTargetTypeSQLDatabase', 'JobTargetTypeSQLElasticPool', 'JobTargetTypeSQLShardMap', 'JobTargetTypeSQLServer'
11707	Type JobTargetType `json:"type,omitempty"`
11708	// ServerName - The target server name.
11709	ServerName *string `json:"serverName,omitempty"`
11710	// DatabaseName - The target database name.
11711	DatabaseName *string `json:"databaseName,omitempty"`
11712	// ElasticPoolName - The target elastic pool name.
11713	ElasticPoolName *string `json:"elasticPoolName,omitempty"`
11714	// ShardMapName - The target shard map.
11715	ShardMapName *string `json:"shardMapName,omitempty"`
11716	// 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.
11717	RefreshCredential *string `json:"refreshCredential,omitempty"`
11718}
11719
11720// JobTargetGroup a group of job targets.
11721type JobTargetGroup struct {
11722	autorest.Response `json:"-"`
11723	// JobTargetGroupProperties - Resource properties.
11724	*JobTargetGroupProperties `json:"properties,omitempty"`
11725	// ID - READ-ONLY; Resource ID.
11726	ID *string `json:"id,omitempty"`
11727	// Name - READ-ONLY; Resource name.
11728	Name *string `json:"name,omitempty"`
11729	// Type - READ-ONLY; Resource type.
11730	Type *string `json:"type,omitempty"`
11731}
11732
11733// MarshalJSON is the custom marshaler for JobTargetGroup.
11734func (jtg JobTargetGroup) MarshalJSON() ([]byte, error) {
11735	objectMap := make(map[string]interface{})
11736	if jtg.JobTargetGroupProperties != nil {
11737		objectMap["properties"] = jtg.JobTargetGroupProperties
11738	}
11739	return json.Marshal(objectMap)
11740}
11741
11742// UnmarshalJSON is the custom unmarshaler for JobTargetGroup struct.
11743func (jtg *JobTargetGroup) UnmarshalJSON(body []byte) error {
11744	var m map[string]*json.RawMessage
11745	err := json.Unmarshal(body, &m)
11746	if err != nil {
11747		return err
11748	}
11749	for k, v := range m {
11750		switch k {
11751		case "properties":
11752			if v != nil {
11753				var jobTargetGroupProperties JobTargetGroupProperties
11754				err = json.Unmarshal(*v, &jobTargetGroupProperties)
11755				if err != nil {
11756					return err
11757				}
11758				jtg.JobTargetGroupProperties = &jobTargetGroupProperties
11759			}
11760		case "id":
11761			if v != nil {
11762				var ID string
11763				err = json.Unmarshal(*v, &ID)
11764				if err != nil {
11765					return err
11766				}
11767				jtg.ID = &ID
11768			}
11769		case "name":
11770			if v != nil {
11771				var name string
11772				err = json.Unmarshal(*v, &name)
11773				if err != nil {
11774					return err
11775				}
11776				jtg.Name = &name
11777			}
11778		case "type":
11779			if v != nil {
11780				var typeVar string
11781				err = json.Unmarshal(*v, &typeVar)
11782				if err != nil {
11783					return err
11784				}
11785				jtg.Type = &typeVar
11786			}
11787		}
11788	}
11789
11790	return nil
11791}
11792
11793// JobTargetGroupListResult a list of target groups.
11794type JobTargetGroupListResult struct {
11795	autorest.Response `json:"-"`
11796	// Value - READ-ONLY; Array of results.
11797	Value *[]JobTargetGroup `json:"value,omitempty"`
11798	// NextLink - READ-ONLY; Link to retrieve next page of results.
11799	NextLink *string `json:"nextLink,omitempty"`
11800}
11801
11802// MarshalJSON is the custom marshaler for JobTargetGroupListResult.
11803func (jtglr JobTargetGroupListResult) MarshalJSON() ([]byte, error) {
11804	objectMap := make(map[string]interface{})
11805	return json.Marshal(objectMap)
11806}
11807
11808// JobTargetGroupListResultIterator provides access to a complete listing of JobTargetGroup values.
11809type JobTargetGroupListResultIterator struct {
11810	i    int
11811	page JobTargetGroupListResultPage
11812}
11813
11814// NextWithContext advances to the next value.  If there was an error making
11815// the request the iterator does not advance and the error is returned.
11816func (iter *JobTargetGroupListResultIterator) NextWithContext(ctx context.Context) (err error) {
11817	if tracing.IsEnabled() {
11818		ctx = tracing.StartSpan(ctx, fqdn+"/JobTargetGroupListResultIterator.NextWithContext")
11819		defer func() {
11820			sc := -1
11821			if iter.Response().Response.Response != nil {
11822				sc = iter.Response().Response.Response.StatusCode
11823			}
11824			tracing.EndSpan(ctx, sc, err)
11825		}()
11826	}
11827	iter.i++
11828	if iter.i < len(iter.page.Values()) {
11829		return nil
11830	}
11831	err = iter.page.NextWithContext(ctx)
11832	if err != nil {
11833		iter.i--
11834		return err
11835	}
11836	iter.i = 0
11837	return nil
11838}
11839
11840// Next advances to the next value.  If there was an error making
11841// the request the iterator does not advance and the error is returned.
11842// Deprecated: Use NextWithContext() instead.
11843func (iter *JobTargetGroupListResultIterator) Next() error {
11844	return iter.NextWithContext(context.Background())
11845}
11846
11847// NotDone returns true if the enumeration should be started or is not yet complete.
11848func (iter JobTargetGroupListResultIterator) NotDone() bool {
11849	return iter.page.NotDone() && iter.i < len(iter.page.Values())
11850}
11851
11852// Response returns the raw server response from the last page request.
11853func (iter JobTargetGroupListResultIterator) Response() JobTargetGroupListResult {
11854	return iter.page.Response()
11855}
11856
11857// Value returns the current value or a zero-initialized value if the
11858// iterator has advanced beyond the end of the collection.
11859func (iter JobTargetGroupListResultIterator) Value() JobTargetGroup {
11860	if !iter.page.NotDone() {
11861		return JobTargetGroup{}
11862	}
11863	return iter.page.Values()[iter.i]
11864}
11865
11866// Creates a new instance of the JobTargetGroupListResultIterator type.
11867func NewJobTargetGroupListResultIterator(page JobTargetGroupListResultPage) JobTargetGroupListResultIterator {
11868	return JobTargetGroupListResultIterator{page: page}
11869}
11870
11871// IsEmpty returns true if the ListResult contains no values.
11872func (jtglr JobTargetGroupListResult) IsEmpty() bool {
11873	return jtglr.Value == nil || len(*jtglr.Value) == 0
11874}
11875
11876// hasNextLink returns true if the NextLink is not empty.
11877func (jtglr JobTargetGroupListResult) hasNextLink() bool {
11878	return jtglr.NextLink != nil && len(*jtglr.NextLink) != 0
11879}
11880
11881// jobTargetGroupListResultPreparer prepares a request to retrieve the next set of results.
11882// It returns nil if no more results exist.
11883func (jtglr JobTargetGroupListResult) jobTargetGroupListResultPreparer(ctx context.Context) (*http.Request, error) {
11884	if !jtglr.hasNextLink() {
11885		return nil, nil
11886	}
11887	return autorest.Prepare((&http.Request{}).WithContext(ctx),
11888		autorest.AsJSON(),
11889		autorest.AsGet(),
11890		autorest.WithBaseURL(to.String(jtglr.NextLink)))
11891}
11892
11893// JobTargetGroupListResultPage contains a page of JobTargetGroup values.
11894type JobTargetGroupListResultPage struct {
11895	fn    func(context.Context, JobTargetGroupListResult) (JobTargetGroupListResult, error)
11896	jtglr JobTargetGroupListResult
11897}
11898
11899// NextWithContext advances to the next page of values.  If there was an error making
11900// the request the page does not advance and the error is returned.
11901func (page *JobTargetGroupListResultPage) NextWithContext(ctx context.Context) (err error) {
11902	if tracing.IsEnabled() {
11903		ctx = tracing.StartSpan(ctx, fqdn+"/JobTargetGroupListResultPage.NextWithContext")
11904		defer func() {
11905			sc := -1
11906			if page.Response().Response.Response != nil {
11907				sc = page.Response().Response.Response.StatusCode
11908			}
11909			tracing.EndSpan(ctx, sc, err)
11910		}()
11911	}
11912	for {
11913		next, err := page.fn(ctx, page.jtglr)
11914		if err != nil {
11915			return err
11916		}
11917		page.jtglr = next
11918		if !next.hasNextLink() || !next.IsEmpty() {
11919			break
11920		}
11921	}
11922	return nil
11923}
11924
11925// Next advances to the next page of values.  If there was an error making
11926// the request the page does not advance and the error is returned.
11927// Deprecated: Use NextWithContext() instead.
11928func (page *JobTargetGroupListResultPage) Next() error {
11929	return page.NextWithContext(context.Background())
11930}
11931
11932// NotDone returns true if the page enumeration should be started or is not yet complete.
11933func (page JobTargetGroupListResultPage) NotDone() bool {
11934	return !page.jtglr.IsEmpty()
11935}
11936
11937// Response returns the raw server response from the last page request.
11938func (page JobTargetGroupListResultPage) Response() JobTargetGroupListResult {
11939	return page.jtglr
11940}
11941
11942// Values returns the slice of values for the current page or nil if there are no values.
11943func (page JobTargetGroupListResultPage) Values() []JobTargetGroup {
11944	if page.jtglr.IsEmpty() {
11945		return nil
11946	}
11947	return *page.jtglr.Value
11948}
11949
11950// Creates a new instance of the JobTargetGroupListResultPage type.
11951func NewJobTargetGroupListResultPage(cur JobTargetGroupListResult, getNextPage func(context.Context, JobTargetGroupListResult) (JobTargetGroupListResult, error)) JobTargetGroupListResultPage {
11952	return JobTargetGroupListResultPage{
11953		fn:    getNextPage,
11954		jtglr: cur,
11955	}
11956}
11957
11958// JobTargetGroupProperties properties of job target group.
11959type JobTargetGroupProperties struct {
11960	// Members - Members of the target group.
11961	Members *[]JobTarget `json:"members,omitempty"`
11962}
11963
11964// JobVersion a job version.
11965type JobVersion struct {
11966	autorest.Response `json:"-"`
11967	// ID - READ-ONLY; Resource ID.
11968	ID *string `json:"id,omitempty"`
11969	// Name - READ-ONLY; Resource name.
11970	Name *string `json:"name,omitempty"`
11971	// Type - READ-ONLY; Resource type.
11972	Type *string `json:"type,omitempty"`
11973}
11974
11975// MarshalJSON is the custom marshaler for JobVersion.
11976func (jv JobVersion) MarshalJSON() ([]byte, error) {
11977	objectMap := make(map[string]interface{})
11978	return json.Marshal(objectMap)
11979}
11980
11981// JobVersionListResult a list of job versions.
11982type JobVersionListResult struct {
11983	autorest.Response `json:"-"`
11984	// Value - READ-ONLY; Array of results.
11985	Value *[]JobVersion `json:"value,omitempty"`
11986	// NextLink - READ-ONLY; Link to retrieve next page of results.
11987	NextLink *string `json:"nextLink,omitempty"`
11988}
11989
11990// MarshalJSON is the custom marshaler for JobVersionListResult.
11991func (jvlr JobVersionListResult) MarshalJSON() ([]byte, error) {
11992	objectMap := make(map[string]interface{})
11993	return json.Marshal(objectMap)
11994}
11995
11996// JobVersionListResultIterator provides access to a complete listing of JobVersion values.
11997type JobVersionListResultIterator struct {
11998	i    int
11999	page JobVersionListResultPage
12000}
12001
12002// NextWithContext advances to the next value.  If there was an error making
12003// the request the iterator does not advance and the error is returned.
12004func (iter *JobVersionListResultIterator) NextWithContext(ctx context.Context) (err error) {
12005	if tracing.IsEnabled() {
12006		ctx = tracing.StartSpan(ctx, fqdn+"/JobVersionListResultIterator.NextWithContext")
12007		defer func() {
12008			sc := -1
12009			if iter.Response().Response.Response != nil {
12010				sc = iter.Response().Response.Response.StatusCode
12011			}
12012			tracing.EndSpan(ctx, sc, err)
12013		}()
12014	}
12015	iter.i++
12016	if iter.i < len(iter.page.Values()) {
12017		return nil
12018	}
12019	err = iter.page.NextWithContext(ctx)
12020	if err != nil {
12021		iter.i--
12022		return err
12023	}
12024	iter.i = 0
12025	return nil
12026}
12027
12028// Next advances to the next value.  If there was an error making
12029// the request the iterator does not advance and the error is returned.
12030// Deprecated: Use NextWithContext() instead.
12031func (iter *JobVersionListResultIterator) Next() error {
12032	return iter.NextWithContext(context.Background())
12033}
12034
12035// NotDone returns true if the enumeration should be started or is not yet complete.
12036func (iter JobVersionListResultIterator) NotDone() bool {
12037	return iter.page.NotDone() && iter.i < len(iter.page.Values())
12038}
12039
12040// Response returns the raw server response from the last page request.
12041func (iter JobVersionListResultIterator) Response() JobVersionListResult {
12042	return iter.page.Response()
12043}
12044
12045// Value returns the current value or a zero-initialized value if the
12046// iterator has advanced beyond the end of the collection.
12047func (iter JobVersionListResultIterator) Value() JobVersion {
12048	if !iter.page.NotDone() {
12049		return JobVersion{}
12050	}
12051	return iter.page.Values()[iter.i]
12052}
12053
12054// Creates a new instance of the JobVersionListResultIterator type.
12055func NewJobVersionListResultIterator(page JobVersionListResultPage) JobVersionListResultIterator {
12056	return JobVersionListResultIterator{page: page}
12057}
12058
12059// IsEmpty returns true if the ListResult contains no values.
12060func (jvlr JobVersionListResult) IsEmpty() bool {
12061	return jvlr.Value == nil || len(*jvlr.Value) == 0
12062}
12063
12064// hasNextLink returns true if the NextLink is not empty.
12065func (jvlr JobVersionListResult) hasNextLink() bool {
12066	return jvlr.NextLink != nil && len(*jvlr.NextLink) != 0
12067}
12068
12069// jobVersionListResultPreparer prepares a request to retrieve the next set of results.
12070// It returns nil if no more results exist.
12071func (jvlr JobVersionListResult) jobVersionListResultPreparer(ctx context.Context) (*http.Request, error) {
12072	if !jvlr.hasNextLink() {
12073		return nil, nil
12074	}
12075	return autorest.Prepare((&http.Request{}).WithContext(ctx),
12076		autorest.AsJSON(),
12077		autorest.AsGet(),
12078		autorest.WithBaseURL(to.String(jvlr.NextLink)))
12079}
12080
12081// JobVersionListResultPage contains a page of JobVersion values.
12082type JobVersionListResultPage struct {
12083	fn   func(context.Context, JobVersionListResult) (JobVersionListResult, error)
12084	jvlr JobVersionListResult
12085}
12086
12087// NextWithContext advances to the next page of values.  If there was an error making
12088// the request the page does not advance and the error is returned.
12089func (page *JobVersionListResultPage) NextWithContext(ctx context.Context) (err error) {
12090	if tracing.IsEnabled() {
12091		ctx = tracing.StartSpan(ctx, fqdn+"/JobVersionListResultPage.NextWithContext")
12092		defer func() {
12093			sc := -1
12094			if page.Response().Response.Response != nil {
12095				sc = page.Response().Response.Response.StatusCode
12096			}
12097			tracing.EndSpan(ctx, sc, err)
12098		}()
12099	}
12100	for {
12101		next, err := page.fn(ctx, page.jvlr)
12102		if err != nil {
12103			return err
12104		}
12105		page.jvlr = next
12106		if !next.hasNextLink() || !next.IsEmpty() {
12107			break
12108		}
12109	}
12110	return nil
12111}
12112
12113// Next advances to the next page of values.  If there was an error making
12114// the request the page does not advance and the error is returned.
12115// Deprecated: Use NextWithContext() instead.
12116func (page *JobVersionListResultPage) Next() error {
12117	return page.NextWithContext(context.Background())
12118}
12119
12120// NotDone returns true if the page enumeration should be started or is not yet complete.
12121func (page JobVersionListResultPage) NotDone() bool {
12122	return !page.jvlr.IsEmpty()
12123}
12124
12125// Response returns the raw server response from the last page request.
12126func (page JobVersionListResultPage) Response() JobVersionListResult {
12127	return page.jvlr
12128}
12129
12130// Values returns the slice of values for the current page or nil if there are no values.
12131func (page JobVersionListResultPage) Values() []JobVersion {
12132	if page.jvlr.IsEmpty() {
12133		return nil
12134	}
12135	return *page.jvlr.Value
12136}
12137
12138// Creates a new instance of the JobVersionListResultPage type.
12139func NewJobVersionListResultPage(cur JobVersionListResult, getNextPage func(context.Context, JobVersionListResult) (JobVersionListResult, error)) JobVersionListResultPage {
12140	return JobVersionListResultPage{
12141		fn:   getNextPage,
12142		jvlr: cur,
12143	}
12144}
12145
12146// LedgerDigestUploads azure SQL Database ledger digest upload settings.
12147type LedgerDigestUploads struct {
12148	autorest.Response `json:"-"`
12149	// LedgerDigestUploadsProperties - Resource properties.
12150	*LedgerDigestUploadsProperties `json:"properties,omitempty"`
12151	// ID - READ-ONLY; Resource ID.
12152	ID *string `json:"id,omitempty"`
12153	// Name - READ-ONLY; Resource name.
12154	Name *string `json:"name,omitempty"`
12155	// Type - READ-ONLY; Resource type.
12156	Type *string `json:"type,omitempty"`
12157}
12158
12159// MarshalJSON is the custom marshaler for LedgerDigestUploads.
12160func (ldu LedgerDigestUploads) MarshalJSON() ([]byte, error) {
12161	objectMap := make(map[string]interface{})
12162	if ldu.LedgerDigestUploadsProperties != nil {
12163		objectMap["properties"] = ldu.LedgerDigestUploadsProperties
12164	}
12165	return json.Marshal(objectMap)
12166}
12167
12168// UnmarshalJSON is the custom unmarshaler for LedgerDigestUploads struct.
12169func (ldu *LedgerDigestUploads) UnmarshalJSON(body []byte) error {
12170	var m map[string]*json.RawMessage
12171	err := json.Unmarshal(body, &m)
12172	if err != nil {
12173		return err
12174	}
12175	for k, v := range m {
12176		switch k {
12177		case "properties":
12178			if v != nil {
12179				var ledgerDigestUploadsProperties LedgerDigestUploadsProperties
12180				err = json.Unmarshal(*v, &ledgerDigestUploadsProperties)
12181				if err != nil {
12182					return err
12183				}
12184				ldu.LedgerDigestUploadsProperties = &ledgerDigestUploadsProperties
12185			}
12186		case "id":
12187			if v != nil {
12188				var ID string
12189				err = json.Unmarshal(*v, &ID)
12190				if err != nil {
12191					return err
12192				}
12193				ldu.ID = &ID
12194			}
12195		case "name":
12196			if v != nil {
12197				var name string
12198				err = json.Unmarshal(*v, &name)
12199				if err != nil {
12200					return err
12201				}
12202				ldu.Name = &name
12203			}
12204		case "type":
12205			if v != nil {
12206				var typeVar string
12207				err = json.Unmarshal(*v, &typeVar)
12208				if err != nil {
12209					return err
12210				}
12211				ldu.Type = &typeVar
12212			}
12213		}
12214	}
12215
12216	return nil
12217}
12218
12219// LedgerDigestUploadsListResult a list of ledger digest upload settings.
12220type LedgerDigestUploadsListResult struct {
12221	autorest.Response `json:"-"`
12222	// Value - READ-ONLY; Array of results.
12223	Value *[]LedgerDigestUploads `json:"value,omitempty"`
12224	// NextLink - READ-ONLY; Link to retrieve next page of results.
12225	NextLink *string `json:"nextLink,omitempty"`
12226}
12227
12228// MarshalJSON is the custom marshaler for LedgerDigestUploadsListResult.
12229func (ldulr LedgerDigestUploadsListResult) MarshalJSON() ([]byte, error) {
12230	objectMap := make(map[string]interface{})
12231	return json.Marshal(objectMap)
12232}
12233
12234// LedgerDigestUploadsListResultIterator provides access to a complete listing of LedgerDigestUploads
12235// values.
12236type LedgerDigestUploadsListResultIterator struct {
12237	i    int
12238	page LedgerDigestUploadsListResultPage
12239}
12240
12241// NextWithContext advances to the next value.  If there was an error making
12242// the request the iterator does not advance and the error is returned.
12243func (iter *LedgerDigestUploadsListResultIterator) NextWithContext(ctx context.Context) (err error) {
12244	if tracing.IsEnabled() {
12245		ctx = tracing.StartSpan(ctx, fqdn+"/LedgerDigestUploadsListResultIterator.NextWithContext")
12246		defer func() {
12247			sc := -1
12248			if iter.Response().Response.Response != nil {
12249				sc = iter.Response().Response.Response.StatusCode
12250			}
12251			tracing.EndSpan(ctx, sc, err)
12252		}()
12253	}
12254	iter.i++
12255	if iter.i < len(iter.page.Values()) {
12256		return nil
12257	}
12258	err = iter.page.NextWithContext(ctx)
12259	if err != nil {
12260		iter.i--
12261		return err
12262	}
12263	iter.i = 0
12264	return nil
12265}
12266
12267// Next advances to the next value.  If there was an error making
12268// the request the iterator does not advance and the error is returned.
12269// Deprecated: Use NextWithContext() instead.
12270func (iter *LedgerDigestUploadsListResultIterator) Next() error {
12271	return iter.NextWithContext(context.Background())
12272}
12273
12274// NotDone returns true if the enumeration should be started or is not yet complete.
12275func (iter LedgerDigestUploadsListResultIterator) NotDone() bool {
12276	return iter.page.NotDone() && iter.i < len(iter.page.Values())
12277}
12278
12279// Response returns the raw server response from the last page request.
12280func (iter LedgerDigestUploadsListResultIterator) Response() LedgerDigestUploadsListResult {
12281	return iter.page.Response()
12282}
12283
12284// Value returns the current value or a zero-initialized value if the
12285// iterator has advanced beyond the end of the collection.
12286func (iter LedgerDigestUploadsListResultIterator) Value() LedgerDigestUploads {
12287	if !iter.page.NotDone() {
12288		return LedgerDigestUploads{}
12289	}
12290	return iter.page.Values()[iter.i]
12291}
12292
12293// Creates a new instance of the LedgerDigestUploadsListResultIterator type.
12294func NewLedgerDigestUploadsListResultIterator(page LedgerDigestUploadsListResultPage) LedgerDigestUploadsListResultIterator {
12295	return LedgerDigestUploadsListResultIterator{page: page}
12296}
12297
12298// IsEmpty returns true if the ListResult contains no values.
12299func (ldulr LedgerDigestUploadsListResult) IsEmpty() bool {
12300	return ldulr.Value == nil || len(*ldulr.Value) == 0
12301}
12302
12303// hasNextLink returns true if the NextLink is not empty.
12304func (ldulr LedgerDigestUploadsListResult) hasNextLink() bool {
12305	return ldulr.NextLink != nil && len(*ldulr.NextLink) != 0
12306}
12307
12308// ledgerDigestUploadsListResultPreparer prepares a request to retrieve the next set of results.
12309// It returns nil if no more results exist.
12310func (ldulr LedgerDigestUploadsListResult) ledgerDigestUploadsListResultPreparer(ctx context.Context) (*http.Request, error) {
12311	if !ldulr.hasNextLink() {
12312		return nil, nil
12313	}
12314	return autorest.Prepare((&http.Request{}).WithContext(ctx),
12315		autorest.AsJSON(),
12316		autorest.AsGet(),
12317		autorest.WithBaseURL(to.String(ldulr.NextLink)))
12318}
12319
12320// LedgerDigestUploadsListResultPage contains a page of LedgerDigestUploads values.
12321type LedgerDigestUploadsListResultPage struct {
12322	fn    func(context.Context, LedgerDigestUploadsListResult) (LedgerDigestUploadsListResult, error)
12323	ldulr LedgerDigestUploadsListResult
12324}
12325
12326// NextWithContext advances to the next page of values.  If there was an error making
12327// the request the page does not advance and the error is returned.
12328func (page *LedgerDigestUploadsListResultPage) NextWithContext(ctx context.Context) (err error) {
12329	if tracing.IsEnabled() {
12330		ctx = tracing.StartSpan(ctx, fqdn+"/LedgerDigestUploadsListResultPage.NextWithContext")
12331		defer func() {
12332			sc := -1
12333			if page.Response().Response.Response != nil {
12334				sc = page.Response().Response.Response.StatusCode
12335			}
12336			tracing.EndSpan(ctx, sc, err)
12337		}()
12338	}
12339	for {
12340		next, err := page.fn(ctx, page.ldulr)
12341		if err != nil {
12342			return err
12343		}
12344		page.ldulr = next
12345		if !next.hasNextLink() || !next.IsEmpty() {
12346			break
12347		}
12348	}
12349	return nil
12350}
12351
12352// Next advances to the next page of values.  If there was an error making
12353// the request the page does not advance and the error is returned.
12354// Deprecated: Use NextWithContext() instead.
12355func (page *LedgerDigestUploadsListResultPage) Next() error {
12356	return page.NextWithContext(context.Background())
12357}
12358
12359// NotDone returns true if the page enumeration should be started or is not yet complete.
12360func (page LedgerDigestUploadsListResultPage) NotDone() bool {
12361	return !page.ldulr.IsEmpty()
12362}
12363
12364// Response returns the raw server response from the last page request.
12365func (page LedgerDigestUploadsListResultPage) Response() LedgerDigestUploadsListResult {
12366	return page.ldulr
12367}
12368
12369// Values returns the slice of values for the current page or nil if there are no values.
12370func (page LedgerDigestUploadsListResultPage) Values() []LedgerDigestUploads {
12371	if page.ldulr.IsEmpty() {
12372		return nil
12373	}
12374	return *page.ldulr.Value
12375}
12376
12377// Creates a new instance of the LedgerDigestUploadsListResultPage type.
12378func NewLedgerDigestUploadsListResultPage(cur LedgerDigestUploadsListResult, getNextPage func(context.Context, LedgerDigestUploadsListResult) (LedgerDigestUploadsListResult, error)) LedgerDigestUploadsListResultPage {
12379	return LedgerDigestUploadsListResultPage{
12380		fn:    getNextPage,
12381		ldulr: cur,
12382	}
12383}
12384
12385// LedgerDigestUploadsProperties the properties of a database ledger digest upload settings.
12386type LedgerDigestUploadsProperties struct {
12387	// DigestStorageEndpoint - The digest storage endpoint, which must be either an Azure blob storage endpoint or an URI for Azure Confidential Ledger.
12388	DigestStorageEndpoint *string `json:"digestStorageEndpoint,omitempty"`
12389	// State - READ-ONLY; Specifies the state of ledger digest upload. Possible values include: 'LedgerDigestUploadsStateEnabled', 'LedgerDigestUploadsStateDisabled'
12390	State LedgerDigestUploadsState `json:"state,omitempty"`
12391}
12392
12393// MarshalJSON is the custom marshaler for LedgerDigestUploadsProperties.
12394func (ldup LedgerDigestUploadsProperties) MarshalJSON() ([]byte, error) {
12395	objectMap := make(map[string]interface{})
12396	if ldup.DigestStorageEndpoint != nil {
12397		objectMap["digestStorageEndpoint"] = ldup.DigestStorageEndpoint
12398	}
12399	return json.Marshal(objectMap)
12400}
12401
12402// LicenseTypeCapability the license type capability
12403type LicenseTypeCapability struct {
12404	// Name - READ-ONLY; License type identifier.
12405	Name *string `json:"name,omitempty"`
12406	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
12407	Status CapabilityStatus `json:"status,omitempty"`
12408	// Reason - The reason for the capability not being available.
12409	Reason *string `json:"reason,omitempty"`
12410}
12411
12412// MarshalJSON is the custom marshaler for LicenseTypeCapability.
12413func (ltc LicenseTypeCapability) MarshalJSON() ([]byte, error) {
12414	objectMap := make(map[string]interface{})
12415	if ltc.Reason != nil {
12416		objectMap["reason"] = ltc.Reason
12417	}
12418	return json.Marshal(objectMap)
12419}
12420
12421// ListAdvisor ...
12422type ListAdvisor struct {
12423	autorest.Response `json:"-"`
12424	Value             *[]Advisor `json:"value,omitempty"`
12425}
12426
12427// ListRecommendedAction ...
12428type ListRecommendedAction struct {
12429	autorest.Response `json:"-"`
12430	Value             *[]RecommendedAction `json:"value,omitempty"`
12431}
12432
12433// LocationCapabilities the location capability.
12434type LocationCapabilities struct {
12435	autorest.Response `json:"-"`
12436	// Name - READ-ONLY; The location name.
12437	Name *string `json:"name,omitempty"`
12438	// SupportedServerVersions - READ-ONLY; The list of supported server versions.
12439	SupportedServerVersions *[]ServerVersionCapability `json:"supportedServerVersions,omitempty"`
12440	// SupportedManagedInstanceVersions - READ-ONLY; The list of supported managed instance versions.
12441	SupportedManagedInstanceVersions *[]ManagedInstanceVersionCapability `json:"supportedManagedInstanceVersions,omitempty"`
12442	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
12443	Status CapabilityStatus `json:"status,omitempty"`
12444	// Reason - The reason for the capability not being available.
12445	Reason *string `json:"reason,omitempty"`
12446}
12447
12448// MarshalJSON is the custom marshaler for LocationCapabilities.
12449func (lc LocationCapabilities) MarshalJSON() ([]byte, error) {
12450	objectMap := make(map[string]interface{})
12451	if lc.Reason != nil {
12452		objectMap["reason"] = lc.Reason
12453	}
12454	return json.Marshal(objectMap)
12455}
12456
12457// LogicalServerSecurityAlertPolicyListResult a list of the server's security alert policies.
12458type LogicalServerSecurityAlertPolicyListResult struct {
12459	autorest.Response `json:"-"`
12460	// Value - READ-ONLY; Array of results.
12461	Value *[]ServerSecurityAlertPolicy `json:"value,omitempty"`
12462	// NextLink - READ-ONLY; Link to retrieve next page of results.
12463	NextLink *string `json:"nextLink,omitempty"`
12464}
12465
12466// MarshalJSON is the custom marshaler for LogicalServerSecurityAlertPolicyListResult.
12467func (lssaplr LogicalServerSecurityAlertPolicyListResult) MarshalJSON() ([]byte, error) {
12468	objectMap := make(map[string]interface{})
12469	return json.Marshal(objectMap)
12470}
12471
12472// LogicalServerSecurityAlertPolicyListResultIterator provides access to a complete listing of
12473// ServerSecurityAlertPolicy values.
12474type LogicalServerSecurityAlertPolicyListResultIterator struct {
12475	i    int
12476	page LogicalServerSecurityAlertPolicyListResultPage
12477}
12478
12479// NextWithContext advances to the next value.  If there was an error making
12480// the request the iterator does not advance and the error is returned.
12481func (iter *LogicalServerSecurityAlertPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
12482	if tracing.IsEnabled() {
12483		ctx = tracing.StartSpan(ctx, fqdn+"/LogicalServerSecurityAlertPolicyListResultIterator.NextWithContext")
12484		defer func() {
12485			sc := -1
12486			if iter.Response().Response.Response != nil {
12487				sc = iter.Response().Response.Response.StatusCode
12488			}
12489			tracing.EndSpan(ctx, sc, err)
12490		}()
12491	}
12492	iter.i++
12493	if iter.i < len(iter.page.Values()) {
12494		return nil
12495	}
12496	err = iter.page.NextWithContext(ctx)
12497	if err != nil {
12498		iter.i--
12499		return err
12500	}
12501	iter.i = 0
12502	return nil
12503}
12504
12505// Next advances to the next value.  If there was an error making
12506// the request the iterator does not advance and the error is returned.
12507// Deprecated: Use NextWithContext() instead.
12508func (iter *LogicalServerSecurityAlertPolicyListResultIterator) Next() error {
12509	return iter.NextWithContext(context.Background())
12510}
12511
12512// NotDone returns true if the enumeration should be started or is not yet complete.
12513func (iter LogicalServerSecurityAlertPolicyListResultIterator) NotDone() bool {
12514	return iter.page.NotDone() && iter.i < len(iter.page.Values())
12515}
12516
12517// Response returns the raw server response from the last page request.
12518func (iter LogicalServerSecurityAlertPolicyListResultIterator) Response() LogicalServerSecurityAlertPolicyListResult {
12519	return iter.page.Response()
12520}
12521
12522// Value returns the current value or a zero-initialized value if the
12523// iterator has advanced beyond the end of the collection.
12524func (iter LogicalServerSecurityAlertPolicyListResultIterator) Value() ServerSecurityAlertPolicy {
12525	if !iter.page.NotDone() {
12526		return ServerSecurityAlertPolicy{}
12527	}
12528	return iter.page.Values()[iter.i]
12529}
12530
12531// Creates a new instance of the LogicalServerSecurityAlertPolicyListResultIterator type.
12532func NewLogicalServerSecurityAlertPolicyListResultIterator(page LogicalServerSecurityAlertPolicyListResultPage) LogicalServerSecurityAlertPolicyListResultIterator {
12533	return LogicalServerSecurityAlertPolicyListResultIterator{page: page}
12534}
12535
12536// IsEmpty returns true if the ListResult contains no values.
12537func (lssaplr LogicalServerSecurityAlertPolicyListResult) IsEmpty() bool {
12538	return lssaplr.Value == nil || len(*lssaplr.Value) == 0
12539}
12540
12541// hasNextLink returns true if the NextLink is not empty.
12542func (lssaplr LogicalServerSecurityAlertPolicyListResult) hasNextLink() bool {
12543	return lssaplr.NextLink != nil && len(*lssaplr.NextLink) != 0
12544}
12545
12546// logicalServerSecurityAlertPolicyListResultPreparer prepares a request to retrieve the next set of results.
12547// It returns nil if no more results exist.
12548func (lssaplr LogicalServerSecurityAlertPolicyListResult) logicalServerSecurityAlertPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
12549	if !lssaplr.hasNextLink() {
12550		return nil, nil
12551	}
12552	return autorest.Prepare((&http.Request{}).WithContext(ctx),
12553		autorest.AsJSON(),
12554		autorest.AsGet(),
12555		autorest.WithBaseURL(to.String(lssaplr.NextLink)))
12556}
12557
12558// LogicalServerSecurityAlertPolicyListResultPage contains a page of ServerSecurityAlertPolicy values.
12559type LogicalServerSecurityAlertPolicyListResultPage struct {
12560	fn      func(context.Context, LogicalServerSecurityAlertPolicyListResult) (LogicalServerSecurityAlertPolicyListResult, error)
12561	lssaplr LogicalServerSecurityAlertPolicyListResult
12562}
12563
12564// NextWithContext advances to the next page of values.  If there was an error making
12565// the request the page does not advance and the error is returned.
12566func (page *LogicalServerSecurityAlertPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
12567	if tracing.IsEnabled() {
12568		ctx = tracing.StartSpan(ctx, fqdn+"/LogicalServerSecurityAlertPolicyListResultPage.NextWithContext")
12569		defer func() {
12570			sc := -1
12571			if page.Response().Response.Response != nil {
12572				sc = page.Response().Response.Response.StatusCode
12573			}
12574			tracing.EndSpan(ctx, sc, err)
12575		}()
12576	}
12577	for {
12578		next, err := page.fn(ctx, page.lssaplr)
12579		if err != nil {
12580			return err
12581		}
12582		page.lssaplr = next
12583		if !next.hasNextLink() || !next.IsEmpty() {
12584			break
12585		}
12586	}
12587	return nil
12588}
12589
12590// Next advances to the next page of values.  If there was an error making
12591// the request the page does not advance and the error is returned.
12592// Deprecated: Use NextWithContext() instead.
12593func (page *LogicalServerSecurityAlertPolicyListResultPage) Next() error {
12594	return page.NextWithContext(context.Background())
12595}
12596
12597// NotDone returns true if the page enumeration should be started or is not yet complete.
12598func (page LogicalServerSecurityAlertPolicyListResultPage) NotDone() bool {
12599	return !page.lssaplr.IsEmpty()
12600}
12601
12602// Response returns the raw server response from the last page request.
12603func (page LogicalServerSecurityAlertPolicyListResultPage) Response() LogicalServerSecurityAlertPolicyListResult {
12604	return page.lssaplr
12605}
12606
12607// Values returns the slice of values for the current page or nil if there are no values.
12608func (page LogicalServerSecurityAlertPolicyListResultPage) Values() []ServerSecurityAlertPolicy {
12609	if page.lssaplr.IsEmpty() {
12610		return nil
12611	}
12612	return *page.lssaplr.Value
12613}
12614
12615// Creates a new instance of the LogicalServerSecurityAlertPolicyListResultPage type.
12616func NewLogicalServerSecurityAlertPolicyListResultPage(cur LogicalServerSecurityAlertPolicyListResult, getNextPage func(context.Context, LogicalServerSecurityAlertPolicyListResult) (LogicalServerSecurityAlertPolicyListResult, error)) LogicalServerSecurityAlertPolicyListResultPage {
12617	return LogicalServerSecurityAlertPolicyListResultPage{
12618		fn:      getNextPage,
12619		lssaplr: cur,
12620	}
12621}
12622
12623// LogSizeCapability the log size capability.
12624type LogSizeCapability struct {
12625	// Limit - READ-ONLY; The log size limit (see 'unit' for the units).
12626	Limit *int32 `json:"limit,omitempty"`
12627	// Unit - READ-ONLY; The units that the limit is expressed in. Possible values include: 'LogSizeUnitMegabytes', 'LogSizeUnitGigabytes', 'LogSizeUnitTerabytes', 'LogSizeUnitPetabytes', 'LogSizeUnitPercent'
12628	Unit LogSizeUnit `json:"unit,omitempty"`
12629}
12630
12631// MarshalJSON is the custom marshaler for LogSizeCapability.
12632func (lsc LogSizeCapability) MarshalJSON() ([]byte, error) {
12633	objectMap := make(map[string]interface{})
12634	return json.Marshal(objectMap)
12635}
12636
12637// LongTermRetentionBackup a long term retention backup.
12638type LongTermRetentionBackup struct {
12639	autorest.Response `json:"-"`
12640	// LongTermRetentionBackupProperties - Resource properties.
12641	*LongTermRetentionBackupProperties `json:"properties,omitempty"`
12642	// ID - READ-ONLY; Resource ID.
12643	ID *string `json:"id,omitempty"`
12644	// Name - READ-ONLY; Resource name.
12645	Name *string `json:"name,omitempty"`
12646	// Type - READ-ONLY; Resource type.
12647	Type *string `json:"type,omitempty"`
12648}
12649
12650// MarshalJSON is the custom marshaler for LongTermRetentionBackup.
12651func (ltrb LongTermRetentionBackup) MarshalJSON() ([]byte, error) {
12652	objectMap := make(map[string]interface{})
12653	if ltrb.LongTermRetentionBackupProperties != nil {
12654		objectMap["properties"] = ltrb.LongTermRetentionBackupProperties
12655	}
12656	return json.Marshal(objectMap)
12657}
12658
12659// UnmarshalJSON is the custom unmarshaler for LongTermRetentionBackup struct.
12660func (ltrb *LongTermRetentionBackup) UnmarshalJSON(body []byte) error {
12661	var m map[string]*json.RawMessage
12662	err := json.Unmarshal(body, &m)
12663	if err != nil {
12664		return err
12665	}
12666	for k, v := range m {
12667		switch k {
12668		case "properties":
12669			if v != nil {
12670				var longTermRetentionBackupProperties LongTermRetentionBackupProperties
12671				err = json.Unmarshal(*v, &longTermRetentionBackupProperties)
12672				if err != nil {
12673					return err
12674				}
12675				ltrb.LongTermRetentionBackupProperties = &longTermRetentionBackupProperties
12676			}
12677		case "id":
12678			if v != nil {
12679				var ID string
12680				err = json.Unmarshal(*v, &ID)
12681				if err != nil {
12682					return err
12683				}
12684				ltrb.ID = &ID
12685			}
12686		case "name":
12687			if v != nil {
12688				var name string
12689				err = json.Unmarshal(*v, &name)
12690				if err != nil {
12691					return err
12692				}
12693				ltrb.Name = &name
12694			}
12695		case "type":
12696			if v != nil {
12697				var typeVar string
12698				err = json.Unmarshal(*v, &typeVar)
12699				if err != nil {
12700					return err
12701				}
12702				ltrb.Type = &typeVar
12703			}
12704		}
12705	}
12706
12707	return nil
12708}
12709
12710// LongTermRetentionBackupListResult a list of long term retention backups.
12711type LongTermRetentionBackupListResult struct {
12712	autorest.Response `json:"-"`
12713	// Value - READ-ONLY; Array of results.
12714	Value *[]LongTermRetentionBackup `json:"value,omitempty"`
12715	// NextLink - READ-ONLY; Link to retrieve next page of results.
12716	NextLink *string `json:"nextLink,omitempty"`
12717}
12718
12719// MarshalJSON is the custom marshaler for LongTermRetentionBackupListResult.
12720func (ltrblr LongTermRetentionBackupListResult) MarshalJSON() ([]byte, error) {
12721	objectMap := make(map[string]interface{})
12722	return json.Marshal(objectMap)
12723}
12724
12725// LongTermRetentionBackupListResultIterator provides access to a complete listing of
12726// LongTermRetentionBackup values.
12727type LongTermRetentionBackupListResultIterator struct {
12728	i    int
12729	page LongTermRetentionBackupListResultPage
12730}
12731
12732// NextWithContext advances to the next value.  If there was an error making
12733// the request the iterator does not advance and the error is returned.
12734func (iter *LongTermRetentionBackupListResultIterator) NextWithContext(ctx context.Context) (err error) {
12735	if tracing.IsEnabled() {
12736		ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupListResultIterator.NextWithContext")
12737		defer func() {
12738			sc := -1
12739			if iter.Response().Response.Response != nil {
12740				sc = iter.Response().Response.Response.StatusCode
12741			}
12742			tracing.EndSpan(ctx, sc, err)
12743		}()
12744	}
12745	iter.i++
12746	if iter.i < len(iter.page.Values()) {
12747		return nil
12748	}
12749	err = iter.page.NextWithContext(ctx)
12750	if err != nil {
12751		iter.i--
12752		return err
12753	}
12754	iter.i = 0
12755	return nil
12756}
12757
12758// Next advances to the next value.  If there was an error making
12759// the request the iterator does not advance and the error is returned.
12760// Deprecated: Use NextWithContext() instead.
12761func (iter *LongTermRetentionBackupListResultIterator) Next() error {
12762	return iter.NextWithContext(context.Background())
12763}
12764
12765// NotDone returns true if the enumeration should be started or is not yet complete.
12766func (iter LongTermRetentionBackupListResultIterator) NotDone() bool {
12767	return iter.page.NotDone() && iter.i < len(iter.page.Values())
12768}
12769
12770// Response returns the raw server response from the last page request.
12771func (iter LongTermRetentionBackupListResultIterator) Response() LongTermRetentionBackupListResult {
12772	return iter.page.Response()
12773}
12774
12775// Value returns the current value or a zero-initialized value if the
12776// iterator has advanced beyond the end of the collection.
12777func (iter LongTermRetentionBackupListResultIterator) Value() LongTermRetentionBackup {
12778	if !iter.page.NotDone() {
12779		return LongTermRetentionBackup{}
12780	}
12781	return iter.page.Values()[iter.i]
12782}
12783
12784// Creates a new instance of the LongTermRetentionBackupListResultIterator type.
12785func NewLongTermRetentionBackupListResultIterator(page LongTermRetentionBackupListResultPage) LongTermRetentionBackupListResultIterator {
12786	return LongTermRetentionBackupListResultIterator{page: page}
12787}
12788
12789// IsEmpty returns true if the ListResult contains no values.
12790func (ltrblr LongTermRetentionBackupListResult) IsEmpty() bool {
12791	return ltrblr.Value == nil || len(*ltrblr.Value) == 0
12792}
12793
12794// hasNextLink returns true if the NextLink is not empty.
12795func (ltrblr LongTermRetentionBackupListResult) hasNextLink() bool {
12796	return ltrblr.NextLink != nil && len(*ltrblr.NextLink) != 0
12797}
12798
12799// longTermRetentionBackupListResultPreparer prepares a request to retrieve the next set of results.
12800// It returns nil if no more results exist.
12801func (ltrblr LongTermRetentionBackupListResult) longTermRetentionBackupListResultPreparer(ctx context.Context) (*http.Request, error) {
12802	if !ltrblr.hasNextLink() {
12803		return nil, nil
12804	}
12805	return autorest.Prepare((&http.Request{}).WithContext(ctx),
12806		autorest.AsJSON(),
12807		autorest.AsGet(),
12808		autorest.WithBaseURL(to.String(ltrblr.NextLink)))
12809}
12810
12811// LongTermRetentionBackupListResultPage contains a page of LongTermRetentionBackup values.
12812type LongTermRetentionBackupListResultPage struct {
12813	fn     func(context.Context, LongTermRetentionBackupListResult) (LongTermRetentionBackupListResult, error)
12814	ltrblr LongTermRetentionBackupListResult
12815}
12816
12817// NextWithContext advances to the next page of values.  If there was an error making
12818// the request the page does not advance and the error is returned.
12819func (page *LongTermRetentionBackupListResultPage) NextWithContext(ctx context.Context) (err error) {
12820	if tracing.IsEnabled() {
12821		ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupListResultPage.NextWithContext")
12822		defer func() {
12823			sc := -1
12824			if page.Response().Response.Response != nil {
12825				sc = page.Response().Response.Response.StatusCode
12826			}
12827			tracing.EndSpan(ctx, sc, err)
12828		}()
12829	}
12830	for {
12831		next, err := page.fn(ctx, page.ltrblr)
12832		if err != nil {
12833			return err
12834		}
12835		page.ltrblr = next
12836		if !next.hasNextLink() || !next.IsEmpty() {
12837			break
12838		}
12839	}
12840	return nil
12841}
12842
12843// Next advances to the next page of values.  If there was an error making
12844// the request the page does not advance and the error is returned.
12845// Deprecated: Use NextWithContext() instead.
12846func (page *LongTermRetentionBackupListResultPage) Next() error {
12847	return page.NextWithContext(context.Background())
12848}
12849
12850// NotDone returns true if the page enumeration should be started or is not yet complete.
12851func (page LongTermRetentionBackupListResultPage) NotDone() bool {
12852	return !page.ltrblr.IsEmpty()
12853}
12854
12855// Response returns the raw server response from the last page request.
12856func (page LongTermRetentionBackupListResultPage) Response() LongTermRetentionBackupListResult {
12857	return page.ltrblr
12858}
12859
12860// Values returns the slice of values for the current page or nil if there are no values.
12861func (page LongTermRetentionBackupListResultPage) Values() []LongTermRetentionBackup {
12862	if page.ltrblr.IsEmpty() {
12863		return nil
12864	}
12865	return *page.ltrblr.Value
12866}
12867
12868// Creates a new instance of the LongTermRetentionBackupListResultPage type.
12869func NewLongTermRetentionBackupListResultPage(cur LongTermRetentionBackupListResult, getNextPage func(context.Context, LongTermRetentionBackupListResult) (LongTermRetentionBackupListResult, error)) LongTermRetentionBackupListResultPage {
12870	return LongTermRetentionBackupListResultPage{
12871		fn:     getNextPage,
12872		ltrblr: cur,
12873	}
12874}
12875
12876// LongTermRetentionBackupOperationResult a LongTermRetentionBackup operation result resource.
12877type LongTermRetentionBackupOperationResult struct {
12878	autorest.Response `json:"-"`
12879	// LongTermRetentionOperationResultProperties - Resource properties.
12880	*LongTermRetentionOperationResultProperties `json:"properties,omitempty"`
12881	// ID - READ-ONLY; Resource ID.
12882	ID *string `json:"id,omitempty"`
12883	// Name - READ-ONLY; Resource name.
12884	Name *string `json:"name,omitempty"`
12885	// Type - READ-ONLY; Resource type.
12886	Type *string `json:"type,omitempty"`
12887}
12888
12889// MarshalJSON is the custom marshaler for LongTermRetentionBackupOperationResult.
12890func (ltrbor LongTermRetentionBackupOperationResult) MarshalJSON() ([]byte, error) {
12891	objectMap := make(map[string]interface{})
12892	if ltrbor.LongTermRetentionOperationResultProperties != nil {
12893		objectMap["properties"] = ltrbor.LongTermRetentionOperationResultProperties
12894	}
12895	return json.Marshal(objectMap)
12896}
12897
12898// UnmarshalJSON is the custom unmarshaler for LongTermRetentionBackupOperationResult struct.
12899func (ltrbor *LongTermRetentionBackupOperationResult) UnmarshalJSON(body []byte) error {
12900	var m map[string]*json.RawMessage
12901	err := json.Unmarshal(body, &m)
12902	if err != nil {
12903		return err
12904	}
12905	for k, v := range m {
12906		switch k {
12907		case "properties":
12908			if v != nil {
12909				var longTermRetentionOperationResultProperties LongTermRetentionOperationResultProperties
12910				err = json.Unmarshal(*v, &longTermRetentionOperationResultProperties)
12911				if err != nil {
12912					return err
12913				}
12914				ltrbor.LongTermRetentionOperationResultProperties = &longTermRetentionOperationResultProperties
12915			}
12916		case "id":
12917			if v != nil {
12918				var ID string
12919				err = json.Unmarshal(*v, &ID)
12920				if err != nil {
12921					return err
12922				}
12923				ltrbor.ID = &ID
12924			}
12925		case "name":
12926			if v != nil {
12927				var name string
12928				err = json.Unmarshal(*v, &name)
12929				if err != nil {
12930					return err
12931				}
12932				ltrbor.Name = &name
12933			}
12934		case "type":
12935			if v != nil {
12936				var typeVar string
12937				err = json.Unmarshal(*v, &typeVar)
12938				if err != nil {
12939					return err
12940				}
12941				ltrbor.Type = &typeVar
12942			}
12943		}
12944	}
12945
12946	return nil
12947}
12948
12949// LongTermRetentionBackupProperties properties of a long term retention backup
12950type LongTermRetentionBackupProperties struct {
12951	// ServerName - READ-ONLY; The server name that the backup database belong to.
12952	ServerName *string `json:"serverName,omitempty"`
12953	// ServerCreateTime - READ-ONLY; The create time of the server.
12954	ServerCreateTime *date.Time `json:"serverCreateTime,omitempty"`
12955	// DatabaseName - READ-ONLY; The name of the database the backup belong to
12956	DatabaseName *string `json:"databaseName,omitempty"`
12957	// DatabaseDeletionTime - READ-ONLY; The delete time of the database
12958	DatabaseDeletionTime *date.Time `json:"databaseDeletionTime,omitempty"`
12959	// BackupTime - READ-ONLY; The time the backup was taken
12960	BackupTime *date.Time `json:"backupTime,omitempty"`
12961	// BackupExpirationTime - READ-ONLY; The time the long term retention backup will expire.
12962	BackupExpirationTime *date.Time `json:"backupExpirationTime,omitempty"`
12963	// BackupStorageRedundancy - READ-ONLY; The storage redundancy type of the backup. Possible values include: 'BackupStorageRedundancyGeo', 'BackupStorageRedundancyLocal', 'BackupStorageRedundancyZone'
12964	BackupStorageRedundancy BackupStorageRedundancy `json:"backupStorageRedundancy,omitempty"`
12965	// RequestedBackupStorageRedundancy - The storage redundancy type of the backup. Possible values include: 'BackupStorageRedundancyGeo', 'BackupStorageRedundancyLocal', 'BackupStorageRedundancyZone'
12966	RequestedBackupStorageRedundancy BackupStorageRedundancy `json:"requestedBackupStorageRedundancy,omitempty"`
12967}
12968
12969// MarshalJSON is the custom marshaler for LongTermRetentionBackupProperties.
12970func (ltrbp LongTermRetentionBackupProperties) MarshalJSON() ([]byte, error) {
12971	objectMap := make(map[string]interface{})
12972	if ltrbp.RequestedBackupStorageRedundancy != "" {
12973		objectMap["requestedBackupStorageRedundancy"] = ltrbp.RequestedBackupStorageRedundancy
12974	}
12975	return json.Marshal(objectMap)
12976}
12977
12978// LongTermRetentionBackupsCopyByResourceGroupFuture an abstraction for monitoring and retrieving the
12979// results of a long-running operation.
12980type LongTermRetentionBackupsCopyByResourceGroupFuture struct {
12981	azure.FutureAPI
12982	// Result returns the result of the asynchronous operation.
12983	// If the operation has not completed it will return an error.
12984	Result func(LongTermRetentionBackupsClient) (LongTermRetentionBackupOperationResult, error)
12985}
12986
12987// UnmarshalJSON is the custom unmarshaller for CreateFuture.
12988func (future *LongTermRetentionBackupsCopyByResourceGroupFuture) UnmarshalJSON(body []byte) error {
12989	var azFuture azure.Future
12990	if err := json.Unmarshal(body, &azFuture); err != nil {
12991		return err
12992	}
12993	future.FutureAPI = &azFuture
12994	future.Result = future.result
12995	return nil
12996}
12997
12998// result is the default implementation for LongTermRetentionBackupsCopyByResourceGroupFuture.Result.
12999func (future *LongTermRetentionBackupsCopyByResourceGroupFuture) result(client LongTermRetentionBackupsClient) (ltrbor LongTermRetentionBackupOperationResult, err error) {
13000	var done bool
13001	done, err = future.DoneWithContext(context.Background(), client)
13002	if err != nil {
13003		err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsCopyByResourceGroupFuture", "Result", future.Response(), "Polling failure")
13004		return
13005	}
13006	if !done {
13007		ltrbor.Response.Response = future.Response()
13008		err = azure.NewAsyncOpIncompleteError("sql.LongTermRetentionBackupsCopyByResourceGroupFuture")
13009		return
13010	}
13011	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13012	if ltrbor.Response.Response, err = future.GetResult(sender); err == nil && ltrbor.Response.Response.StatusCode != http.StatusNoContent {
13013		ltrbor, err = client.CopyByResourceGroupResponder(ltrbor.Response.Response)
13014		if err != nil {
13015			err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsCopyByResourceGroupFuture", "Result", ltrbor.Response.Response, "Failure responding to request")
13016		}
13017	}
13018	return
13019}
13020
13021// LongTermRetentionBackupsCopyFuture an abstraction for monitoring and retrieving the results of a
13022// long-running operation.
13023type LongTermRetentionBackupsCopyFuture struct {
13024	azure.FutureAPI
13025	// Result returns the result of the asynchronous operation.
13026	// If the operation has not completed it will return an error.
13027	Result func(LongTermRetentionBackupsClient) (LongTermRetentionBackupOperationResult, error)
13028}
13029
13030// UnmarshalJSON is the custom unmarshaller for CreateFuture.
13031func (future *LongTermRetentionBackupsCopyFuture) UnmarshalJSON(body []byte) error {
13032	var azFuture azure.Future
13033	if err := json.Unmarshal(body, &azFuture); err != nil {
13034		return err
13035	}
13036	future.FutureAPI = &azFuture
13037	future.Result = future.result
13038	return nil
13039}
13040
13041// result is the default implementation for LongTermRetentionBackupsCopyFuture.Result.
13042func (future *LongTermRetentionBackupsCopyFuture) result(client LongTermRetentionBackupsClient) (ltrbor LongTermRetentionBackupOperationResult, err error) {
13043	var done bool
13044	done, err = future.DoneWithContext(context.Background(), client)
13045	if err != nil {
13046		err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsCopyFuture", "Result", future.Response(), "Polling failure")
13047		return
13048	}
13049	if !done {
13050		ltrbor.Response.Response = future.Response()
13051		err = azure.NewAsyncOpIncompleteError("sql.LongTermRetentionBackupsCopyFuture")
13052		return
13053	}
13054	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13055	if ltrbor.Response.Response, err = future.GetResult(sender); err == nil && ltrbor.Response.Response.StatusCode != http.StatusNoContent {
13056		ltrbor, err = client.CopyResponder(ltrbor.Response.Response)
13057		if err != nil {
13058			err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsCopyFuture", "Result", ltrbor.Response.Response, "Failure responding to request")
13059		}
13060	}
13061	return
13062}
13063
13064// LongTermRetentionBackupsDeleteByResourceGroupFuture an abstraction for monitoring and retrieving the
13065// results of a long-running operation.
13066type LongTermRetentionBackupsDeleteByResourceGroupFuture struct {
13067	azure.FutureAPI
13068	// Result returns the result of the asynchronous operation.
13069	// If the operation has not completed it will return an error.
13070	Result func(LongTermRetentionBackupsClient) (autorest.Response, error)
13071}
13072
13073// UnmarshalJSON is the custom unmarshaller for CreateFuture.
13074func (future *LongTermRetentionBackupsDeleteByResourceGroupFuture) UnmarshalJSON(body []byte) error {
13075	var azFuture azure.Future
13076	if err := json.Unmarshal(body, &azFuture); err != nil {
13077		return err
13078	}
13079	future.FutureAPI = &azFuture
13080	future.Result = future.result
13081	return nil
13082}
13083
13084// result is the default implementation for LongTermRetentionBackupsDeleteByResourceGroupFuture.Result.
13085func (future *LongTermRetentionBackupsDeleteByResourceGroupFuture) result(client LongTermRetentionBackupsClient) (ar autorest.Response, err error) {
13086	var done bool
13087	done, err = future.DoneWithContext(context.Background(), client)
13088	if err != nil {
13089		err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsDeleteByResourceGroupFuture", "Result", future.Response(), "Polling failure")
13090		return
13091	}
13092	if !done {
13093		ar.Response = future.Response()
13094		err = azure.NewAsyncOpIncompleteError("sql.LongTermRetentionBackupsDeleteByResourceGroupFuture")
13095		return
13096	}
13097	ar.Response = future.Response()
13098	return
13099}
13100
13101// LongTermRetentionBackupsDeleteFuture an abstraction for monitoring and retrieving the results of a
13102// long-running operation.
13103type LongTermRetentionBackupsDeleteFuture struct {
13104	azure.FutureAPI
13105	// Result returns the result of the asynchronous operation.
13106	// If the operation has not completed it will return an error.
13107	Result func(LongTermRetentionBackupsClient) (autorest.Response, error)
13108}
13109
13110// UnmarshalJSON is the custom unmarshaller for CreateFuture.
13111func (future *LongTermRetentionBackupsDeleteFuture) UnmarshalJSON(body []byte) error {
13112	var azFuture azure.Future
13113	if err := json.Unmarshal(body, &azFuture); err != nil {
13114		return err
13115	}
13116	future.FutureAPI = &azFuture
13117	future.Result = future.result
13118	return nil
13119}
13120
13121// result is the default implementation for LongTermRetentionBackupsDeleteFuture.Result.
13122func (future *LongTermRetentionBackupsDeleteFuture) result(client LongTermRetentionBackupsClient) (ar autorest.Response, err error) {
13123	var done bool
13124	done, err = future.DoneWithContext(context.Background(), client)
13125	if err != nil {
13126		err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsDeleteFuture", "Result", future.Response(), "Polling failure")
13127		return
13128	}
13129	if !done {
13130		ar.Response = future.Response()
13131		err = azure.NewAsyncOpIncompleteError("sql.LongTermRetentionBackupsDeleteFuture")
13132		return
13133	}
13134	ar.Response = future.Response()
13135	return
13136}
13137
13138// LongTermRetentionBackupsUpdateByResourceGroupFuture an abstraction for monitoring and retrieving the
13139// results of a long-running operation.
13140type LongTermRetentionBackupsUpdateByResourceGroupFuture struct {
13141	azure.FutureAPI
13142	// Result returns the result of the asynchronous operation.
13143	// If the operation has not completed it will return an error.
13144	Result func(LongTermRetentionBackupsClient) (LongTermRetentionBackupOperationResult, error)
13145}
13146
13147// UnmarshalJSON is the custom unmarshaller for CreateFuture.
13148func (future *LongTermRetentionBackupsUpdateByResourceGroupFuture) UnmarshalJSON(body []byte) error {
13149	var azFuture azure.Future
13150	if err := json.Unmarshal(body, &azFuture); err != nil {
13151		return err
13152	}
13153	future.FutureAPI = &azFuture
13154	future.Result = future.result
13155	return nil
13156}
13157
13158// result is the default implementation for LongTermRetentionBackupsUpdateByResourceGroupFuture.Result.
13159func (future *LongTermRetentionBackupsUpdateByResourceGroupFuture) result(client LongTermRetentionBackupsClient) (ltrbor LongTermRetentionBackupOperationResult, err error) {
13160	var done bool
13161	done, err = future.DoneWithContext(context.Background(), client)
13162	if err != nil {
13163		err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsUpdateByResourceGroupFuture", "Result", future.Response(), "Polling failure")
13164		return
13165	}
13166	if !done {
13167		ltrbor.Response.Response = future.Response()
13168		err = azure.NewAsyncOpIncompleteError("sql.LongTermRetentionBackupsUpdateByResourceGroupFuture")
13169		return
13170	}
13171	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13172	if ltrbor.Response.Response, err = future.GetResult(sender); err == nil && ltrbor.Response.Response.StatusCode != http.StatusNoContent {
13173		ltrbor, err = client.UpdateByResourceGroupResponder(ltrbor.Response.Response)
13174		if err != nil {
13175			err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsUpdateByResourceGroupFuture", "Result", ltrbor.Response.Response, "Failure responding to request")
13176		}
13177	}
13178	return
13179}
13180
13181// LongTermRetentionBackupsUpdateFuture an abstraction for monitoring and retrieving the results of a
13182// long-running operation.
13183type LongTermRetentionBackupsUpdateFuture struct {
13184	azure.FutureAPI
13185	// Result returns the result of the asynchronous operation.
13186	// If the operation has not completed it will return an error.
13187	Result func(LongTermRetentionBackupsClient) (LongTermRetentionBackupOperationResult, error)
13188}
13189
13190// UnmarshalJSON is the custom unmarshaller for CreateFuture.
13191func (future *LongTermRetentionBackupsUpdateFuture) UnmarshalJSON(body []byte) error {
13192	var azFuture azure.Future
13193	if err := json.Unmarshal(body, &azFuture); err != nil {
13194		return err
13195	}
13196	future.FutureAPI = &azFuture
13197	future.Result = future.result
13198	return nil
13199}
13200
13201// result is the default implementation for LongTermRetentionBackupsUpdateFuture.Result.
13202func (future *LongTermRetentionBackupsUpdateFuture) result(client LongTermRetentionBackupsClient) (ltrbor LongTermRetentionBackupOperationResult, err error) {
13203	var done bool
13204	done, err = future.DoneWithContext(context.Background(), client)
13205	if err != nil {
13206		err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsUpdateFuture", "Result", future.Response(), "Polling failure")
13207		return
13208	}
13209	if !done {
13210		ltrbor.Response.Response = future.Response()
13211		err = azure.NewAsyncOpIncompleteError("sql.LongTermRetentionBackupsUpdateFuture")
13212		return
13213	}
13214	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13215	if ltrbor.Response.Response, err = future.GetResult(sender); err == nil && ltrbor.Response.Response.StatusCode != http.StatusNoContent {
13216		ltrbor, err = client.UpdateResponder(ltrbor.Response.Response)
13217		if err != nil {
13218			err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsUpdateFuture", "Result", ltrbor.Response.Response, "Failure responding to request")
13219		}
13220	}
13221	return
13222}
13223
13224// LongTermRetentionManagedInstanceBackupsDeleteByResourceGroupFuture an abstraction for monitoring and
13225// retrieving the results of a long-running operation.
13226type LongTermRetentionManagedInstanceBackupsDeleteByResourceGroupFuture struct {
13227	azure.FutureAPI
13228	// Result returns the result of the asynchronous operation.
13229	// If the operation has not completed it will return an error.
13230	Result func(LongTermRetentionManagedInstanceBackupsClient) (autorest.Response, error)
13231}
13232
13233// UnmarshalJSON is the custom unmarshaller for CreateFuture.
13234func (future *LongTermRetentionManagedInstanceBackupsDeleteByResourceGroupFuture) UnmarshalJSON(body []byte) error {
13235	var azFuture azure.Future
13236	if err := json.Unmarshal(body, &azFuture); err != nil {
13237		return err
13238	}
13239	future.FutureAPI = &azFuture
13240	future.Result = future.result
13241	return nil
13242}
13243
13244// result is the default implementation for LongTermRetentionManagedInstanceBackupsDeleteByResourceGroupFuture.Result.
13245func (future *LongTermRetentionManagedInstanceBackupsDeleteByResourceGroupFuture) result(client LongTermRetentionManagedInstanceBackupsClient) (ar autorest.Response, err error) {
13246	var done bool
13247	done, err = future.DoneWithContext(context.Background(), client)
13248	if err != nil {
13249		err = autorest.NewErrorWithError(err, "sql.LongTermRetentionManagedInstanceBackupsDeleteByResourceGroupFuture", "Result", future.Response(), "Polling failure")
13250		return
13251	}
13252	if !done {
13253		ar.Response = future.Response()
13254		err = azure.NewAsyncOpIncompleteError("sql.LongTermRetentionManagedInstanceBackupsDeleteByResourceGroupFuture")
13255		return
13256	}
13257	ar.Response = future.Response()
13258	return
13259}
13260
13261// LongTermRetentionManagedInstanceBackupsDeleteFuture an abstraction for monitoring and retrieving the
13262// results of a long-running operation.
13263type LongTermRetentionManagedInstanceBackupsDeleteFuture struct {
13264	azure.FutureAPI
13265	// Result returns the result of the asynchronous operation.
13266	// If the operation has not completed it will return an error.
13267	Result func(LongTermRetentionManagedInstanceBackupsClient) (autorest.Response, error)
13268}
13269
13270// UnmarshalJSON is the custom unmarshaller for CreateFuture.
13271func (future *LongTermRetentionManagedInstanceBackupsDeleteFuture) UnmarshalJSON(body []byte) error {
13272	var azFuture azure.Future
13273	if err := json.Unmarshal(body, &azFuture); err != nil {
13274		return err
13275	}
13276	future.FutureAPI = &azFuture
13277	future.Result = future.result
13278	return nil
13279}
13280
13281// result is the default implementation for LongTermRetentionManagedInstanceBackupsDeleteFuture.Result.
13282func (future *LongTermRetentionManagedInstanceBackupsDeleteFuture) result(client LongTermRetentionManagedInstanceBackupsClient) (ar autorest.Response, err error) {
13283	var done bool
13284	done, err = future.DoneWithContext(context.Background(), client)
13285	if err != nil {
13286		err = autorest.NewErrorWithError(err, "sql.LongTermRetentionManagedInstanceBackupsDeleteFuture", "Result", future.Response(), "Polling failure")
13287		return
13288	}
13289	if !done {
13290		ar.Response = future.Response()
13291		err = azure.NewAsyncOpIncompleteError("sql.LongTermRetentionManagedInstanceBackupsDeleteFuture")
13292		return
13293	}
13294	ar.Response = future.Response()
13295	return
13296}
13297
13298// LongTermRetentionOperationResultProperties contains the operation result properties for long term
13299// retention backup operation.
13300type LongTermRetentionOperationResultProperties struct {
13301	// RequestID - READ-ONLY; Request Id.
13302	RequestID *uuid.UUID `json:"requestId,omitempty"`
13303	// OperationType - READ-ONLY; Operation type.
13304	OperationType *string `json:"operationType,omitempty"`
13305	// FromBackupResourceID - READ-ONLY; Source backup resource id
13306	FromBackupResourceID *string `json:"fromBackupResourceId,omitempty"`
13307	// ToBackupResourceID - READ-ONLY; Target backup resource id
13308	ToBackupResourceID *string `json:"toBackupResourceId,omitempty"`
13309	// TargetBackupStorageRedundancy - READ-ONLY; The storage redundancy type of the copied backup. Possible values include: 'BackupStorageRedundancyGeo', 'BackupStorageRedundancyLocal', 'BackupStorageRedundancyZone'
13310	TargetBackupStorageRedundancy BackupStorageRedundancy `json:"targetBackupStorageRedundancy,omitempty"`
13311	// Status - READ-ONLY; Operation status
13312	Status *string `json:"status,omitempty"`
13313	// Message - READ-ONLY; Progress message
13314	Message *string `json:"message,omitempty"`
13315}
13316
13317// MarshalJSON is the custom marshaler for LongTermRetentionOperationResultProperties.
13318func (ltrorp LongTermRetentionOperationResultProperties) MarshalJSON() ([]byte, error) {
13319	objectMap := make(map[string]interface{})
13320	return json.Marshal(objectMap)
13321}
13322
13323// LongTermRetentionPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results
13324// of a long-running operation.
13325type LongTermRetentionPoliciesCreateOrUpdateFuture struct {
13326	azure.FutureAPI
13327	// Result returns the result of the asynchronous operation.
13328	// If the operation has not completed it will return an error.
13329	Result func(LongTermRetentionPoliciesClient) (LongTermRetentionPolicy, error)
13330}
13331
13332// UnmarshalJSON is the custom unmarshaller for CreateFuture.
13333func (future *LongTermRetentionPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
13334	var azFuture azure.Future
13335	if err := json.Unmarshal(body, &azFuture); err != nil {
13336		return err
13337	}
13338	future.FutureAPI = &azFuture
13339	future.Result = future.result
13340	return nil
13341}
13342
13343// result is the default implementation for LongTermRetentionPoliciesCreateOrUpdateFuture.Result.
13344func (future *LongTermRetentionPoliciesCreateOrUpdateFuture) result(client LongTermRetentionPoliciesClient) (ltrp LongTermRetentionPolicy, err error) {
13345	var done bool
13346	done, err = future.DoneWithContext(context.Background(), client)
13347	if err != nil {
13348		err = autorest.NewErrorWithError(err, "sql.LongTermRetentionPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
13349		return
13350	}
13351	if !done {
13352		ltrp.Response.Response = future.Response()
13353		err = azure.NewAsyncOpIncompleteError("sql.LongTermRetentionPoliciesCreateOrUpdateFuture")
13354		return
13355	}
13356	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13357	if ltrp.Response.Response, err = future.GetResult(sender); err == nil && ltrp.Response.Response.StatusCode != http.StatusNoContent {
13358		ltrp, err = client.CreateOrUpdateResponder(ltrp.Response.Response)
13359		if err != nil {
13360			err = autorest.NewErrorWithError(err, "sql.LongTermRetentionPoliciesCreateOrUpdateFuture", "Result", ltrp.Response.Response, "Failure responding to request")
13361		}
13362	}
13363	return
13364}
13365
13366// LongTermRetentionPolicy a long term retention policy.
13367type LongTermRetentionPolicy struct {
13368	autorest.Response `json:"-"`
13369	// BaseLongTermRetentionPolicyProperties - Resource properties.
13370	*BaseLongTermRetentionPolicyProperties `json:"properties,omitempty"`
13371	// ID - READ-ONLY; Resource ID.
13372	ID *string `json:"id,omitempty"`
13373	// Name - READ-ONLY; Resource name.
13374	Name *string `json:"name,omitempty"`
13375	// Type - READ-ONLY; Resource type.
13376	Type *string `json:"type,omitempty"`
13377}
13378
13379// MarshalJSON is the custom marshaler for LongTermRetentionPolicy.
13380func (ltrp LongTermRetentionPolicy) MarshalJSON() ([]byte, error) {
13381	objectMap := make(map[string]interface{})
13382	if ltrp.BaseLongTermRetentionPolicyProperties != nil {
13383		objectMap["properties"] = ltrp.BaseLongTermRetentionPolicyProperties
13384	}
13385	return json.Marshal(objectMap)
13386}
13387
13388// UnmarshalJSON is the custom unmarshaler for LongTermRetentionPolicy struct.
13389func (ltrp *LongTermRetentionPolicy) UnmarshalJSON(body []byte) error {
13390	var m map[string]*json.RawMessage
13391	err := json.Unmarshal(body, &m)
13392	if err != nil {
13393		return err
13394	}
13395	for k, v := range m {
13396		switch k {
13397		case "properties":
13398			if v != nil {
13399				var baseLongTermRetentionPolicyProperties BaseLongTermRetentionPolicyProperties
13400				err = json.Unmarshal(*v, &baseLongTermRetentionPolicyProperties)
13401				if err != nil {
13402					return err
13403				}
13404				ltrp.BaseLongTermRetentionPolicyProperties = &baseLongTermRetentionPolicyProperties
13405			}
13406		case "id":
13407			if v != nil {
13408				var ID string
13409				err = json.Unmarshal(*v, &ID)
13410				if err != nil {
13411					return err
13412				}
13413				ltrp.ID = &ID
13414			}
13415		case "name":
13416			if v != nil {
13417				var name string
13418				err = json.Unmarshal(*v, &name)
13419				if err != nil {
13420					return err
13421				}
13422				ltrp.Name = &name
13423			}
13424		case "type":
13425			if v != nil {
13426				var typeVar string
13427				err = json.Unmarshal(*v, &typeVar)
13428				if err != nil {
13429					return err
13430				}
13431				ltrp.Type = &typeVar
13432			}
13433		}
13434	}
13435
13436	return nil
13437}
13438
13439// LongTermRetentionPolicyListResult a list of long term retention policies.
13440type LongTermRetentionPolicyListResult struct {
13441	autorest.Response `json:"-"`
13442	// Value - READ-ONLY; Array of results.
13443	Value *[]LongTermRetentionPolicy `json:"value,omitempty"`
13444	// NextLink - READ-ONLY; Link to retrieve next page of results.
13445	NextLink *string `json:"nextLink,omitempty"`
13446}
13447
13448// MarshalJSON is the custom marshaler for LongTermRetentionPolicyListResult.
13449func (ltrplr LongTermRetentionPolicyListResult) MarshalJSON() ([]byte, error) {
13450	objectMap := make(map[string]interface{})
13451	return json.Marshal(objectMap)
13452}
13453
13454// LongTermRetentionPolicyListResultIterator provides access to a complete listing of
13455// LongTermRetentionPolicy values.
13456type LongTermRetentionPolicyListResultIterator struct {
13457	i    int
13458	page LongTermRetentionPolicyListResultPage
13459}
13460
13461// NextWithContext advances to the next value.  If there was an error making
13462// the request the iterator does not advance and the error is returned.
13463func (iter *LongTermRetentionPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
13464	if tracing.IsEnabled() {
13465		ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionPolicyListResultIterator.NextWithContext")
13466		defer func() {
13467			sc := -1
13468			if iter.Response().Response.Response != nil {
13469				sc = iter.Response().Response.Response.StatusCode
13470			}
13471			tracing.EndSpan(ctx, sc, err)
13472		}()
13473	}
13474	iter.i++
13475	if iter.i < len(iter.page.Values()) {
13476		return nil
13477	}
13478	err = iter.page.NextWithContext(ctx)
13479	if err != nil {
13480		iter.i--
13481		return err
13482	}
13483	iter.i = 0
13484	return nil
13485}
13486
13487// Next advances to the next value.  If there was an error making
13488// the request the iterator does not advance and the error is returned.
13489// Deprecated: Use NextWithContext() instead.
13490func (iter *LongTermRetentionPolicyListResultIterator) Next() error {
13491	return iter.NextWithContext(context.Background())
13492}
13493
13494// NotDone returns true if the enumeration should be started or is not yet complete.
13495func (iter LongTermRetentionPolicyListResultIterator) NotDone() bool {
13496	return iter.page.NotDone() && iter.i < len(iter.page.Values())
13497}
13498
13499// Response returns the raw server response from the last page request.
13500func (iter LongTermRetentionPolicyListResultIterator) Response() LongTermRetentionPolicyListResult {
13501	return iter.page.Response()
13502}
13503
13504// Value returns the current value or a zero-initialized value if the
13505// iterator has advanced beyond the end of the collection.
13506func (iter LongTermRetentionPolicyListResultIterator) Value() LongTermRetentionPolicy {
13507	if !iter.page.NotDone() {
13508		return LongTermRetentionPolicy{}
13509	}
13510	return iter.page.Values()[iter.i]
13511}
13512
13513// Creates a new instance of the LongTermRetentionPolicyListResultIterator type.
13514func NewLongTermRetentionPolicyListResultIterator(page LongTermRetentionPolicyListResultPage) LongTermRetentionPolicyListResultIterator {
13515	return LongTermRetentionPolicyListResultIterator{page: page}
13516}
13517
13518// IsEmpty returns true if the ListResult contains no values.
13519func (ltrplr LongTermRetentionPolicyListResult) IsEmpty() bool {
13520	return ltrplr.Value == nil || len(*ltrplr.Value) == 0
13521}
13522
13523// hasNextLink returns true if the NextLink is not empty.
13524func (ltrplr LongTermRetentionPolicyListResult) hasNextLink() bool {
13525	return ltrplr.NextLink != nil && len(*ltrplr.NextLink) != 0
13526}
13527
13528// longTermRetentionPolicyListResultPreparer prepares a request to retrieve the next set of results.
13529// It returns nil if no more results exist.
13530func (ltrplr LongTermRetentionPolicyListResult) longTermRetentionPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
13531	if !ltrplr.hasNextLink() {
13532		return nil, nil
13533	}
13534	return autorest.Prepare((&http.Request{}).WithContext(ctx),
13535		autorest.AsJSON(),
13536		autorest.AsGet(),
13537		autorest.WithBaseURL(to.String(ltrplr.NextLink)))
13538}
13539
13540// LongTermRetentionPolicyListResultPage contains a page of LongTermRetentionPolicy values.
13541type LongTermRetentionPolicyListResultPage struct {
13542	fn     func(context.Context, LongTermRetentionPolicyListResult) (LongTermRetentionPolicyListResult, error)
13543	ltrplr LongTermRetentionPolicyListResult
13544}
13545
13546// NextWithContext advances to the next page of values.  If there was an error making
13547// the request the page does not advance and the error is returned.
13548func (page *LongTermRetentionPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
13549	if tracing.IsEnabled() {
13550		ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionPolicyListResultPage.NextWithContext")
13551		defer func() {
13552			sc := -1
13553			if page.Response().Response.Response != nil {
13554				sc = page.Response().Response.Response.StatusCode
13555			}
13556			tracing.EndSpan(ctx, sc, err)
13557		}()
13558	}
13559	for {
13560		next, err := page.fn(ctx, page.ltrplr)
13561		if err != nil {
13562			return err
13563		}
13564		page.ltrplr = next
13565		if !next.hasNextLink() || !next.IsEmpty() {
13566			break
13567		}
13568	}
13569	return nil
13570}
13571
13572// Next advances to the next page of values.  If there was an error making
13573// the request the page does not advance and the error is returned.
13574// Deprecated: Use NextWithContext() instead.
13575func (page *LongTermRetentionPolicyListResultPage) Next() error {
13576	return page.NextWithContext(context.Background())
13577}
13578
13579// NotDone returns true if the page enumeration should be started or is not yet complete.
13580func (page LongTermRetentionPolicyListResultPage) NotDone() bool {
13581	return !page.ltrplr.IsEmpty()
13582}
13583
13584// Response returns the raw server response from the last page request.
13585func (page LongTermRetentionPolicyListResultPage) Response() LongTermRetentionPolicyListResult {
13586	return page.ltrplr
13587}
13588
13589// Values returns the slice of values for the current page or nil if there are no values.
13590func (page LongTermRetentionPolicyListResultPage) Values() []LongTermRetentionPolicy {
13591	if page.ltrplr.IsEmpty() {
13592		return nil
13593	}
13594	return *page.ltrplr.Value
13595}
13596
13597// Creates a new instance of the LongTermRetentionPolicyListResultPage type.
13598func NewLongTermRetentionPolicyListResultPage(cur LongTermRetentionPolicyListResult, getNextPage func(context.Context, LongTermRetentionPolicyListResult) (LongTermRetentionPolicyListResult, error)) LongTermRetentionPolicyListResultPage {
13599	return LongTermRetentionPolicyListResultPage{
13600		fn:     getNextPage,
13601		ltrplr: cur,
13602	}
13603}
13604
13605// MaintenanceConfigurationCapability the maintenance configuration capability
13606type MaintenanceConfigurationCapability struct {
13607	// Name - READ-ONLY; Maintenance configuration name
13608	Name *string `json:"name,omitempty"`
13609	// ZoneRedundant - READ-ONLY; Whether or not zone redundancy is supported for the maintenance configuration.
13610	ZoneRedundant *bool `json:"zoneRedundant,omitempty"`
13611	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
13612	Status CapabilityStatus `json:"status,omitempty"`
13613	// Reason - The reason for the capability not being available.
13614	Reason *string `json:"reason,omitempty"`
13615}
13616
13617// MarshalJSON is the custom marshaler for MaintenanceConfigurationCapability.
13618func (mcc MaintenanceConfigurationCapability) MarshalJSON() ([]byte, error) {
13619	objectMap := make(map[string]interface{})
13620	if mcc.Reason != nil {
13621		objectMap["reason"] = mcc.Reason
13622	}
13623	return json.Marshal(objectMap)
13624}
13625
13626// MaintenanceWindowOptions maintenance window options.
13627type MaintenanceWindowOptions struct {
13628	autorest.Response `json:"-"`
13629	// MaintenanceWindowOptionsProperties - Resource properties.
13630	*MaintenanceWindowOptionsProperties `json:"properties,omitempty"`
13631	// ID - READ-ONLY; Resource ID.
13632	ID *string `json:"id,omitempty"`
13633	// Name - READ-ONLY; Resource name.
13634	Name *string `json:"name,omitempty"`
13635	// Type - READ-ONLY; Resource type.
13636	Type *string `json:"type,omitempty"`
13637}
13638
13639// MarshalJSON is the custom marshaler for MaintenanceWindowOptions.
13640func (mwo MaintenanceWindowOptions) MarshalJSON() ([]byte, error) {
13641	objectMap := make(map[string]interface{})
13642	if mwo.MaintenanceWindowOptionsProperties != nil {
13643		objectMap["properties"] = mwo.MaintenanceWindowOptionsProperties
13644	}
13645	return json.Marshal(objectMap)
13646}
13647
13648// UnmarshalJSON is the custom unmarshaler for MaintenanceWindowOptions struct.
13649func (mwo *MaintenanceWindowOptions) UnmarshalJSON(body []byte) error {
13650	var m map[string]*json.RawMessage
13651	err := json.Unmarshal(body, &m)
13652	if err != nil {
13653		return err
13654	}
13655	for k, v := range m {
13656		switch k {
13657		case "properties":
13658			if v != nil {
13659				var maintenanceWindowOptionsProperties MaintenanceWindowOptionsProperties
13660				err = json.Unmarshal(*v, &maintenanceWindowOptionsProperties)
13661				if err != nil {
13662					return err
13663				}
13664				mwo.MaintenanceWindowOptionsProperties = &maintenanceWindowOptionsProperties
13665			}
13666		case "id":
13667			if v != nil {
13668				var ID string
13669				err = json.Unmarshal(*v, &ID)
13670				if err != nil {
13671					return err
13672				}
13673				mwo.ID = &ID
13674			}
13675		case "name":
13676			if v != nil {
13677				var name string
13678				err = json.Unmarshal(*v, &name)
13679				if err != nil {
13680					return err
13681				}
13682				mwo.Name = &name
13683			}
13684		case "type":
13685			if v != nil {
13686				var typeVar string
13687				err = json.Unmarshal(*v, &typeVar)
13688				if err != nil {
13689					return err
13690				}
13691				mwo.Type = &typeVar
13692			}
13693		}
13694	}
13695
13696	return nil
13697}
13698
13699// MaintenanceWindowOptionsProperties maintenance window options properties.
13700type MaintenanceWindowOptionsProperties struct {
13701	// IsEnabled - Whether maintenance windows are enabled for the database.
13702	IsEnabled *bool `json:"isEnabled,omitempty"`
13703	// MaintenanceWindowCycles - Available maintenance cycles e.g. {Saturday, 0, 48*60}, {Wednesday, 0, 24*60}.
13704	MaintenanceWindowCycles *[]MaintenanceWindowTimeRange `json:"maintenanceWindowCycles,omitempty"`
13705	// MinDurationInMinutes - Minimum duration of maintenance window.
13706	MinDurationInMinutes *int32 `json:"minDurationInMinutes,omitempty"`
13707	// DefaultDurationInMinutes - Default duration for maintenance window.
13708	DefaultDurationInMinutes *int32 `json:"defaultDurationInMinutes,omitempty"`
13709	// MinCycles - Minimum number of maintenance windows cycles to be set on the database.
13710	MinCycles *int32 `json:"minCycles,omitempty"`
13711	// TimeGranularityInMinutes - Time granularity in minutes for maintenance windows.
13712	TimeGranularityInMinutes *int32 `json:"timeGranularityInMinutes,omitempty"`
13713	// AllowMultipleMaintenanceWindowsPerCycle - Whether we allow multiple maintenance windows per cycle.
13714	AllowMultipleMaintenanceWindowsPerCycle *bool `json:"allowMultipleMaintenanceWindowsPerCycle,omitempty"`
13715}
13716
13717// MaintenanceWindows maintenance windows.
13718type MaintenanceWindows struct {
13719	autorest.Response `json:"-"`
13720	// MaintenanceWindowsProperties - Resource properties.
13721	*MaintenanceWindowsProperties `json:"properties,omitempty"`
13722	// ID - READ-ONLY; Resource ID.
13723	ID *string `json:"id,omitempty"`
13724	// Name - READ-ONLY; Resource name.
13725	Name *string `json:"name,omitempty"`
13726	// Type - READ-ONLY; Resource type.
13727	Type *string `json:"type,omitempty"`
13728}
13729
13730// MarshalJSON is the custom marshaler for MaintenanceWindows.
13731func (mw MaintenanceWindows) MarshalJSON() ([]byte, error) {
13732	objectMap := make(map[string]interface{})
13733	if mw.MaintenanceWindowsProperties != nil {
13734		objectMap["properties"] = mw.MaintenanceWindowsProperties
13735	}
13736	return json.Marshal(objectMap)
13737}
13738
13739// UnmarshalJSON is the custom unmarshaler for MaintenanceWindows struct.
13740func (mw *MaintenanceWindows) UnmarshalJSON(body []byte) error {
13741	var m map[string]*json.RawMessage
13742	err := json.Unmarshal(body, &m)
13743	if err != nil {
13744		return err
13745	}
13746	for k, v := range m {
13747		switch k {
13748		case "properties":
13749			if v != nil {
13750				var maintenanceWindowsProperties MaintenanceWindowsProperties
13751				err = json.Unmarshal(*v, &maintenanceWindowsProperties)
13752				if err != nil {
13753					return err
13754				}
13755				mw.MaintenanceWindowsProperties = &maintenanceWindowsProperties
13756			}
13757		case "id":
13758			if v != nil {
13759				var ID string
13760				err = json.Unmarshal(*v, &ID)
13761				if err != nil {
13762					return err
13763				}
13764				mw.ID = &ID
13765			}
13766		case "name":
13767			if v != nil {
13768				var name string
13769				err = json.Unmarshal(*v, &name)
13770				if err != nil {
13771					return err
13772				}
13773				mw.Name = &name
13774			}
13775		case "type":
13776			if v != nil {
13777				var typeVar string
13778				err = json.Unmarshal(*v, &typeVar)
13779				if err != nil {
13780					return err
13781				}
13782				mw.Type = &typeVar
13783			}
13784		}
13785	}
13786
13787	return nil
13788}
13789
13790// MaintenanceWindowsProperties maintenance windows resource properties.
13791type MaintenanceWindowsProperties struct {
13792	TimeRanges *[]MaintenanceWindowTimeRange `json:"timeRanges,omitempty"`
13793}
13794
13795// MaintenanceWindowTimeRange maintenance window time range.
13796type MaintenanceWindowTimeRange struct {
13797	// DayOfWeek - Day of maintenance window. Possible values include: 'DayOfWeekSunday', 'DayOfWeekMonday', 'DayOfWeekTuesday', 'DayOfWeekWednesday', 'DayOfWeekThursday', 'DayOfWeekFriday', 'DayOfWeekSaturday'
13798	DayOfWeek DayOfWeek `json:"dayOfWeek,omitempty"`
13799	// StartTime - Start time minutes offset from 12am.
13800	StartTime *string `json:"startTime,omitempty"`
13801	// Duration - Duration of maintenance window in minutes.
13802	Duration *string `json:"duration,omitempty"`
13803}
13804
13805// ManagedBackupShortTermRetentionPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving
13806// the results of a long-running operation.
13807type ManagedBackupShortTermRetentionPoliciesCreateOrUpdateFuture struct {
13808	azure.FutureAPI
13809	// Result returns the result of the asynchronous operation.
13810	// If the operation has not completed it will return an error.
13811	Result func(ManagedBackupShortTermRetentionPoliciesClient) (ManagedBackupShortTermRetentionPolicy, error)
13812}
13813
13814// UnmarshalJSON is the custom unmarshaller for CreateFuture.
13815func (future *ManagedBackupShortTermRetentionPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
13816	var azFuture azure.Future
13817	if err := json.Unmarshal(body, &azFuture); err != nil {
13818		return err
13819	}
13820	future.FutureAPI = &azFuture
13821	future.Result = future.result
13822	return nil
13823}
13824
13825// result is the default implementation for ManagedBackupShortTermRetentionPoliciesCreateOrUpdateFuture.Result.
13826func (future *ManagedBackupShortTermRetentionPoliciesCreateOrUpdateFuture) result(client ManagedBackupShortTermRetentionPoliciesClient) (mbstrp ManagedBackupShortTermRetentionPolicy, err error) {
13827	var done bool
13828	done, err = future.DoneWithContext(context.Background(), client)
13829	if err != nil {
13830		err = autorest.NewErrorWithError(err, "sql.ManagedBackupShortTermRetentionPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
13831		return
13832	}
13833	if !done {
13834		mbstrp.Response.Response = future.Response()
13835		err = azure.NewAsyncOpIncompleteError("sql.ManagedBackupShortTermRetentionPoliciesCreateOrUpdateFuture")
13836		return
13837	}
13838	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13839	if mbstrp.Response.Response, err = future.GetResult(sender); err == nil && mbstrp.Response.Response.StatusCode != http.StatusNoContent {
13840		mbstrp, err = client.CreateOrUpdateResponder(mbstrp.Response.Response)
13841		if err != nil {
13842			err = autorest.NewErrorWithError(err, "sql.ManagedBackupShortTermRetentionPoliciesCreateOrUpdateFuture", "Result", mbstrp.Response.Response, "Failure responding to request")
13843		}
13844	}
13845	return
13846}
13847
13848// ManagedBackupShortTermRetentionPoliciesUpdateFuture an abstraction for monitoring and retrieving the
13849// results of a long-running operation.
13850type ManagedBackupShortTermRetentionPoliciesUpdateFuture struct {
13851	azure.FutureAPI
13852	// Result returns the result of the asynchronous operation.
13853	// If the operation has not completed it will return an error.
13854	Result func(ManagedBackupShortTermRetentionPoliciesClient) (ManagedBackupShortTermRetentionPolicy, error)
13855}
13856
13857// UnmarshalJSON is the custom unmarshaller for CreateFuture.
13858func (future *ManagedBackupShortTermRetentionPoliciesUpdateFuture) UnmarshalJSON(body []byte) error {
13859	var azFuture azure.Future
13860	if err := json.Unmarshal(body, &azFuture); err != nil {
13861		return err
13862	}
13863	future.FutureAPI = &azFuture
13864	future.Result = future.result
13865	return nil
13866}
13867
13868// result is the default implementation for ManagedBackupShortTermRetentionPoliciesUpdateFuture.Result.
13869func (future *ManagedBackupShortTermRetentionPoliciesUpdateFuture) result(client ManagedBackupShortTermRetentionPoliciesClient) (mbstrp ManagedBackupShortTermRetentionPolicy, err error) {
13870	var done bool
13871	done, err = future.DoneWithContext(context.Background(), client)
13872	if err != nil {
13873		err = autorest.NewErrorWithError(err, "sql.ManagedBackupShortTermRetentionPoliciesUpdateFuture", "Result", future.Response(), "Polling failure")
13874		return
13875	}
13876	if !done {
13877		mbstrp.Response.Response = future.Response()
13878		err = azure.NewAsyncOpIncompleteError("sql.ManagedBackupShortTermRetentionPoliciesUpdateFuture")
13879		return
13880	}
13881	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13882	if mbstrp.Response.Response, err = future.GetResult(sender); err == nil && mbstrp.Response.Response.StatusCode != http.StatusNoContent {
13883		mbstrp, err = client.UpdateResponder(mbstrp.Response.Response)
13884		if err != nil {
13885			err = autorest.NewErrorWithError(err, "sql.ManagedBackupShortTermRetentionPoliciesUpdateFuture", "Result", mbstrp.Response.Response, "Failure responding to request")
13886		}
13887	}
13888	return
13889}
13890
13891// ManagedBackupShortTermRetentionPolicy a short term retention policy.
13892type ManagedBackupShortTermRetentionPolicy struct {
13893	autorest.Response `json:"-"`
13894	// ManagedBackupShortTermRetentionPolicyProperties - Resource properties.
13895	*ManagedBackupShortTermRetentionPolicyProperties `json:"properties,omitempty"`
13896	// ID - READ-ONLY; Resource ID.
13897	ID *string `json:"id,omitempty"`
13898	// Name - READ-ONLY; Resource name.
13899	Name *string `json:"name,omitempty"`
13900	// Type - READ-ONLY; Resource type.
13901	Type *string `json:"type,omitempty"`
13902}
13903
13904// MarshalJSON is the custom marshaler for ManagedBackupShortTermRetentionPolicy.
13905func (mbstrp ManagedBackupShortTermRetentionPolicy) MarshalJSON() ([]byte, error) {
13906	objectMap := make(map[string]interface{})
13907	if mbstrp.ManagedBackupShortTermRetentionPolicyProperties != nil {
13908		objectMap["properties"] = mbstrp.ManagedBackupShortTermRetentionPolicyProperties
13909	}
13910	return json.Marshal(objectMap)
13911}
13912
13913// UnmarshalJSON is the custom unmarshaler for ManagedBackupShortTermRetentionPolicy struct.
13914func (mbstrp *ManagedBackupShortTermRetentionPolicy) UnmarshalJSON(body []byte) error {
13915	var m map[string]*json.RawMessage
13916	err := json.Unmarshal(body, &m)
13917	if err != nil {
13918		return err
13919	}
13920	for k, v := range m {
13921		switch k {
13922		case "properties":
13923			if v != nil {
13924				var managedBackupShortTermRetentionPolicyProperties ManagedBackupShortTermRetentionPolicyProperties
13925				err = json.Unmarshal(*v, &managedBackupShortTermRetentionPolicyProperties)
13926				if err != nil {
13927					return err
13928				}
13929				mbstrp.ManagedBackupShortTermRetentionPolicyProperties = &managedBackupShortTermRetentionPolicyProperties
13930			}
13931		case "id":
13932			if v != nil {
13933				var ID string
13934				err = json.Unmarshal(*v, &ID)
13935				if err != nil {
13936					return err
13937				}
13938				mbstrp.ID = &ID
13939			}
13940		case "name":
13941			if v != nil {
13942				var name string
13943				err = json.Unmarshal(*v, &name)
13944				if err != nil {
13945					return err
13946				}
13947				mbstrp.Name = &name
13948			}
13949		case "type":
13950			if v != nil {
13951				var typeVar string
13952				err = json.Unmarshal(*v, &typeVar)
13953				if err != nil {
13954					return err
13955				}
13956				mbstrp.Type = &typeVar
13957			}
13958		}
13959	}
13960
13961	return nil
13962}
13963
13964// ManagedBackupShortTermRetentionPolicyListResult a list of short term retention policies.
13965type ManagedBackupShortTermRetentionPolicyListResult struct {
13966	autorest.Response `json:"-"`
13967	// Value - READ-ONLY; Array of results.
13968	Value *[]ManagedBackupShortTermRetentionPolicy `json:"value,omitempty"`
13969	// NextLink - READ-ONLY; Link to retrieve next page of results.
13970	NextLink *string `json:"nextLink,omitempty"`
13971}
13972
13973// MarshalJSON is the custom marshaler for ManagedBackupShortTermRetentionPolicyListResult.
13974func (mbstrplr ManagedBackupShortTermRetentionPolicyListResult) MarshalJSON() ([]byte, error) {
13975	objectMap := make(map[string]interface{})
13976	return json.Marshal(objectMap)
13977}
13978
13979// ManagedBackupShortTermRetentionPolicyListResultIterator provides access to a complete listing of
13980// ManagedBackupShortTermRetentionPolicy values.
13981type ManagedBackupShortTermRetentionPolicyListResultIterator struct {
13982	i    int
13983	page ManagedBackupShortTermRetentionPolicyListResultPage
13984}
13985
13986// NextWithContext advances to the next value.  If there was an error making
13987// the request the iterator does not advance and the error is returned.
13988func (iter *ManagedBackupShortTermRetentionPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
13989	if tracing.IsEnabled() {
13990		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedBackupShortTermRetentionPolicyListResultIterator.NextWithContext")
13991		defer func() {
13992			sc := -1
13993			if iter.Response().Response.Response != nil {
13994				sc = iter.Response().Response.Response.StatusCode
13995			}
13996			tracing.EndSpan(ctx, sc, err)
13997		}()
13998	}
13999	iter.i++
14000	if iter.i < len(iter.page.Values()) {
14001		return nil
14002	}
14003	err = iter.page.NextWithContext(ctx)
14004	if err != nil {
14005		iter.i--
14006		return err
14007	}
14008	iter.i = 0
14009	return nil
14010}
14011
14012// Next advances to the next value.  If there was an error making
14013// the request the iterator does not advance and the error is returned.
14014// Deprecated: Use NextWithContext() instead.
14015func (iter *ManagedBackupShortTermRetentionPolicyListResultIterator) Next() error {
14016	return iter.NextWithContext(context.Background())
14017}
14018
14019// NotDone returns true if the enumeration should be started or is not yet complete.
14020func (iter ManagedBackupShortTermRetentionPolicyListResultIterator) NotDone() bool {
14021	return iter.page.NotDone() && iter.i < len(iter.page.Values())
14022}
14023
14024// Response returns the raw server response from the last page request.
14025func (iter ManagedBackupShortTermRetentionPolicyListResultIterator) Response() ManagedBackupShortTermRetentionPolicyListResult {
14026	return iter.page.Response()
14027}
14028
14029// Value returns the current value or a zero-initialized value if the
14030// iterator has advanced beyond the end of the collection.
14031func (iter ManagedBackupShortTermRetentionPolicyListResultIterator) Value() ManagedBackupShortTermRetentionPolicy {
14032	if !iter.page.NotDone() {
14033		return ManagedBackupShortTermRetentionPolicy{}
14034	}
14035	return iter.page.Values()[iter.i]
14036}
14037
14038// Creates a new instance of the ManagedBackupShortTermRetentionPolicyListResultIterator type.
14039func NewManagedBackupShortTermRetentionPolicyListResultIterator(page ManagedBackupShortTermRetentionPolicyListResultPage) ManagedBackupShortTermRetentionPolicyListResultIterator {
14040	return ManagedBackupShortTermRetentionPolicyListResultIterator{page: page}
14041}
14042
14043// IsEmpty returns true if the ListResult contains no values.
14044func (mbstrplr ManagedBackupShortTermRetentionPolicyListResult) IsEmpty() bool {
14045	return mbstrplr.Value == nil || len(*mbstrplr.Value) == 0
14046}
14047
14048// hasNextLink returns true if the NextLink is not empty.
14049func (mbstrplr ManagedBackupShortTermRetentionPolicyListResult) hasNextLink() bool {
14050	return mbstrplr.NextLink != nil && len(*mbstrplr.NextLink) != 0
14051}
14052
14053// managedBackupShortTermRetentionPolicyListResultPreparer prepares a request to retrieve the next set of results.
14054// It returns nil if no more results exist.
14055func (mbstrplr ManagedBackupShortTermRetentionPolicyListResult) managedBackupShortTermRetentionPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
14056	if !mbstrplr.hasNextLink() {
14057		return nil, nil
14058	}
14059	return autorest.Prepare((&http.Request{}).WithContext(ctx),
14060		autorest.AsJSON(),
14061		autorest.AsGet(),
14062		autorest.WithBaseURL(to.String(mbstrplr.NextLink)))
14063}
14064
14065// ManagedBackupShortTermRetentionPolicyListResultPage contains a page of
14066// ManagedBackupShortTermRetentionPolicy values.
14067type ManagedBackupShortTermRetentionPolicyListResultPage struct {
14068	fn       func(context.Context, ManagedBackupShortTermRetentionPolicyListResult) (ManagedBackupShortTermRetentionPolicyListResult, error)
14069	mbstrplr ManagedBackupShortTermRetentionPolicyListResult
14070}
14071
14072// NextWithContext advances to the next page of values.  If there was an error making
14073// the request the page does not advance and the error is returned.
14074func (page *ManagedBackupShortTermRetentionPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
14075	if tracing.IsEnabled() {
14076		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedBackupShortTermRetentionPolicyListResultPage.NextWithContext")
14077		defer func() {
14078			sc := -1
14079			if page.Response().Response.Response != nil {
14080				sc = page.Response().Response.Response.StatusCode
14081			}
14082			tracing.EndSpan(ctx, sc, err)
14083		}()
14084	}
14085	for {
14086		next, err := page.fn(ctx, page.mbstrplr)
14087		if err != nil {
14088			return err
14089		}
14090		page.mbstrplr = next
14091		if !next.hasNextLink() || !next.IsEmpty() {
14092			break
14093		}
14094	}
14095	return nil
14096}
14097
14098// Next advances to the next page of values.  If there was an error making
14099// the request the page does not advance and the error is returned.
14100// Deprecated: Use NextWithContext() instead.
14101func (page *ManagedBackupShortTermRetentionPolicyListResultPage) Next() error {
14102	return page.NextWithContext(context.Background())
14103}
14104
14105// NotDone returns true if the page enumeration should be started or is not yet complete.
14106func (page ManagedBackupShortTermRetentionPolicyListResultPage) NotDone() bool {
14107	return !page.mbstrplr.IsEmpty()
14108}
14109
14110// Response returns the raw server response from the last page request.
14111func (page ManagedBackupShortTermRetentionPolicyListResultPage) Response() ManagedBackupShortTermRetentionPolicyListResult {
14112	return page.mbstrplr
14113}
14114
14115// Values returns the slice of values for the current page or nil if there are no values.
14116func (page ManagedBackupShortTermRetentionPolicyListResultPage) Values() []ManagedBackupShortTermRetentionPolicy {
14117	if page.mbstrplr.IsEmpty() {
14118		return nil
14119	}
14120	return *page.mbstrplr.Value
14121}
14122
14123// Creates a new instance of the ManagedBackupShortTermRetentionPolicyListResultPage type.
14124func NewManagedBackupShortTermRetentionPolicyListResultPage(cur ManagedBackupShortTermRetentionPolicyListResult, getNextPage func(context.Context, ManagedBackupShortTermRetentionPolicyListResult) (ManagedBackupShortTermRetentionPolicyListResult, error)) ManagedBackupShortTermRetentionPolicyListResultPage {
14125	return ManagedBackupShortTermRetentionPolicyListResultPage{
14126		fn:       getNextPage,
14127		mbstrplr: cur,
14128	}
14129}
14130
14131// ManagedBackupShortTermRetentionPolicyProperties properties of a short term retention policy
14132type ManagedBackupShortTermRetentionPolicyProperties struct {
14133	// RetentionDays - The backup retention period in days. This is how many days Point-in-Time Restore will be supported.
14134	RetentionDays *int32 `json:"retentionDays,omitempty"`
14135}
14136
14137// ManagedDatabase a managed database resource.
14138type ManagedDatabase struct {
14139	autorest.Response `json:"-"`
14140	// ManagedDatabaseProperties - Resource properties.
14141	*ManagedDatabaseProperties `json:"properties,omitempty"`
14142	// Location - Resource location.
14143	Location *string `json:"location,omitempty"`
14144	// Tags - Resource tags.
14145	Tags map[string]*string `json:"tags"`
14146	// ID - READ-ONLY; Resource ID.
14147	ID *string `json:"id,omitempty"`
14148	// Name - READ-ONLY; Resource name.
14149	Name *string `json:"name,omitempty"`
14150	// Type - READ-ONLY; Resource type.
14151	Type *string `json:"type,omitempty"`
14152}
14153
14154// MarshalJSON is the custom marshaler for ManagedDatabase.
14155func (md ManagedDatabase) MarshalJSON() ([]byte, error) {
14156	objectMap := make(map[string]interface{})
14157	if md.ManagedDatabaseProperties != nil {
14158		objectMap["properties"] = md.ManagedDatabaseProperties
14159	}
14160	if md.Location != nil {
14161		objectMap["location"] = md.Location
14162	}
14163	if md.Tags != nil {
14164		objectMap["tags"] = md.Tags
14165	}
14166	return json.Marshal(objectMap)
14167}
14168
14169// UnmarshalJSON is the custom unmarshaler for ManagedDatabase struct.
14170func (md *ManagedDatabase) UnmarshalJSON(body []byte) error {
14171	var m map[string]*json.RawMessage
14172	err := json.Unmarshal(body, &m)
14173	if err != nil {
14174		return err
14175	}
14176	for k, v := range m {
14177		switch k {
14178		case "properties":
14179			if v != nil {
14180				var managedDatabaseProperties ManagedDatabaseProperties
14181				err = json.Unmarshal(*v, &managedDatabaseProperties)
14182				if err != nil {
14183					return err
14184				}
14185				md.ManagedDatabaseProperties = &managedDatabaseProperties
14186			}
14187		case "location":
14188			if v != nil {
14189				var location string
14190				err = json.Unmarshal(*v, &location)
14191				if err != nil {
14192					return err
14193				}
14194				md.Location = &location
14195			}
14196		case "tags":
14197			if v != nil {
14198				var tags map[string]*string
14199				err = json.Unmarshal(*v, &tags)
14200				if err != nil {
14201					return err
14202				}
14203				md.Tags = tags
14204			}
14205		case "id":
14206			if v != nil {
14207				var ID string
14208				err = json.Unmarshal(*v, &ID)
14209				if err != nil {
14210					return err
14211				}
14212				md.ID = &ID
14213			}
14214		case "name":
14215			if v != nil {
14216				var name string
14217				err = json.Unmarshal(*v, &name)
14218				if err != nil {
14219					return err
14220				}
14221				md.Name = &name
14222			}
14223		case "type":
14224			if v != nil {
14225				var typeVar string
14226				err = json.Unmarshal(*v, &typeVar)
14227				if err != nil {
14228					return err
14229				}
14230				md.Type = &typeVar
14231			}
14232		}
14233	}
14234
14235	return nil
14236}
14237
14238// ManagedDatabaseListResult a list of managed databases.
14239type ManagedDatabaseListResult struct {
14240	autorest.Response `json:"-"`
14241	// Value - READ-ONLY; Array of results.
14242	Value *[]ManagedDatabase `json:"value,omitempty"`
14243	// NextLink - READ-ONLY; Link to retrieve next page of results.
14244	NextLink *string `json:"nextLink,omitempty"`
14245}
14246
14247// MarshalJSON is the custom marshaler for ManagedDatabaseListResult.
14248func (mdlr ManagedDatabaseListResult) MarshalJSON() ([]byte, error) {
14249	objectMap := make(map[string]interface{})
14250	return json.Marshal(objectMap)
14251}
14252
14253// ManagedDatabaseListResultIterator provides access to a complete listing of ManagedDatabase values.
14254type ManagedDatabaseListResultIterator struct {
14255	i    int
14256	page ManagedDatabaseListResultPage
14257}
14258
14259// NextWithContext advances to the next value.  If there was an error making
14260// the request the iterator does not advance and the error is returned.
14261func (iter *ManagedDatabaseListResultIterator) NextWithContext(ctx context.Context) (err error) {
14262	if tracing.IsEnabled() {
14263		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseListResultIterator.NextWithContext")
14264		defer func() {
14265			sc := -1
14266			if iter.Response().Response.Response != nil {
14267				sc = iter.Response().Response.Response.StatusCode
14268			}
14269			tracing.EndSpan(ctx, sc, err)
14270		}()
14271	}
14272	iter.i++
14273	if iter.i < len(iter.page.Values()) {
14274		return nil
14275	}
14276	err = iter.page.NextWithContext(ctx)
14277	if err != nil {
14278		iter.i--
14279		return err
14280	}
14281	iter.i = 0
14282	return nil
14283}
14284
14285// Next advances to the next value.  If there was an error making
14286// the request the iterator does not advance and the error is returned.
14287// Deprecated: Use NextWithContext() instead.
14288func (iter *ManagedDatabaseListResultIterator) Next() error {
14289	return iter.NextWithContext(context.Background())
14290}
14291
14292// NotDone returns true if the enumeration should be started or is not yet complete.
14293func (iter ManagedDatabaseListResultIterator) NotDone() bool {
14294	return iter.page.NotDone() && iter.i < len(iter.page.Values())
14295}
14296
14297// Response returns the raw server response from the last page request.
14298func (iter ManagedDatabaseListResultIterator) Response() ManagedDatabaseListResult {
14299	return iter.page.Response()
14300}
14301
14302// Value returns the current value or a zero-initialized value if the
14303// iterator has advanced beyond the end of the collection.
14304func (iter ManagedDatabaseListResultIterator) Value() ManagedDatabase {
14305	if !iter.page.NotDone() {
14306		return ManagedDatabase{}
14307	}
14308	return iter.page.Values()[iter.i]
14309}
14310
14311// Creates a new instance of the ManagedDatabaseListResultIterator type.
14312func NewManagedDatabaseListResultIterator(page ManagedDatabaseListResultPage) ManagedDatabaseListResultIterator {
14313	return ManagedDatabaseListResultIterator{page: page}
14314}
14315
14316// IsEmpty returns true if the ListResult contains no values.
14317func (mdlr ManagedDatabaseListResult) IsEmpty() bool {
14318	return mdlr.Value == nil || len(*mdlr.Value) == 0
14319}
14320
14321// hasNextLink returns true if the NextLink is not empty.
14322func (mdlr ManagedDatabaseListResult) hasNextLink() bool {
14323	return mdlr.NextLink != nil && len(*mdlr.NextLink) != 0
14324}
14325
14326// managedDatabaseListResultPreparer prepares a request to retrieve the next set of results.
14327// It returns nil if no more results exist.
14328func (mdlr ManagedDatabaseListResult) managedDatabaseListResultPreparer(ctx context.Context) (*http.Request, error) {
14329	if !mdlr.hasNextLink() {
14330		return nil, nil
14331	}
14332	return autorest.Prepare((&http.Request{}).WithContext(ctx),
14333		autorest.AsJSON(),
14334		autorest.AsGet(),
14335		autorest.WithBaseURL(to.String(mdlr.NextLink)))
14336}
14337
14338// ManagedDatabaseListResultPage contains a page of ManagedDatabase values.
14339type ManagedDatabaseListResultPage struct {
14340	fn   func(context.Context, ManagedDatabaseListResult) (ManagedDatabaseListResult, error)
14341	mdlr ManagedDatabaseListResult
14342}
14343
14344// NextWithContext advances to the next page of values.  If there was an error making
14345// the request the page does not advance and the error is returned.
14346func (page *ManagedDatabaseListResultPage) NextWithContext(ctx context.Context) (err error) {
14347	if tracing.IsEnabled() {
14348		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseListResultPage.NextWithContext")
14349		defer func() {
14350			sc := -1
14351			if page.Response().Response.Response != nil {
14352				sc = page.Response().Response.Response.StatusCode
14353			}
14354			tracing.EndSpan(ctx, sc, err)
14355		}()
14356	}
14357	for {
14358		next, err := page.fn(ctx, page.mdlr)
14359		if err != nil {
14360			return err
14361		}
14362		page.mdlr = next
14363		if !next.hasNextLink() || !next.IsEmpty() {
14364			break
14365		}
14366	}
14367	return nil
14368}
14369
14370// Next advances to the next page of values.  If there was an error making
14371// the request the page does not advance and the error is returned.
14372// Deprecated: Use NextWithContext() instead.
14373func (page *ManagedDatabaseListResultPage) Next() error {
14374	return page.NextWithContext(context.Background())
14375}
14376
14377// NotDone returns true if the page enumeration should be started or is not yet complete.
14378func (page ManagedDatabaseListResultPage) NotDone() bool {
14379	return !page.mdlr.IsEmpty()
14380}
14381
14382// Response returns the raw server response from the last page request.
14383func (page ManagedDatabaseListResultPage) Response() ManagedDatabaseListResult {
14384	return page.mdlr
14385}
14386
14387// Values returns the slice of values for the current page or nil if there are no values.
14388func (page ManagedDatabaseListResultPage) Values() []ManagedDatabase {
14389	if page.mdlr.IsEmpty() {
14390		return nil
14391	}
14392	return *page.mdlr.Value
14393}
14394
14395// Creates a new instance of the ManagedDatabaseListResultPage type.
14396func NewManagedDatabaseListResultPage(cur ManagedDatabaseListResult, getNextPage func(context.Context, ManagedDatabaseListResult) (ManagedDatabaseListResult, error)) ManagedDatabaseListResultPage {
14397	return ManagedDatabaseListResultPage{
14398		fn:   getNextPage,
14399		mdlr: cur,
14400	}
14401}
14402
14403// ManagedDatabaseProperties the managed database's properties.
14404type ManagedDatabaseProperties struct {
14405	// Collation - Collation of the managed database.
14406	Collation *string `json:"collation,omitempty"`
14407	// Status - READ-ONLY; Status of the database. Possible values include: 'ManagedDatabaseStatusOnline', 'ManagedDatabaseStatusOffline', 'ManagedDatabaseStatusShutdown', 'ManagedDatabaseStatusCreating', 'ManagedDatabaseStatusInaccessible', 'ManagedDatabaseStatusRestoring', 'ManagedDatabaseStatusUpdating'
14408	Status ManagedDatabaseStatus `json:"status,omitempty"`
14409	// CreationDate - READ-ONLY; Creation date of the database.
14410	CreationDate *date.Time `json:"creationDate,omitempty"`
14411	// EarliestRestorePoint - READ-ONLY; Earliest restore point in time for point in time restore.
14412	EarliestRestorePoint *date.Time `json:"earliestRestorePoint,omitempty"`
14413	// 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.
14414	RestorePointInTime *date.Time `json:"restorePointInTime,omitempty"`
14415	// DefaultSecondaryLocation - READ-ONLY; Geo paired region.
14416	DefaultSecondaryLocation *string `json:"defaultSecondaryLocation,omitempty"`
14417	// CatalogCollation - Collation of the metadata catalog. Possible values include: 'CatalogCollationTypeDATABASEDEFAULT', 'CatalogCollationTypeSQLLatin1GeneralCP1CIAS'
14418	CatalogCollation CatalogCollationType `json:"catalogCollation,omitempty"`
14419	// 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. Recovery: Creates a database by restoring a geo-replicated backup. RecoverableDatabaseId must be specified as the recoverable database resource ID to restore. RestoreLongTermRetentionBackup: Create a database by restoring from a long term retention backup (longTermRetentionBackupResourceId required). Possible values include: 'ManagedDatabaseCreateModeDefault', 'ManagedDatabaseCreateModeRestoreExternalBackup', 'ManagedDatabaseCreateModePointInTimeRestore', 'ManagedDatabaseCreateModeRecovery', 'ManagedDatabaseCreateModeRestoreLongTermRetentionBackup'
14420	CreateMode ManagedDatabaseCreateMode `json:"createMode,omitempty"`
14421	// StorageContainerURI - Conditional. If createMode is RestoreExternalBackup, this value is required. Specifies the uri of the storage container where backups for this restore are stored.
14422	StorageContainerURI *string `json:"storageContainerUri,omitempty"`
14423	// SourceDatabaseID - The resource identifier of the source database associated with create operation of this database.
14424	SourceDatabaseID *string `json:"sourceDatabaseId,omitempty"`
14425	// RestorableDroppedDatabaseID - The restorable dropped database resource id to restore when creating this database.
14426	RestorableDroppedDatabaseID *string `json:"restorableDroppedDatabaseId,omitempty"`
14427	// StorageContainerSasToken - Conditional. If createMode is RestoreExternalBackup, this value is required. Specifies the storage container sas token.
14428	StorageContainerSasToken *string `json:"storageContainerSasToken,omitempty"`
14429	// FailoverGroupID - READ-ONLY; Instance Failover Group resource identifier that this managed database belongs to.
14430	FailoverGroupID *string `json:"failoverGroupId,omitempty"`
14431	// RecoverableDatabaseID - The resource identifier of the recoverable database associated with create operation of this database.
14432	RecoverableDatabaseID *string `json:"recoverableDatabaseId,omitempty"`
14433	// LongTermRetentionBackupResourceID - The name of the Long Term Retention backup to be used for restore of this managed database.
14434	LongTermRetentionBackupResourceID *string `json:"longTermRetentionBackupResourceId,omitempty"`
14435	// AutoCompleteRestore - Whether to auto complete restore of this managed database.
14436	AutoCompleteRestore *bool `json:"autoCompleteRestore,omitempty"`
14437	// LastBackupName - Last backup file name for restore of this managed database.
14438	LastBackupName *string `json:"lastBackupName,omitempty"`
14439}
14440
14441// MarshalJSON is the custom marshaler for ManagedDatabaseProperties.
14442func (mdp ManagedDatabaseProperties) MarshalJSON() ([]byte, error) {
14443	objectMap := make(map[string]interface{})
14444	if mdp.Collation != nil {
14445		objectMap["collation"] = mdp.Collation
14446	}
14447	if mdp.RestorePointInTime != nil {
14448		objectMap["restorePointInTime"] = mdp.RestorePointInTime
14449	}
14450	if mdp.CatalogCollation != "" {
14451		objectMap["catalogCollation"] = mdp.CatalogCollation
14452	}
14453	if mdp.CreateMode != "" {
14454		objectMap["createMode"] = mdp.CreateMode
14455	}
14456	if mdp.StorageContainerURI != nil {
14457		objectMap["storageContainerUri"] = mdp.StorageContainerURI
14458	}
14459	if mdp.SourceDatabaseID != nil {
14460		objectMap["sourceDatabaseId"] = mdp.SourceDatabaseID
14461	}
14462	if mdp.RestorableDroppedDatabaseID != nil {
14463		objectMap["restorableDroppedDatabaseId"] = mdp.RestorableDroppedDatabaseID
14464	}
14465	if mdp.StorageContainerSasToken != nil {
14466		objectMap["storageContainerSasToken"] = mdp.StorageContainerSasToken
14467	}
14468	if mdp.RecoverableDatabaseID != nil {
14469		objectMap["recoverableDatabaseId"] = mdp.RecoverableDatabaseID
14470	}
14471	if mdp.LongTermRetentionBackupResourceID != nil {
14472		objectMap["longTermRetentionBackupResourceId"] = mdp.LongTermRetentionBackupResourceID
14473	}
14474	if mdp.AutoCompleteRestore != nil {
14475		objectMap["autoCompleteRestore"] = mdp.AutoCompleteRestore
14476	}
14477	if mdp.LastBackupName != nil {
14478		objectMap["lastBackupName"] = mdp.LastBackupName
14479	}
14480	return json.Marshal(objectMap)
14481}
14482
14483// ManagedDatabaseRestoreDetailsProperties the managed database's restore details properties.
14484type ManagedDatabaseRestoreDetailsProperties struct {
14485	// Status - READ-ONLY; Restore status.
14486	Status *string `json:"status,omitempty"`
14487	// CurrentRestoringFileName - READ-ONLY; Current restoring file name.
14488	CurrentRestoringFileName *string `json:"currentRestoringFileName,omitempty"`
14489	// LastRestoredFileName - READ-ONLY; Last restored file name.
14490	LastRestoredFileName *string `json:"lastRestoredFileName,omitempty"`
14491	// LastRestoredFileTime - READ-ONLY; Last restored file time.
14492	LastRestoredFileTime *date.Time `json:"lastRestoredFileTime,omitempty"`
14493	// PercentCompleted - READ-ONLY; Percent completed.
14494	PercentCompleted *float64 `json:"percentCompleted,omitempty"`
14495	// UnrestorableFiles - READ-ONLY; List of unrestorable files.
14496	UnrestorableFiles *[]string `json:"unrestorableFiles,omitempty"`
14497	// NumberOfFilesDetected - READ-ONLY; Number of files detected.
14498	NumberOfFilesDetected *int64 `json:"numberOfFilesDetected,omitempty"`
14499	// LastUploadedFileName - READ-ONLY; Last uploaded file name.
14500	LastUploadedFileName *string `json:"lastUploadedFileName,omitempty"`
14501	// LastUploadedFileTime - READ-ONLY; Last uploaded file time.
14502	LastUploadedFileTime *date.Time `json:"lastUploadedFileTime,omitempty"`
14503	// BlockReason - READ-ONLY; The reason why restore is in Blocked state.
14504	BlockReason *string `json:"blockReason,omitempty"`
14505}
14506
14507// MarshalJSON is the custom marshaler for ManagedDatabaseRestoreDetailsProperties.
14508func (mdrdp ManagedDatabaseRestoreDetailsProperties) MarshalJSON() ([]byte, error) {
14509	objectMap := make(map[string]interface{})
14510	return json.Marshal(objectMap)
14511}
14512
14513// ManagedDatabaseRestoreDetailsResult a managed database restore details.
14514type ManagedDatabaseRestoreDetailsResult struct {
14515	autorest.Response `json:"-"`
14516	// ManagedDatabaseRestoreDetailsProperties - Resource properties.
14517	*ManagedDatabaseRestoreDetailsProperties `json:"properties,omitempty"`
14518	// ID - READ-ONLY; Resource ID.
14519	ID *string `json:"id,omitempty"`
14520	// Name - READ-ONLY; Resource name.
14521	Name *string `json:"name,omitempty"`
14522	// Type - READ-ONLY; Resource type.
14523	Type *string `json:"type,omitempty"`
14524}
14525
14526// MarshalJSON is the custom marshaler for ManagedDatabaseRestoreDetailsResult.
14527func (mdrdr ManagedDatabaseRestoreDetailsResult) MarshalJSON() ([]byte, error) {
14528	objectMap := make(map[string]interface{})
14529	if mdrdr.ManagedDatabaseRestoreDetailsProperties != nil {
14530		objectMap["properties"] = mdrdr.ManagedDatabaseRestoreDetailsProperties
14531	}
14532	return json.Marshal(objectMap)
14533}
14534
14535// UnmarshalJSON is the custom unmarshaler for ManagedDatabaseRestoreDetailsResult struct.
14536func (mdrdr *ManagedDatabaseRestoreDetailsResult) UnmarshalJSON(body []byte) error {
14537	var m map[string]*json.RawMessage
14538	err := json.Unmarshal(body, &m)
14539	if err != nil {
14540		return err
14541	}
14542	for k, v := range m {
14543		switch k {
14544		case "properties":
14545			if v != nil {
14546				var managedDatabaseRestoreDetailsProperties ManagedDatabaseRestoreDetailsProperties
14547				err = json.Unmarshal(*v, &managedDatabaseRestoreDetailsProperties)
14548				if err != nil {
14549					return err
14550				}
14551				mdrdr.ManagedDatabaseRestoreDetailsProperties = &managedDatabaseRestoreDetailsProperties
14552			}
14553		case "id":
14554			if v != nil {
14555				var ID string
14556				err = json.Unmarshal(*v, &ID)
14557				if err != nil {
14558					return err
14559				}
14560				mdrdr.ID = &ID
14561			}
14562		case "name":
14563			if v != nil {
14564				var name string
14565				err = json.Unmarshal(*v, &name)
14566				if err != nil {
14567					return err
14568				}
14569				mdrdr.Name = &name
14570			}
14571		case "type":
14572			if v != nil {
14573				var typeVar string
14574				err = json.Unmarshal(*v, &typeVar)
14575				if err != nil {
14576					return err
14577				}
14578				mdrdr.Type = &typeVar
14579			}
14580		}
14581	}
14582
14583	return nil
14584}
14585
14586// ManagedDatabasesCompleteRestoreFuture an abstraction for monitoring and retrieving the results of a
14587// long-running operation.
14588type ManagedDatabasesCompleteRestoreFuture struct {
14589	azure.FutureAPI
14590	// Result returns the result of the asynchronous operation.
14591	// If the operation has not completed it will return an error.
14592	Result func(ManagedDatabasesClient) (autorest.Response, error)
14593}
14594
14595// UnmarshalJSON is the custom unmarshaller for CreateFuture.
14596func (future *ManagedDatabasesCompleteRestoreFuture) UnmarshalJSON(body []byte) error {
14597	var azFuture azure.Future
14598	if err := json.Unmarshal(body, &azFuture); err != nil {
14599		return err
14600	}
14601	future.FutureAPI = &azFuture
14602	future.Result = future.result
14603	return nil
14604}
14605
14606// result is the default implementation for ManagedDatabasesCompleteRestoreFuture.Result.
14607func (future *ManagedDatabasesCompleteRestoreFuture) result(client ManagedDatabasesClient) (ar autorest.Response, err error) {
14608	var done bool
14609	done, err = future.DoneWithContext(context.Background(), client)
14610	if err != nil {
14611		err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesCompleteRestoreFuture", "Result", future.Response(), "Polling failure")
14612		return
14613	}
14614	if !done {
14615		ar.Response = future.Response()
14616		err = azure.NewAsyncOpIncompleteError("sql.ManagedDatabasesCompleteRestoreFuture")
14617		return
14618	}
14619	ar.Response = future.Response()
14620	return
14621}
14622
14623// ManagedDatabasesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
14624// long-running operation.
14625type ManagedDatabasesCreateOrUpdateFuture struct {
14626	azure.FutureAPI
14627	// Result returns the result of the asynchronous operation.
14628	// If the operation has not completed it will return an error.
14629	Result func(ManagedDatabasesClient) (ManagedDatabase, error)
14630}
14631
14632// UnmarshalJSON is the custom unmarshaller for CreateFuture.
14633func (future *ManagedDatabasesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
14634	var azFuture azure.Future
14635	if err := json.Unmarshal(body, &azFuture); err != nil {
14636		return err
14637	}
14638	future.FutureAPI = &azFuture
14639	future.Result = future.result
14640	return nil
14641}
14642
14643// result is the default implementation for ManagedDatabasesCreateOrUpdateFuture.Result.
14644func (future *ManagedDatabasesCreateOrUpdateFuture) result(client ManagedDatabasesClient) (md ManagedDatabase, err error) {
14645	var done bool
14646	done, err = future.DoneWithContext(context.Background(), client)
14647	if err != nil {
14648		err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
14649		return
14650	}
14651	if !done {
14652		md.Response.Response = future.Response()
14653		err = azure.NewAsyncOpIncompleteError("sql.ManagedDatabasesCreateOrUpdateFuture")
14654		return
14655	}
14656	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
14657	if md.Response.Response, err = future.GetResult(sender); err == nil && md.Response.Response.StatusCode != http.StatusNoContent {
14658		md, err = client.CreateOrUpdateResponder(md.Response.Response)
14659		if err != nil {
14660			err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesCreateOrUpdateFuture", "Result", md.Response.Response, "Failure responding to request")
14661		}
14662	}
14663	return
14664}
14665
14666// ManagedDatabasesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
14667// operation.
14668type ManagedDatabasesDeleteFuture struct {
14669	azure.FutureAPI
14670	// Result returns the result of the asynchronous operation.
14671	// If the operation has not completed it will return an error.
14672	Result func(ManagedDatabasesClient) (autorest.Response, error)
14673}
14674
14675// UnmarshalJSON is the custom unmarshaller for CreateFuture.
14676func (future *ManagedDatabasesDeleteFuture) UnmarshalJSON(body []byte) error {
14677	var azFuture azure.Future
14678	if err := json.Unmarshal(body, &azFuture); err != nil {
14679		return err
14680	}
14681	future.FutureAPI = &azFuture
14682	future.Result = future.result
14683	return nil
14684}
14685
14686// result is the default implementation for ManagedDatabasesDeleteFuture.Result.
14687func (future *ManagedDatabasesDeleteFuture) result(client ManagedDatabasesClient) (ar autorest.Response, err error) {
14688	var done bool
14689	done, err = future.DoneWithContext(context.Background(), client)
14690	if err != nil {
14691		err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesDeleteFuture", "Result", future.Response(), "Polling failure")
14692		return
14693	}
14694	if !done {
14695		ar.Response = future.Response()
14696		err = azure.NewAsyncOpIncompleteError("sql.ManagedDatabasesDeleteFuture")
14697		return
14698	}
14699	ar.Response = future.Response()
14700	return
14701}
14702
14703// ManagedDatabaseSecurityAlertPolicy a managed database security alert policy.
14704type ManagedDatabaseSecurityAlertPolicy struct {
14705	autorest.Response `json:"-"`
14706	// SecurityAlertPolicyProperties - Resource properties.
14707	*SecurityAlertPolicyProperties `json:"properties,omitempty"`
14708	// ID - READ-ONLY; Resource ID.
14709	ID *string `json:"id,omitempty"`
14710	// Name - READ-ONLY; Resource name.
14711	Name *string `json:"name,omitempty"`
14712	// Type - READ-ONLY; Resource type.
14713	Type *string `json:"type,omitempty"`
14714}
14715
14716// MarshalJSON is the custom marshaler for ManagedDatabaseSecurityAlertPolicy.
14717func (mdsap ManagedDatabaseSecurityAlertPolicy) MarshalJSON() ([]byte, error) {
14718	objectMap := make(map[string]interface{})
14719	if mdsap.SecurityAlertPolicyProperties != nil {
14720		objectMap["properties"] = mdsap.SecurityAlertPolicyProperties
14721	}
14722	return json.Marshal(objectMap)
14723}
14724
14725// UnmarshalJSON is the custom unmarshaler for ManagedDatabaseSecurityAlertPolicy struct.
14726func (mdsap *ManagedDatabaseSecurityAlertPolicy) UnmarshalJSON(body []byte) error {
14727	var m map[string]*json.RawMessage
14728	err := json.Unmarshal(body, &m)
14729	if err != nil {
14730		return err
14731	}
14732	for k, v := range m {
14733		switch k {
14734		case "properties":
14735			if v != nil {
14736				var securityAlertPolicyProperties SecurityAlertPolicyProperties
14737				err = json.Unmarshal(*v, &securityAlertPolicyProperties)
14738				if err != nil {
14739					return err
14740				}
14741				mdsap.SecurityAlertPolicyProperties = &securityAlertPolicyProperties
14742			}
14743		case "id":
14744			if v != nil {
14745				var ID string
14746				err = json.Unmarshal(*v, &ID)
14747				if err != nil {
14748					return err
14749				}
14750				mdsap.ID = &ID
14751			}
14752		case "name":
14753			if v != nil {
14754				var name string
14755				err = json.Unmarshal(*v, &name)
14756				if err != nil {
14757					return err
14758				}
14759				mdsap.Name = &name
14760			}
14761		case "type":
14762			if v != nil {
14763				var typeVar string
14764				err = json.Unmarshal(*v, &typeVar)
14765				if err != nil {
14766					return err
14767				}
14768				mdsap.Type = &typeVar
14769			}
14770		}
14771	}
14772
14773	return nil
14774}
14775
14776// ManagedDatabaseSecurityAlertPolicyListResult a list of the managed database's security alert policies.
14777type ManagedDatabaseSecurityAlertPolicyListResult struct {
14778	autorest.Response `json:"-"`
14779	// Value - READ-ONLY; Array of results.
14780	Value *[]ManagedDatabaseSecurityAlertPolicy `json:"value,omitempty"`
14781	// NextLink - READ-ONLY; Link to retrieve next page of results.
14782	NextLink *string `json:"nextLink,omitempty"`
14783}
14784
14785// MarshalJSON is the custom marshaler for ManagedDatabaseSecurityAlertPolicyListResult.
14786func (mdsaplr ManagedDatabaseSecurityAlertPolicyListResult) MarshalJSON() ([]byte, error) {
14787	objectMap := make(map[string]interface{})
14788	return json.Marshal(objectMap)
14789}
14790
14791// ManagedDatabaseSecurityAlertPolicyListResultIterator provides access to a complete listing of
14792// ManagedDatabaseSecurityAlertPolicy values.
14793type ManagedDatabaseSecurityAlertPolicyListResultIterator struct {
14794	i    int
14795	page ManagedDatabaseSecurityAlertPolicyListResultPage
14796}
14797
14798// NextWithContext advances to the next value.  If there was an error making
14799// the request the iterator does not advance and the error is returned.
14800func (iter *ManagedDatabaseSecurityAlertPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
14801	if tracing.IsEnabled() {
14802		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseSecurityAlertPolicyListResultIterator.NextWithContext")
14803		defer func() {
14804			sc := -1
14805			if iter.Response().Response.Response != nil {
14806				sc = iter.Response().Response.Response.StatusCode
14807			}
14808			tracing.EndSpan(ctx, sc, err)
14809		}()
14810	}
14811	iter.i++
14812	if iter.i < len(iter.page.Values()) {
14813		return nil
14814	}
14815	err = iter.page.NextWithContext(ctx)
14816	if err != nil {
14817		iter.i--
14818		return err
14819	}
14820	iter.i = 0
14821	return nil
14822}
14823
14824// Next advances to the next value.  If there was an error making
14825// the request the iterator does not advance and the error is returned.
14826// Deprecated: Use NextWithContext() instead.
14827func (iter *ManagedDatabaseSecurityAlertPolicyListResultIterator) Next() error {
14828	return iter.NextWithContext(context.Background())
14829}
14830
14831// NotDone returns true if the enumeration should be started or is not yet complete.
14832func (iter ManagedDatabaseSecurityAlertPolicyListResultIterator) NotDone() bool {
14833	return iter.page.NotDone() && iter.i < len(iter.page.Values())
14834}
14835
14836// Response returns the raw server response from the last page request.
14837func (iter ManagedDatabaseSecurityAlertPolicyListResultIterator) Response() ManagedDatabaseSecurityAlertPolicyListResult {
14838	return iter.page.Response()
14839}
14840
14841// Value returns the current value or a zero-initialized value if the
14842// iterator has advanced beyond the end of the collection.
14843func (iter ManagedDatabaseSecurityAlertPolicyListResultIterator) Value() ManagedDatabaseSecurityAlertPolicy {
14844	if !iter.page.NotDone() {
14845		return ManagedDatabaseSecurityAlertPolicy{}
14846	}
14847	return iter.page.Values()[iter.i]
14848}
14849
14850// Creates a new instance of the ManagedDatabaseSecurityAlertPolicyListResultIterator type.
14851func NewManagedDatabaseSecurityAlertPolicyListResultIterator(page ManagedDatabaseSecurityAlertPolicyListResultPage) ManagedDatabaseSecurityAlertPolicyListResultIterator {
14852	return ManagedDatabaseSecurityAlertPolicyListResultIterator{page: page}
14853}
14854
14855// IsEmpty returns true if the ListResult contains no values.
14856func (mdsaplr ManagedDatabaseSecurityAlertPolicyListResult) IsEmpty() bool {
14857	return mdsaplr.Value == nil || len(*mdsaplr.Value) == 0
14858}
14859
14860// hasNextLink returns true if the NextLink is not empty.
14861func (mdsaplr ManagedDatabaseSecurityAlertPolicyListResult) hasNextLink() bool {
14862	return mdsaplr.NextLink != nil && len(*mdsaplr.NextLink) != 0
14863}
14864
14865// managedDatabaseSecurityAlertPolicyListResultPreparer prepares a request to retrieve the next set of results.
14866// It returns nil if no more results exist.
14867func (mdsaplr ManagedDatabaseSecurityAlertPolicyListResult) managedDatabaseSecurityAlertPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
14868	if !mdsaplr.hasNextLink() {
14869		return nil, nil
14870	}
14871	return autorest.Prepare((&http.Request{}).WithContext(ctx),
14872		autorest.AsJSON(),
14873		autorest.AsGet(),
14874		autorest.WithBaseURL(to.String(mdsaplr.NextLink)))
14875}
14876
14877// ManagedDatabaseSecurityAlertPolicyListResultPage contains a page of ManagedDatabaseSecurityAlertPolicy
14878// values.
14879type ManagedDatabaseSecurityAlertPolicyListResultPage struct {
14880	fn      func(context.Context, ManagedDatabaseSecurityAlertPolicyListResult) (ManagedDatabaseSecurityAlertPolicyListResult, error)
14881	mdsaplr ManagedDatabaseSecurityAlertPolicyListResult
14882}
14883
14884// NextWithContext advances to the next page of values.  If there was an error making
14885// the request the page does not advance and the error is returned.
14886func (page *ManagedDatabaseSecurityAlertPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
14887	if tracing.IsEnabled() {
14888		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseSecurityAlertPolicyListResultPage.NextWithContext")
14889		defer func() {
14890			sc := -1
14891			if page.Response().Response.Response != nil {
14892				sc = page.Response().Response.Response.StatusCode
14893			}
14894			tracing.EndSpan(ctx, sc, err)
14895		}()
14896	}
14897	for {
14898		next, err := page.fn(ctx, page.mdsaplr)
14899		if err != nil {
14900			return err
14901		}
14902		page.mdsaplr = next
14903		if !next.hasNextLink() || !next.IsEmpty() {
14904			break
14905		}
14906	}
14907	return nil
14908}
14909
14910// Next advances to the next page of values.  If there was an error making
14911// the request the page does not advance and the error is returned.
14912// Deprecated: Use NextWithContext() instead.
14913func (page *ManagedDatabaseSecurityAlertPolicyListResultPage) Next() error {
14914	return page.NextWithContext(context.Background())
14915}
14916
14917// NotDone returns true if the page enumeration should be started or is not yet complete.
14918func (page ManagedDatabaseSecurityAlertPolicyListResultPage) NotDone() bool {
14919	return !page.mdsaplr.IsEmpty()
14920}
14921
14922// Response returns the raw server response from the last page request.
14923func (page ManagedDatabaseSecurityAlertPolicyListResultPage) Response() ManagedDatabaseSecurityAlertPolicyListResult {
14924	return page.mdsaplr
14925}
14926
14927// Values returns the slice of values for the current page or nil if there are no values.
14928func (page ManagedDatabaseSecurityAlertPolicyListResultPage) Values() []ManagedDatabaseSecurityAlertPolicy {
14929	if page.mdsaplr.IsEmpty() {
14930		return nil
14931	}
14932	return *page.mdsaplr.Value
14933}
14934
14935// Creates a new instance of the ManagedDatabaseSecurityAlertPolicyListResultPage type.
14936func NewManagedDatabaseSecurityAlertPolicyListResultPage(cur ManagedDatabaseSecurityAlertPolicyListResult, getNextPage func(context.Context, ManagedDatabaseSecurityAlertPolicyListResult) (ManagedDatabaseSecurityAlertPolicyListResult, error)) ManagedDatabaseSecurityAlertPolicyListResultPage {
14937	return ManagedDatabaseSecurityAlertPolicyListResultPage{
14938		fn:      getNextPage,
14939		mdsaplr: cur,
14940	}
14941}
14942
14943// ManagedDatabasesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
14944// operation.
14945type ManagedDatabasesUpdateFuture struct {
14946	azure.FutureAPI
14947	// Result returns the result of the asynchronous operation.
14948	// If the operation has not completed it will return an error.
14949	Result func(ManagedDatabasesClient) (ManagedDatabase, error)
14950}
14951
14952// UnmarshalJSON is the custom unmarshaller for CreateFuture.
14953func (future *ManagedDatabasesUpdateFuture) UnmarshalJSON(body []byte) error {
14954	var azFuture azure.Future
14955	if err := json.Unmarshal(body, &azFuture); err != nil {
14956		return err
14957	}
14958	future.FutureAPI = &azFuture
14959	future.Result = future.result
14960	return nil
14961}
14962
14963// result is the default implementation for ManagedDatabasesUpdateFuture.Result.
14964func (future *ManagedDatabasesUpdateFuture) result(client ManagedDatabasesClient) (md ManagedDatabase, err error) {
14965	var done bool
14966	done, err = future.DoneWithContext(context.Background(), client)
14967	if err != nil {
14968		err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesUpdateFuture", "Result", future.Response(), "Polling failure")
14969		return
14970	}
14971	if !done {
14972		md.Response.Response = future.Response()
14973		err = azure.NewAsyncOpIncompleteError("sql.ManagedDatabasesUpdateFuture")
14974		return
14975	}
14976	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
14977	if md.Response.Response, err = future.GetResult(sender); err == nil && md.Response.Response.StatusCode != http.StatusNoContent {
14978		md, err = client.UpdateResponder(md.Response.Response)
14979		if err != nil {
14980			err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesUpdateFuture", "Result", md.Response.Response, "Failure responding to request")
14981		}
14982	}
14983	return
14984}
14985
14986// ManagedDatabaseUpdate an managed database update.
14987type ManagedDatabaseUpdate struct {
14988	// ManagedDatabaseProperties - Resource properties.
14989	*ManagedDatabaseProperties `json:"properties,omitempty"`
14990	// Tags - Resource tags.
14991	Tags map[string]*string `json:"tags"`
14992}
14993
14994// MarshalJSON is the custom marshaler for ManagedDatabaseUpdate.
14995func (mdu ManagedDatabaseUpdate) MarshalJSON() ([]byte, error) {
14996	objectMap := make(map[string]interface{})
14997	if mdu.ManagedDatabaseProperties != nil {
14998		objectMap["properties"] = mdu.ManagedDatabaseProperties
14999	}
15000	if mdu.Tags != nil {
15001		objectMap["tags"] = mdu.Tags
15002	}
15003	return json.Marshal(objectMap)
15004}
15005
15006// UnmarshalJSON is the custom unmarshaler for ManagedDatabaseUpdate struct.
15007func (mdu *ManagedDatabaseUpdate) UnmarshalJSON(body []byte) error {
15008	var m map[string]*json.RawMessage
15009	err := json.Unmarshal(body, &m)
15010	if err != nil {
15011		return err
15012	}
15013	for k, v := range m {
15014		switch k {
15015		case "properties":
15016			if v != nil {
15017				var managedDatabaseProperties ManagedDatabaseProperties
15018				err = json.Unmarshal(*v, &managedDatabaseProperties)
15019				if err != nil {
15020					return err
15021				}
15022				mdu.ManagedDatabaseProperties = &managedDatabaseProperties
15023			}
15024		case "tags":
15025			if v != nil {
15026				var tags map[string]*string
15027				err = json.Unmarshal(*v, &tags)
15028				if err != nil {
15029					return err
15030				}
15031				mdu.Tags = tags
15032			}
15033		}
15034	}
15035
15036	return nil
15037}
15038
15039// ManagedDatabaseVulnerabilityAssessmentScansInitiateScanFuture an abstraction for monitoring and
15040// retrieving the results of a long-running operation.
15041type ManagedDatabaseVulnerabilityAssessmentScansInitiateScanFuture struct {
15042	azure.FutureAPI
15043	// Result returns the result of the asynchronous operation.
15044	// If the operation has not completed it will return an error.
15045	Result func(ManagedDatabaseVulnerabilityAssessmentScansClient) (autorest.Response, error)
15046}
15047
15048// UnmarshalJSON is the custom unmarshaller for CreateFuture.
15049func (future *ManagedDatabaseVulnerabilityAssessmentScansInitiateScanFuture) UnmarshalJSON(body []byte) error {
15050	var azFuture azure.Future
15051	if err := json.Unmarshal(body, &azFuture); err != nil {
15052		return err
15053	}
15054	future.FutureAPI = &azFuture
15055	future.Result = future.result
15056	return nil
15057}
15058
15059// result is the default implementation for ManagedDatabaseVulnerabilityAssessmentScansInitiateScanFuture.Result.
15060func (future *ManagedDatabaseVulnerabilityAssessmentScansInitiateScanFuture) result(client ManagedDatabaseVulnerabilityAssessmentScansClient) (ar autorest.Response, err error) {
15061	var done bool
15062	done, err = future.DoneWithContext(context.Background(), client)
15063	if err != nil {
15064		err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseVulnerabilityAssessmentScansInitiateScanFuture", "Result", future.Response(), "Polling failure")
15065		return
15066	}
15067	if !done {
15068		ar.Response = future.Response()
15069		err = azure.NewAsyncOpIncompleteError("sql.ManagedDatabaseVulnerabilityAssessmentScansInitiateScanFuture")
15070		return
15071	}
15072	ar.Response = future.Response()
15073	return
15074}
15075
15076// ManagedInstance an Azure SQL managed instance.
15077type ManagedInstance struct {
15078	autorest.Response `json:"-"`
15079	// Identity - The Azure Active Directory identity of the managed instance.
15080	Identity *ResourceIdentity `json:"identity,omitempty"`
15081	// Sku - Managed instance SKU. Allowed values for sku.name: GP_Gen4, GP_Gen5, BC_Gen4, BC_Gen5
15082	Sku *Sku `json:"sku,omitempty"`
15083	// ManagedInstanceProperties - Resource properties.
15084	*ManagedInstanceProperties `json:"properties,omitempty"`
15085	// Location - Resource location.
15086	Location *string `json:"location,omitempty"`
15087	// Tags - Resource tags.
15088	Tags map[string]*string `json:"tags"`
15089	// ID - READ-ONLY; Resource ID.
15090	ID *string `json:"id,omitempty"`
15091	// Name - READ-ONLY; Resource name.
15092	Name *string `json:"name,omitempty"`
15093	// Type - READ-ONLY; Resource type.
15094	Type *string `json:"type,omitempty"`
15095}
15096
15097// MarshalJSON is the custom marshaler for ManagedInstance.
15098func (mi ManagedInstance) MarshalJSON() ([]byte, error) {
15099	objectMap := make(map[string]interface{})
15100	if mi.Identity != nil {
15101		objectMap["identity"] = mi.Identity
15102	}
15103	if mi.Sku != nil {
15104		objectMap["sku"] = mi.Sku
15105	}
15106	if mi.ManagedInstanceProperties != nil {
15107		objectMap["properties"] = mi.ManagedInstanceProperties
15108	}
15109	if mi.Location != nil {
15110		objectMap["location"] = mi.Location
15111	}
15112	if mi.Tags != nil {
15113		objectMap["tags"] = mi.Tags
15114	}
15115	return json.Marshal(objectMap)
15116}
15117
15118// UnmarshalJSON is the custom unmarshaler for ManagedInstance struct.
15119func (mi *ManagedInstance) UnmarshalJSON(body []byte) error {
15120	var m map[string]*json.RawMessage
15121	err := json.Unmarshal(body, &m)
15122	if err != nil {
15123		return err
15124	}
15125	for k, v := range m {
15126		switch k {
15127		case "identity":
15128			if v != nil {
15129				var identity ResourceIdentity
15130				err = json.Unmarshal(*v, &identity)
15131				if err != nil {
15132					return err
15133				}
15134				mi.Identity = &identity
15135			}
15136		case "sku":
15137			if v != nil {
15138				var sku Sku
15139				err = json.Unmarshal(*v, &sku)
15140				if err != nil {
15141					return err
15142				}
15143				mi.Sku = &sku
15144			}
15145		case "properties":
15146			if v != nil {
15147				var managedInstanceProperties ManagedInstanceProperties
15148				err = json.Unmarshal(*v, &managedInstanceProperties)
15149				if err != nil {
15150					return err
15151				}
15152				mi.ManagedInstanceProperties = &managedInstanceProperties
15153			}
15154		case "location":
15155			if v != nil {
15156				var location string
15157				err = json.Unmarshal(*v, &location)
15158				if err != nil {
15159					return err
15160				}
15161				mi.Location = &location
15162			}
15163		case "tags":
15164			if v != nil {
15165				var tags map[string]*string
15166				err = json.Unmarshal(*v, &tags)
15167				if err != nil {
15168					return err
15169				}
15170				mi.Tags = tags
15171			}
15172		case "id":
15173			if v != nil {
15174				var ID string
15175				err = json.Unmarshal(*v, &ID)
15176				if err != nil {
15177					return err
15178				}
15179				mi.ID = &ID
15180			}
15181		case "name":
15182			if v != nil {
15183				var name string
15184				err = json.Unmarshal(*v, &name)
15185				if err != nil {
15186					return err
15187				}
15188				mi.Name = &name
15189			}
15190		case "type":
15191			if v != nil {
15192				var typeVar string
15193				err = json.Unmarshal(*v, &typeVar)
15194				if err != nil {
15195					return err
15196				}
15197				mi.Type = &typeVar
15198			}
15199		}
15200	}
15201
15202	return nil
15203}
15204
15205// ManagedInstanceAdministrator an Azure SQL managed instance administrator.
15206type ManagedInstanceAdministrator struct {
15207	autorest.Response `json:"-"`
15208	// ManagedInstanceAdministratorProperties - Resource properties.
15209	*ManagedInstanceAdministratorProperties `json:"properties,omitempty"`
15210	// ID - READ-ONLY; Resource ID.
15211	ID *string `json:"id,omitempty"`
15212	// Name - READ-ONLY; Resource name.
15213	Name *string `json:"name,omitempty"`
15214	// Type - READ-ONLY; Resource type.
15215	Type *string `json:"type,omitempty"`
15216}
15217
15218// MarshalJSON is the custom marshaler for ManagedInstanceAdministrator.
15219func (mia ManagedInstanceAdministrator) MarshalJSON() ([]byte, error) {
15220	objectMap := make(map[string]interface{})
15221	if mia.ManagedInstanceAdministratorProperties != nil {
15222		objectMap["properties"] = mia.ManagedInstanceAdministratorProperties
15223	}
15224	return json.Marshal(objectMap)
15225}
15226
15227// UnmarshalJSON is the custom unmarshaler for ManagedInstanceAdministrator struct.
15228func (mia *ManagedInstanceAdministrator) UnmarshalJSON(body []byte) error {
15229	var m map[string]*json.RawMessage
15230	err := json.Unmarshal(body, &m)
15231	if err != nil {
15232		return err
15233	}
15234	for k, v := range m {
15235		switch k {
15236		case "properties":
15237			if v != nil {
15238				var managedInstanceAdministratorProperties ManagedInstanceAdministratorProperties
15239				err = json.Unmarshal(*v, &managedInstanceAdministratorProperties)
15240				if err != nil {
15241					return err
15242				}
15243				mia.ManagedInstanceAdministratorProperties = &managedInstanceAdministratorProperties
15244			}
15245		case "id":
15246			if v != nil {
15247				var ID string
15248				err = json.Unmarshal(*v, &ID)
15249				if err != nil {
15250					return err
15251				}
15252				mia.ID = &ID
15253			}
15254		case "name":
15255			if v != nil {
15256				var name string
15257				err = json.Unmarshal(*v, &name)
15258				if err != nil {
15259					return err
15260				}
15261				mia.Name = &name
15262			}
15263		case "type":
15264			if v != nil {
15265				var typeVar string
15266				err = json.Unmarshal(*v, &typeVar)
15267				if err != nil {
15268					return err
15269				}
15270				mia.Type = &typeVar
15271			}
15272		}
15273	}
15274
15275	return nil
15276}
15277
15278// ManagedInstanceAdministratorListResult a list of managed instance administrators.
15279type ManagedInstanceAdministratorListResult struct {
15280	autorest.Response `json:"-"`
15281	// Value - READ-ONLY; Array of results.
15282	Value *[]ManagedInstanceAdministrator `json:"value,omitempty"`
15283	// NextLink - READ-ONLY; Link to retrieve next page of results.
15284	NextLink *string `json:"nextLink,omitempty"`
15285}
15286
15287// MarshalJSON is the custom marshaler for ManagedInstanceAdministratorListResult.
15288func (mialr ManagedInstanceAdministratorListResult) MarshalJSON() ([]byte, error) {
15289	objectMap := make(map[string]interface{})
15290	return json.Marshal(objectMap)
15291}
15292
15293// ManagedInstanceAdministratorListResultIterator provides access to a complete listing of
15294// ManagedInstanceAdministrator values.
15295type ManagedInstanceAdministratorListResultIterator struct {
15296	i    int
15297	page ManagedInstanceAdministratorListResultPage
15298}
15299
15300// NextWithContext advances to the next value.  If there was an error making
15301// the request the iterator does not advance and the error is returned.
15302func (iter *ManagedInstanceAdministratorListResultIterator) NextWithContext(ctx context.Context) (err error) {
15303	if tracing.IsEnabled() {
15304		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceAdministratorListResultIterator.NextWithContext")
15305		defer func() {
15306			sc := -1
15307			if iter.Response().Response.Response != nil {
15308				sc = iter.Response().Response.Response.StatusCode
15309			}
15310			tracing.EndSpan(ctx, sc, err)
15311		}()
15312	}
15313	iter.i++
15314	if iter.i < len(iter.page.Values()) {
15315		return nil
15316	}
15317	err = iter.page.NextWithContext(ctx)
15318	if err != nil {
15319		iter.i--
15320		return err
15321	}
15322	iter.i = 0
15323	return nil
15324}
15325
15326// Next advances to the next value.  If there was an error making
15327// the request the iterator does not advance and the error is returned.
15328// Deprecated: Use NextWithContext() instead.
15329func (iter *ManagedInstanceAdministratorListResultIterator) Next() error {
15330	return iter.NextWithContext(context.Background())
15331}
15332
15333// NotDone returns true if the enumeration should be started or is not yet complete.
15334func (iter ManagedInstanceAdministratorListResultIterator) NotDone() bool {
15335	return iter.page.NotDone() && iter.i < len(iter.page.Values())
15336}
15337
15338// Response returns the raw server response from the last page request.
15339func (iter ManagedInstanceAdministratorListResultIterator) Response() ManagedInstanceAdministratorListResult {
15340	return iter.page.Response()
15341}
15342
15343// Value returns the current value or a zero-initialized value if the
15344// iterator has advanced beyond the end of the collection.
15345func (iter ManagedInstanceAdministratorListResultIterator) Value() ManagedInstanceAdministrator {
15346	if !iter.page.NotDone() {
15347		return ManagedInstanceAdministrator{}
15348	}
15349	return iter.page.Values()[iter.i]
15350}
15351
15352// Creates a new instance of the ManagedInstanceAdministratorListResultIterator type.
15353func NewManagedInstanceAdministratorListResultIterator(page ManagedInstanceAdministratorListResultPage) ManagedInstanceAdministratorListResultIterator {
15354	return ManagedInstanceAdministratorListResultIterator{page: page}
15355}
15356
15357// IsEmpty returns true if the ListResult contains no values.
15358func (mialr ManagedInstanceAdministratorListResult) IsEmpty() bool {
15359	return mialr.Value == nil || len(*mialr.Value) == 0
15360}
15361
15362// hasNextLink returns true if the NextLink is not empty.
15363func (mialr ManagedInstanceAdministratorListResult) hasNextLink() bool {
15364	return mialr.NextLink != nil && len(*mialr.NextLink) != 0
15365}
15366
15367// managedInstanceAdministratorListResultPreparer prepares a request to retrieve the next set of results.
15368// It returns nil if no more results exist.
15369func (mialr ManagedInstanceAdministratorListResult) managedInstanceAdministratorListResultPreparer(ctx context.Context) (*http.Request, error) {
15370	if !mialr.hasNextLink() {
15371		return nil, nil
15372	}
15373	return autorest.Prepare((&http.Request{}).WithContext(ctx),
15374		autorest.AsJSON(),
15375		autorest.AsGet(),
15376		autorest.WithBaseURL(to.String(mialr.NextLink)))
15377}
15378
15379// ManagedInstanceAdministratorListResultPage contains a page of ManagedInstanceAdministrator values.
15380type ManagedInstanceAdministratorListResultPage struct {
15381	fn    func(context.Context, ManagedInstanceAdministratorListResult) (ManagedInstanceAdministratorListResult, error)
15382	mialr ManagedInstanceAdministratorListResult
15383}
15384
15385// NextWithContext advances to the next page of values.  If there was an error making
15386// the request the page does not advance and the error is returned.
15387func (page *ManagedInstanceAdministratorListResultPage) NextWithContext(ctx context.Context) (err error) {
15388	if tracing.IsEnabled() {
15389		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceAdministratorListResultPage.NextWithContext")
15390		defer func() {
15391			sc := -1
15392			if page.Response().Response.Response != nil {
15393				sc = page.Response().Response.Response.StatusCode
15394			}
15395			tracing.EndSpan(ctx, sc, err)
15396		}()
15397	}
15398	for {
15399		next, err := page.fn(ctx, page.mialr)
15400		if err != nil {
15401			return err
15402		}
15403		page.mialr = next
15404		if !next.hasNextLink() || !next.IsEmpty() {
15405			break
15406		}
15407	}
15408	return nil
15409}
15410
15411// Next advances to the next page of values.  If there was an error making
15412// the request the page does not advance and the error is returned.
15413// Deprecated: Use NextWithContext() instead.
15414func (page *ManagedInstanceAdministratorListResultPage) Next() error {
15415	return page.NextWithContext(context.Background())
15416}
15417
15418// NotDone returns true if the page enumeration should be started or is not yet complete.
15419func (page ManagedInstanceAdministratorListResultPage) NotDone() bool {
15420	return !page.mialr.IsEmpty()
15421}
15422
15423// Response returns the raw server response from the last page request.
15424func (page ManagedInstanceAdministratorListResultPage) Response() ManagedInstanceAdministratorListResult {
15425	return page.mialr
15426}
15427
15428// Values returns the slice of values for the current page or nil if there are no values.
15429func (page ManagedInstanceAdministratorListResultPage) Values() []ManagedInstanceAdministrator {
15430	if page.mialr.IsEmpty() {
15431		return nil
15432	}
15433	return *page.mialr.Value
15434}
15435
15436// Creates a new instance of the ManagedInstanceAdministratorListResultPage type.
15437func NewManagedInstanceAdministratorListResultPage(cur ManagedInstanceAdministratorListResult, getNextPage func(context.Context, ManagedInstanceAdministratorListResult) (ManagedInstanceAdministratorListResult, error)) ManagedInstanceAdministratorListResultPage {
15438	return ManagedInstanceAdministratorListResultPage{
15439		fn:    getNextPage,
15440		mialr: cur,
15441	}
15442}
15443
15444// ManagedInstanceAdministratorProperties the properties of a managed instance administrator.
15445type ManagedInstanceAdministratorProperties struct {
15446	// AdministratorType - Type of the managed instance administrator.
15447	AdministratorType *string `json:"administratorType,omitempty"`
15448	// Login - Login name of the managed instance administrator.
15449	Login *string `json:"login,omitempty"`
15450	// Sid - SID (object ID) of the managed instance administrator.
15451	Sid *uuid.UUID `json:"sid,omitempty"`
15452	// TenantID - Tenant ID of the managed instance administrator.
15453	TenantID *uuid.UUID `json:"tenantId,omitempty"`
15454}
15455
15456// ManagedInstanceAdministratorsCreateOrUpdateFuture an abstraction for monitoring and retrieving the
15457// results of a long-running operation.
15458type ManagedInstanceAdministratorsCreateOrUpdateFuture struct {
15459	azure.FutureAPI
15460	// Result returns the result of the asynchronous operation.
15461	// If the operation has not completed it will return an error.
15462	Result func(ManagedInstanceAdministratorsClient) (ManagedInstanceAdministrator, error)
15463}
15464
15465// UnmarshalJSON is the custom unmarshaller for CreateFuture.
15466func (future *ManagedInstanceAdministratorsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
15467	var azFuture azure.Future
15468	if err := json.Unmarshal(body, &azFuture); err != nil {
15469		return err
15470	}
15471	future.FutureAPI = &azFuture
15472	future.Result = future.result
15473	return nil
15474}
15475
15476// result is the default implementation for ManagedInstanceAdministratorsCreateOrUpdateFuture.Result.
15477func (future *ManagedInstanceAdministratorsCreateOrUpdateFuture) result(client ManagedInstanceAdministratorsClient) (mia ManagedInstanceAdministrator, err error) {
15478	var done bool
15479	done, err = future.DoneWithContext(context.Background(), client)
15480	if err != nil {
15481		err = autorest.NewErrorWithError(err, "sql.ManagedInstanceAdministratorsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
15482		return
15483	}
15484	if !done {
15485		mia.Response.Response = future.Response()
15486		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstanceAdministratorsCreateOrUpdateFuture")
15487		return
15488	}
15489	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15490	if mia.Response.Response, err = future.GetResult(sender); err == nil && mia.Response.Response.StatusCode != http.StatusNoContent {
15491		mia, err = client.CreateOrUpdateResponder(mia.Response.Response)
15492		if err != nil {
15493			err = autorest.NewErrorWithError(err, "sql.ManagedInstanceAdministratorsCreateOrUpdateFuture", "Result", mia.Response.Response, "Failure responding to request")
15494		}
15495	}
15496	return
15497}
15498
15499// ManagedInstanceAdministratorsDeleteFuture an abstraction for monitoring and retrieving the results of a
15500// long-running operation.
15501type ManagedInstanceAdministratorsDeleteFuture struct {
15502	azure.FutureAPI
15503	// Result returns the result of the asynchronous operation.
15504	// If the operation has not completed it will return an error.
15505	Result func(ManagedInstanceAdministratorsClient) (autorest.Response, error)
15506}
15507
15508// UnmarshalJSON is the custom unmarshaller for CreateFuture.
15509func (future *ManagedInstanceAdministratorsDeleteFuture) UnmarshalJSON(body []byte) error {
15510	var azFuture azure.Future
15511	if err := json.Unmarshal(body, &azFuture); err != nil {
15512		return err
15513	}
15514	future.FutureAPI = &azFuture
15515	future.Result = future.result
15516	return nil
15517}
15518
15519// result is the default implementation for ManagedInstanceAdministratorsDeleteFuture.Result.
15520func (future *ManagedInstanceAdministratorsDeleteFuture) result(client ManagedInstanceAdministratorsClient) (ar autorest.Response, err error) {
15521	var done bool
15522	done, err = future.DoneWithContext(context.Background(), client)
15523	if err != nil {
15524		err = autorest.NewErrorWithError(err, "sql.ManagedInstanceAdministratorsDeleteFuture", "Result", future.Response(), "Polling failure")
15525		return
15526	}
15527	if !done {
15528		ar.Response = future.Response()
15529		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstanceAdministratorsDeleteFuture")
15530		return
15531	}
15532	ar.Response = future.Response()
15533	return
15534}
15535
15536// ManagedInstanceAzureADOnlyAuthentication azure Active Directory only authentication.
15537type ManagedInstanceAzureADOnlyAuthentication struct {
15538	autorest.Response `json:"-"`
15539	// ManagedInstanceAzureADOnlyAuthProperties - Resource properties.
15540	*ManagedInstanceAzureADOnlyAuthProperties `json:"properties,omitempty"`
15541	// ID - READ-ONLY; Resource ID.
15542	ID *string `json:"id,omitempty"`
15543	// Name - READ-ONLY; Resource name.
15544	Name *string `json:"name,omitempty"`
15545	// Type - READ-ONLY; Resource type.
15546	Type *string `json:"type,omitempty"`
15547}
15548
15549// MarshalJSON is the custom marshaler for ManagedInstanceAzureADOnlyAuthentication.
15550func (miaaoa ManagedInstanceAzureADOnlyAuthentication) MarshalJSON() ([]byte, error) {
15551	objectMap := make(map[string]interface{})
15552	if miaaoa.ManagedInstanceAzureADOnlyAuthProperties != nil {
15553		objectMap["properties"] = miaaoa.ManagedInstanceAzureADOnlyAuthProperties
15554	}
15555	return json.Marshal(objectMap)
15556}
15557
15558// UnmarshalJSON is the custom unmarshaler for ManagedInstanceAzureADOnlyAuthentication struct.
15559func (miaaoa *ManagedInstanceAzureADOnlyAuthentication) UnmarshalJSON(body []byte) error {
15560	var m map[string]*json.RawMessage
15561	err := json.Unmarshal(body, &m)
15562	if err != nil {
15563		return err
15564	}
15565	for k, v := range m {
15566		switch k {
15567		case "properties":
15568			if v != nil {
15569				var managedInstanceAzureADOnlyAuthProperties ManagedInstanceAzureADOnlyAuthProperties
15570				err = json.Unmarshal(*v, &managedInstanceAzureADOnlyAuthProperties)
15571				if err != nil {
15572					return err
15573				}
15574				miaaoa.ManagedInstanceAzureADOnlyAuthProperties = &managedInstanceAzureADOnlyAuthProperties
15575			}
15576		case "id":
15577			if v != nil {
15578				var ID string
15579				err = json.Unmarshal(*v, &ID)
15580				if err != nil {
15581					return err
15582				}
15583				miaaoa.ID = &ID
15584			}
15585		case "name":
15586			if v != nil {
15587				var name string
15588				err = json.Unmarshal(*v, &name)
15589				if err != nil {
15590					return err
15591				}
15592				miaaoa.Name = &name
15593			}
15594		case "type":
15595			if v != nil {
15596				var typeVar string
15597				err = json.Unmarshal(*v, &typeVar)
15598				if err != nil {
15599					return err
15600				}
15601				miaaoa.Type = &typeVar
15602			}
15603		}
15604	}
15605
15606	return nil
15607}
15608
15609// ManagedInstanceAzureADOnlyAuthenticationsCreateOrUpdateFuture an abstraction for monitoring and
15610// retrieving the results of a long-running operation.
15611type ManagedInstanceAzureADOnlyAuthenticationsCreateOrUpdateFuture struct {
15612	azure.FutureAPI
15613	// Result returns the result of the asynchronous operation.
15614	// If the operation has not completed it will return an error.
15615	Result func(ManagedInstanceAzureADOnlyAuthenticationsClient) (ManagedInstanceAzureADOnlyAuthentication, error)
15616}
15617
15618// UnmarshalJSON is the custom unmarshaller for CreateFuture.
15619func (future *ManagedInstanceAzureADOnlyAuthenticationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
15620	var azFuture azure.Future
15621	if err := json.Unmarshal(body, &azFuture); err != nil {
15622		return err
15623	}
15624	future.FutureAPI = &azFuture
15625	future.Result = future.result
15626	return nil
15627}
15628
15629// result is the default implementation for ManagedInstanceAzureADOnlyAuthenticationsCreateOrUpdateFuture.Result.
15630func (future *ManagedInstanceAzureADOnlyAuthenticationsCreateOrUpdateFuture) result(client ManagedInstanceAzureADOnlyAuthenticationsClient) (miaaoa ManagedInstanceAzureADOnlyAuthentication, err error) {
15631	var done bool
15632	done, err = future.DoneWithContext(context.Background(), client)
15633	if err != nil {
15634		err = autorest.NewErrorWithError(err, "sql.ManagedInstanceAzureADOnlyAuthenticationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
15635		return
15636	}
15637	if !done {
15638		miaaoa.Response.Response = future.Response()
15639		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstanceAzureADOnlyAuthenticationsCreateOrUpdateFuture")
15640		return
15641	}
15642	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15643	if miaaoa.Response.Response, err = future.GetResult(sender); err == nil && miaaoa.Response.Response.StatusCode != http.StatusNoContent {
15644		miaaoa, err = client.CreateOrUpdateResponder(miaaoa.Response.Response)
15645		if err != nil {
15646			err = autorest.NewErrorWithError(err, "sql.ManagedInstanceAzureADOnlyAuthenticationsCreateOrUpdateFuture", "Result", miaaoa.Response.Response, "Failure responding to request")
15647		}
15648	}
15649	return
15650}
15651
15652// ManagedInstanceAzureADOnlyAuthenticationsDeleteFuture an abstraction for monitoring and retrieving the
15653// results of a long-running operation.
15654type ManagedInstanceAzureADOnlyAuthenticationsDeleteFuture struct {
15655	azure.FutureAPI
15656	// Result returns the result of the asynchronous operation.
15657	// If the operation has not completed it will return an error.
15658	Result func(ManagedInstanceAzureADOnlyAuthenticationsClient) (autorest.Response, error)
15659}
15660
15661// UnmarshalJSON is the custom unmarshaller for CreateFuture.
15662func (future *ManagedInstanceAzureADOnlyAuthenticationsDeleteFuture) UnmarshalJSON(body []byte) error {
15663	var azFuture azure.Future
15664	if err := json.Unmarshal(body, &azFuture); err != nil {
15665		return err
15666	}
15667	future.FutureAPI = &azFuture
15668	future.Result = future.result
15669	return nil
15670}
15671
15672// result is the default implementation for ManagedInstanceAzureADOnlyAuthenticationsDeleteFuture.Result.
15673func (future *ManagedInstanceAzureADOnlyAuthenticationsDeleteFuture) result(client ManagedInstanceAzureADOnlyAuthenticationsClient) (ar autorest.Response, err error) {
15674	var done bool
15675	done, err = future.DoneWithContext(context.Background(), client)
15676	if err != nil {
15677		err = autorest.NewErrorWithError(err, "sql.ManagedInstanceAzureADOnlyAuthenticationsDeleteFuture", "Result", future.Response(), "Polling failure")
15678		return
15679	}
15680	if !done {
15681		ar.Response = future.Response()
15682		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstanceAzureADOnlyAuthenticationsDeleteFuture")
15683		return
15684	}
15685	ar.Response = future.Response()
15686	return
15687}
15688
15689// ManagedInstanceAzureADOnlyAuthListResult a list of active directory only authentications.
15690type ManagedInstanceAzureADOnlyAuthListResult struct {
15691	autorest.Response `json:"-"`
15692	// Value - READ-ONLY; Array of results.
15693	Value *[]ManagedInstanceAzureADOnlyAuthentication `json:"value,omitempty"`
15694	// NextLink - READ-ONLY; Link to retrieve next page of results.
15695	NextLink *string `json:"nextLink,omitempty"`
15696}
15697
15698// MarshalJSON is the custom marshaler for ManagedInstanceAzureADOnlyAuthListResult.
15699func (miaaoalr ManagedInstanceAzureADOnlyAuthListResult) MarshalJSON() ([]byte, error) {
15700	objectMap := make(map[string]interface{})
15701	return json.Marshal(objectMap)
15702}
15703
15704// ManagedInstanceAzureADOnlyAuthListResultIterator provides access to a complete listing of
15705// ManagedInstanceAzureADOnlyAuthentication values.
15706type ManagedInstanceAzureADOnlyAuthListResultIterator struct {
15707	i    int
15708	page ManagedInstanceAzureADOnlyAuthListResultPage
15709}
15710
15711// NextWithContext advances to the next value.  If there was an error making
15712// the request the iterator does not advance and the error is returned.
15713func (iter *ManagedInstanceAzureADOnlyAuthListResultIterator) NextWithContext(ctx context.Context) (err error) {
15714	if tracing.IsEnabled() {
15715		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceAzureADOnlyAuthListResultIterator.NextWithContext")
15716		defer func() {
15717			sc := -1
15718			if iter.Response().Response.Response != nil {
15719				sc = iter.Response().Response.Response.StatusCode
15720			}
15721			tracing.EndSpan(ctx, sc, err)
15722		}()
15723	}
15724	iter.i++
15725	if iter.i < len(iter.page.Values()) {
15726		return nil
15727	}
15728	err = iter.page.NextWithContext(ctx)
15729	if err != nil {
15730		iter.i--
15731		return err
15732	}
15733	iter.i = 0
15734	return nil
15735}
15736
15737// Next advances to the next value.  If there was an error making
15738// the request the iterator does not advance and the error is returned.
15739// Deprecated: Use NextWithContext() instead.
15740func (iter *ManagedInstanceAzureADOnlyAuthListResultIterator) Next() error {
15741	return iter.NextWithContext(context.Background())
15742}
15743
15744// NotDone returns true if the enumeration should be started or is not yet complete.
15745func (iter ManagedInstanceAzureADOnlyAuthListResultIterator) NotDone() bool {
15746	return iter.page.NotDone() && iter.i < len(iter.page.Values())
15747}
15748
15749// Response returns the raw server response from the last page request.
15750func (iter ManagedInstanceAzureADOnlyAuthListResultIterator) Response() ManagedInstanceAzureADOnlyAuthListResult {
15751	return iter.page.Response()
15752}
15753
15754// Value returns the current value or a zero-initialized value if the
15755// iterator has advanced beyond the end of the collection.
15756func (iter ManagedInstanceAzureADOnlyAuthListResultIterator) Value() ManagedInstanceAzureADOnlyAuthentication {
15757	if !iter.page.NotDone() {
15758		return ManagedInstanceAzureADOnlyAuthentication{}
15759	}
15760	return iter.page.Values()[iter.i]
15761}
15762
15763// Creates a new instance of the ManagedInstanceAzureADOnlyAuthListResultIterator type.
15764func NewManagedInstanceAzureADOnlyAuthListResultIterator(page ManagedInstanceAzureADOnlyAuthListResultPage) ManagedInstanceAzureADOnlyAuthListResultIterator {
15765	return ManagedInstanceAzureADOnlyAuthListResultIterator{page: page}
15766}
15767
15768// IsEmpty returns true if the ListResult contains no values.
15769func (miaaoalr ManagedInstanceAzureADOnlyAuthListResult) IsEmpty() bool {
15770	return miaaoalr.Value == nil || len(*miaaoalr.Value) == 0
15771}
15772
15773// hasNextLink returns true if the NextLink is not empty.
15774func (miaaoalr ManagedInstanceAzureADOnlyAuthListResult) hasNextLink() bool {
15775	return miaaoalr.NextLink != nil && len(*miaaoalr.NextLink) != 0
15776}
15777
15778// managedInstanceAzureADOnlyAuthListResultPreparer prepares a request to retrieve the next set of results.
15779// It returns nil if no more results exist.
15780func (miaaoalr ManagedInstanceAzureADOnlyAuthListResult) managedInstanceAzureADOnlyAuthListResultPreparer(ctx context.Context) (*http.Request, error) {
15781	if !miaaoalr.hasNextLink() {
15782		return nil, nil
15783	}
15784	return autorest.Prepare((&http.Request{}).WithContext(ctx),
15785		autorest.AsJSON(),
15786		autorest.AsGet(),
15787		autorest.WithBaseURL(to.String(miaaoalr.NextLink)))
15788}
15789
15790// ManagedInstanceAzureADOnlyAuthListResultPage contains a page of ManagedInstanceAzureADOnlyAuthentication
15791// values.
15792type ManagedInstanceAzureADOnlyAuthListResultPage struct {
15793	fn       func(context.Context, ManagedInstanceAzureADOnlyAuthListResult) (ManagedInstanceAzureADOnlyAuthListResult, error)
15794	miaaoalr ManagedInstanceAzureADOnlyAuthListResult
15795}
15796
15797// NextWithContext advances to the next page of values.  If there was an error making
15798// the request the page does not advance and the error is returned.
15799func (page *ManagedInstanceAzureADOnlyAuthListResultPage) NextWithContext(ctx context.Context) (err error) {
15800	if tracing.IsEnabled() {
15801		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceAzureADOnlyAuthListResultPage.NextWithContext")
15802		defer func() {
15803			sc := -1
15804			if page.Response().Response.Response != nil {
15805				sc = page.Response().Response.Response.StatusCode
15806			}
15807			tracing.EndSpan(ctx, sc, err)
15808		}()
15809	}
15810	for {
15811		next, err := page.fn(ctx, page.miaaoalr)
15812		if err != nil {
15813			return err
15814		}
15815		page.miaaoalr = next
15816		if !next.hasNextLink() || !next.IsEmpty() {
15817			break
15818		}
15819	}
15820	return nil
15821}
15822
15823// Next advances to the next page of values.  If there was an error making
15824// the request the page does not advance and the error is returned.
15825// Deprecated: Use NextWithContext() instead.
15826func (page *ManagedInstanceAzureADOnlyAuthListResultPage) Next() error {
15827	return page.NextWithContext(context.Background())
15828}
15829
15830// NotDone returns true if the page enumeration should be started or is not yet complete.
15831func (page ManagedInstanceAzureADOnlyAuthListResultPage) NotDone() bool {
15832	return !page.miaaoalr.IsEmpty()
15833}
15834
15835// Response returns the raw server response from the last page request.
15836func (page ManagedInstanceAzureADOnlyAuthListResultPage) Response() ManagedInstanceAzureADOnlyAuthListResult {
15837	return page.miaaoalr
15838}
15839
15840// Values returns the slice of values for the current page or nil if there are no values.
15841func (page ManagedInstanceAzureADOnlyAuthListResultPage) Values() []ManagedInstanceAzureADOnlyAuthentication {
15842	if page.miaaoalr.IsEmpty() {
15843		return nil
15844	}
15845	return *page.miaaoalr.Value
15846}
15847
15848// Creates a new instance of the ManagedInstanceAzureADOnlyAuthListResultPage type.
15849func NewManagedInstanceAzureADOnlyAuthListResultPage(cur ManagedInstanceAzureADOnlyAuthListResult, getNextPage func(context.Context, ManagedInstanceAzureADOnlyAuthListResult) (ManagedInstanceAzureADOnlyAuthListResult, error)) ManagedInstanceAzureADOnlyAuthListResultPage {
15850	return ManagedInstanceAzureADOnlyAuthListResultPage{
15851		fn:       getNextPage,
15852		miaaoalr: cur,
15853	}
15854}
15855
15856// ManagedInstanceAzureADOnlyAuthProperties properties of a active directory only authentication for
15857// Managed Instance.
15858type ManagedInstanceAzureADOnlyAuthProperties struct {
15859	// AzureADOnlyAuthentication - Azure Active Directory only Authentication enabled.
15860	AzureADOnlyAuthentication *bool `json:"azureADOnlyAuthentication,omitempty"`
15861}
15862
15863// ManagedInstanceEditionCapability the managed server capability
15864type ManagedInstanceEditionCapability struct {
15865	// Name - READ-ONLY; The managed server version name.
15866	Name *string `json:"name,omitempty"`
15867	// SupportedFamilies - READ-ONLY; The supported families.
15868	SupportedFamilies *[]ManagedInstanceFamilyCapability `json:"supportedFamilies,omitempty"`
15869	// SupportedStorageCapabilities - READ-ONLY; The list of supported storage capabilities for this edition
15870	SupportedStorageCapabilities *[]StorageCapability `json:"supportedStorageCapabilities,omitempty"`
15871	// ZoneRedundant - READ-ONLY; Whether or not zone redundancy is supported for the edition.
15872	ZoneRedundant *bool `json:"zoneRedundant,omitempty"`
15873	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
15874	Status CapabilityStatus `json:"status,omitempty"`
15875	// Reason - The reason for the capability not being available.
15876	Reason *string `json:"reason,omitempty"`
15877}
15878
15879// MarshalJSON is the custom marshaler for ManagedInstanceEditionCapability.
15880func (miec ManagedInstanceEditionCapability) MarshalJSON() ([]byte, error) {
15881	objectMap := make(map[string]interface{})
15882	if miec.Reason != nil {
15883		objectMap["reason"] = miec.Reason
15884	}
15885	return json.Marshal(objectMap)
15886}
15887
15888// ManagedInstanceEncryptionProtector the managed instance encryption protector.
15889type ManagedInstanceEncryptionProtector struct {
15890	autorest.Response `json:"-"`
15891	// Kind - READ-ONLY; Kind of encryption protector. This is metadata used for the Azure portal experience.
15892	Kind *string `json:"kind,omitempty"`
15893	// ManagedInstanceEncryptionProtectorProperties - Resource properties.
15894	*ManagedInstanceEncryptionProtectorProperties `json:"properties,omitempty"`
15895	// ID - READ-ONLY; Resource ID.
15896	ID *string `json:"id,omitempty"`
15897	// Name - READ-ONLY; Resource name.
15898	Name *string `json:"name,omitempty"`
15899	// Type - READ-ONLY; Resource type.
15900	Type *string `json:"type,omitempty"`
15901}
15902
15903// MarshalJSON is the custom marshaler for ManagedInstanceEncryptionProtector.
15904func (miep ManagedInstanceEncryptionProtector) MarshalJSON() ([]byte, error) {
15905	objectMap := make(map[string]interface{})
15906	if miep.ManagedInstanceEncryptionProtectorProperties != nil {
15907		objectMap["properties"] = miep.ManagedInstanceEncryptionProtectorProperties
15908	}
15909	return json.Marshal(objectMap)
15910}
15911
15912// UnmarshalJSON is the custom unmarshaler for ManagedInstanceEncryptionProtector struct.
15913func (miep *ManagedInstanceEncryptionProtector) UnmarshalJSON(body []byte) error {
15914	var m map[string]*json.RawMessage
15915	err := json.Unmarshal(body, &m)
15916	if err != nil {
15917		return err
15918	}
15919	for k, v := range m {
15920		switch k {
15921		case "kind":
15922			if v != nil {
15923				var kind string
15924				err = json.Unmarshal(*v, &kind)
15925				if err != nil {
15926					return err
15927				}
15928				miep.Kind = &kind
15929			}
15930		case "properties":
15931			if v != nil {
15932				var managedInstanceEncryptionProtectorProperties ManagedInstanceEncryptionProtectorProperties
15933				err = json.Unmarshal(*v, &managedInstanceEncryptionProtectorProperties)
15934				if err != nil {
15935					return err
15936				}
15937				miep.ManagedInstanceEncryptionProtectorProperties = &managedInstanceEncryptionProtectorProperties
15938			}
15939		case "id":
15940			if v != nil {
15941				var ID string
15942				err = json.Unmarshal(*v, &ID)
15943				if err != nil {
15944					return err
15945				}
15946				miep.ID = &ID
15947			}
15948		case "name":
15949			if v != nil {
15950				var name string
15951				err = json.Unmarshal(*v, &name)
15952				if err != nil {
15953					return err
15954				}
15955				miep.Name = &name
15956			}
15957		case "type":
15958			if v != nil {
15959				var typeVar string
15960				err = json.Unmarshal(*v, &typeVar)
15961				if err != nil {
15962					return err
15963				}
15964				miep.Type = &typeVar
15965			}
15966		}
15967	}
15968
15969	return nil
15970}
15971
15972// ManagedInstanceEncryptionProtectorListResult a list of managed instance encryption protectors.
15973type ManagedInstanceEncryptionProtectorListResult struct {
15974	autorest.Response `json:"-"`
15975	// Value - READ-ONLY; Array of results.
15976	Value *[]ManagedInstanceEncryptionProtector `json:"value,omitempty"`
15977	// NextLink - READ-ONLY; Link to retrieve next page of results.
15978	NextLink *string `json:"nextLink,omitempty"`
15979}
15980
15981// MarshalJSON is the custom marshaler for ManagedInstanceEncryptionProtectorListResult.
15982func (mieplr ManagedInstanceEncryptionProtectorListResult) MarshalJSON() ([]byte, error) {
15983	objectMap := make(map[string]interface{})
15984	return json.Marshal(objectMap)
15985}
15986
15987// ManagedInstanceEncryptionProtectorListResultIterator provides access to a complete listing of
15988// ManagedInstanceEncryptionProtector values.
15989type ManagedInstanceEncryptionProtectorListResultIterator struct {
15990	i    int
15991	page ManagedInstanceEncryptionProtectorListResultPage
15992}
15993
15994// NextWithContext advances to the next value.  If there was an error making
15995// the request the iterator does not advance and the error is returned.
15996func (iter *ManagedInstanceEncryptionProtectorListResultIterator) NextWithContext(ctx context.Context) (err error) {
15997	if tracing.IsEnabled() {
15998		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceEncryptionProtectorListResultIterator.NextWithContext")
15999		defer func() {
16000			sc := -1
16001			if iter.Response().Response.Response != nil {
16002				sc = iter.Response().Response.Response.StatusCode
16003			}
16004			tracing.EndSpan(ctx, sc, err)
16005		}()
16006	}
16007	iter.i++
16008	if iter.i < len(iter.page.Values()) {
16009		return nil
16010	}
16011	err = iter.page.NextWithContext(ctx)
16012	if err != nil {
16013		iter.i--
16014		return err
16015	}
16016	iter.i = 0
16017	return nil
16018}
16019
16020// Next advances to the next value.  If there was an error making
16021// the request the iterator does not advance and the error is returned.
16022// Deprecated: Use NextWithContext() instead.
16023func (iter *ManagedInstanceEncryptionProtectorListResultIterator) Next() error {
16024	return iter.NextWithContext(context.Background())
16025}
16026
16027// NotDone returns true if the enumeration should be started or is not yet complete.
16028func (iter ManagedInstanceEncryptionProtectorListResultIterator) NotDone() bool {
16029	return iter.page.NotDone() && iter.i < len(iter.page.Values())
16030}
16031
16032// Response returns the raw server response from the last page request.
16033func (iter ManagedInstanceEncryptionProtectorListResultIterator) Response() ManagedInstanceEncryptionProtectorListResult {
16034	return iter.page.Response()
16035}
16036
16037// Value returns the current value or a zero-initialized value if the
16038// iterator has advanced beyond the end of the collection.
16039func (iter ManagedInstanceEncryptionProtectorListResultIterator) Value() ManagedInstanceEncryptionProtector {
16040	if !iter.page.NotDone() {
16041		return ManagedInstanceEncryptionProtector{}
16042	}
16043	return iter.page.Values()[iter.i]
16044}
16045
16046// Creates a new instance of the ManagedInstanceEncryptionProtectorListResultIterator type.
16047func NewManagedInstanceEncryptionProtectorListResultIterator(page ManagedInstanceEncryptionProtectorListResultPage) ManagedInstanceEncryptionProtectorListResultIterator {
16048	return ManagedInstanceEncryptionProtectorListResultIterator{page: page}
16049}
16050
16051// IsEmpty returns true if the ListResult contains no values.
16052func (mieplr ManagedInstanceEncryptionProtectorListResult) IsEmpty() bool {
16053	return mieplr.Value == nil || len(*mieplr.Value) == 0
16054}
16055
16056// hasNextLink returns true if the NextLink is not empty.
16057func (mieplr ManagedInstanceEncryptionProtectorListResult) hasNextLink() bool {
16058	return mieplr.NextLink != nil && len(*mieplr.NextLink) != 0
16059}
16060
16061// managedInstanceEncryptionProtectorListResultPreparer prepares a request to retrieve the next set of results.
16062// It returns nil if no more results exist.
16063func (mieplr ManagedInstanceEncryptionProtectorListResult) managedInstanceEncryptionProtectorListResultPreparer(ctx context.Context) (*http.Request, error) {
16064	if !mieplr.hasNextLink() {
16065		return nil, nil
16066	}
16067	return autorest.Prepare((&http.Request{}).WithContext(ctx),
16068		autorest.AsJSON(),
16069		autorest.AsGet(),
16070		autorest.WithBaseURL(to.String(mieplr.NextLink)))
16071}
16072
16073// ManagedInstanceEncryptionProtectorListResultPage contains a page of ManagedInstanceEncryptionProtector
16074// values.
16075type ManagedInstanceEncryptionProtectorListResultPage struct {
16076	fn     func(context.Context, ManagedInstanceEncryptionProtectorListResult) (ManagedInstanceEncryptionProtectorListResult, error)
16077	mieplr ManagedInstanceEncryptionProtectorListResult
16078}
16079
16080// NextWithContext advances to the next page of values.  If there was an error making
16081// the request the page does not advance and the error is returned.
16082func (page *ManagedInstanceEncryptionProtectorListResultPage) NextWithContext(ctx context.Context) (err error) {
16083	if tracing.IsEnabled() {
16084		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceEncryptionProtectorListResultPage.NextWithContext")
16085		defer func() {
16086			sc := -1
16087			if page.Response().Response.Response != nil {
16088				sc = page.Response().Response.Response.StatusCode
16089			}
16090			tracing.EndSpan(ctx, sc, err)
16091		}()
16092	}
16093	for {
16094		next, err := page.fn(ctx, page.mieplr)
16095		if err != nil {
16096			return err
16097		}
16098		page.mieplr = next
16099		if !next.hasNextLink() || !next.IsEmpty() {
16100			break
16101		}
16102	}
16103	return nil
16104}
16105
16106// Next advances to the next page of values.  If there was an error making
16107// the request the page does not advance and the error is returned.
16108// Deprecated: Use NextWithContext() instead.
16109func (page *ManagedInstanceEncryptionProtectorListResultPage) Next() error {
16110	return page.NextWithContext(context.Background())
16111}
16112
16113// NotDone returns true if the page enumeration should be started or is not yet complete.
16114func (page ManagedInstanceEncryptionProtectorListResultPage) NotDone() bool {
16115	return !page.mieplr.IsEmpty()
16116}
16117
16118// Response returns the raw server response from the last page request.
16119func (page ManagedInstanceEncryptionProtectorListResultPage) Response() ManagedInstanceEncryptionProtectorListResult {
16120	return page.mieplr
16121}
16122
16123// Values returns the slice of values for the current page or nil if there are no values.
16124func (page ManagedInstanceEncryptionProtectorListResultPage) Values() []ManagedInstanceEncryptionProtector {
16125	if page.mieplr.IsEmpty() {
16126		return nil
16127	}
16128	return *page.mieplr.Value
16129}
16130
16131// Creates a new instance of the ManagedInstanceEncryptionProtectorListResultPage type.
16132func NewManagedInstanceEncryptionProtectorListResultPage(cur ManagedInstanceEncryptionProtectorListResult, getNextPage func(context.Context, ManagedInstanceEncryptionProtectorListResult) (ManagedInstanceEncryptionProtectorListResult, error)) ManagedInstanceEncryptionProtectorListResultPage {
16133	return ManagedInstanceEncryptionProtectorListResultPage{
16134		fn:     getNextPage,
16135		mieplr: cur,
16136	}
16137}
16138
16139// ManagedInstanceEncryptionProtectorProperties properties for an encryption protector execution.
16140type ManagedInstanceEncryptionProtectorProperties struct {
16141	// ServerKeyName - The name of the managed instance key.
16142	ServerKeyName *string `json:"serverKeyName,omitempty"`
16143	// ServerKeyType - The encryption protector type like 'ServiceManaged', 'AzureKeyVault'. Possible values include: 'ServerKeyTypeServiceManaged', 'ServerKeyTypeAzureKeyVault'
16144	ServerKeyType ServerKeyType `json:"serverKeyType,omitempty"`
16145	// URI - READ-ONLY; The URI of the server key.
16146	URI *string `json:"uri,omitempty"`
16147	// Thumbprint - READ-ONLY; Thumbprint of the server key.
16148	Thumbprint *string `json:"thumbprint,omitempty"`
16149	// AutoRotationEnabled - Key auto rotation opt-in flag. Either true or false.
16150	AutoRotationEnabled *bool `json:"autoRotationEnabled,omitempty"`
16151}
16152
16153// MarshalJSON is the custom marshaler for ManagedInstanceEncryptionProtectorProperties.
16154func (miepp ManagedInstanceEncryptionProtectorProperties) MarshalJSON() ([]byte, error) {
16155	objectMap := make(map[string]interface{})
16156	if miepp.ServerKeyName != nil {
16157		objectMap["serverKeyName"] = miepp.ServerKeyName
16158	}
16159	if miepp.ServerKeyType != "" {
16160		objectMap["serverKeyType"] = miepp.ServerKeyType
16161	}
16162	if miepp.AutoRotationEnabled != nil {
16163		objectMap["autoRotationEnabled"] = miepp.AutoRotationEnabled
16164	}
16165	return json.Marshal(objectMap)
16166}
16167
16168// ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture an abstraction for monitoring and retrieving the
16169// results of a long-running operation.
16170type ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture struct {
16171	azure.FutureAPI
16172	// Result returns the result of the asynchronous operation.
16173	// If the operation has not completed it will return an error.
16174	Result func(ManagedInstanceEncryptionProtectorsClient) (ManagedInstanceEncryptionProtector, error)
16175}
16176
16177// UnmarshalJSON is the custom unmarshaller for CreateFuture.
16178func (future *ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
16179	var azFuture azure.Future
16180	if err := json.Unmarshal(body, &azFuture); err != nil {
16181		return err
16182	}
16183	future.FutureAPI = &azFuture
16184	future.Result = future.result
16185	return nil
16186}
16187
16188// result is the default implementation for ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture.Result.
16189func (future *ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture) result(client ManagedInstanceEncryptionProtectorsClient) (miep ManagedInstanceEncryptionProtector, err error) {
16190	var done bool
16191	done, err = future.DoneWithContext(context.Background(), client)
16192	if err != nil {
16193		err = autorest.NewErrorWithError(err, "sql.ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
16194		return
16195	}
16196	if !done {
16197		miep.Response.Response = future.Response()
16198		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture")
16199		return
16200	}
16201	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
16202	if miep.Response.Response, err = future.GetResult(sender); err == nil && miep.Response.Response.StatusCode != http.StatusNoContent {
16203		miep, err = client.CreateOrUpdateResponder(miep.Response.Response)
16204		if err != nil {
16205			err = autorest.NewErrorWithError(err, "sql.ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture", "Result", miep.Response.Response, "Failure responding to request")
16206		}
16207	}
16208	return
16209}
16210
16211// ManagedInstanceEncryptionProtectorsRevalidateFuture an abstraction for monitoring and retrieving the
16212// results of a long-running operation.
16213type ManagedInstanceEncryptionProtectorsRevalidateFuture struct {
16214	azure.FutureAPI
16215	// Result returns the result of the asynchronous operation.
16216	// If the operation has not completed it will return an error.
16217	Result func(ManagedInstanceEncryptionProtectorsClient) (autorest.Response, error)
16218}
16219
16220// UnmarshalJSON is the custom unmarshaller for CreateFuture.
16221func (future *ManagedInstanceEncryptionProtectorsRevalidateFuture) UnmarshalJSON(body []byte) error {
16222	var azFuture azure.Future
16223	if err := json.Unmarshal(body, &azFuture); err != nil {
16224		return err
16225	}
16226	future.FutureAPI = &azFuture
16227	future.Result = future.result
16228	return nil
16229}
16230
16231// result is the default implementation for ManagedInstanceEncryptionProtectorsRevalidateFuture.Result.
16232func (future *ManagedInstanceEncryptionProtectorsRevalidateFuture) result(client ManagedInstanceEncryptionProtectorsClient) (ar autorest.Response, err error) {
16233	var done bool
16234	done, err = future.DoneWithContext(context.Background(), client)
16235	if err != nil {
16236		err = autorest.NewErrorWithError(err, "sql.ManagedInstanceEncryptionProtectorsRevalidateFuture", "Result", future.Response(), "Polling failure")
16237		return
16238	}
16239	if !done {
16240		ar.Response = future.Response()
16241		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstanceEncryptionProtectorsRevalidateFuture")
16242		return
16243	}
16244	ar.Response = future.Response()
16245	return
16246}
16247
16248// ManagedInstanceExternalAdministrator properties of a active directory administrator.
16249type ManagedInstanceExternalAdministrator struct {
16250	// AdministratorType - Type of the sever administrator. Possible values include: 'AdministratorTypeActiveDirectory'
16251	AdministratorType AdministratorType `json:"administratorType,omitempty"`
16252	// PrincipalType - Principal Type of the sever administrator. Possible values include: 'PrincipalTypeUser', 'PrincipalTypeGroup', 'PrincipalTypeApplication'
16253	PrincipalType PrincipalType `json:"principalType,omitempty"`
16254	// Login - Login name of the server administrator.
16255	Login *string `json:"login,omitempty"`
16256	// Sid - SID (object ID) of the server administrator.
16257	Sid *uuid.UUID `json:"sid,omitempty"`
16258	// TenantID - Tenant ID of the administrator.
16259	TenantID *uuid.UUID `json:"tenantId,omitempty"`
16260	// AzureADOnlyAuthentication - Azure Active Directory only Authentication enabled.
16261	AzureADOnlyAuthentication *bool `json:"azureADOnlyAuthentication,omitempty"`
16262}
16263
16264// ManagedInstanceFamilyCapability the managed server family capability.
16265type ManagedInstanceFamilyCapability struct {
16266	// Name - READ-ONLY; Family name.
16267	Name *string `json:"name,omitempty"`
16268	// Sku - READ-ONLY; SKU name.
16269	Sku *string `json:"sku,omitempty"`
16270	// SupportedLicenseTypes - READ-ONLY; List of supported license types.
16271	SupportedLicenseTypes *[]LicenseTypeCapability `json:"supportedLicenseTypes,omitempty"`
16272	// SupportedVcoresValues - READ-ONLY; List of supported virtual cores values.
16273	SupportedVcoresValues *[]ManagedInstanceVcoresCapability `json:"supportedVcoresValues,omitempty"`
16274	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
16275	Status CapabilityStatus `json:"status,omitempty"`
16276	// Reason - The reason for the capability not being available.
16277	Reason *string `json:"reason,omitempty"`
16278}
16279
16280// MarshalJSON is the custom marshaler for ManagedInstanceFamilyCapability.
16281func (mifc ManagedInstanceFamilyCapability) MarshalJSON() ([]byte, error) {
16282	objectMap := make(map[string]interface{})
16283	if mifc.Reason != nil {
16284		objectMap["reason"] = mifc.Reason
16285	}
16286	return json.Marshal(objectMap)
16287}
16288
16289// ManagedInstanceKey a managed instance key.
16290type ManagedInstanceKey struct {
16291	autorest.Response `json:"-"`
16292	// Kind - READ-ONLY; Kind of encryption protector. This is metadata used for the Azure portal experience.
16293	Kind *string `json:"kind,omitempty"`
16294	// ManagedInstanceKeyProperties - Resource properties.
16295	*ManagedInstanceKeyProperties `json:"properties,omitempty"`
16296	// ID - READ-ONLY; Resource ID.
16297	ID *string `json:"id,omitempty"`
16298	// Name - READ-ONLY; Resource name.
16299	Name *string `json:"name,omitempty"`
16300	// Type - READ-ONLY; Resource type.
16301	Type *string `json:"type,omitempty"`
16302}
16303
16304// MarshalJSON is the custom marshaler for ManagedInstanceKey.
16305func (mik ManagedInstanceKey) MarshalJSON() ([]byte, error) {
16306	objectMap := make(map[string]interface{})
16307	if mik.ManagedInstanceKeyProperties != nil {
16308		objectMap["properties"] = mik.ManagedInstanceKeyProperties
16309	}
16310	return json.Marshal(objectMap)
16311}
16312
16313// UnmarshalJSON is the custom unmarshaler for ManagedInstanceKey struct.
16314func (mik *ManagedInstanceKey) UnmarshalJSON(body []byte) error {
16315	var m map[string]*json.RawMessage
16316	err := json.Unmarshal(body, &m)
16317	if err != nil {
16318		return err
16319	}
16320	for k, v := range m {
16321		switch k {
16322		case "kind":
16323			if v != nil {
16324				var kind string
16325				err = json.Unmarshal(*v, &kind)
16326				if err != nil {
16327					return err
16328				}
16329				mik.Kind = &kind
16330			}
16331		case "properties":
16332			if v != nil {
16333				var managedInstanceKeyProperties ManagedInstanceKeyProperties
16334				err = json.Unmarshal(*v, &managedInstanceKeyProperties)
16335				if err != nil {
16336					return err
16337				}
16338				mik.ManagedInstanceKeyProperties = &managedInstanceKeyProperties
16339			}
16340		case "id":
16341			if v != nil {
16342				var ID string
16343				err = json.Unmarshal(*v, &ID)
16344				if err != nil {
16345					return err
16346				}
16347				mik.ID = &ID
16348			}
16349		case "name":
16350			if v != nil {
16351				var name string
16352				err = json.Unmarshal(*v, &name)
16353				if err != nil {
16354					return err
16355				}
16356				mik.Name = &name
16357			}
16358		case "type":
16359			if v != nil {
16360				var typeVar string
16361				err = json.Unmarshal(*v, &typeVar)
16362				if err != nil {
16363					return err
16364				}
16365				mik.Type = &typeVar
16366			}
16367		}
16368	}
16369
16370	return nil
16371}
16372
16373// ManagedInstanceKeyListResult a list of managed instance keys.
16374type ManagedInstanceKeyListResult struct {
16375	autorest.Response `json:"-"`
16376	// Value - READ-ONLY; Array of results.
16377	Value *[]ManagedInstanceKey `json:"value,omitempty"`
16378	// NextLink - READ-ONLY; Link to retrieve next page of results.
16379	NextLink *string `json:"nextLink,omitempty"`
16380}
16381
16382// MarshalJSON is the custom marshaler for ManagedInstanceKeyListResult.
16383func (miklr ManagedInstanceKeyListResult) MarshalJSON() ([]byte, error) {
16384	objectMap := make(map[string]interface{})
16385	return json.Marshal(objectMap)
16386}
16387
16388// ManagedInstanceKeyListResultIterator provides access to a complete listing of ManagedInstanceKey values.
16389type ManagedInstanceKeyListResultIterator struct {
16390	i    int
16391	page ManagedInstanceKeyListResultPage
16392}
16393
16394// NextWithContext advances to the next value.  If there was an error making
16395// the request the iterator does not advance and the error is returned.
16396func (iter *ManagedInstanceKeyListResultIterator) NextWithContext(ctx context.Context) (err error) {
16397	if tracing.IsEnabled() {
16398		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceKeyListResultIterator.NextWithContext")
16399		defer func() {
16400			sc := -1
16401			if iter.Response().Response.Response != nil {
16402				sc = iter.Response().Response.Response.StatusCode
16403			}
16404			tracing.EndSpan(ctx, sc, err)
16405		}()
16406	}
16407	iter.i++
16408	if iter.i < len(iter.page.Values()) {
16409		return nil
16410	}
16411	err = iter.page.NextWithContext(ctx)
16412	if err != nil {
16413		iter.i--
16414		return err
16415	}
16416	iter.i = 0
16417	return nil
16418}
16419
16420// Next advances to the next value.  If there was an error making
16421// the request the iterator does not advance and the error is returned.
16422// Deprecated: Use NextWithContext() instead.
16423func (iter *ManagedInstanceKeyListResultIterator) Next() error {
16424	return iter.NextWithContext(context.Background())
16425}
16426
16427// NotDone returns true if the enumeration should be started or is not yet complete.
16428func (iter ManagedInstanceKeyListResultIterator) NotDone() bool {
16429	return iter.page.NotDone() && iter.i < len(iter.page.Values())
16430}
16431
16432// Response returns the raw server response from the last page request.
16433func (iter ManagedInstanceKeyListResultIterator) Response() ManagedInstanceKeyListResult {
16434	return iter.page.Response()
16435}
16436
16437// Value returns the current value or a zero-initialized value if the
16438// iterator has advanced beyond the end of the collection.
16439func (iter ManagedInstanceKeyListResultIterator) Value() ManagedInstanceKey {
16440	if !iter.page.NotDone() {
16441		return ManagedInstanceKey{}
16442	}
16443	return iter.page.Values()[iter.i]
16444}
16445
16446// Creates a new instance of the ManagedInstanceKeyListResultIterator type.
16447func NewManagedInstanceKeyListResultIterator(page ManagedInstanceKeyListResultPage) ManagedInstanceKeyListResultIterator {
16448	return ManagedInstanceKeyListResultIterator{page: page}
16449}
16450
16451// IsEmpty returns true if the ListResult contains no values.
16452func (miklr ManagedInstanceKeyListResult) IsEmpty() bool {
16453	return miklr.Value == nil || len(*miklr.Value) == 0
16454}
16455
16456// hasNextLink returns true if the NextLink is not empty.
16457func (miklr ManagedInstanceKeyListResult) hasNextLink() bool {
16458	return miklr.NextLink != nil && len(*miklr.NextLink) != 0
16459}
16460
16461// managedInstanceKeyListResultPreparer prepares a request to retrieve the next set of results.
16462// It returns nil if no more results exist.
16463func (miklr ManagedInstanceKeyListResult) managedInstanceKeyListResultPreparer(ctx context.Context) (*http.Request, error) {
16464	if !miklr.hasNextLink() {
16465		return nil, nil
16466	}
16467	return autorest.Prepare((&http.Request{}).WithContext(ctx),
16468		autorest.AsJSON(),
16469		autorest.AsGet(),
16470		autorest.WithBaseURL(to.String(miklr.NextLink)))
16471}
16472
16473// ManagedInstanceKeyListResultPage contains a page of ManagedInstanceKey values.
16474type ManagedInstanceKeyListResultPage struct {
16475	fn    func(context.Context, ManagedInstanceKeyListResult) (ManagedInstanceKeyListResult, error)
16476	miklr ManagedInstanceKeyListResult
16477}
16478
16479// NextWithContext advances to the next page of values.  If there was an error making
16480// the request the page does not advance and the error is returned.
16481func (page *ManagedInstanceKeyListResultPage) NextWithContext(ctx context.Context) (err error) {
16482	if tracing.IsEnabled() {
16483		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceKeyListResultPage.NextWithContext")
16484		defer func() {
16485			sc := -1
16486			if page.Response().Response.Response != nil {
16487				sc = page.Response().Response.Response.StatusCode
16488			}
16489			tracing.EndSpan(ctx, sc, err)
16490		}()
16491	}
16492	for {
16493		next, err := page.fn(ctx, page.miklr)
16494		if err != nil {
16495			return err
16496		}
16497		page.miklr = next
16498		if !next.hasNextLink() || !next.IsEmpty() {
16499			break
16500		}
16501	}
16502	return nil
16503}
16504
16505// Next advances to the next page of values.  If there was an error making
16506// the request the page does not advance and the error is returned.
16507// Deprecated: Use NextWithContext() instead.
16508func (page *ManagedInstanceKeyListResultPage) Next() error {
16509	return page.NextWithContext(context.Background())
16510}
16511
16512// NotDone returns true if the page enumeration should be started or is not yet complete.
16513func (page ManagedInstanceKeyListResultPage) NotDone() bool {
16514	return !page.miklr.IsEmpty()
16515}
16516
16517// Response returns the raw server response from the last page request.
16518func (page ManagedInstanceKeyListResultPage) Response() ManagedInstanceKeyListResult {
16519	return page.miklr
16520}
16521
16522// Values returns the slice of values for the current page or nil if there are no values.
16523func (page ManagedInstanceKeyListResultPage) Values() []ManagedInstanceKey {
16524	if page.miklr.IsEmpty() {
16525		return nil
16526	}
16527	return *page.miklr.Value
16528}
16529
16530// Creates a new instance of the ManagedInstanceKeyListResultPage type.
16531func NewManagedInstanceKeyListResultPage(cur ManagedInstanceKeyListResult, getNextPage func(context.Context, ManagedInstanceKeyListResult) (ManagedInstanceKeyListResult, error)) ManagedInstanceKeyListResultPage {
16532	return ManagedInstanceKeyListResultPage{
16533		fn:    getNextPage,
16534		miklr: cur,
16535	}
16536}
16537
16538// ManagedInstanceKeyProperties properties for a key execution.
16539type ManagedInstanceKeyProperties struct {
16540	// ServerKeyType - The key type like 'ServiceManaged', 'AzureKeyVault'. Possible values include: 'ServerKeyTypeServiceManaged', 'ServerKeyTypeAzureKeyVault'
16541	ServerKeyType ServerKeyType `json:"serverKeyType,omitempty"`
16542	// URI - The URI of the key. If the ServerKeyType is AzureKeyVault, then the URI is required.
16543	URI *string `json:"uri,omitempty"`
16544	// Thumbprint - READ-ONLY; Thumbprint of the key.
16545	Thumbprint *string `json:"thumbprint,omitempty"`
16546	// CreationDate - READ-ONLY; The key creation date.
16547	CreationDate *date.Time `json:"creationDate,omitempty"`
16548	// AutoRotationEnabled - READ-ONLY; Key auto rotation opt-in flag. Either true or false.
16549	AutoRotationEnabled *bool `json:"autoRotationEnabled,omitempty"`
16550}
16551
16552// MarshalJSON is the custom marshaler for ManagedInstanceKeyProperties.
16553func (mikp ManagedInstanceKeyProperties) MarshalJSON() ([]byte, error) {
16554	objectMap := make(map[string]interface{})
16555	if mikp.ServerKeyType != "" {
16556		objectMap["serverKeyType"] = mikp.ServerKeyType
16557	}
16558	if mikp.URI != nil {
16559		objectMap["uri"] = mikp.URI
16560	}
16561	return json.Marshal(objectMap)
16562}
16563
16564// ManagedInstanceKeysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
16565// long-running operation.
16566type ManagedInstanceKeysCreateOrUpdateFuture struct {
16567	azure.FutureAPI
16568	// Result returns the result of the asynchronous operation.
16569	// If the operation has not completed it will return an error.
16570	Result func(ManagedInstanceKeysClient) (ManagedInstanceKey, error)
16571}
16572
16573// UnmarshalJSON is the custom unmarshaller for CreateFuture.
16574func (future *ManagedInstanceKeysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
16575	var azFuture azure.Future
16576	if err := json.Unmarshal(body, &azFuture); err != nil {
16577		return err
16578	}
16579	future.FutureAPI = &azFuture
16580	future.Result = future.result
16581	return nil
16582}
16583
16584// result is the default implementation for ManagedInstanceKeysCreateOrUpdateFuture.Result.
16585func (future *ManagedInstanceKeysCreateOrUpdateFuture) result(client ManagedInstanceKeysClient) (mik ManagedInstanceKey, err error) {
16586	var done bool
16587	done, err = future.DoneWithContext(context.Background(), client)
16588	if err != nil {
16589		err = autorest.NewErrorWithError(err, "sql.ManagedInstanceKeysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
16590		return
16591	}
16592	if !done {
16593		mik.Response.Response = future.Response()
16594		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstanceKeysCreateOrUpdateFuture")
16595		return
16596	}
16597	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
16598	if mik.Response.Response, err = future.GetResult(sender); err == nil && mik.Response.Response.StatusCode != http.StatusNoContent {
16599		mik, err = client.CreateOrUpdateResponder(mik.Response.Response)
16600		if err != nil {
16601			err = autorest.NewErrorWithError(err, "sql.ManagedInstanceKeysCreateOrUpdateFuture", "Result", mik.Response.Response, "Failure responding to request")
16602		}
16603	}
16604	return
16605}
16606
16607// ManagedInstanceKeysDeleteFuture an abstraction for monitoring and retrieving the results of a
16608// long-running operation.
16609type ManagedInstanceKeysDeleteFuture struct {
16610	azure.FutureAPI
16611	// Result returns the result of the asynchronous operation.
16612	// If the operation has not completed it will return an error.
16613	Result func(ManagedInstanceKeysClient) (autorest.Response, error)
16614}
16615
16616// UnmarshalJSON is the custom unmarshaller for CreateFuture.
16617func (future *ManagedInstanceKeysDeleteFuture) UnmarshalJSON(body []byte) error {
16618	var azFuture azure.Future
16619	if err := json.Unmarshal(body, &azFuture); err != nil {
16620		return err
16621	}
16622	future.FutureAPI = &azFuture
16623	future.Result = future.result
16624	return nil
16625}
16626
16627// result is the default implementation for ManagedInstanceKeysDeleteFuture.Result.
16628func (future *ManagedInstanceKeysDeleteFuture) result(client ManagedInstanceKeysClient) (ar autorest.Response, err error) {
16629	var done bool
16630	done, err = future.DoneWithContext(context.Background(), client)
16631	if err != nil {
16632		err = autorest.NewErrorWithError(err, "sql.ManagedInstanceKeysDeleteFuture", "Result", future.Response(), "Polling failure")
16633		return
16634	}
16635	if !done {
16636		ar.Response = future.Response()
16637		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstanceKeysDeleteFuture")
16638		return
16639	}
16640	ar.Response = future.Response()
16641	return
16642}
16643
16644// ManagedInstanceListResult a list of managed instances.
16645type ManagedInstanceListResult struct {
16646	autorest.Response `json:"-"`
16647	// Value - READ-ONLY; Array of results.
16648	Value *[]ManagedInstance `json:"value,omitempty"`
16649	// NextLink - READ-ONLY; Link to retrieve next page of results.
16650	NextLink *string `json:"nextLink,omitempty"`
16651}
16652
16653// MarshalJSON is the custom marshaler for ManagedInstanceListResult.
16654func (milr ManagedInstanceListResult) MarshalJSON() ([]byte, error) {
16655	objectMap := make(map[string]interface{})
16656	return json.Marshal(objectMap)
16657}
16658
16659// ManagedInstanceListResultIterator provides access to a complete listing of ManagedInstance values.
16660type ManagedInstanceListResultIterator struct {
16661	i    int
16662	page ManagedInstanceListResultPage
16663}
16664
16665// NextWithContext advances to the next value.  If there was an error making
16666// the request the iterator does not advance and the error is returned.
16667func (iter *ManagedInstanceListResultIterator) NextWithContext(ctx context.Context) (err error) {
16668	if tracing.IsEnabled() {
16669		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceListResultIterator.NextWithContext")
16670		defer func() {
16671			sc := -1
16672			if iter.Response().Response.Response != nil {
16673				sc = iter.Response().Response.Response.StatusCode
16674			}
16675			tracing.EndSpan(ctx, sc, err)
16676		}()
16677	}
16678	iter.i++
16679	if iter.i < len(iter.page.Values()) {
16680		return nil
16681	}
16682	err = iter.page.NextWithContext(ctx)
16683	if err != nil {
16684		iter.i--
16685		return err
16686	}
16687	iter.i = 0
16688	return nil
16689}
16690
16691// Next advances to the next value.  If there was an error making
16692// the request the iterator does not advance and the error is returned.
16693// Deprecated: Use NextWithContext() instead.
16694func (iter *ManagedInstanceListResultIterator) Next() error {
16695	return iter.NextWithContext(context.Background())
16696}
16697
16698// NotDone returns true if the enumeration should be started or is not yet complete.
16699func (iter ManagedInstanceListResultIterator) NotDone() bool {
16700	return iter.page.NotDone() && iter.i < len(iter.page.Values())
16701}
16702
16703// Response returns the raw server response from the last page request.
16704func (iter ManagedInstanceListResultIterator) Response() ManagedInstanceListResult {
16705	return iter.page.Response()
16706}
16707
16708// Value returns the current value or a zero-initialized value if the
16709// iterator has advanced beyond the end of the collection.
16710func (iter ManagedInstanceListResultIterator) Value() ManagedInstance {
16711	if !iter.page.NotDone() {
16712		return ManagedInstance{}
16713	}
16714	return iter.page.Values()[iter.i]
16715}
16716
16717// Creates a new instance of the ManagedInstanceListResultIterator type.
16718func NewManagedInstanceListResultIterator(page ManagedInstanceListResultPage) ManagedInstanceListResultIterator {
16719	return ManagedInstanceListResultIterator{page: page}
16720}
16721
16722// IsEmpty returns true if the ListResult contains no values.
16723func (milr ManagedInstanceListResult) IsEmpty() bool {
16724	return milr.Value == nil || len(*milr.Value) == 0
16725}
16726
16727// hasNextLink returns true if the NextLink is not empty.
16728func (milr ManagedInstanceListResult) hasNextLink() bool {
16729	return milr.NextLink != nil && len(*milr.NextLink) != 0
16730}
16731
16732// managedInstanceListResultPreparer prepares a request to retrieve the next set of results.
16733// It returns nil if no more results exist.
16734func (milr ManagedInstanceListResult) managedInstanceListResultPreparer(ctx context.Context) (*http.Request, error) {
16735	if !milr.hasNextLink() {
16736		return nil, nil
16737	}
16738	return autorest.Prepare((&http.Request{}).WithContext(ctx),
16739		autorest.AsJSON(),
16740		autorest.AsGet(),
16741		autorest.WithBaseURL(to.String(milr.NextLink)))
16742}
16743
16744// ManagedInstanceListResultPage contains a page of ManagedInstance values.
16745type ManagedInstanceListResultPage struct {
16746	fn   func(context.Context, ManagedInstanceListResult) (ManagedInstanceListResult, error)
16747	milr ManagedInstanceListResult
16748}
16749
16750// NextWithContext advances to the next page of values.  If there was an error making
16751// the request the page does not advance and the error is returned.
16752func (page *ManagedInstanceListResultPage) NextWithContext(ctx context.Context) (err error) {
16753	if tracing.IsEnabled() {
16754		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceListResultPage.NextWithContext")
16755		defer func() {
16756			sc := -1
16757			if page.Response().Response.Response != nil {
16758				sc = page.Response().Response.Response.StatusCode
16759			}
16760			tracing.EndSpan(ctx, sc, err)
16761		}()
16762	}
16763	for {
16764		next, err := page.fn(ctx, page.milr)
16765		if err != nil {
16766			return err
16767		}
16768		page.milr = next
16769		if !next.hasNextLink() || !next.IsEmpty() {
16770			break
16771		}
16772	}
16773	return nil
16774}
16775
16776// Next advances to the next page of values.  If there was an error making
16777// the request the page does not advance and the error is returned.
16778// Deprecated: Use NextWithContext() instead.
16779func (page *ManagedInstanceListResultPage) Next() error {
16780	return page.NextWithContext(context.Background())
16781}
16782
16783// NotDone returns true if the page enumeration should be started or is not yet complete.
16784func (page ManagedInstanceListResultPage) NotDone() bool {
16785	return !page.milr.IsEmpty()
16786}
16787
16788// Response returns the raw server response from the last page request.
16789func (page ManagedInstanceListResultPage) Response() ManagedInstanceListResult {
16790	return page.milr
16791}
16792
16793// Values returns the slice of values for the current page or nil if there are no values.
16794func (page ManagedInstanceListResultPage) Values() []ManagedInstance {
16795	if page.milr.IsEmpty() {
16796		return nil
16797	}
16798	return *page.milr.Value
16799}
16800
16801// Creates a new instance of the ManagedInstanceListResultPage type.
16802func NewManagedInstanceListResultPage(cur ManagedInstanceListResult, getNextPage func(context.Context, ManagedInstanceListResult) (ManagedInstanceListResult, error)) ManagedInstanceListResultPage {
16803	return ManagedInstanceListResultPage{
16804		fn:   getNextPage,
16805		milr: cur,
16806	}
16807}
16808
16809// ManagedInstanceLongTermRetentionBackup a long term retention backup for a managed database.
16810type ManagedInstanceLongTermRetentionBackup struct {
16811	autorest.Response `json:"-"`
16812	// ManagedInstanceLongTermRetentionBackupProperties - Resource properties.
16813	*ManagedInstanceLongTermRetentionBackupProperties `json:"properties,omitempty"`
16814	// ID - READ-ONLY; Resource ID.
16815	ID *string `json:"id,omitempty"`
16816	// Name - READ-ONLY; Resource name.
16817	Name *string `json:"name,omitempty"`
16818	// Type - READ-ONLY; Resource type.
16819	Type *string `json:"type,omitempty"`
16820}
16821
16822// MarshalJSON is the custom marshaler for ManagedInstanceLongTermRetentionBackup.
16823func (miltrb ManagedInstanceLongTermRetentionBackup) MarshalJSON() ([]byte, error) {
16824	objectMap := make(map[string]interface{})
16825	if miltrb.ManagedInstanceLongTermRetentionBackupProperties != nil {
16826		objectMap["properties"] = miltrb.ManagedInstanceLongTermRetentionBackupProperties
16827	}
16828	return json.Marshal(objectMap)
16829}
16830
16831// UnmarshalJSON is the custom unmarshaler for ManagedInstanceLongTermRetentionBackup struct.
16832func (miltrb *ManagedInstanceLongTermRetentionBackup) UnmarshalJSON(body []byte) error {
16833	var m map[string]*json.RawMessage
16834	err := json.Unmarshal(body, &m)
16835	if err != nil {
16836		return err
16837	}
16838	for k, v := range m {
16839		switch k {
16840		case "properties":
16841			if v != nil {
16842				var managedInstanceLongTermRetentionBackupProperties ManagedInstanceLongTermRetentionBackupProperties
16843				err = json.Unmarshal(*v, &managedInstanceLongTermRetentionBackupProperties)
16844				if err != nil {
16845					return err
16846				}
16847				miltrb.ManagedInstanceLongTermRetentionBackupProperties = &managedInstanceLongTermRetentionBackupProperties
16848			}
16849		case "id":
16850			if v != nil {
16851				var ID string
16852				err = json.Unmarshal(*v, &ID)
16853				if err != nil {
16854					return err
16855				}
16856				miltrb.ID = &ID
16857			}
16858		case "name":
16859			if v != nil {
16860				var name string
16861				err = json.Unmarshal(*v, &name)
16862				if err != nil {
16863					return err
16864				}
16865				miltrb.Name = &name
16866			}
16867		case "type":
16868			if v != nil {
16869				var typeVar string
16870				err = json.Unmarshal(*v, &typeVar)
16871				if err != nil {
16872					return err
16873				}
16874				miltrb.Type = &typeVar
16875			}
16876		}
16877	}
16878
16879	return nil
16880}
16881
16882// ManagedInstanceLongTermRetentionBackupListResult a list of long term retention backups for managed
16883// database(s).
16884type ManagedInstanceLongTermRetentionBackupListResult struct {
16885	autorest.Response `json:"-"`
16886	// Value - READ-ONLY; Array of results.
16887	Value *[]ManagedInstanceLongTermRetentionBackup `json:"value,omitempty"`
16888	// NextLink - READ-ONLY; Link to retrieve next page of results.
16889	NextLink *string `json:"nextLink,omitempty"`
16890}
16891
16892// MarshalJSON is the custom marshaler for ManagedInstanceLongTermRetentionBackupListResult.
16893func (miltrblr ManagedInstanceLongTermRetentionBackupListResult) MarshalJSON() ([]byte, error) {
16894	objectMap := make(map[string]interface{})
16895	return json.Marshal(objectMap)
16896}
16897
16898// ManagedInstanceLongTermRetentionBackupListResultIterator provides access to a complete listing of
16899// ManagedInstanceLongTermRetentionBackup values.
16900type ManagedInstanceLongTermRetentionBackupListResultIterator struct {
16901	i    int
16902	page ManagedInstanceLongTermRetentionBackupListResultPage
16903}
16904
16905// NextWithContext advances to the next value.  If there was an error making
16906// the request the iterator does not advance and the error is returned.
16907func (iter *ManagedInstanceLongTermRetentionBackupListResultIterator) NextWithContext(ctx context.Context) (err error) {
16908	if tracing.IsEnabled() {
16909		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceLongTermRetentionBackupListResultIterator.NextWithContext")
16910		defer func() {
16911			sc := -1
16912			if iter.Response().Response.Response != nil {
16913				sc = iter.Response().Response.Response.StatusCode
16914			}
16915			tracing.EndSpan(ctx, sc, err)
16916		}()
16917	}
16918	iter.i++
16919	if iter.i < len(iter.page.Values()) {
16920		return nil
16921	}
16922	err = iter.page.NextWithContext(ctx)
16923	if err != nil {
16924		iter.i--
16925		return err
16926	}
16927	iter.i = 0
16928	return nil
16929}
16930
16931// Next advances to the next value.  If there was an error making
16932// the request the iterator does not advance and the error is returned.
16933// Deprecated: Use NextWithContext() instead.
16934func (iter *ManagedInstanceLongTermRetentionBackupListResultIterator) Next() error {
16935	return iter.NextWithContext(context.Background())
16936}
16937
16938// NotDone returns true if the enumeration should be started or is not yet complete.
16939func (iter ManagedInstanceLongTermRetentionBackupListResultIterator) NotDone() bool {
16940	return iter.page.NotDone() && iter.i < len(iter.page.Values())
16941}
16942
16943// Response returns the raw server response from the last page request.
16944func (iter ManagedInstanceLongTermRetentionBackupListResultIterator) Response() ManagedInstanceLongTermRetentionBackupListResult {
16945	return iter.page.Response()
16946}
16947
16948// Value returns the current value or a zero-initialized value if the
16949// iterator has advanced beyond the end of the collection.
16950func (iter ManagedInstanceLongTermRetentionBackupListResultIterator) Value() ManagedInstanceLongTermRetentionBackup {
16951	if !iter.page.NotDone() {
16952		return ManagedInstanceLongTermRetentionBackup{}
16953	}
16954	return iter.page.Values()[iter.i]
16955}
16956
16957// Creates a new instance of the ManagedInstanceLongTermRetentionBackupListResultIterator type.
16958func NewManagedInstanceLongTermRetentionBackupListResultIterator(page ManagedInstanceLongTermRetentionBackupListResultPage) ManagedInstanceLongTermRetentionBackupListResultIterator {
16959	return ManagedInstanceLongTermRetentionBackupListResultIterator{page: page}
16960}
16961
16962// IsEmpty returns true if the ListResult contains no values.
16963func (miltrblr ManagedInstanceLongTermRetentionBackupListResult) IsEmpty() bool {
16964	return miltrblr.Value == nil || len(*miltrblr.Value) == 0
16965}
16966
16967// hasNextLink returns true if the NextLink is not empty.
16968func (miltrblr ManagedInstanceLongTermRetentionBackupListResult) hasNextLink() bool {
16969	return miltrblr.NextLink != nil && len(*miltrblr.NextLink) != 0
16970}
16971
16972// managedInstanceLongTermRetentionBackupListResultPreparer prepares a request to retrieve the next set of results.
16973// It returns nil if no more results exist.
16974func (miltrblr ManagedInstanceLongTermRetentionBackupListResult) managedInstanceLongTermRetentionBackupListResultPreparer(ctx context.Context) (*http.Request, error) {
16975	if !miltrblr.hasNextLink() {
16976		return nil, nil
16977	}
16978	return autorest.Prepare((&http.Request{}).WithContext(ctx),
16979		autorest.AsJSON(),
16980		autorest.AsGet(),
16981		autorest.WithBaseURL(to.String(miltrblr.NextLink)))
16982}
16983
16984// ManagedInstanceLongTermRetentionBackupListResultPage contains a page of
16985// ManagedInstanceLongTermRetentionBackup values.
16986type ManagedInstanceLongTermRetentionBackupListResultPage struct {
16987	fn       func(context.Context, ManagedInstanceLongTermRetentionBackupListResult) (ManagedInstanceLongTermRetentionBackupListResult, error)
16988	miltrblr ManagedInstanceLongTermRetentionBackupListResult
16989}
16990
16991// NextWithContext advances to the next page of values.  If there was an error making
16992// the request the page does not advance and the error is returned.
16993func (page *ManagedInstanceLongTermRetentionBackupListResultPage) NextWithContext(ctx context.Context) (err error) {
16994	if tracing.IsEnabled() {
16995		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceLongTermRetentionBackupListResultPage.NextWithContext")
16996		defer func() {
16997			sc := -1
16998			if page.Response().Response.Response != nil {
16999				sc = page.Response().Response.Response.StatusCode
17000			}
17001			tracing.EndSpan(ctx, sc, err)
17002		}()
17003	}
17004	for {
17005		next, err := page.fn(ctx, page.miltrblr)
17006		if err != nil {
17007			return err
17008		}
17009		page.miltrblr = next
17010		if !next.hasNextLink() || !next.IsEmpty() {
17011			break
17012		}
17013	}
17014	return nil
17015}
17016
17017// Next advances to the next page of values.  If there was an error making
17018// the request the page does not advance and the error is returned.
17019// Deprecated: Use NextWithContext() instead.
17020func (page *ManagedInstanceLongTermRetentionBackupListResultPage) Next() error {
17021	return page.NextWithContext(context.Background())
17022}
17023
17024// NotDone returns true if the page enumeration should be started or is not yet complete.
17025func (page ManagedInstanceLongTermRetentionBackupListResultPage) NotDone() bool {
17026	return !page.miltrblr.IsEmpty()
17027}
17028
17029// Response returns the raw server response from the last page request.
17030func (page ManagedInstanceLongTermRetentionBackupListResultPage) Response() ManagedInstanceLongTermRetentionBackupListResult {
17031	return page.miltrblr
17032}
17033
17034// Values returns the slice of values for the current page or nil if there are no values.
17035func (page ManagedInstanceLongTermRetentionBackupListResultPage) Values() []ManagedInstanceLongTermRetentionBackup {
17036	if page.miltrblr.IsEmpty() {
17037		return nil
17038	}
17039	return *page.miltrblr.Value
17040}
17041
17042// Creates a new instance of the ManagedInstanceLongTermRetentionBackupListResultPage type.
17043func NewManagedInstanceLongTermRetentionBackupListResultPage(cur ManagedInstanceLongTermRetentionBackupListResult, getNextPage func(context.Context, ManagedInstanceLongTermRetentionBackupListResult) (ManagedInstanceLongTermRetentionBackupListResult, error)) ManagedInstanceLongTermRetentionBackupListResultPage {
17044	return ManagedInstanceLongTermRetentionBackupListResultPage{
17045		fn:       getNextPage,
17046		miltrblr: cur,
17047	}
17048}
17049
17050// ManagedInstanceLongTermRetentionBackupProperties properties of a long term retention backup
17051type ManagedInstanceLongTermRetentionBackupProperties struct {
17052	// ManagedInstanceName - READ-ONLY; The managed instance that the backup database belongs to.
17053	ManagedInstanceName *string `json:"managedInstanceName,omitempty"`
17054	// ManagedInstanceCreateTime - READ-ONLY; The create time of the instance.
17055	ManagedInstanceCreateTime *date.Time `json:"managedInstanceCreateTime,omitempty"`
17056	// DatabaseName - READ-ONLY; The name of the database the backup belong to
17057	DatabaseName *string `json:"databaseName,omitempty"`
17058	// DatabaseDeletionTime - READ-ONLY; The delete time of the database
17059	DatabaseDeletionTime *date.Time `json:"databaseDeletionTime,omitempty"`
17060	// BackupTime - READ-ONLY; The time the backup was taken
17061	BackupTime *date.Time `json:"backupTime,omitempty"`
17062	// BackupExpirationTime - READ-ONLY; The time the long term retention backup will expire.
17063	BackupExpirationTime *date.Time `json:"backupExpirationTime,omitempty"`
17064	// BackupStorageRedundancy - READ-ONLY; The storage redundancy type of the backup. Possible values include: 'BackupStorageRedundancyGeo', 'BackupStorageRedundancyLocal', 'BackupStorageRedundancyZone'
17065	BackupStorageRedundancy BackupStorageRedundancy `json:"backupStorageRedundancy,omitempty"`
17066}
17067
17068// MarshalJSON is the custom marshaler for ManagedInstanceLongTermRetentionBackupProperties.
17069func (miltrbp ManagedInstanceLongTermRetentionBackupProperties) MarshalJSON() ([]byte, error) {
17070	objectMap := make(map[string]interface{})
17071	return json.Marshal(objectMap)
17072}
17073
17074// ManagedInstanceLongTermRetentionPoliciesCreateOrUpdateFuture an abstraction for monitoring and
17075// retrieving the results of a long-running operation.
17076type ManagedInstanceLongTermRetentionPoliciesCreateOrUpdateFuture struct {
17077	azure.FutureAPI
17078	// Result returns the result of the asynchronous operation.
17079	// If the operation has not completed it will return an error.
17080	Result func(ManagedInstanceLongTermRetentionPoliciesClient) (ManagedInstanceLongTermRetentionPolicy, error)
17081}
17082
17083// UnmarshalJSON is the custom unmarshaller for CreateFuture.
17084func (future *ManagedInstanceLongTermRetentionPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
17085	var azFuture azure.Future
17086	if err := json.Unmarshal(body, &azFuture); err != nil {
17087		return err
17088	}
17089	future.FutureAPI = &azFuture
17090	future.Result = future.result
17091	return nil
17092}
17093
17094// result is the default implementation for ManagedInstanceLongTermRetentionPoliciesCreateOrUpdateFuture.Result.
17095func (future *ManagedInstanceLongTermRetentionPoliciesCreateOrUpdateFuture) result(client ManagedInstanceLongTermRetentionPoliciesClient) (miltrp ManagedInstanceLongTermRetentionPolicy, err error) {
17096	var done bool
17097	done, err = future.DoneWithContext(context.Background(), client)
17098	if err != nil {
17099		err = autorest.NewErrorWithError(err, "sql.ManagedInstanceLongTermRetentionPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
17100		return
17101	}
17102	if !done {
17103		miltrp.Response.Response = future.Response()
17104		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstanceLongTermRetentionPoliciesCreateOrUpdateFuture")
17105		return
17106	}
17107	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
17108	if miltrp.Response.Response, err = future.GetResult(sender); err == nil && miltrp.Response.Response.StatusCode != http.StatusNoContent {
17109		miltrp, err = client.CreateOrUpdateResponder(miltrp.Response.Response)
17110		if err != nil {
17111			err = autorest.NewErrorWithError(err, "sql.ManagedInstanceLongTermRetentionPoliciesCreateOrUpdateFuture", "Result", miltrp.Response.Response, "Failure responding to request")
17112		}
17113	}
17114	return
17115}
17116
17117// ManagedInstanceLongTermRetentionPolicy a long term retention policy.
17118type ManagedInstanceLongTermRetentionPolicy struct {
17119	autorest.Response `json:"-"`
17120	// BaseLongTermRetentionPolicyProperties - Resource properties.
17121	*BaseLongTermRetentionPolicyProperties `json:"properties,omitempty"`
17122	// ID - READ-ONLY; Resource ID.
17123	ID *string `json:"id,omitempty"`
17124	// Name - READ-ONLY; Resource name.
17125	Name *string `json:"name,omitempty"`
17126	// Type - READ-ONLY; Resource type.
17127	Type *string `json:"type,omitempty"`
17128}
17129
17130// MarshalJSON is the custom marshaler for ManagedInstanceLongTermRetentionPolicy.
17131func (miltrp ManagedInstanceLongTermRetentionPolicy) MarshalJSON() ([]byte, error) {
17132	objectMap := make(map[string]interface{})
17133	if miltrp.BaseLongTermRetentionPolicyProperties != nil {
17134		objectMap["properties"] = miltrp.BaseLongTermRetentionPolicyProperties
17135	}
17136	return json.Marshal(objectMap)
17137}
17138
17139// UnmarshalJSON is the custom unmarshaler for ManagedInstanceLongTermRetentionPolicy struct.
17140func (miltrp *ManagedInstanceLongTermRetentionPolicy) UnmarshalJSON(body []byte) error {
17141	var m map[string]*json.RawMessage
17142	err := json.Unmarshal(body, &m)
17143	if err != nil {
17144		return err
17145	}
17146	for k, v := range m {
17147		switch k {
17148		case "properties":
17149			if v != nil {
17150				var baseLongTermRetentionPolicyProperties BaseLongTermRetentionPolicyProperties
17151				err = json.Unmarshal(*v, &baseLongTermRetentionPolicyProperties)
17152				if err != nil {
17153					return err
17154				}
17155				miltrp.BaseLongTermRetentionPolicyProperties = &baseLongTermRetentionPolicyProperties
17156			}
17157		case "id":
17158			if v != nil {
17159				var ID string
17160				err = json.Unmarshal(*v, &ID)
17161				if err != nil {
17162					return err
17163				}
17164				miltrp.ID = &ID
17165			}
17166		case "name":
17167			if v != nil {
17168				var name string
17169				err = json.Unmarshal(*v, &name)
17170				if err != nil {
17171					return err
17172				}
17173				miltrp.Name = &name
17174			}
17175		case "type":
17176			if v != nil {
17177				var typeVar string
17178				err = json.Unmarshal(*v, &typeVar)
17179				if err != nil {
17180					return err
17181				}
17182				miltrp.Type = &typeVar
17183			}
17184		}
17185	}
17186
17187	return nil
17188}
17189
17190// ManagedInstanceLongTermRetentionPolicyListResult a list of long term retention policies.
17191type ManagedInstanceLongTermRetentionPolicyListResult struct {
17192	autorest.Response `json:"-"`
17193	// Value - READ-ONLY; Array of results.
17194	Value *[]ManagedInstanceLongTermRetentionPolicy `json:"value,omitempty"`
17195	// NextLink - READ-ONLY; Link to retrieve next page of results.
17196	NextLink *string `json:"nextLink,omitempty"`
17197}
17198
17199// MarshalJSON is the custom marshaler for ManagedInstanceLongTermRetentionPolicyListResult.
17200func (miltrplr ManagedInstanceLongTermRetentionPolicyListResult) MarshalJSON() ([]byte, error) {
17201	objectMap := make(map[string]interface{})
17202	return json.Marshal(objectMap)
17203}
17204
17205// ManagedInstanceLongTermRetentionPolicyListResultIterator provides access to a complete listing of
17206// ManagedInstanceLongTermRetentionPolicy values.
17207type ManagedInstanceLongTermRetentionPolicyListResultIterator struct {
17208	i    int
17209	page ManagedInstanceLongTermRetentionPolicyListResultPage
17210}
17211
17212// NextWithContext advances to the next value.  If there was an error making
17213// the request the iterator does not advance and the error is returned.
17214func (iter *ManagedInstanceLongTermRetentionPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
17215	if tracing.IsEnabled() {
17216		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceLongTermRetentionPolicyListResultIterator.NextWithContext")
17217		defer func() {
17218			sc := -1
17219			if iter.Response().Response.Response != nil {
17220				sc = iter.Response().Response.Response.StatusCode
17221			}
17222			tracing.EndSpan(ctx, sc, err)
17223		}()
17224	}
17225	iter.i++
17226	if iter.i < len(iter.page.Values()) {
17227		return nil
17228	}
17229	err = iter.page.NextWithContext(ctx)
17230	if err != nil {
17231		iter.i--
17232		return err
17233	}
17234	iter.i = 0
17235	return nil
17236}
17237
17238// Next advances to the next value.  If there was an error making
17239// the request the iterator does not advance and the error is returned.
17240// Deprecated: Use NextWithContext() instead.
17241func (iter *ManagedInstanceLongTermRetentionPolicyListResultIterator) Next() error {
17242	return iter.NextWithContext(context.Background())
17243}
17244
17245// NotDone returns true if the enumeration should be started or is not yet complete.
17246func (iter ManagedInstanceLongTermRetentionPolicyListResultIterator) NotDone() bool {
17247	return iter.page.NotDone() && iter.i < len(iter.page.Values())
17248}
17249
17250// Response returns the raw server response from the last page request.
17251func (iter ManagedInstanceLongTermRetentionPolicyListResultIterator) Response() ManagedInstanceLongTermRetentionPolicyListResult {
17252	return iter.page.Response()
17253}
17254
17255// Value returns the current value or a zero-initialized value if the
17256// iterator has advanced beyond the end of the collection.
17257func (iter ManagedInstanceLongTermRetentionPolicyListResultIterator) Value() ManagedInstanceLongTermRetentionPolicy {
17258	if !iter.page.NotDone() {
17259		return ManagedInstanceLongTermRetentionPolicy{}
17260	}
17261	return iter.page.Values()[iter.i]
17262}
17263
17264// Creates a new instance of the ManagedInstanceLongTermRetentionPolicyListResultIterator type.
17265func NewManagedInstanceLongTermRetentionPolicyListResultIterator(page ManagedInstanceLongTermRetentionPolicyListResultPage) ManagedInstanceLongTermRetentionPolicyListResultIterator {
17266	return ManagedInstanceLongTermRetentionPolicyListResultIterator{page: page}
17267}
17268
17269// IsEmpty returns true if the ListResult contains no values.
17270func (miltrplr ManagedInstanceLongTermRetentionPolicyListResult) IsEmpty() bool {
17271	return miltrplr.Value == nil || len(*miltrplr.Value) == 0
17272}
17273
17274// hasNextLink returns true if the NextLink is not empty.
17275func (miltrplr ManagedInstanceLongTermRetentionPolicyListResult) hasNextLink() bool {
17276	return miltrplr.NextLink != nil && len(*miltrplr.NextLink) != 0
17277}
17278
17279// managedInstanceLongTermRetentionPolicyListResultPreparer prepares a request to retrieve the next set of results.
17280// It returns nil if no more results exist.
17281func (miltrplr ManagedInstanceLongTermRetentionPolicyListResult) managedInstanceLongTermRetentionPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
17282	if !miltrplr.hasNextLink() {
17283		return nil, nil
17284	}
17285	return autorest.Prepare((&http.Request{}).WithContext(ctx),
17286		autorest.AsJSON(),
17287		autorest.AsGet(),
17288		autorest.WithBaseURL(to.String(miltrplr.NextLink)))
17289}
17290
17291// ManagedInstanceLongTermRetentionPolicyListResultPage contains a page of
17292// ManagedInstanceLongTermRetentionPolicy values.
17293type ManagedInstanceLongTermRetentionPolicyListResultPage struct {
17294	fn       func(context.Context, ManagedInstanceLongTermRetentionPolicyListResult) (ManagedInstanceLongTermRetentionPolicyListResult, error)
17295	miltrplr ManagedInstanceLongTermRetentionPolicyListResult
17296}
17297
17298// NextWithContext advances to the next page of values.  If there was an error making
17299// the request the page does not advance and the error is returned.
17300func (page *ManagedInstanceLongTermRetentionPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
17301	if tracing.IsEnabled() {
17302		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceLongTermRetentionPolicyListResultPage.NextWithContext")
17303		defer func() {
17304			sc := -1
17305			if page.Response().Response.Response != nil {
17306				sc = page.Response().Response.Response.StatusCode
17307			}
17308			tracing.EndSpan(ctx, sc, err)
17309		}()
17310	}
17311	for {
17312		next, err := page.fn(ctx, page.miltrplr)
17313		if err != nil {
17314			return err
17315		}
17316		page.miltrplr = next
17317		if !next.hasNextLink() || !next.IsEmpty() {
17318			break
17319		}
17320	}
17321	return nil
17322}
17323
17324// Next advances to the next page of values.  If there was an error making
17325// the request the page does not advance and the error is returned.
17326// Deprecated: Use NextWithContext() instead.
17327func (page *ManagedInstanceLongTermRetentionPolicyListResultPage) Next() error {
17328	return page.NextWithContext(context.Background())
17329}
17330
17331// NotDone returns true if the page enumeration should be started or is not yet complete.
17332func (page ManagedInstanceLongTermRetentionPolicyListResultPage) NotDone() bool {
17333	return !page.miltrplr.IsEmpty()
17334}
17335
17336// Response returns the raw server response from the last page request.
17337func (page ManagedInstanceLongTermRetentionPolicyListResultPage) Response() ManagedInstanceLongTermRetentionPolicyListResult {
17338	return page.miltrplr
17339}
17340
17341// Values returns the slice of values for the current page or nil if there are no values.
17342func (page ManagedInstanceLongTermRetentionPolicyListResultPage) Values() []ManagedInstanceLongTermRetentionPolicy {
17343	if page.miltrplr.IsEmpty() {
17344		return nil
17345	}
17346	return *page.miltrplr.Value
17347}
17348
17349// Creates a new instance of the ManagedInstanceLongTermRetentionPolicyListResultPage type.
17350func NewManagedInstanceLongTermRetentionPolicyListResultPage(cur ManagedInstanceLongTermRetentionPolicyListResult, getNextPage func(context.Context, ManagedInstanceLongTermRetentionPolicyListResult) (ManagedInstanceLongTermRetentionPolicyListResult, error)) ManagedInstanceLongTermRetentionPolicyListResultPage {
17351	return ManagedInstanceLongTermRetentionPolicyListResultPage{
17352		fn:       getNextPage,
17353		miltrplr: cur,
17354	}
17355}
17356
17357// ManagedInstanceMaintenanceConfigurationCapability the maintenance configuration capability
17358type ManagedInstanceMaintenanceConfigurationCapability struct {
17359	// Name - READ-ONLY; Maintenance configuration name
17360	Name *string `json:"name,omitempty"`
17361	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
17362	Status CapabilityStatus `json:"status,omitempty"`
17363	// Reason - The reason for the capability not being available.
17364	Reason *string `json:"reason,omitempty"`
17365}
17366
17367// MarshalJSON is the custom marshaler for ManagedInstanceMaintenanceConfigurationCapability.
17368func (mimcc ManagedInstanceMaintenanceConfigurationCapability) MarshalJSON() ([]byte, error) {
17369	objectMap := make(map[string]interface{})
17370	if mimcc.Reason != nil {
17371		objectMap["reason"] = mimcc.Reason
17372	}
17373	return json.Marshal(objectMap)
17374}
17375
17376// ManagedInstanceOperation a managed instance operation.
17377type ManagedInstanceOperation struct {
17378	autorest.Response `json:"-"`
17379	// ManagedInstanceOperationProperties - Resource properties.
17380	*ManagedInstanceOperationProperties `json:"properties,omitempty"`
17381	// ID - READ-ONLY; Resource ID.
17382	ID *string `json:"id,omitempty"`
17383	// Name - READ-ONLY; Resource name.
17384	Name *string `json:"name,omitempty"`
17385	// Type - READ-ONLY; Resource type.
17386	Type *string `json:"type,omitempty"`
17387}
17388
17389// MarshalJSON is the custom marshaler for ManagedInstanceOperation.
17390func (mio ManagedInstanceOperation) MarshalJSON() ([]byte, error) {
17391	objectMap := make(map[string]interface{})
17392	if mio.ManagedInstanceOperationProperties != nil {
17393		objectMap["properties"] = mio.ManagedInstanceOperationProperties
17394	}
17395	return json.Marshal(objectMap)
17396}
17397
17398// UnmarshalJSON is the custom unmarshaler for ManagedInstanceOperation struct.
17399func (mio *ManagedInstanceOperation) UnmarshalJSON(body []byte) error {
17400	var m map[string]*json.RawMessage
17401	err := json.Unmarshal(body, &m)
17402	if err != nil {
17403		return err
17404	}
17405	for k, v := range m {
17406		switch k {
17407		case "properties":
17408			if v != nil {
17409				var managedInstanceOperationProperties ManagedInstanceOperationProperties
17410				err = json.Unmarshal(*v, &managedInstanceOperationProperties)
17411				if err != nil {
17412					return err
17413				}
17414				mio.ManagedInstanceOperationProperties = &managedInstanceOperationProperties
17415			}
17416		case "id":
17417			if v != nil {
17418				var ID string
17419				err = json.Unmarshal(*v, &ID)
17420				if err != nil {
17421					return err
17422				}
17423				mio.ID = &ID
17424			}
17425		case "name":
17426			if v != nil {
17427				var name string
17428				err = json.Unmarshal(*v, &name)
17429				if err != nil {
17430					return err
17431				}
17432				mio.Name = &name
17433			}
17434		case "type":
17435			if v != nil {
17436				var typeVar string
17437				err = json.Unmarshal(*v, &typeVar)
17438				if err != nil {
17439					return err
17440				}
17441				mio.Type = &typeVar
17442			}
17443		}
17444	}
17445
17446	return nil
17447}
17448
17449// ManagedInstanceOperationListResult the response to a list managed instance operations request
17450type ManagedInstanceOperationListResult struct {
17451	autorest.Response `json:"-"`
17452	// Value - READ-ONLY; Array of results.
17453	Value *[]ManagedInstanceOperation `json:"value,omitempty"`
17454	// NextLink - READ-ONLY; Link to retrieve next page of results.
17455	NextLink *string `json:"nextLink,omitempty"`
17456}
17457
17458// MarshalJSON is the custom marshaler for ManagedInstanceOperationListResult.
17459func (miolr ManagedInstanceOperationListResult) MarshalJSON() ([]byte, error) {
17460	objectMap := make(map[string]interface{})
17461	return json.Marshal(objectMap)
17462}
17463
17464// ManagedInstanceOperationListResultIterator provides access to a complete listing of
17465// ManagedInstanceOperation values.
17466type ManagedInstanceOperationListResultIterator struct {
17467	i    int
17468	page ManagedInstanceOperationListResultPage
17469}
17470
17471// NextWithContext advances to the next value.  If there was an error making
17472// the request the iterator does not advance and the error is returned.
17473func (iter *ManagedInstanceOperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
17474	if tracing.IsEnabled() {
17475		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceOperationListResultIterator.NextWithContext")
17476		defer func() {
17477			sc := -1
17478			if iter.Response().Response.Response != nil {
17479				sc = iter.Response().Response.Response.StatusCode
17480			}
17481			tracing.EndSpan(ctx, sc, err)
17482		}()
17483	}
17484	iter.i++
17485	if iter.i < len(iter.page.Values()) {
17486		return nil
17487	}
17488	err = iter.page.NextWithContext(ctx)
17489	if err != nil {
17490		iter.i--
17491		return err
17492	}
17493	iter.i = 0
17494	return nil
17495}
17496
17497// Next advances to the next value.  If there was an error making
17498// the request the iterator does not advance and the error is returned.
17499// Deprecated: Use NextWithContext() instead.
17500func (iter *ManagedInstanceOperationListResultIterator) Next() error {
17501	return iter.NextWithContext(context.Background())
17502}
17503
17504// NotDone returns true if the enumeration should be started or is not yet complete.
17505func (iter ManagedInstanceOperationListResultIterator) NotDone() bool {
17506	return iter.page.NotDone() && iter.i < len(iter.page.Values())
17507}
17508
17509// Response returns the raw server response from the last page request.
17510func (iter ManagedInstanceOperationListResultIterator) Response() ManagedInstanceOperationListResult {
17511	return iter.page.Response()
17512}
17513
17514// Value returns the current value or a zero-initialized value if the
17515// iterator has advanced beyond the end of the collection.
17516func (iter ManagedInstanceOperationListResultIterator) Value() ManagedInstanceOperation {
17517	if !iter.page.NotDone() {
17518		return ManagedInstanceOperation{}
17519	}
17520	return iter.page.Values()[iter.i]
17521}
17522
17523// Creates a new instance of the ManagedInstanceOperationListResultIterator type.
17524func NewManagedInstanceOperationListResultIterator(page ManagedInstanceOperationListResultPage) ManagedInstanceOperationListResultIterator {
17525	return ManagedInstanceOperationListResultIterator{page: page}
17526}
17527
17528// IsEmpty returns true if the ListResult contains no values.
17529func (miolr ManagedInstanceOperationListResult) IsEmpty() bool {
17530	return miolr.Value == nil || len(*miolr.Value) == 0
17531}
17532
17533// hasNextLink returns true if the NextLink is not empty.
17534func (miolr ManagedInstanceOperationListResult) hasNextLink() bool {
17535	return miolr.NextLink != nil && len(*miolr.NextLink) != 0
17536}
17537
17538// managedInstanceOperationListResultPreparer prepares a request to retrieve the next set of results.
17539// It returns nil if no more results exist.
17540func (miolr ManagedInstanceOperationListResult) managedInstanceOperationListResultPreparer(ctx context.Context) (*http.Request, error) {
17541	if !miolr.hasNextLink() {
17542		return nil, nil
17543	}
17544	return autorest.Prepare((&http.Request{}).WithContext(ctx),
17545		autorest.AsJSON(),
17546		autorest.AsGet(),
17547		autorest.WithBaseURL(to.String(miolr.NextLink)))
17548}
17549
17550// ManagedInstanceOperationListResultPage contains a page of ManagedInstanceOperation values.
17551type ManagedInstanceOperationListResultPage struct {
17552	fn    func(context.Context, ManagedInstanceOperationListResult) (ManagedInstanceOperationListResult, error)
17553	miolr ManagedInstanceOperationListResult
17554}
17555
17556// NextWithContext advances to the next page of values.  If there was an error making
17557// the request the page does not advance and the error is returned.
17558func (page *ManagedInstanceOperationListResultPage) NextWithContext(ctx context.Context) (err error) {
17559	if tracing.IsEnabled() {
17560		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceOperationListResultPage.NextWithContext")
17561		defer func() {
17562			sc := -1
17563			if page.Response().Response.Response != nil {
17564				sc = page.Response().Response.Response.StatusCode
17565			}
17566			tracing.EndSpan(ctx, sc, err)
17567		}()
17568	}
17569	for {
17570		next, err := page.fn(ctx, page.miolr)
17571		if err != nil {
17572			return err
17573		}
17574		page.miolr = next
17575		if !next.hasNextLink() || !next.IsEmpty() {
17576			break
17577		}
17578	}
17579	return nil
17580}
17581
17582// Next advances to the next page of values.  If there was an error making
17583// the request the page does not advance and the error is returned.
17584// Deprecated: Use NextWithContext() instead.
17585func (page *ManagedInstanceOperationListResultPage) Next() error {
17586	return page.NextWithContext(context.Background())
17587}
17588
17589// NotDone returns true if the page enumeration should be started or is not yet complete.
17590func (page ManagedInstanceOperationListResultPage) NotDone() bool {
17591	return !page.miolr.IsEmpty()
17592}
17593
17594// Response returns the raw server response from the last page request.
17595func (page ManagedInstanceOperationListResultPage) Response() ManagedInstanceOperationListResult {
17596	return page.miolr
17597}
17598
17599// Values returns the slice of values for the current page or nil if there are no values.
17600func (page ManagedInstanceOperationListResultPage) Values() []ManagedInstanceOperation {
17601	if page.miolr.IsEmpty() {
17602		return nil
17603	}
17604	return *page.miolr.Value
17605}
17606
17607// Creates a new instance of the ManagedInstanceOperationListResultPage type.
17608func NewManagedInstanceOperationListResultPage(cur ManagedInstanceOperationListResult, getNextPage func(context.Context, ManagedInstanceOperationListResult) (ManagedInstanceOperationListResult, error)) ManagedInstanceOperationListResultPage {
17609	return ManagedInstanceOperationListResultPage{
17610		fn:    getNextPage,
17611		miolr: cur,
17612	}
17613}
17614
17615// ManagedInstanceOperationParametersPair the parameters of a managed instance operation.
17616type ManagedInstanceOperationParametersPair struct {
17617	// CurrentParameters - READ-ONLY; The current parameters.
17618	CurrentParameters *UpsertManagedServerOperationParameters `json:"currentParameters,omitempty"`
17619	// RequestedParameters - READ-ONLY; The requested parameters.
17620	RequestedParameters *UpsertManagedServerOperationParameters `json:"requestedParameters,omitempty"`
17621}
17622
17623// MarshalJSON is the custom marshaler for ManagedInstanceOperationParametersPair.
17624func (miopp ManagedInstanceOperationParametersPair) MarshalJSON() ([]byte, error) {
17625	objectMap := make(map[string]interface{})
17626	return json.Marshal(objectMap)
17627}
17628
17629// ManagedInstanceOperationProperties the properties of a managed instance operation.
17630type ManagedInstanceOperationProperties struct {
17631	// ManagedInstanceName - READ-ONLY; The name of the managed instance the operation is being performed on.
17632	ManagedInstanceName *string `json:"managedInstanceName,omitempty"`
17633	// Operation - READ-ONLY; The name of operation.
17634	Operation *string `json:"operation,omitempty"`
17635	// OperationFriendlyName - READ-ONLY; The friendly name of operation.
17636	OperationFriendlyName *string `json:"operationFriendlyName,omitempty"`
17637	// PercentComplete - READ-ONLY; The percentage of the operation completed.
17638	PercentComplete *int32 `json:"percentComplete,omitempty"`
17639	// StartTime - READ-ONLY; The operation start time.
17640	StartTime *date.Time `json:"startTime,omitempty"`
17641	// State - READ-ONLY; The operation state. Possible values include: 'ManagementOperationStatePending', 'ManagementOperationStateInProgress', 'ManagementOperationStateSucceeded', 'ManagementOperationStateFailed', 'ManagementOperationStateCancelInProgress', 'ManagementOperationStateCancelled'
17642	State ManagementOperationState `json:"state,omitempty"`
17643	// ErrorCode - READ-ONLY; The operation error code.
17644	ErrorCode *int32 `json:"errorCode,omitempty"`
17645	// ErrorDescription - READ-ONLY; The operation error description.
17646	ErrorDescription *string `json:"errorDescription,omitempty"`
17647	// ErrorSeverity - READ-ONLY; The operation error severity.
17648	ErrorSeverity *int32 `json:"errorSeverity,omitempty"`
17649	// IsUserError - READ-ONLY; Whether or not the error is a user error.
17650	IsUserError *bool `json:"isUserError,omitempty"`
17651	// EstimatedCompletionTime - READ-ONLY; The estimated completion time of the operation.
17652	EstimatedCompletionTime *date.Time `json:"estimatedCompletionTime,omitempty"`
17653	// Description - READ-ONLY; The operation description.
17654	Description *string `json:"description,omitempty"`
17655	// IsCancellable - READ-ONLY; Whether the operation can be cancelled.
17656	IsCancellable *bool `json:"isCancellable,omitempty"`
17657	// OperationParameters - READ-ONLY; The operation parameters.
17658	OperationParameters *ManagedInstanceOperationParametersPair `json:"operationParameters,omitempty"`
17659	// OperationSteps - READ-ONLY; The operation steps.
17660	OperationSteps *ManagedInstanceOperationSteps `json:"operationSteps,omitempty"`
17661}
17662
17663// MarshalJSON is the custom marshaler for ManagedInstanceOperationProperties.
17664func (miop ManagedInstanceOperationProperties) MarshalJSON() ([]byte, error) {
17665	objectMap := make(map[string]interface{})
17666	return json.Marshal(objectMap)
17667}
17668
17669// ManagedInstanceOperationSteps the steps of a managed instance operation.
17670type ManagedInstanceOperationSteps struct {
17671	// TotalSteps - READ-ONLY; The total number of operation steps.
17672	TotalSteps *string `json:"totalSteps,omitempty"`
17673	// CurrentStep - READ-ONLY; The number of current operation steps.
17674	CurrentStep *int32 `json:"currentStep,omitempty"`
17675	// StepsList - READ-ONLY; The operation steps list.
17676	StepsList *[]UpsertManagedServerOperationStep `json:"stepsList,omitempty"`
17677}
17678
17679// MarshalJSON is the custom marshaler for ManagedInstanceOperationSteps.
17680func (mios ManagedInstanceOperationSteps) MarshalJSON() ([]byte, error) {
17681	objectMap := make(map[string]interface{})
17682	return json.Marshal(objectMap)
17683}
17684
17685// ManagedInstancePairInfo pairs of Managed Instances in the failover group.
17686type ManagedInstancePairInfo struct {
17687	// PrimaryManagedInstanceID - Id of Primary Managed Instance in pair.
17688	PrimaryManagedInstanceID *string `json:"primaryManagedInstanceId,omitempty"`
17689	// PartnerManagedInstanceID - Id of Partner Managed Instance in pair.
17690	PartnerManagedInstanceID *string `json:"partnerManagedInstanceId,omitempty"`
17691}
17692
17693// ManagedInstancePecProperty a private endpoint connection under a managed instance
17694type ManagedInstancePecProperty struct {
17695	// ID - READ-ONLY; Resource ID.
17696	ID *string `json:"id,omitempty"`
17697	// Properties - READ-ONLY; Private endpoint connection properties
17698	Properties *ManagedInstancePrivateEndpointConnectionProperties `json:"properties,omitempty"`
17699}
17700
17701// MarshalJSON is the custom marshaler for ManagedInstancePecProperty.
17702func (mipp ManagedInstancePecProperty) MarshalJSON() ([]byte, error) {
17703	objectMap := make(map[string]interface{})
17704	return json.Marshal(objectMap)
17705}
17706
17707// ManagedInstancePrivateEndpointConnection a private endpoint connection
17708type ManagedInstancePrivateEndpointConnection struct {
17709	autorest.Response `json:"-"`
17710	// ManagedInstancePrivateEndpointConnectionProperties - Resource properties.
17711	*ManagedInstancePrivateEndpointConnectionProperties `json:"properties,omitempty"`
17712	// ID - READ-ONLY; Resource ID.
17713	ID *string `json:"id,omitempty"`
17714	// Name - READ-ONLY; Resource name.
17715	Name *string `json:"name,omitempty"`
17716	// Type - READ-ONLY; Resource type.
17717	Type *string `json:"type,omitempty"`
17718}
17719
17720// MarshalJSON is the custom marshaler for ManagedInstancePrivateEndpointConnection.
17721func (mipec ManagedInstancePrivateEndpointConnection) MarshalJSON() ([]byte, error) {
17722	objectMap := make(map[string]interface{})
17723	if mipec.ManagedInstancePrivateEndpointConnectionProperties != nil {
17724		objectMap["properties"] = mipec.ManagedInstancePrivateEndpointConnectionProperties
17725	}
17726	return json.Marshal(objectMap)
17727}
17728
17729// UnmarshalJSON is the custom unmarshaler for ManagedInstancePrivateEndpointConnection struct.
17730func (mipec *ManagedInstancePrivateEndpointConnection) UnmarshalJSON(body []byte) error {
17731	var m map[string]*json.RawMessage
17732	err := json.Unmarshal(body, &m)
17733	if err != nil {
17734		return err
17735	}
17736	for k, v := range m {
17737		switch k {
17738		case "properties":
17739			if v != nil {
17740				var managedInstancePrivateEndpointConnectionProperties ManagedInstancePrivateEndpointConnectionProperties
17741				err = json.Unmarshal(*v, &managedInstancePrivateEndpointConnectionProperties)
17742				if err != nil {
17743					return err
17744				}
17745				mipec.ManagedInstancePrivateEndpointConnectionProperties = &managedInstancePrivateEndpointConnectionProperties
17746			}
17747		case "id":
17748			if v != nil {
17749				var ID string
17750				err = json.Unmarshal(*v, &ID)
17751				if err != nil {
17752					return err
17753				}
17754				mipec.ID = &ID
17755			}
17756		case "name":
17757			if v != nil {
17758				var name string
17759				err = json.Unmarshal(*v, &name)
17760				if err != nil {
17761					return err
17762				}
17763				mipec.Name = &name
17764			}
17765		case "type":
17766			if v != nil {
17767				var typeVar string
17768				err = json.Unmarshal(*v, &typeVar)
17769				if err != nil {
17770					return err
17771				}
17772				mipec.Type = &typeVar
17773			}
17774		}
17775	}
17776
17777	return nil
17778}
17779
17780// ManagedInstancePrivateEndpointConnectionListResult a list of private endpoint connections.
17781type ManagedInstancePrivateEndpointConnectionListResult struct {
17782	autorest.Response `json:"-"`
17783	// Value - READ-ONLY; Array of results.
17784	Value *[]ManagedInstancePrivateEndpointConnection `json:"value,omitempty"`
17785	// NextLink - READ-ONLY; Link to retrieve next page of results.
17786	NextLink *string `json:"nextLink,omitempty"`
17787}
17788
17789// MarshalJSON is the custom marshaler for ManagedInstancePrivateEndpointConnectionListResult.
17790func (mipeclr ManagedInstancePrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) {
17791	objectMap := make(map[string]interface{})
17792	return json.Marshal(objectMap)
17793}
17794
17795// ManagedInstancePrivateEndpointConnectionListResultIterator provides access to a complete listing of
17796// ManagedInstancePrivateEndpointConnection values.
17797type ManagedInstancePrivateEndpointConnectionListResultIterator struct {
17798	i    int
17799	page ManagedInstancePrivateEndpointConnectionListResultPage
17800}
17801
17802// NextWithContext advances to the next value.  If there was an error making
17803// the request the iterator does not advance and the error is returned.
17804func (iter *ManagedInstancePrivateEndpointConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) {
17805	if tracing.IsEnabled() {
17806		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstancePrivateEndpointConnectionListResultIterator.NextWithContext")
17807		defer func() {
17808			sc := -1
17809			if iter.Response().Response.Response != nil {
17810				sc = iter.Response().Response.Response.StatusCode
17811			}
17812			tracing.EndSpan(ctx, sc, err)
17813		}()
17814	}
17815	iter.i++
17816	if iter.i < len(iter.page.Values()) {
17817		return nil
17818	}
17819	err = iter.page.NextWithContext(ctx)
17820	if err != nil {
17821		iter.i--
17822		return err
17823	}
17824	iter.i = 0
17825	return nil
17826}
17827
17828// Next advances to the next value.  If there was an error making
17829// the request the iterator does not advance and the error is returned.
17830// Deprecated: Use NextWithContext() instead.
17831func (iter *ManagedInstancePrivateEndpointConnectionListResultIterator) Next() error {
17832	return iter.NextWithContext(context.Background())
17833}
17834
17835// NotDone returns true if the enumeration should be started or is not yet complete.
17836func (iter ManagedInstancePrivateEndpointConnectionListResultIterator) NotDone() bool {
17837	return iter.page.NotDone() && iter.i < len(iter.page.Values())
17838}
17839
17840// Response returns the raw server response from the last page request.
17841func (iter ManagedInstancePrivateEndpointConnectionListResultIterator) Response() ManagedInstancePrivateEndpointConnectionListResult {
17842	return iter.page.Response()
17843}
17844
17845// Value returns the current value or a zero-initialized value if the
17846// iterator has advanced beyond the end of the collection.
17847func (iter ManagedInstancePrivateEndpointConnectionListResultIterator) Value() ManagedInstancePrivateEndpointConnection {
17848	if !iter.page.NotDone() {
17849		return ManagedInstancePrivateEndpointConnection{}
17850	}
17851	return iter.page.Values()[iter.i]
17852}
17853
17854// Creates a new instance of the ManagedInstancePrivateEndpointConnectionListResultIterator type.
17855func NewManagedInstancePrivateEndpointConnectionListResultIterator(page ManagedInstancePrivateEndpointConnectionListResultPage) ManagedInstancePrivateEndpointConnectionListResultIterator {
17856	return ManagedInstancePrivateEndpointConnectionListResultIterator{page: page}
17857}
17858
17859// IsEmpty returns true if the ListResult contains no values.
17860func (mipeclr ManagedInstancePrivateEndpointConnectionListResult) IsEmpty() bool {
17861	return mipeclr.Value == nil || len(*mipeclr.Value) == 0
17862}
17863
17864// hasNextLink returns true if the NextLink is not empty.
17865func (mipeclr ManagedInstancePrivateEndpointConnectionListResult) hasNextLink() bool {
17866	return mipeclr.NextLink != nil && len(*mipeclr.NextLink) != 0
17867}
17868
17869// managedInstancePrivateEndpointConnectionListResultPreparer prepares a request to retrieve the next set of results.
17870// It returns nil if no more results exist.
17871func (mipeclr ManagedInstancePrivateEndpointConnectionListResult) managedInstancePrivateEndpointConnectionListResultPreparer(ctx context.Context) (*http.Request, error) {
17872	if !mipeclr.hasNextLink() {
17873		return nil, nil
17874	}
17875	return autorest.Prepare((&http.Request{}).WithContext(ctx),
17876		autorest.AsJSON(),
17877		autorest.AsGet(),
17878		autorest.WithBaseURL(to.String(mipeclr.NextLink)))
17879}
17880
17881// ManagedInstancePrivateEndpointConnectionListResultPage contains a page of
17882// ManagedInstancePrivateEndpointConnection values.
17883type ManagedInstancePrivateEndpointConnectionListResultPage struct {
17884	fn      func(context.Context, ManagedInstancePrivateEndpointConnectionListResult) (ManagedInstancePrivateEndpointConnectionListResult, error)
17885	mipeclr ManagedInstancePrivateEndpointConnectionListResult
17886}
17887
17888// NextWithContext advances to the next page of values.  If there was an error making
17889// the request the page does not advance and the error is returned.
17890func (page *ManagedInstancePrivateEndpointConnectionListResultPage) NextWithContext(ctx context.Context) (err error) {
17891	if tracing.IsEnabled() {
17892		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstancePrivateEndpointConnectionListResultPage.NextWithContext")
17893		defer func() {
17894			sc := -1
17895			if page.Response().Response.Response != nil {
17896				sc = page.Response().Response.Response.StatusCode
17897			}
17898			tracing.EndSpan(ctx, sc, err)
17899		}()
17900	}
17901	for {
17902		next, err := page.fn(ctx, page.mipeclr)
17903		if err != nil {
17904			return err
17905		}
17906		page.mipeclr = next
17907		if !next.hasNextLink() || !next.IsEmpty() {
17908			break
17909		}
17910	}
17911	return nil
17912}
17913
17914// Next advances to the next page of values.  If there was an error making
17915// the request the page does not advance and the error is returned.
17916// Deprecated: Use NextWithContext() instead.
17917func (page *ManagedInstancePrivateEndpointConnectionListResultPage) Next() error {
17918	return page.NextWithContext(context.Background())
17919}
17920
17921// NotDone returns true if the page enumeration should be started or is not yet complete.
17922func (page ManagedInstancePrivateEndpointConnectionListResultPage) NotDone() bool {
17923	return !page.mipeclr.IsEmpty()
17924}
17925
17926// Response returns the raw server response from the last page request.
17927func (page ManagedInstancePrivateEndpointConnectionListResultPage) Response() ManagedInstancePrivateEndpointConnectionListResult {
17928	return page.mipeclr
17929}
17930
17931// Values returns the slice of values for the current page or nil if there are no values.
17932func (page ManagedInstancePrivateEndpointConnectionListResultPage) Values() []ManagedInstancePrivateEndpointConnection {
17933	if page.mipeclr.IsEmpty() {
17934		return nil
17935	}
17936	return *page.mipeclr.Value
17937}
17938
17939// Creates a new instance of the ManagedInstancePrivateEndpointConnectionListResultPage type.
17940func NewManagedInstancePrivateEndpointConnectionListResultPage(cur ManagedInstancePrivateEndpointConnectionListResult, getNextPage func(context.Context, ManagedInstancePrivateEndpointConnectionListResult) (ManagedInstancePrivateEndpointConnectionListResult, error)) ManagedInstancePrivateEndpointConnectionListResultPage {
17941	return ManagedInstancePrivateEndpointConnectionListResultPage{
17942		fn:      getNextPage,
17943		mipeclr: cur,
17944	}
17945}
17946
17947// ManagedInstancePrivateEndpointConnectionProperties properties of a private endpoint connection.
17948type ManagedInstancePrivateEndpointConnectionProperties struct {
17949	// PrivateEndpoint - Private endpoint which the connection belongs to.
17950	PrivateEndpoint *ManagedInstancePrivateEndpointProperty `json:"privateEndpoint,omitempty"`
17951	// PrivateLinkServiceConnectionState - Connection State of the Private Endpoint Connection.
17952	PrivateLinkServiceConnectionState *ManagedInstancePrivateLinkServiceConnectionStateProperty `json:"privateLinkServiceConnectionState,omitempty"`
17953	// ProvisioningState - READ-ONLY; State of the Private Endpoint Connection.
17954	ProvisioningState *string `json:"provisioningState,omitempty"`
17955}
17956
17957// MarshalJSON is the custom marshaler for ManagedInstancePrivateEndpointConnectionProperties.
17958func (mipecp ManagedInstancePrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) {
17959	objectMap := make(map[string]interface{})
17960	if mipecp.PrivateEndpoint != nil {
17961		objectMap["privateEndpoint"] = mipecp.PrivateEndpoint
17962	}
17963	if mipecp.PrivateLinkServiceConnectionState != nil {
17964		objectMap["privateLinkServiceConnectionState"] = mipecp.PrivateLinkServiceConnectionState
17965	}
17966	return json.Marshal(objectMap)
17967}
17968
17969// ManagedInstancePrivateEndpointConnectionsCreateOrUpdateFuture an abstraction for monitoring and
17970// retrieving the results of a long-running operation.
17971type ManagedInstancePrivateEndpointConnectionsCreateOrUpdateFuture struct {
17972	azure.FutureAPI
17973	// Result returns the result of the asynchronous operation.
17974	// If the operation has not completed it will return an error.
17975	Result func(ManagedInstancePrivateEndpointConnectionsClient) (ManagedInstancePrivateEndpointConnection, error)
17976}
17977
17978// UnmarshalJSON is the custom unmarshaller for CreateFuture.
17979func (future *ManagedInstancePrivateEndpointConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
17980	var azFuture azure.Future
17981	if err := json.Unmarshal(body, &azFuture); err != nil {
17982		return err
17983	}
17984	future.FutureAPI = &azFuture
17985	future.Result = future.result
17986	return nil
17987}
17988
17989// result is the default implementation for ManagedInstancePrivateEndpointConnectionsCreateOrUpdateFuture.Result.
17990func (future *ManagedInstancePrivateEndpointConnectionsCreateOrUpdateFuture) result(client ManagedInstancePrivateEndpointConnectionsClient) (mipec ManagedInstancePrivateEndpointConnection, err error) {
17991	var done bool
17992	done, err = future.DoneWithContext(context.Background(), client)
17993	if err != nil {
17994		err = autorest.NewErrorWithError(err, "sql.ManagedInstancePrivateEndpointConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
17995		return
17996	}
17997	if !done {
17998		mipec.Response.Response = future.Response()
17999		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstancePrivateEndpointConnectionsCreateOrUpdateFuture")
18000		return
18001	}
18002	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
18003	if mipec.Response.Response, err = future.GetResult(sender); err == nil && mipec.Response.Response.StatusCode != http.StatusNoContent {
18004		mipec, err = client.CreateOrUpdateResponder(mipec.Response.Response)
18005		if err != nil {
18006			err = autorest.NewErrorWithError(err, "sql.ManagedInstancePrivateEndpointConnectionsCreateOrUpdateFuture", "Result", mipec.Response.Response, "Failure responding to request")
18007		}
18008	}
18009	return
18010}
18011
18012// ManagedInstancePrivateEndpointConnectionsDeleteFuture an abstraction for monitoring and retrieving the
18013// results of a long-running operation.
18014type ManagedInstancePrivateEndpointConnectionsDeleteFuture struct {
18015	azure.FutureAPI
18016	// Result returns the result of the asynchronous operation.
18017	// If the operation has not completed it will return an error.
18018	Result func(ManagedInstancePrivateEndpointConnectionsClient) (autorest.Response, error)
18019}
18020
18021// UnmarshalJSON is the custom unmarshaller for CreateFuture.
18022func (future *ManagedInstancePrivateEndpointConnectionsDeleteFuture) UnmarshalJSON(body []byte) error {
18023	var azFuture azure.Future
18024	if err := json.Unmarshal(body, &azFuture); err != nil {
18025		return err
18026	}
18027	future.FutureAPI = &azFuture
18028	future.Result = future.result
18029	return nil
18030}
18031
18032// result is the default implementation for ManagedInstancePrivateEndpointConnectionsDeleteFuture.Result.
18033func (future *ManagedInstancePrivateEndpointConnectionsDeleteFuture) result(client ManagedInstancePrivateEndpointConnectionsClient) (ar autorest.Response, err error) {
18034	var done bool
18035	done, err = future.DoneWithContext(context.Background(), client)
18036	if err != nil {
18037		err = autorest.NewErrorWithError(err, "sql.ManagedInstancePrivateEndpointConnectionsDeleteFuture", "Result", future.Response(), "Polling failure")
18038		return
18039	}
18040	if !done {
18041		ar.Response = future.Response()
18042		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstancePrivateEndpointConnectionsDeleteFuture")
18043		return
18044	}
18045	ar.Response = future.Response()
18046	return
18047}
18048
18049// ManagedInstancePrivateEndpointProperty ...
18050type ManagedInstancePrivateEndpointProperty struct {
18051	// ID - Resource id of the private endpoint.
18052	ID *string `json:"id,omitempty"`
18053}
18054
18055// ManagedInstancePrivateLink a private link resource
18056type ManagedInstancePrivateLink struct {
18057	autorest.Response `json:"-"`
18058	// Properties - READ-ONLY; The private link resource group id.
18059	Properties *ManagedInstancePrivateLinkProperties `json:"properties,omitempty"`
18060	// ID - READ-ONLY; Resource ID.
18061	ID *string `json:"id,omitempty"`
18062	// Name - READ-ONLY; Resource name.
18063	Name *string `json:"name,omitempty"`
18064	// Type - READ-ONLY; Resource type.
18065	Type *string `json:"type,omitempty"`
18066}
18067
18068// MarshalJSON is the custom marshaler for ManagedInstancePrivateLink.
18069func (mipl ManagedInstancePrivateLink) MarshalJSON() ([]byte, error) {
18070	objectMap := make(map[string]interface{})
18071	return json.Marshal(objectMap)
18072}
18073
18074// ManagedInstancePrivateLinkListResult a list of private link resources
18075type ManagedInstancePrivateLinkListResult struct {
18076	autorest.Response `json:"-"`
18077	// Value - READ-ONLY; Array of results.
18078	Value *[]ManagedInstancePrivateLink `json:"value,omitempty"`
18079	// NextLink - READ-ONLY; Link to retrieve next page of results.
18080	NextLink *string `json:"nextLink,omitempty"`
18081}
18082
18083// MarshalJSON is the custom marshaler for ManagedInstancePrivateLinkListResult.
18084func (mipllr ManagedInstancePrivateLinkListResult) MarshalJSON() ([]byte, error) {
18085	objectMap := make(map[string]interface{})
18086	return json.Marshal(objectMap)
18087}
18088
18089// ManagedInstancePrivateLinkListResultIterator provides access to a complete listing of
18090// ManagedInstancePrivateLink values.
18091type ManagedInstancePrivateLinkListResultIterator struct {
18092	i    int
18093	page ManagedInstancePrivateLinkListResultPage
18094}
18095
18096// NextWithContext advances to the next value.  If there was an error making
18097// the request the iterator does not advance and the error is returned.
18098func (iter *ManagedInstancePrivateLinkListResultIterator) NextWithContext(ctx context.Context) (err error) {
18099	if tracing.IsEnabled() {
18100		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstancePrivateLinkListResultIterator.NextWithContext")
18101		defer func() {
18102			sc := -1
18103			if iter.Response().Response.Response != nil {
18104				sc = iter.Response().Response.Response.StatusCode
18105			}
18106			tracing.EndSpan(ctx, sc, err)
18107		}()
18108	}
18109	iter.i++
18110	if iter.i < len(iter.page.Values()) {
18111		return nil
18112	}
18113	err = iter.page.NextWithContext(ctx)
18114	if err != nil {
18115		iter.i--
18116		return err
18117	}
18118	iter.i = 0
18119	return nil
18120}
18121
18122// Next advances to the next value.  If there was an error making
18123// the request the iterator does not advance and the error is returned.
18124// Deprecated: Use NextWithContext() instead.
18125func (iter *ManagedInstancePrivateLinkListResultIterator) Next() error {
18126	return iter.NextWithContext(context.Background())
18127}
18128
18129// NotDone returns true if the enumeration should be started or is not yet complete.
18130func (iter ManagedInstancePrivateLinkListResultIterator) NotDone() bool {
18131	return iter.page.NotDone() && iter.i < len(iter.page.Values())
18132}
18133
18134// Response returns the raw server response from the last page request.
18135func (iter ManagedInstancePrivateLinkListResultIterator) Response() ManagedInstancePrivateLinkListResult {
18136	return iter.page.Response()
18137}
18138
18139// Value returns the current value or a zero-initialized value if the
18140// iterator has advanced beyond the end of the collection.
18141func (iter ManagedInstancePrivateLinkListResultIterator) Value() ManagedInstancePrivateLink {
18142	if !iter.page.NotDone() {
18143		return ManagedInstancePrivateLink{}
18144	}
18145	return iter.page.Values()[iter.i]
18146}
18147
18148// Creates a new instance of the ManagedInstancePrivateLinkListResultIterator type.
18149func NewManagedInstancePrivateLinkListResultIterator(page ManagedInstancePrivateLinkListResultPage) ManagedInstancePrivateLinkListResultIterator {
18150	return ManagedInstancePrivateLinkListResultIterator{page: page}
18151}
18152
18153// IsEmpty returns true if the ListResult contains no values.
18154func (mipllr ManagedInstancePrivateLinkListResult) IsEmpty() bool {
18155	return mipllr.Value == nil || len(*mipllr.Value) == 0
18156}
18157
18158// hasNextLink returns true if the NextLink is not empty.
18159func (mipllr ManagedInstancePrivateLinkListResult) hasNextLink() bool {
18160	return mipllr.NextLink != nil && len(*mipllr.NextLink) != 0
18161}
18162
18163// managedInstancePrivateLinkListResultPreparer prepares a request to retrieve the next set of results.
18164// It returns nil if no more results exist.
18165func (mipllr ManagedInstancePrivateLinkListResult) managedInstancePrivateLinkListResultPreparer(ctx context.Context) (*http.Request, error) {
18166	if !mipllr.hasNextLink() {
18167		return nil, nil
18168	}
18169	return autorest.Prepare((&http.Request{}).WithContext(ctx),
18170		autorest.AsJSON(),
18171		autorest.AsGet(),
18172		autorest.WithBaseURL(to.String(mipllr.NextLink)))
18173}
18174
18175// ManagedInstancePrivateLinkListResultPage contains a page of ManagedInstancePrivateLink values.
18176type ManagedInstancePrivateLinkListResultPage struct {
18177	fn     func(context.Context, ManagedInstancePrivateLinkListResult) (ManagedInstancePrivateLinkListResult, error)
18178	mipllr ManagedInstancePrivateLinkListResult
18179}
18180
18181// NextWithContext advances to the next page of values.  If there was an error making
18182// the request the page does not advance and the error is returned.
18183func (page *ManagedInstancePrivateLinkListResultPage) NextWithContext(ctx context.Context) (err error) {
18184	if tracing.IsEnabled() {
18185		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstancePrivateLinkListResultPage.NextWithContext")
18186		defer func() {
18187			sc := -1
18188			if page.Response().Response.Response != nil {
18189				sc = page.Response().Response.Response.StatusCode
18190			}
18191			tracing.EndSpan(ctx, sc, err)
18192		}()
18193	}
18194	for {
18195		next, err := page.fn(ctx, page.mipllr)
18196		if err != nil {
18197			return err
18198		}
18199		page.mipllr = next
18200		if !next.hasNextLink() || !next.IsEmpty() {
18201			break
18202		}
18203	}
18204	return nil
18205}
18206
18207// Next advances to the next page of values.  If there was an error making
18208// the request the page does not advance and the error is returned.
18209// Deprecated: Use NextWithContext() instead.
18210func (page *ManagedInstancePrivateLinkListResultPage) Next() error {
18211	return page.NextWithContext(context.Background())
18212}
18213
18214// NotDone returns true if the page enumeration should be started or is not yet complete.
18215func (page ManagedInstancePrivateLinkListResultPage) NotDone() bool {
18216	return !page.mipllr.IsEmpty()
18217}
18218
18219// Response returns the raw server response from the last page request.
18220func (page ManagedInstancePrivateLinkListResultPage) Response() ManagedInstancePrivateLinkListResult {
18221	return page.mipllr
18222}
18223
18224// Values returns the slice of values for the current page or nil if there are no values.
18225func (page ManagedInstancePrivateLinkListResultPage) Values() []ManagedInstancePrivateLink {
18226	if page.mipllr.IsEmpty() {
18227		return nil
18228	}
18229	return *page.mipllr.Value
18230}
18231
18232// Creates a new instance of the ManagedInstancePrivateLinkListResultPage type.
18233func NewManagedInstancePrivateLinkListResultPage(cur ManagedInstancePrivateLinkListResult, getNextPage func(context.Context, ManagedInstancePrivateLinkListResult) (ManagedInstancePrivateLinkListResult, error)) ManagedInstancePrivateLinkListResultPage {
18234	return ManagedInstancePrivateLinkListResultPage{
18235		fn:     getNextPage,
18236		mipllr: cur,
18237	}
18238}
18239
18240// ManagedInstancePrivateLinkProperties properties of a private link resource.
18241type ManagedInstancePrivateLinkProperties struct {
18242	// GroupID - READ-ONLY; The private link resource group id.
18243	GroupID *string `json:"groupId,omitempty"`
18244	// RequiredMembers - READ-ONLY; The private link resource required member names.
18245	RequiredMembers *[]string `json:"requiredMembers,omitempty"`
18246}
18247
18248// MarshalJSON is the custom marshaler for ManagedInstancePrivateLinkProperties.
18249func (miplp ManagedInstancePrivateLinkProperties) MarshalJSON() ([]byte, error) {
18250	objectMap := make(map[string]interface{})
18251	return json.Marshal(objectMap)
18252}
18253
18254// ManagedInstancePrivateLinkServiceConnectionStateProperty ...
18255type ManagedInstancePrivateLinkServiceConnectionStateProperty struct {
18256	// Status - The private link service connection status.
18257	Status *string `json:"status,omitempty"`
18258	// Description - The private link service connection description.
18259	Description *string `json:"description,omitempty"`
18260	// ActionsRequired - READ-ONLY; The private link service connection description.
18261	ActionsRequired *string `json:"actionsRequired,omitempty"`
18262}
18263
18264// MarshalJSON is the custom marshaler for ManagedInstancePrivateLinkServiceConnectionStateProperty.
18265func (miplscsp ManagedInstancePrivateLinkServiceConnectionStateProperty) MarshalJSON() ([]byte, error) {
18266	objectMap := make(map[string]interface{})
18267	if miplscsp.Status != nil {
18268		objectMap["status"] = miplscsp.Status
18269	}
18270	if miplscsp.Description != nil {
18271		objectMap["description"] = miplscsp.Description
18272	}
18273	return json.Marshal(objectMap)
18274}
18275
18276// ManagedInstanceProperties the properties of a managed instance.
18277type ManagedInstanceProperties struct {
18278	// ProvisioningState - READ-ONLY; Possible values include: 'ProvisioningState1Creating', 'ProvisioningState1Deleting', 'ProvisioningState1Updating', 'ProvisioningState1Unknown', 'ProvisioningState1Succeeded', 'ProvisioningState1Failed'
18279	ProvisioningState ProvisioningState1 `json:"provisioningState,omitempty"`
18280	// ManagedInstanceCreateMode - Specifies the mode of database creation.
18281	//
18282	// Default: Regular instance creation.
18283	//
18284	// Restore: Creates an instance by restoring a set of backups to specific point in time. RestorePointInTime and SourceManagedInstanceId must be specified. Possible values include: 'ManagedServerCreateModeDefault', 'ManagedServerCreateModePointInTimeRestore'
18285	ManagedInstanceCreateMode ManagedServerCreateMode `json:"managedInstanceCreateMode,omitempty"`
18286	// FullyQualifiedDomainName - READ-ONLY; The fully qualified domain name of the managed instance.
18287	FullyQualifiedDomainName *string `json:"fullyQualifiedDomainName,omitempty"`
18288	// AdministratorLogin - Administrator username for the managed instance. Can only be specified when the managed instance is being created (and is required for creation).
18289	AdministratorLogin *string `json:"administratorLogin,omitempty"`
18290	// AdministratorLoginPassword - The administrator login password (required for managed instance creation).
18291	AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"`
18292	// SubnetID - Subnet resource ID for the managed instance.
18293	SubnetID *string `json:"subnetId,omitempty"`
18294	// State - READ-ONLY; The state of the managed instance.
18295	State *string `json:"state,omitempty"`
18296	// LicenseType - The license type. Possible values are 'LicenseIncluded' (regular price inclusive of a new SQL license) and 'BasePrice' (discounted AHB price for bringing your own SQL licenses). Possible values include: 'ManagedInstanceLicenseTypeLicenseIncluded', 'ManagedInstanceLicenseTypeBasePrice'
18297	LicenseType ManagedInstanceLicenseType `json:"licenseType,omitempty"`
18298	// VCores - The number of vCores. Allowed values: 8, 16, 24, 32, 40, 64, 80.
18299	VCores *int32 `json:"vCores,omitempty"`
18300	// StorageSizeInGB - Storage size in GB. Minimum value: 32. Maximum value: 8192. Increments of 32 GB allowed only.
18301	StorageSizeInGB *int32 `json:"storageSizeInGB,omitempty"`
18302	// Collation - Collation of the managed instance.
18303	Collation *string `json:"collation,omitempty"`
18304	// DNSZone - READ-ONLY; The Dns Zone that the managed instance is in.
18305	DNSZone *string `json:"dnsZone,omitempty"`
18306	// DNSZonePartner - The resource id of another managed instance whose DNS zone this managed instance will share after creation.
18307	DNSZonePartner *string `json:"dnsZonePartner,omitempty"`
18308	// PublicDataEndpointEnabled - Whether or not the public data endpoint is enabled.
18309	PublicDataEndpointEnabled *bool `json:"publicDataEndpointEnabled,omitempty"`
18310	// SourceManagedInstanceID - The resource identifier of the source managed instance associated with create operation of this instance.
18311	SourceManagedInstanceID *string `json:"sourceManagedInstanceId,omitempty"`
18312	// RestorePointInTime - Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database.
18313	RestorePointInTime *date.Time `json:"restorePointInTime,omitempty"`
18314	// ProxyOverride - Connection type used for connecting to the instance. Possible values include: 'ManagedInstanceProxyOverrideProxy', 'ManagedInstanceProxyOverrideRedirect', 'ManagedInstanceProxyOverrideDefault'
18315	ProxyOverride ManagedInstanceProxyOverride `json:"proxyOverride,omitempty"`
18316	// TimezoneID - Id of the timezone. Allowed values are timezones supported by Windows.
18317	// Windows keeps details on supported timezones, including the id, in registry under
18318	// KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones.
18319	// You can get those registry values via SQL Server by querying SELECT name AS timezone_id FROM sys.time_zone_info.
18320	// List of Ids can also be obtained by executing [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell.
18321	// An example of valid timezone id is "Pacific Standard Time" or "W. Europe Standard Time".
18322	TimezoneID *string `json:"timezoneId,omitempty"`
18323	// InstancePoolID - The Id of the instance pool this managed server belongs to.
18324	InstancePoolID *string `json:"instancePoolId,omitempty"`
18325	// MaintenanceConfigurationID - Specifies maintenance configuration id to apply to this managed instance.
18326	MaintenanceConfigurationID *string `json:"maintenanceConfigurationId,omitempty"`
18327	// PrivateEndpointConnections - READ-ONLY; List of private endpoint connections on a managed instance.
18328	PrivateEndpointConnections *[]ManagedInstancePecProperty `json:"privateEndpointConnections,omitempty"`
18329	// MinimalTLSVersion - Minimal TLS version. Allowed values: 'None', '1.0', '1.1', '1.2'
18330	MinimalTLSVersion *string `json:"minimalTlsVersion,omitempty"`
18331	// StorageAccountType - The storage account type used to store backups for this instance. The options are LRS (LocallyRedundantStorage), ZRS (ZoneRedundantStorage) and GRS (GeoRedundantStorage). Possible values include: 'StorageAccountTypeGRS', 'StorageAccountTypeLRS', 'StorageAccountTypeZRS'
18332	StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"`
18333	// ZoneRedundant - Whether or not the multi-az is enabled.
18334	ZoneRedundant *bool `json:"zoneRedundant,omitempty"`
18335	// PrimaryUserAssignedIdentityID - The resource id of a user assigned identity to be used by default.
18336	PrimaryUserAssignedIdentityID *string `json:"primaryUserAssignedIdentityId,omitempty"`
18337	// KeyID - A CMK URI of the key to use for encryption.
18338	KeyID *string `json:"keyId,omitempty"`
18339	// Administrators - The Azure Active Directory administrator of the server.
18340	Administrators *ManagedInstanceExternalAdministrator `json:"administrators,omitempty"`
18341}
18342
18343// MarshalJSON is the custom marshaler for ManagedInstanceProperties.
18344func (mip ManagedInstanceProperties) MarshalJSON() ([]byte, error) {
18345	objectMap := make(map[string]interface{})
18346	if mip.ManagedInstanceCreateMode != "" {
18347		objectMap["managedInstanceCreateMode"] = mip.ManagedInstanceCreateMode
18348	}
18349	if mip.AdministratorLogin != nil {
18350		objectMap["administratorLogin"] = mip.AdministratorLogin
18351	}
18352	if mip.AdministratorLoginPassword != nil {
18353		objectMap["administratorLoginPassword"] = mip.AdministratorLoginPassword
18354	}
18355	if mip.SubnetID != nil {
18356		objectMap["subnetId"] = mip.SubnetID
18357	}
18358	if mip.LicenseType != "" {
18359		objectMap["licenseType"] = mip.LicenseType
18360	}
18361	if mip.VCores != nil {
18362		objectMap["vCores"] = mip.VCores
18363	}
18364	if mip.StorageSizeInGB != nil {
18365		objectMap["storageSizeInGB"] = mip.StorageSizeInGB
18366	}
18367	if mip.Collation != nil {
18368		objectMap["collation"] = mip.Collation
18369	}
18370	if mip.DNSZonePartner != nil {
18371		objectMap["dnsZonePartner"] = mip.DNSZonePartner
18372	}
18373	if mip.PublicDataEndpointEnabled != nil {
18374		objectMap["publicDataEndpointEnabled"] = mip.PublicDataEndpointEnabled
18375	}
18376	if mip.SourceManagedInstanceID != nil {
18377		objectMap["sourceManagedInstanceId"] = mip.SourceManagedInstanceID
18378	}
18379	if mip.RestorePointInTime != nil {
18380		objectMap["restorePointInTime"] = mip.RestorePointInTime
18381	}
18382	if mip.ProxyOverride != "" {
18383		objectMap["proxyOverride"] = mip.ProxyOverride
18384	}
18385	if mip.TimezoneID != nil {
18386		objectMap["timezoneId"] = mip.TimezoneID
18387	}
18388	if mip.InstancePoolID != nil {
18389		objectMap["instancePoolId"] = mip.InstancePoolID
18390	}
18391	if mip.MaintenanceConfigurationID != nil {
18392		objectMap["maintenanceConfigurationId"] = mip.MaintenanceConfigurationID
18393	}
18394	if mip.MinimalTLSVersion != nil {
18395		objectMap["minimalTlsVersion"] = mip.MinimalTLSVersion
18396	}
18397	if mip.StorageAccountType != "" {
18398		objectMap["storageAccountType"] = mip.StorageAccountType
18399	}
18400	if mip.ZoneRedundant != nil {
18401		objectMap["zoneRedundant"] = mip.ZoneRedundant
18402	}
18403	if mip.PrimaryUserAssignedIdentityID != nil {
18404		objectMap["primaryUserAssignedIdentityId"] = mip.PrimaryUserAssignedIdentityID
18405	}
18406	if mip.KeyID != nil {
18407		objectMap["keyId"] = mip.KeyID
18408	}
18409	if mip.Administrators != nil {
18410		objectMap["administrators"] = mip.Administrators
18411	}
18412	return json.Marshal(objectMap)
18413}
18414
18415// ManagedInstanceQuery database query.
18416type ManagedInstanceQuery struct {
18417	autorest.Response `json:"-"`
18418	// QueryProperties - Resource properties.
18419	*QueryProperties `json:"properties,omitempty"`
18420	// ID - READ-ONLY; Resource ID.
18421	ID *string `json:"id,omitempty"`
18422	// Name - READ-ONLY; Resource name.
18423	Name *string `json:"name,omitempty"`
18424	// Type - READ-ONLY; Resource type.
18425	Type *string `json:"type,omitempty"`
18426}
18427
18428// MarshalJSON is the custom marshaler for ManagedInstanceQuery.
18429func (miq ManagedInstanceQuery) MarshalJSON() ([]byte, error) {
18430	objectMap := make(map[string]interface{})
18431	if miq.QueryProperties != nil {
18432		objectMap["properties"] = miq.QueryProperties
18433	}
18434	return json.Marshal(objectMap)
18435}
18436
18437// UnmarshalJSON is the custom unmarshaler for ManagedInstanceQuery struct.
18438func (miq *ManagedInstanceQuery) UnmarshalJSON(body []byte) error {
18439	var m map[string]*json.RawMessage
18440	err := json.Unmarshal(body, &m)
18441	if err != nil {
18442		return err
18443	}
18444	for k, v := range m {
18445		switch k {
18446		case "properties":
18447			if v != nil {
18448				var queryProperties QueryProperties
18449				err = json.Unmarshal(*v, &queryProperties)
18450				if err != nil {
18451					return err
18452				}
18453				miq.QueryProperties = &queryProperties
18454			}
18455		case "id":
18456			if v != nil {
18457				var ID string
18458				err = json.Unmarshal(*v, &ID)
18459				if err != nil {
18460					return err
18461				}
18462				miq.ID = &ID
18463			}
18464		case "name":
18465			if v != nil {
18466				var name string
18467				err = json.Unmarshal(*v, &name)
18468				if err != nil {
18469					return err
18470				}
18471				miq.Name = &name
18472			}
18473		case "type":
18474			if v != nil {
18475				var typeVar string
18476				err = json.Unmarshal(*v, &typeVar)
18477				if err != nil {
18478					return err
18479				}
18480				miq.Type = &typeVar
18481			}
18482		}
18483	}
18484
18485	return nil
18486}
18487
18488// ManagedInstanceQueryStatistics execution statistics for one particular query
18489type ManagedInstanceQueryStatistics struct {
18490	autorest.Response `json:"-"`
18491	// Value - READ-ONLY; Array of results.
18492	Value *[]QueryStatistics `json:"value,omitempty"`
18493	// NextLink - READ-ONLY; Link to retrieve next page of results.
18494	NextLink *string `json:"nextLink,omitempty"`
18495}
18496
18497// MarshalJSON is the custom marshaler for ManagedInstanceQueryStatistics.
18498func (miqs ManagedInstanceQueryStatistics) MarshalJSON() ([]byte, error) {
18499	objectMap := make(map[string]interface{})
18500	return json.Marshal(objectMap)
18501}
18502
18503// ManagedInstanceQueryStatisticsIterator provides access to a complete listing of QueryStatistics values.
18504type ManagedInstanceQueryStatisticsIterator struct {
18505	i    int
18506	page ManagedInstanceQueryStatisticsPage
18507}
18508
18509// NextWithContext advances to the next value.  If there was an error making
18510// the request the iterator does not advance and the error is returned.
18511func (iter *ManagedInstanceQueryStatisticsIterator) NextWithContext(ctx context.Context) (err error) {
18512	if tracing.IsEnabled() {
18513		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceQueryStatisticsIterator.NextWithContext")
18514		defer func() {
18515			sc := -1
18516			if iter.Response().Response.Response != nil {
18517				sc = iter.Response().Response.Response.StatusCode
18518			}
18519			tracing.EndSpan(ctx, sc, err)
18520		}()
18521	}
18522	iter.i++
18523	if iter.i < len(iter.page.Values()) {
18524		return nil
18525	}
18526	err = iter.page.NextWithContext(ctx)
18527	if err != nil {
18528		iter.i--
18529		return err
18530	}
18531	iter.i = 0
18532	return nil
18533}
18534
18535// Next advances to the next value.  If there was an error making
18536// the request the iterator does not advance and the error is returned.
18537// Deprecated: Use NextWithContext() instead.
18538func (iter *ManagedInstanceQueryStatisticsIterator) Next() error {
18539	return iter.NextWithContext(context.Background())
18540}
18541
18542// NotDone returns true if the enumeration should be started or is not yet complete.
18543func (iter ManagedInstanceQueryStatisticsIterator) NotDone() bool {
18544	return iter.page.NotDone() && iter.i < len(iter.page.Values())
18545}
18546
18547// Response returns the raw server response from the last page request.
18548func (iter ManagedInstanceQueryStatisticsIterator) Response() ManagedInstanceQueryStatistics {
18549	return iter.page.Response()
18550}
18551
18552// Value returns the current value or a zero-initialized value if the
18553// iterator has advanced beyond the end of the collection.
18554func (iter ManagedInstanceQueryStatisticsIterator) Value() QueryStatistics {
18555	if !iter.page.NotDone() {
18556		return QueryStatistics{}
18557	}
18558	return iter.page.Values()[iter.i]
18559}
18560
18561// Creates a new instance of the ManagedInstanceQueryStatisticsIterator type.
18562func NewManagedInstanceQueryStatisticsIterator(page ManagedInstanceQueryStatisticsPage) ManagedInstanceQueryStatisticsIterator {
18563	return ManagedInstanceQueryStatisticsIterator{page: page}
18564}
18565
18566// IsEmpty returns true if the ListResult contains no values.
18567func (miqs ManagedInstanceQueryStatistics) IsEmpty() bool {
18568	return miqs.Value == nil || len(*miqs.Value) == 0
18569}
18570
18571// hasNextLink returns true if the NextLink is not empty.
18572func (miqs ManagedInstanceQueryStatistics) hasNextLink() bool {
18573	return miqs.NextLink != nil && len(*miqs.NextLink) != 0
18574}
18575
18576// managedInstanceQueryStatisticsPreparer prepares a request to retrieve the next set of results.
18577// It returns nil if no more results exist.
18578func (miqs ManagedInstanceQueryStatistics) managedInstanceQueryStatisticsPreparer(ctx context.Context) (*http.Request, error) {
18579	if !miqs.hasNextLink() {
18580		return nil, nil
18581	}
18582	return autorest.Prepare((&http.Request{}).WithContext(ctx),
18583		autorest.AsJSON(),
18584		autorest.AsGet(),
18585		autorest.WithBaseURL(to.String(miqs.NextLink)))
18586}
18587
18588// ManagedInstanceQueryStatisticsPage contains a page of QueryStatistics values.
18589type ManagedInstanceQueryStatisticsPage struct {
18590	fn   func(context.Context, ManagedInstanceQueryStatistics) (ManagedInstanceQueryStatistics, error)
18591	miqs ManagedInstanceQueryStatistics
18592}
18593
18594// NextWithContext advances to the next page of values.  If there was an error making
18595// the request the page does not advance and the error is returned.
18596func (page *ManagedInstanceQueryStatisticsPage) NextWithContext(ctx context.Context) (err error) {
18597	if tracing.IsEnabled() {
18598		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceQueryStatisticsPage.NextWithContext")
18599		defer func() {
18600			sc := -1
18601			if page.Response().Response.Response != nil {
18602				sc = page.Response().Response.Response.StatusCode
18603			}
18604			tracing.EndSpan(ctx, sc, err)
18605		}()
18606	}
18607	for {
18608		next, err := page.fn(ctx, page.miqs)
18609		if err != nil {
18610			return err
18611		}
18612		page.miqs = next
18613		if !next.hasNextLink() || !next.IsEmpty() {
18614			break
18615		}
18616	}
18617	return nil
18618}
18619
18620// Next advances to the next page of values.  If there was an error making
18621// the request the page does not advance and the error is returned.
18622// Deprecated: Use NextWithContext() instead.
18623func (page *ManagedInstanceQueryStatisticsPage) Next() error {
18624	return page.NextWithContext(context.Background())
18625}
18626
18627// NotDone returns true if the page enumeration should be started or is not yet complete.
18628func (page ManagedInstanceQueryStatisticsPage) NotDone() bool {
18629	return !page.miqs.IsEmpty()
18630}
18631
18632// Response returns the raw server response from the last page request.
18633func (page ManagedInstanceQueryStatisticsPage) Response() ManagedInstanceQueryStatistics {
18634	return page.miqs
18635}
18636
18637// Values returns the slice of values for the current page or nil if there are no values.
18638func (page ManagedInstanceQueryStatisticsPage) Values() []QueryStatistics {
18639	if page.miqs.IsEmpty() {
18640		return nil
18641	}
18642	return *page.miqs.Value
18643}
18644
18645// Creates a new instance of the ManagedInstanceQueryStatisticsPage type.
18646func NewManagedInstanceQueryStatisticsPage(cur ManagedInstanceQueryStatistics, getNextPage func(context.Context, ManagedInstanceQueryStatistics) (ManagedInstanceQueryStatistics, error)) ManagedInstanceQueryStatisticsPage {
18647	return ManagedInstanceQueryStatisticsPage{
18648		fn:   getNextPage,
18649		miqs: cur,
18650	}
18651}
18652
18653// ManagedInstancesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
18654// long-running operation.
18655type ManagedInstancesCreateOrUpdateFuture struct {
18656	azure.FutureAPI
18657	// Result returns the result of the asynchronous operation.
18658	// If the operation has not completed it will return an error.
18659	Result func(ManagedInstancesClient) (ManagedInstance, error)
18660}
18661
18662// UnmarshalJSON is the custom unmarshaller for CreateFuture.
18663func (future *ManagedInstancesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
18664	var azFuture azure.Future
18665	if err := json.Unmarshal(body, &azFuture); err != nil {
18666		return err
18667	}
18668	future.FutureAPI = &azFuture
18669	future.Result = future.result
18670	return nil
18671}
18672
18673// result is the default implementation for ManagedInstancesCreateOrUpdateFuture.Result.
18674func (future *ManagedInstancesCreateOrUpdateFuture) result(client ManagedInstancesClient) (mi ManagedInstance, err error) {
18675	var done bool
18676	done, err = future.DoneWithContext(context.Background(), client)
18677	if err != nil {
18678		err = autorest.NewErrorWithError(err, "sql.ManagedInstancesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
18679		return
18680	}
18681	if !done {
18682		mi.Response.Response = future.Response()
18683		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstancesCreateOrUpdateFuture")
18684		return
18685	}
18686	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
18687	if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent {
18688		mi, err = client.CreateOrUpdateResponder(mi.Response.Response)
18689		if err != nil {
18690			err = autorest.NewErrorWithError(err, "sql.ManagedInstancesCreateOrUpdateFuture", "Result", mi.Response.Response, "Failure responding to request")
18691		}
18692	}
18693	return
18694}
18695
18696// ManagedInstancesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
18697// operation.
18698type ManagedInstancesDeleteFuture struct {
18699	azure.FutureAPI
18700	// Result returns the result of the asynchronous operation.
18701	// If the operation has not completed it will return an error.
18702	Result func(ManagedInstancesClient) (autorest.Response, error)
18703}
18704
18705// UnmarshalJSON is the custom unmarshaller for CreateFuture.
18706func (future *ManagedInstancesDeleteFuture) UnmarshalJSON(body []byte) error {
18707	var azFuture azure.Future
18708	if err := json.Unmarshal(body, &azFuture); err != nil {
18709		return err
18710	}
18711	future.FutureAPI = &azFuture
18712	future.Result = future.result
18713	return nil
18714}
18715
18716// result is the default implementation for ManagedInstancesDeleteFuture.Result.
18717func (future *ManagedInstancesDeleteFuture) result(client ManagedInstancesClient) (ar autorest.Response, err error) {
18718	var done bool
18719	done, err = future.DoneWithContext(context.Background(), client)
18720	if err != nil {
18721		err = autorest.NewErrorWithError(err, "sql.ManagedInstancesDeleteFuture", "Result", future.Response(), "Polling failure")
18722		return
18723	}
18724	if !done {
18725		ar.Response = future.Response()
18726		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstancesDeleteFuture")
18727		return
18728	}
18729	ar.Response = future.Response()
18730	return
18731}
18732
18733// ManagedInstancesFailoverFuture an abstraction for monitoring and retrieving the results of a
18734// long-running operation.
18735type ManagedInstancesFailoverFuture struct {
18736	azure.FutureAPI
18737	// Result returns the result of the asynchronous operation.
18738	// If the operation has not completed it will return an error.
18739	Result func(ManagedInstancesClient) (autorest.Response, error)
18740}
18741
18742// UnmarshalJSON is the custom unmarshaller for CreateFuture.
18743func (future *ManagedInstancesFailoverFuture) UnmarshalJSON(body []byte) error {
18744	var azFuture azure.Future
18745	if err := json.Unmarshal(body, &azFuture); err != nil {
18746		return err
18747	}
18748	future.FutureAPI = &azFuture
18749	future.Result = future.result
18750	return nil
18751}
18752
18753// result is the default implementation for ManagedInstancesFailoverFuture.Result.
18754func (future *ManagedInstancesFailoverFuture) result(client ManagedInstancesClient) (ar autorest.Response, err error) {
18755	var done bool
18756	done, err = future.DoneWithContext(context.Background(), client)
18757	if err != nil {
18758		err = autorest.NewErrorWithError(err, "sql.ManagedInstancesFailoverFuture", "Result", future.Response(), "Polling failure")
18759		return
18760	}
18761	if !done {
18762		ar.Response = future.Response()
18763		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstancesFailoverFuture")
18764		return
18765	}
18766	ar.Response = future.Response()
18767	return
18768}
18769
18770// ManagedInstancesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
18771// operation.
18772type ManagedInstancesUpdateFuture struct {
18773	azure.FutureAPI
18774	// Result returns the result of the asynchronous operation.
18775	// If the operation has not completed it will return an error.
18776	Result func(ManagedInstancesClient) (ManagedInstance, error)
18777}
18778
18779// UnmarshalJSON is the custom unmarshaller for CreateFuture.
18780func (future *ManagedInstancesUpdateFuture) UnmarshalJSON(body []byte) error {
18781	var azFuture azure.Future
18782	if err := json.Unmarshal(body, &azFuture); err != nil {
18783		return err
18784	}
18785	future.FutureAPI = &azFuture
18786	future.Result = future.result
18787	return nil
18788}
18789
18790// result is the default implementation for ManagedInstancesUpdateFuture.Result.
18791func (future *ManagedInstancesUpdateFuture) result(client ManagedInstancesClient) (mi ManagedInstance, err error) {
18792	var done bool
18793	done, err = future.DoneWithContext(context.Background(), client)
18794	if err != nil {
18795		err = autorest.NewErrorWithError(err, "sql.ManagedInstancesUpdateFuture", "Result", future.Response(), "Polling failure")
18796		return
18797	}
18798	if !done {
18799		mi.Response.Response = future.Response()
18800		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstancesUpdateFuture")
18801		return
18802	}
18803	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
18804	if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent {
18805		mi, err = client.UpdateResponder(mi.Response.Response)
18806		if err != nil {
18807			err = autorest.NewErrorWithError(err, "sql.ManagedInstancesUpdateFuture", "Result", mi.Response.Response, "Failure responding to request")
18808		}
18809	}
18810	return
18811}
18812
18813// ManagedInstanceTdeCertificatesCreateFuture an abstraction for monitoring and retrieving the results of a
18814// long-running operation.
18815type ManagedInstanceTdeCertificatesCreateFuture struct {
18816	azure.FutureAPI
18817	// Result returns the result of the asynchronous operation.
18818	// If the operation has not completed it will return an error.
18819	Result func(ManagedInstanceTdeCertificatesClient) (autorest.Response, error)
18820}
18821
18822// UnmarshalJSON is the custom unmarshaller for CreateFuture.
18823func (future *ManagedInstanceTdeCertificatesCreateFuture) UnmarshalJSON(body []byte) error {
18824	var azFuture azure.Future
18825	if err := json.Unmarshal(body, &azFuture); err != nil {
18826		return err
18827	}
18828	future.FutureAPI = &azFuture
18829	future.Result = future.result
18830	return nil
18831}
18832
18833// result is the default implementation for ManagedInstanceTdeCertificatesCreateFuture.Result.
18834func (future *ManagedInstanceTdeCertificatesCreateFuture) result(client ManagedInstanceTdeCertificatesClient) (ar autorest.Response, err error) {
18835	var done bool
18836	done, err = future.DoneWithContext(context.Background(), client)
18837	if err != nil {
18838		err = autorest.NewErrorWithError(err, "sql.ManagedInstanceTdeCertificatesCreateFuture", "Result", future.Response(), "Polling failure")
18839		return
18840	}
18841	if !done {
18842		ar.Response = future.Response()
18843		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstanceTdeCertificatesCreateFuture")
18844		return
18845	}
18846	ar.Response = future.Response()
18847	return
18848}
18849
18850// ManagedInstanceUpdate an update request for an Azure SQL Database managed instance.
18851type ManagedInstanceUpdate struct {
18852	// Sku - Managed instance sku
18853	Sku *Sku `json:"sku,omitempty"`
18854	// Identity - Managed instance identity
18855	Identity *ResourceIdentity `json:"identity,omitempty"`
18856	// ManagedInstanceProperties - Resource properties.
18857	*ManagedInstanceProperties `json:"properties,omitempty"`
18858	// Tags - Resource tags.
18859	Tags map[string]*string `json:"tags"`
18860}
18861
18862// MarshalJSON is the custom marshaler for ManagedInstanceUpdate.
18863func (miu ManagedInstanceUpdate) MarshalJSON() ([]byte, error) {
18864	objectMap := make(map[string]interface{})
18865	if miu.Sku != nil {
18866		objectMap["sku"] = miu.Sku
18867	}
18868	if miu.Identity != nil {
18869		objectMap["identity"] = miu.Identity
18870	}
18871	if miu.ManagedInstanceProperties != nil {
18872		objectMap["properties"] = miu.ManagedInstanceProperties
18873	}
18874	if miu.Tags != nil {
18875		objectMap["tags"] = miu.Tags
18876	}
18877	return json.Marshal(objectMap)
18878}
18879
18880// UnmarshalJSON is the custom unmarshaler for ManagedInstanceUpdate struct.
18881func (miu *ManagedInstanceUpdate) UnmarshalJSON(body []byte) error {
18882	var m map[string]*json.RawMessage
18883	err := json.Unmarshal(body, &m)
18884	if err != nil {
18885		return err
18886	}
18887	for k, v := range m {
18888		switch k {
18889		case "sku":
18890			if v != nil {
18891				var sku Sku
18892				err = json.Unmarshal(*v, &sku)
18893				if err != nil {
18894					return err
18895				}
18896				miu.Sku = &sku
18897			}
18898		case "identity":
18899			if v != nil {
18900				var identity ResourceIdentity
18901				err = json.Unmarshal(*v, &identity)
18902				if err != nil {
18903					return err
18904				}
18905				miu.Identity = &identity
18906			}
18907		case "properties":
18908			if v != nil {
18909				var managedInstanceProperties ManagedInstanceProperties
18910				err = json.Unmarshal(*v, &managedInstanceProperties)
18911				if err != nil {
18912					return err
18913				}
18914				miu.ManagedInstanceProperties = &managedInstanceProperties
18915			}
18916		case "tags":
18917			if v != nil {
18918				var tags map[string]*string
18919				err = json.Unmarshal(*v, &tags)
18920				if err != nil {
18921					return err
18922				}
18923				miu.Tags = tags
18924			}
18925		}
18926	}
18927
18928	return nil
18929}
18930
18931// ManagedInstanceVcoresCapability the managed instance virtual cores capability.
18932type ManagedInstanceVcoresCapability struct {
18933	// Name - READ-ONLY; The virtual cores identifier.
18934	Name *string `json:"name,omitempty"`
18935	// Value - READ-ONLY; The virtual cores value.
18936	Value *int32 `json:"value,omitempty"`
18937	// IncludedMaxSize - READ-ONLY; Included size.
18938	IncludedMaxSize *MaxSizeCapability `json:"includedMaxSize,omitempty"`
18939	// SupportedStorageSizes - READ-ONLY; Storage size ranges.
18940	SupportedStorageSizes *[]MaxSizeRangeCapability `json:"supportedStorageSizes,omitempty"`
18941	// InstancePoolSupported - READ-ONLY; True if this service objective is supported for managed instances in an instance pool.
18942	InstancePoolSupported *bool `json:"instancePoolSupported,omitempty"`
18943	// StandaloneSupported - READ-ONLY; True if this service objective is supported for standalone managed instances.
18944	StandaloneSupported *bool `json:"standaloneSupported,omitempty"`
18945	// SupportedMaintenanceConfigurations - READ-ONLY; List of supported maintenance configurations
18946	SupportedMaintenanceConfigurations *[]ManagedInstanceMaintenanceConfigurationCapability `json:"supportedMaintenanceConfigurations,omitempty"`
18947	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
18948	Status CapabilityStatus `json:"status,omitempty"`
18949	// Reason - The reason for the capability not being available.
18950	Reason *string `json:"reason,omitempty"`
18951}
18952
18953// MarshalJSON is the custom marshaler for ManagedInstanceVcoresCapability.
18954func (mivc ManagedInstanceVcoresCapability) MarshalJSON() ([]byte, error) {
18955	objectMap := make(map[string]interface{})
18956	if mivc.Reason != nil {
18957		objectMap["reason"] = mivc.Reason
18958	}
18959	return json.Marshal(objectMap)
18960}
18961
18962// ManagedInstanceVersionCapability the managed instance capability
18963type ManagedInstanceVersionCapability struct {
18964	// Name - READ-ONLY; The server version name.
18965	Name *string `json:"name,omitempty"`
18966	// SupportedEditions - READ-ONLY; The list of supported managed instance editions.
18967	SupportedEditions *[]ManagedInstanceEditionCapability `json:"supportedEditions,omitempty"`
18968	// SupportedInstancePoolEditions - READ-ONLY; The list of supported instance pool editions.
18969	SupportedInstancePoolEditions *[]InstancePoolEditionCapability `json:"supportedInstancePoolEditions,omitempty"`
18970	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
18971	Status CapabilityStatus `json:"status,omitempty"`
18972	// Reason - The reason for the capability not being available.
18973	Reason *string `json:"reason,omitempty"`
18974}
18975
18976// MarshalJSON is the custom marshaler for ManagedInstanceVersionCapability.
18977func (mivc ManagedInstanceVersionCapability) MarshalJSON() ([]byte, error) {
18978	objectMap := make(map[string]interface{})
18979	if mivc.Reason != nil {
18980		objectMap["reason"] = mivc.Reason
18981	}
18982	return json.Marshal(objectMap)
18983}
18984
18985// ManagedInstanceVulnerabilityAssessment a managed instance vulnerability assessment.
18986type ManagedInstanceVulnerabilityAssessment struct {
18987	autorest.Response `json:"-"`
18988	// ManagedInstanceVulnerabilityAssessmentProperties - Resource properties.
18989	*ManagedInstanceVulnerabilityAssessmentProperties `json:"properties,omitempty"`
18990	// ID - READ-ONLY; Resource ID.
18991	ID *string `json:"id,omitempty"`
18992	// Name - READ-ONLY; Resource name.
18993	Name *string `json:"name,omitempty"`
18994	// Type - READ-ONLY; Resource type.
18995	Type *string `json:"type,omitempty"`
18996}
18997
18998// MarshalJSON is the custom marshaler for ManagedInstanceVulnerabilityAssessment.
18999func (miva ManagedInstanceVulnerabilityAssessment) MarshalJSON() ([]byte, error) {
19000	objectMap := make(map[string]interface{})
19001	if miva.ManagedInstanceVulnerabilityAssessmentProperties != nil {
19002		objectMap["properties"] = miva.ManagedInstanceVulnerabilityAssessmentProperties
19003	}
19004	return json.Marshal(objectMap)
19005}
19006
19007// UnmarshalJSON is the custom unmarshaler for ManagedInstanceVulnerabilityAssessment struct.
19008func (miva *ManagedInstanceVulnerabilityAssessment) UnmarshalJSON(body []byte) error {
19009	var m map[string]*json.RawMessage
19010	err := json.Unmarshal(body, &m)
19011	if err != nil {
19012		return err
19013	}
19014	for k, v := range m {
19015		switch k {
19016		case "properties":
19017			if v != nil {
19018				var managedInstanceVulnerabilityAssessmentProperties ManagedInstanceVulnerabilityAssessmentProperties
19019				err = json.Unmarshal(*v, &managedInstanceVulnerabilityAssessmentProperties)
19020				if err != nil {
19021					return err
19022				}
19023				miva.ManagedInstanceVulnerabilityAssessmentProperties = &managedInstanceVulnerabilityAssessmentProperties
19024			}
19025		case "id":
19026			if v != nil {
19027				var ID string
19028				err = json.Unmarshal(*v, &ID)
19029				if err != nil {
19030					return err
19031				}
19032				miva.ID = &ID
19033			}
19034		case "name":
19035			if v != nil {
19036				var name string
19037				err = json.Unmarshal(*v, &name)
19038				if err != nil {
19039					return err
19040				}
19041				miva.Name = &name
19042			}
19043		case "type":
19044			if v != nil {
19045				var typeVar string
19046				err = json.Unmarshal(*v, &typeVar)
19047				if err != nil {
19048					return err
19049				}
19050				miva.Type = &typeVar
19051			}
19052		}
19053	}
19054
19055	return nil
19056}
19057
19058// ManagedInstanceVulnerabilityAssessmentListResult a list of the ManagedInstance's vulnerability
19059// assessments.
19060type ManagedInstanceVulnerabilityAssessmentListResult struct {
19061	autorest.Response `json:"-"`
19062	// Value - READ-ONLY; Array of results.
19063	Value *[]ManagedInstanceVulnerabilityAssessment `json:"value,omitempty"`
19064	// NextLink - READ-ONLY; Link to retrieve next page of results.
19065	NextLink *string `json:"nextLink,omitempty"`
19066}
19067
19068// MarshalJSON is the custom marshaler for ManagedInstanceVulnerabilityAssessmentListResult.
19069func (mivalr ManagedInstanceVulnerabilityAssessmentListResult) MarshalJSON() ([]byte, error) {
19070	objectMap := make(map[string]interface{})
19071	return json.Marshal(objectMap)
19072}
19073
19074// ManagedInstanceVulnerabilityAssessmentListResultIterator provides access to a complete listing of
19075// ManagedInstanceVulnerabilityAssessment values.
19076type ManagedInstanceVulnerabilityAssessmentListResultIterator struct {
19077	i    int
19078	page ManagedInstanceVulnerabilityAssessmentListResultPage
19079}
19080
19081// NextWithContext advances to the next value.  If there was an error making
19082// the request the iterator does not advance and the error is returned.
19083func (iter *ManagedInstanceVulnerabilityAssessmentListResultIterator) NextWithContext(ctx context.Context) (err error) {
19084	if tracing.IsEnabled() {
19085		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceVulnerabilityAssessmentListResultIterator.NextWithContext")
19086		defer func() {
19087			sc := -1
19088			if iter.Response().Response.Response != nil {
19089				sc = iter.Response().Response.Response.StatusCode
19090			}
19091			tracing.EndSpan(ctx, sc, err)
19092		}()
19093	}
19094	iter.i++
19095	if iter.i < len(iter.page.Values()) {
19096		return nil
19097	}
19098	err = iter.page.NextWithContext(ctx)
19099	if err != nil {
19100		iter.i--
19101		return err
19102	}
19103	iter.i = 0
19104	return nil
19105}
19106
19107// Next advances to the next value.  If there was an error making
19108// the request the iterator does not advance and the error is returned.
19109// Deprecated: Use NextWithContext() instead.
19110func (iter *ManagedInstanceVulnerabilityAssessmentListResultIterator) Next() error {
19111	return iter.NextWithContext(context.Background())
19112}
19113
19114// NotDone returns true if the enumeration should be started or is not yet complete.
19115func (iter ManagedInstanceVulnerabilityAssessmentListResultIterator) NotDone() bool {
19116	return iter.page.NotDone() && iter.i < len(iter.page.Values())
19117}
19118
19119// Response returns the raw server response from the last page request.
19120func (iter ManagedInstanceVulnerabilityAssessmentListResultIterator) Response() ManagedInstanceVulnerabilityAssessmentListResult {
19121	return iter.page.Response()
19122}
19123
19124// Value returns the current value or a zero-initialized value if the
19125// iterator has advanced beyond the end of the collection.
19126func (iter ManagedInstanceVulnerabilityAssessmentListResultIterator) Value() ManagedInstanceVulnerabilityAssessment {
19127	if !iter.page.NotDone() {
19128		return ManagedInstanceVulnerabilityAssessment{}
19129	}
19130	return iter.page.Values()[iter.i]
19131}
19132
19133// Creates a new instance of the ManagedInstanceVulnerabilityAssessmentListResultIterator type.
19134func NewManagedInstanceVulnerabilityAssessmentListResultIterator(page ManagedInstanceVulnerabilityAssessmentListResultPage) ManagedInstanceVulnerabilityAssessmentListResultIterator {
19135	return ManagedInstanceVulnerabilityAssessmentListResultIterator{page: page}
19136}
19137
19138// IsEmpty returns true if the ListResult contains no values.
19139func (mivalr ManagedInstanceVulnerabilityAssessmentListResult) IsEmpty() bool {
19140	return mivalr.Value == nil || len(*mivalr.Value) == 0
19141}
19142
19143// hasNextLink returns true if the NextLink is not empty.
19144func (mivalr ManagedInstanceVulnerabilityAssessmentListResult) hasNextLink() bool {
19145	return mivalr.NextLink != nil && len(*mivalr.NextLink) != 0
19146}
19147
19148// managedInstanceVulnerabilityAssessmentListResultPreparer prepares a request to retrieve the next set of results.
19149// It returns nil if no more results exist.
19150func (mivalr ManagedInstanceVulnerabilityAssessmentListResult) managedInstanceVulnerabilityAssessmentListResultPreparer(ctx context.Context) (*http.Request, error) {
19151	if !mivalr.hasNextLink() {
19152		return nil, nil
19153	}
19154	return autorest.Prepare((&http.Request{}).WithContext(ctx),
19155		autorest.AsJSON(),
19156		autorest.AsGet(),
19157		autorest.WithBaseURL(to.String(mivalr.NextLink)))
19158}
19159
19160// ManagedInstanceVulnerabilityAssessmentListResultPage contains a page of
19161// ManagedInstanceVulnerabilityAssessment values.
19162type ManagedInstanceVulnerabilityAssessmentListResultPage struct {
19163	fn     func(context.Context, ManagedInstanceVulnerabilityAssessmentListResult) (ManagedInstanceVulnerabilityAssessmentListResult, error)
19164	mivalr ManagedInstanceVulnerabilityAssessmentListResult
19165}
19166
19167// NextWithContext advances to the next page of values.  If there was an error making
19168// the request the page does not advance and the error is returned.
19169func (page *ManagedInstanceVulnerabilityAssessmentListResultPage) NextWithContext(ctx context.Context) (err error) {
19170	if tracing.IsEnabled() {
19171		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceVulnerabilityAssessmentListResultPage.NextWithContext")
19172		defer func() {
19173			sc := -1
19174			if page.Response().Response.Response != nil {
19175				sc = page.Response().Response.Response.StatusCode
19176			}
19177			tracing.EndSpan(ctx, sc, err)
19178		}()
19179	}
19180	for {
19181		next, err := page.fn(ctx, page.mivalr)
19182		if err != nil {
19183			return err
19184		}
19185		page.mivalr = next
19186		if !next.hasNextLink() || !next.IsEmpty() {
19187			break
19188		}
19189	}
19190	return nil
19191}
19192
19193// Next advances to the next page of values.  If there was an error making
19194// the request the page does not advance and the error is returned.
19195// Deprecated: Use NextWithContext() instead.
19196func (page *ManagedInstanceVulnerabilityAssessmentListResultPage) Next() error {
19197	return page.NextWithContext(context.Background())
19198}
19199
19200// NotDone returns true if the page enumeration should be started or is not yet complete.
19201func (page ManagedInstanceVulnerabilityAssessmentListResultPage) NotDone() bool {
19202	return !page.mivalr.IsEmpty()
19203}
19204
19205// Response returns the raw server response from the last page request.
19206func (page ManagedInstanceVulnerabilityAssessmentListResultPage) Response() ManagedInstanceVulnerabilityAssessmentListResult {
19207	return page.mivalr
19208}
19209
19210// Values returns the slice of values for the current page or nil if there are no values.
19211func (page ManagedInstanceVulnerabilityAssessmentListResultPage) Values() []ManagedInstanceVulnerabilityAssessment {
19212	if page.mivalr.IsEmpty() {
19213		return nil
19214	}
19215	return *page.mivalr.Value
19216}
19217
19218// Creates a new instance of the ManagedInstanceVulnerabilityAssessmentListResultPage type.
19219func NewManagedInstanceVulnerabilityAssessmentListResultPage(cur ManagedInstanceVulnerabilityAssessmentListResult, getNextPage func(context.Context, ManagedInstanceVulnerabilityAssessmentListResult) (ManagedInstanceVulnerabilityAssessmentListResult, error)) ManagedInstanceVulnerabilityAssessmentListResultPage {
19220	return ManagedInstanceVulnerabilityAssessmentListResultPage{
19221		fn:     getNextPage,
19222		mivalr: cur,
19223	}
19224}
19225
19226// ManagedInstanceVulnerabilityAssessmentProperties properties of a managed instance vulnerability
19227// assessment.
19228type ManagedInstanceVulnerabilityAssessmentProperties struct {
19229	// StorageContainerPath - A blob storage container path to hold the scan results (e.g. https://myStorage.blob.core.windows.net/VaScans/).
19230	StorageContainerPath *string `json:"storageContainerPath,omitempty"`
19231	// 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. Applies only if the storage account is not behind a Vnet or a firewall
19232	StorageContainerSasKey *string `json:"storageContainerSasKey,omitempty"`
19233	// StorageAccountAccessKey - Specifies the identifier key of the storage account for vulnerability assessment scan results. If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is required. Applies only if the storage account is not behind a Vnet or a firewall
19234	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
19235	// RecurringScans - The recurring scans settings
19236	RecurringScans *VulnerabilityAssessmentRecurringScansProperties `json:"recurringScans,omitempty"`
19237}
19238
19239// ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCreateOrUpdateFuture an abstraction for
19240// monitoring and retrieving the results of a long-running operation.
19241type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCreateOrUpdateFuture struct {
19242	azure.FutureAPI
19243	// Result returns the result of the asynchronous operation.
19244	// If the operation has not completed it will return an error.
19245	Result func(ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) (ManagedBackupShortTermRetentionPolicy, error)
19246}
19247
19248// UnmarshalJSON is the custom unmarshaller for CreateFuture.
19249func (future *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
19250	var azFuture azure.Future
19251	if err := json.Unmarshal(body, &azFuture); err != nil {
19252		return err
19253	}
19254	future.FutureAPI = &azFuture
19255	future.Result = future.result
19256	return nil
19257}
19258
19259// result is the default implementation for ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCreateOrUpdateFuture.Result.
19260func (future *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCreateOrUpdateFuture) result(client ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) (mbstrp ManagedBackupShortTermRetentionPolicy, err error) {
19261	var done bool
19262	done, err = future.DoneWithContext(context.Background(), client)
19263	if err != nil {
19264		err = autorest.NewErrorWithError(err, "sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
19265		return
19266	}
19267	if !done {
19268		mbstrp.Response.Response = future.Response()
19269		err = azure.NewAsyncOpIncompleteError("sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCreateOrUpdateFuture")
19270		return
19271	}
19272	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
19273	if mbstrp.Response.Response, err = future.GetResult(sender); err == nil && mbstrp.Response.Response.StatusCode != http.StatusNoContent {
19274		mbstrp, err = client.CreateOrUpdateResponder(mbstrp.Response.Response)
19275		if err != nil {
19276			err = autorest.NewErrorWithError(err, "sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCreateOrUpdateFuture", "Result", mbstrp.Response.Response, "Failure responding to request")
19277		}
19278	}
19279	return
19280}
19281
19282// ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesUpdateFuture an abstraction for
19283// monitoring and retrieving the results of a long-running operation.
19284type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesUpdateFuture struct {
19285	azure.FutureAPI
19286	// Result returns the result of the asynchronous operation.
19287	// If the operation has not completed it will return an error.
19288	Result func(ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) (ManagedBackupShortTermRetentionPolicy, error)
19289}
19290
19291// UnmarshalJSON is the custom unmarshaller for CreateFuture.
19292func (future *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesUpdateFuture) UnmarshalJSON(body []byte) error {
19293	var azFuture azure.Future
19294	if err := json.Unmarshal(body, &azFuture); err != nil {
19295		return err
19296	}
19297	future.FutureAPI = &azFuture
19298	future.Result = future.result
19299	return nil
19300}
19301
19302// result is the default implementation for ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesUpdateFuture.Result.
19303func (future *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesUpdateFuture) result(client ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) (mbstrp ManagedBackupShortTermRetentionPolicy, err error) {
19304	var done bool
19305	done, err = future.DoneWithContext(context.Background(), client)
19306	if err != nil {
19307		err = autorest.NewErrorWithError(err, "sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesUpdateFuture", "Result", future.Response(), "Polling failure")
19308		return
19309	}
19310	if !done {
19311		mbstrp.Response.Response = future.Response()
19312		err = azure.NewAsyncOpIncompleteError("sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesUpdateFuture")
19313		return
19314	}
19315	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
19316	if mbstrp.Response.Response, err = future.GetResult(sender); err == nil && mbstrp.Response.Response.StatusCode != http.StatusNoContent {
19317		mbstrp, err = client.UpdateResponder(mbstrp.Response.Response)
19318		if err != nil {
19319			err = autorest.NewErrorWithError(err, "sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesUpdateFuture", "Result", mbstrp.Response.Response, "Failure responding to request")
19320		}
19321	}
19322	return
19323}
19324
19325// ManagedServerSecurityAlertPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the
19326// results of a long-running operation.
19327type ManagedServerSecurityAlertPoliciesCreateOrUpdateFuture struct {
19328	azure.FutureAPI
19329	// Result returns the result of the asynchronous operation.
19330	// If the operation has not completed it will return an error.
19331	Result func(ManagedServerSecurityAlertPoliciesClient) (ManagedServerSecurityAlertPolicy, error)
19332}
19333
19334// UnmarshalJSON is the custom unmarshaller for CreateFuture.
19335func (future *ManagedServerSecurityAlertPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
19336	var azFuture azure.Future
19337	if err := json.Unmarshal(body, &azFuture); err != nil {
19338		return err
19339	}
19340	future.FutureAPI = &azFuture
19341	future.Result = future.result
19342	return nil
19343}
19344
19345// result is the default implementation for ManagedServerSecurityAlertPoliciesCreateOrUpdateFuture.Result.
19346func (future *ManagedServerSecurityAlertPoliciesCreateOrUpdateFuture) result(client ManagedServerSecurityAlertPoliciesClient) (mssap ManagedServerSecurityAlertPolicy, err error) {
19347	var done bool
19348	done, err = future.DoneWithContext(context.Background(), client)
19349	if err != nil {
19350		err = autorest.NewErrorWithError(err, "sql.ManagedServerSecurityAlertPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
19351		return
19352	}
19353	if !done {
19354		mssap.Response.Response = future.Response()
19355		err = azure.NewAsyncOpIncompleteError("sql.ManagedServerSecurityAlertPoliciesCreateOrUpdateFuture")
19356		return
19357	}
19358	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
19359	if mssap.Response.Response, err = future.GetResult(sender); err == nil && mssap.Response.Response.StatusCode != http.StatusNoContent {
19360		mssap, err = client.CreateOrUpdateResponder(mssap.Response.Response)
19361		if err != nil {
19362			err = autorest.NewErrorWithError(err, "sql.ManagedServerSecurityAlertPoliciesCreateOrUpdateFuture", "Result", mssap.Response.Response, "Failure responding to request")
19363		}
19364	}
19365	return
19366}
19367
19368// ManagedServerSecurityAlertPolicy a managed server security alert policy.
19369type ManagedServerSecurityAlertPolicy struct {
19370	autorest.Response `json:"-"`
19371	// SystemData - READ-ONLY; SystemData of SecurityAlertPolicyResource.
19372	SystemData *SystemData `json:"systemData,omitempty"`
19373	// SecurityAlertsPolicyProperties - Resource properties.
19374	*SecurityAlertsPolicyProperties `json:"properties,omitempty"`
19375	// ID - READ-ONLY; Resource ID.
19376	ID *string `json:"id,omitempty"`
19377	// Name - READ-ONLY; Resource name.
19378	Name *string `json:"name,omitempty"`
19379	// Type - READ-ONLY; Resource type.
19380	Type *string `json:"type,omitempty"`
19381}
19382
19383// MarshalJSON is the custom marshaler for ManagedServerSecurityAlertPolicy.
19384func (mssap ManagedServerSecurityAlertPolicy) MarshalJSON() ([]byte, error) {
19385	objectMap := make(map[string]interface{})
19386	if mssap.SecurityAlertsPolicyProperties != nil {
19387		objectMap["properties"] = mssap.SecurityAlertsPolicyProperties
19388	}
19389	return json.Marshal(objectMap)
19390}
19391
19392// UnmarshalJSON is the custom unmarshaler for ManagedServerSecurityAlertPolicy struct.
19393func (mssap *ManagedServerSecurityAlertPolicy) UnmarshalJSON(body []byte) error {
19394	var m map[string]*json.RawMessage
19395	err := json.Unmarshal(body, &m)
19396	if err != nil {
19397		return err
19398	}
19399	for k, v := range m {
19400		switch k {
19401		case "systemData":
19402			if v != nil {
19403				var systemData SystemData
19404				err = json.Unmarshal(*v, &systemData)
19405				if err != nil {
19406					return err
19407				}
19408				mssap.SystemData = &systemData
19409			}
19410		case "properties":
19411			if v != nil {
19412				var securityAlertsPolicyProperties SecurityAlertsPolicyProperties
19413				err = json.Unmarshal(*v, &securityAlertsPolicyProperties)
19414				if err != nil {
19415					return err
19416				}
19417				mssap.SecurityAlertsPolicyProperties = &securityAlertsPolicyProperties
19418			}
19419		case "id":
19420			if v != nil {
19421				var ID string
19422				err = json.Unmarshal(*v, &ID)
19423				if err != nil {
19424					return err
19425				}
19426				mssap.ID = &ID
19427			}
19428		case "name":
19429			if v != nil {
19430				var name string
19431				err = json.Unmarshal(*v, &name)
19432				if err != nil {
19433					return err
19434				}
19435				mssap.Name = &name
19436			}
19437		case "type":
19438			if v != nil {
19439				var typeVar string
19440				err = json.Unmarshal(*v, &typeVar)
19441				if err != nil {
19442					return err
19443				}
19444				mssap.Type = &typeVar
19445			}
19446		}
19447	}
19448
19449	return nil
19450}
19451
19452// ManagedServerSecurityAlertPolicyListResult a list of the managed Server's security alert policies.
19453type ManagedServerSecurityAlertPolicyListResult struct {
19454	autorest.Response `json:"-"`
19455	// Value - READ-ONLY; Array of results.
19456	Value *[]ManagedServerSecurityAlertPolicy `json:"value,omitempty"`
19457	// NextLink - READ-ONLY; Link to retrieve next page of results.
19458	NextLink *string `json:"nextLink,omitempty"`
19459}
19460
19461// MarshalJSON is the custom marshaler for ManagedServerSecurityAlertPolicyListResult.
19462func (mssaplr ManagedServerSecurityAlertPolicyListResult) MarshalJSON() ([]byte, error) {
19463	objectMap := make(map[string]interface{})
19464	return json.Marshal(objectMap)
19465}
19466
19467// ManagedServerSecurityAlertPolicyListResultIterator provides access to a complete listing of
19468// ManagedServerSecurityAlertPolicy values.
19469type ManagedServerSecurityAlertPolicyListResultIterator struct {
19470	i    int
19471	page ManagedServerSecurityAlertPolicyListResultPage
19472}
19473
19474// NextWithContext advances to the next value.  If there was an error making
19475// the request the iterator does not advance and the error is returned.
19476func (iter *ManagedServerSecurityAlertPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
19477	if tracing.IsEnabled() {
19478		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedServerSecurityAlertPolicyListResultIterator.NextWithContext")
19479		defer func() {
19480			sc := -1
19481			if iter.Response().Response.Response != nil {
19482				sc = iter.Response().Response.Response.StatusCode
19483			}
19484			tracing.EndSpan(ctx, sc, err)
19485		}()
19486	}
19487	iter.i++
19488	if iter.i < len(iter.page.Values()) {
19489		return nil
19490	}
19491	err = iter.page.NextWithContext(ctx)
19492	if err != nil {
19493		iter.i--
19494		return err
19495	}
19496	iter.i = 0
19497	return nil
19498}
19499
19500// Next advances to the next value.  If there was an error making
19501// the request the iterator does not advance and the error is returned.
19502// Deprecated: Use NextWithContext() instead.
19503func (iter *ManagedServerSecurityAlertPolicyListResultIterator) Next() error {
19504	return iter.NextWithContext(context.Background())
19505}
19506
19507// NotDone returns true if the enumeration should be started or is not yet complete.
19508func (iter ManagedServerSecurityAlertPolicyListResultIterator) NotDone() bool {
19509	return iter.page.NotDone() && iter.i < len(iter.page.Values())
19510}
19511
19512// Response returns the raw server response from the last page request.
19513func (iter ManagedServerSecurityAlertPolicyListResultIterator) Response() ManagedServerSecurityAlertPolicyListResult {
19514	return iter.page.Response()
19515}
19516
19517// Value returns the current value or a zero-initialized value if the
19518// iterator has advanced beyond the end of the collection.
19519func (iter ManagedServerSecurityAlertPolicyListResultIterator) Value() ManagedServerSecurityAlertPolicy {
19520	if !iter.page.NotDone() {
19521		return ManagedServerSecurityAlertPolicy{}
19522	}
19523	return iter.page.Values()[iter.i]
19524}
19525
19526// Creates a new instance of the ManagedServerSecurityAlertPolicyListResultIterator type.
19527func NewManagedServerSecurityAlertPolicyListResultIterator(page ManagedServerSecurityAlertPolicyListResultPage) ManagedServerSecurityAlertPolicyListResultIterator {
19528	return ManagedServerSecurityAlertPolicyListResultIterator{page: page}
19529}
19530
19531// IsEmpty returns true if the ListResult contains no values.
19532func (mssaplr ManagedServerSecurityAlertPolicyListResult) IsEmpty() bool {
19533	return mssaplr.Value == nil || len(*mssaplr.Value) == 0
19534}
19535
19536// hasNextLink returns true if the NextLink is not empty.
19537func (mssaplr ManagedServerSecurityAlertPolicyListResult) hasNextLink() bool {
19538	return mssaplr.NextLink != nil && len(*mssaplr.NextLink) != 0
19539}
19540
19541// managedServerSecurityAlertPolicyListResultPreparer prepares a request to retrieve the next set of results.
19542// It returns nil if no more results exist.
19543func (mssaplr ManagedServerSecurityAlertPolicyListResult) managedServerSecurityAlertPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
19544	if !mssaplr.hasNextLink() {
19545		return nil, nil
19546	}
19547	return autorest.Prepare((&http.Request{}).WithContext(ctx),
19548		autorest.AsJSON(),
19549		autorest.AsGet(),
19550		autorest.WithBaseURL(to.String(mssaplr.NextLink)))
19551}
19552
19553// ManagedServerSecurityAlertPolicyListResultPage contains a page of ManagedServerSecurityAlertPolicy
19554// values.
19555type ManagedServerSecurityAlertPolicyListResultPage struct {
19556	fn      func(context.Context, ManagedServerSecurityAlertPolicyListResult) (ManagedServerSecurityAlertPolicyListResult, error)
19557	mssaplr ManagedServerSecurityAlertPolicyListResult
19558}
19559
19560// NextWithContext advances to the next page of values.  If there was an error making
19561// the request the page does not advance and the error is returned.
19562func (page *ManagedServerSecurityAlertPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
19563	if tracing.IsEnabled() {
19564		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedServerSecurityAlertPolicyListResultPage.NextWithContext")
19565		defer func() {
19566			sc := -1
19567			if page.Response().Response.Response != nil {
19568				sc = page.Response().Response.Response.StatusCode
19569			}
19570			tracing.EndSpan(ctx, sc, err)
19571		}()
19572	}
19573	for {
19574		next, err := page.fn(ctx, page.mssaplr)
19575		if err != nil {
19576			return err
19577		}
19578		page.mssaplr = next
19579		if !next.hasNextLink() || !next.IsEmpty() {
19580			break
19581		}
19582	}
19583	return nil
19584}
19585
19586// Next advances to the next page of values.  If there was an error making
19587// the request the page does not advance and the error is returned.
19588// Deprecated: Use NextWithContext() instead.
19589func (page *ManagedServerSecurityAlertPolicyListResultPage) Next() error {
19590	return page.NextWithContext(context.Background())
19591}
19592
19593// NotDone returns true if the page enumeration should be started or is not yet complete.
19594func (page ManagedServerSecurityAlertPolicyListResultPage) NotDone() bool {
19595	return !page.mssaplr.IsEmpty()
19596}
19597
19598// Response returns the raw server response from the last page request.
19599func (page ManagedServerSecurityAlertPolicyListResultPage) Response() ManagedServerSecurityAlertPolicyListResult {
19600	return page.mssaplr
19601}
19602
19603// Values returns the slice of values for the current page or nil if there are no values.
19604func (page ManagedServerSecurityAlertPolicyListResultPage) Values() []ManagedServerSecurityAlertPolicy {
19605	if page.mssaplr.IsEmpty() {
19606		return nil
19607	}
19608	return *page.mssaplr.Value
19609}
19610
19611// Creates a new instance of the ManagedServerSecurityAlertPolicyListResultPage type.
19612func NewManagedServerSecurityAlertPolicyListResultPage(cur ManagedServerSecurityAlertPolicyListResult, getNextPage func(context.Context, ManagedServerSecurityAlertPolicyListResult) (ManagedServerSecurityAlertPolicyListResult, error)) ManagedServerSecurityAlertPolicyListResultPage {
19613	return ManagedServerSecurityAlertPolicyListResultPage{
19614		fn:      getNextPage,
19615		mssaplr: cur,
19616	}
19617}
19618
19619// ManagedTransparentDataEncryption a managed database transparent data encryption state.
19620type ManagedTransparentDataEncryption struct {
19621	autorest.Response `json:"-"`
19622	// ManagedTransparentDataEncryptionProperties - Resource properties.
19623	*ManagedTransparentDataEncryptionProperties `json:"properties,omitempty"`
19624	// ID - READ-ONLY; Resource ID.
19625	ID *string `json:"id,omitempty"`
19626	// Name - READ-ONLY; Resource name.
19627	Name *string `json:"name,omitempty"`
19628	// Type - READ-ONLY; Resource type.
19629	Type *string `json:"type,omitempty"`
19630}
19631
19632// MarshalJSON is the custom marshaler for ManagedTransparentDataEncryption.
19633func (mtde ManagedTransparentDataEncryption) MarshalJSON() ([]byte, error) {
19634	objectMap := make(map[string]interface{})
19635	if mtde.ManagedTransparentDataEncryptionProperties != nil {
19636		objectMap["properties"] = mtde.ManagedTransparentDataEncryptionProperties
19637	}
19638	return json.Marshal(objectMap)
19639}
19640
19641// UnmarshalJSON is the custom unmarshaler for ManagedTransparentDataEncryption struct.
19642func (mtde *ManagedTransparentDataEncryption) UnmarshalJSON(body []byte) error {
19643	var m map[string]*json.RawMessage
19644	err := json.Unmarshal(body, &m)
19645	if err != nil {
19646		return err
19647	}
19648	for k, v := range m {
19649		switch k {
19650		case "properties":
19651			if v != nil {
19652				var managedTransparentDataEncryptionProperties ManagedTransparentDataEncryptionProperties
19653				err = json.Unmarshal(*v, &managedTransparentDataEncryptionProperties)
19654				if err != nil {
19655					return err
19656				}
19657				mtde.ManagedTransparentDataEncryptionProperties = &managedTransparentDataEncryptionProperties
19658			}
19659		case "id":
19660			if v != nil {
19661				var ID string
19662				err = json.Unmarshal(*v, &ID)
19663				if err != nil {
19664					return err
19665				}
19666				mtde.ID = &ID
19667			}
19668		case "name":
19669			if v != nil {
19670				var name string
19671				err = json.Unmarshal(*v, &name)
19672				if err != nil {
19673					return err
19674				}
19675				mtde.Name = &name
19676			}
19677		case "type":
19678			if v != nil {
19679				var typeVar string
19680				err = json.Unmarshal(*v, &typeVar)
19681				if err != nil {
19682					return err
19683				}
19684				mtde.Type = &typeVar
19685			}
19686		}
19687	}
19688
19689	return nil
19690}
19691
19692// ManagedTransparentDataEncryptionListResult a list of managed transparent data encryptions
19693type ManagedTransparentDataEncryptionListResult struct {
19694	autorest.Response `json:"-"`
19695	// Value - READ-ONLY; Array of results.
19696	Value *[]ManagedTransparentDataEncryption `json:"value,omitempty"`
19697	// NextLink - READ-ONLY; Link to retrieve next page of results.
19698	NextLink *string `json:"nextLink,omitempty"`
19699}
19700
19701// MarshalJSON is the custom marshaler for ManagedTransparentDataEncryptionListResult.
19702func (mtdelr ManagedTransparentDataEncryptionListResult) MarshalJSON() ([]byte, error) {
19703	objectMap := make(map[string]interface{})
19704	return json.Marshal(objectMap)
19705}
19706
19707// ManagedTransparentDataEncryptionListResultIterator provides access to a complete listing of
19708// ManagedTransparentDataEncryption values.
19709type ManagedTransparentDataEncryptionListResultIterator struct {
19710	i    int
19711	page ManagedTransparentDataEncryptionListResultPage
19712}
19713
19714// NextWithContext advances to the next value.  If there was an error making
19715// the request the iterator does not advance and the error is returned.
19716func (iter *ManagedTransparentDataEncryptionListResultIterator) NextWithContext(ctx context.Context) (err error) {
19717	if tracing.IsEnabled() {
19718		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedTransparentDataEncryptionListResultIterator.NextWithContext")
19719		defer func() {
19720			sc := -1
19721			if iter.Response().Response.Response != nil {
19722				sc = iter.Response().Response.Response.StatusCode
19723			}
19724			tracing.EndSpan(ctx, sc, err)
19725		}()
19726	}
19727	iter.i++
19728	if iter.i < len(iter.page.Values()) {
19729		return nil
19730	}
19731	err = iter.page.NextWithContext(ctx)
19732	if err != nil {
19733		iter.i--
19734		return err
19735	}
19736	iter.i = 0
19737	return nil
19738}
19739
19740// Next advances to the next value.  If there was an error making
19741// the request the iterator does not advance and the error is returned.
19742// Deprecated: Use NextWithContext() instead.
19743func (iter *ManagedTransparentDataEncryptionListResultIterator) Next() error {
19744	return iter.NextWithContext(context.Background())
19745}
19746
19747// NotDone returns true if the enumeration should be started or is not yet complete.
19748func (iter ManagedTransparentDataEncryptionListResultIterator) NotDone() bool {
19749	return iter.page.NotDone() && iter.i < len(iter.page.Values())
19750}
19751
19752// Response returns the raw server response from the last page request.
19753func (iter ManagedTransparentDataEncryptionListResultIterator) Response() ManagedTransparentDataEncryptionListResult {
19754	return iter.page.Response()
19755}
19756
19757// Value returns the current value or a zero-initialized value if the
19758// iterator has advanced beyond the end of the collection.
19759func (iter ManagedTransparentDataEncryptionListResultIterator) Value() ManagedTransparentDataEncryption {
19760	if !iter.page.NotDone() {
19761		return ManagedTransparentDataEncryption{}
19762	}
19763	return iter.page.Values()[iter.i]
19764}
19765
19766// Creates a new instance of the ManagedTransparentDataEncryptionListResultIterator type.
19767func NewManagedTransparentDataEncryptionListResultIterator(page ManagedTransparentDataEncryptionListResultPage) ManagedTransparentDataEncryptionListResultIterator {
19768	return ManagedTransparentDataEncryptionListResultIterator{page: page}
19769}
19770
19771// IsEmpty returns true if the ListResult contains no values.
19772func (mtdelr ManagedTransparentDataEncryptionListResult) IsEmpty() bool {
19773	return mtdelr.Value == nil || len(*mtdelr.Value) == 0
19774}
19775
19776// hasNextLink returns true if the NextLink is not empty.
19777func (mtdelr ManagedTransparentDataEncryptionListResult) hasNextLink() bool {
19778	return mtdelr.NextLink != nil && len(*mtdelr.NextLink) != 0
19779}
19780
19781// managedTransparentDataEncryptionListResultPreparer prepares a request to retrieve the next set of results.
19782// It returns nil if no more results exist.
19783func (mtdelr ManagedTransparentDataEncryptionListResult) managedTransparentDataEncryptionListResultPreparer(ctx context.Context) (*http.Request, error) {
19784	if !mtdelr.hasNextLink() {
19785		return nil, nil
19786	}
19787	return autorest.Prepare((&http.Request{}).WithContext(ctx),
19788		autorest.AsJSON(),
19789		autorest.AsGet(),
19790		autorest.WithBaseURL(to.String(mtdelr.NextLink)))
19791}
19792
19793// ManagedTransparentDataEncryptionListResultPage contains a page of ManagedTransparentDataEncryption
19794// values.
19795type ManagedTransparentDataEncryptionListResultPage struct {
19796	fn     func(context.Context, ManagedTransparentDataEncryptionListResult) (ManagedTransparentDataEncryptionListResult, error)
19797	mtdelr ManagedTransparentDataEncryptionListResult
19798}
19799
19800// NextWithContext advances to the next page of values.  If there was an error making
19801// the request the page does not advance and the error is returned.
19802func (page *ManagedTransparentDataEncryptionListResultPage) NextWithContext(ctx context.Context) (err error) {
19803	if tracing.IsEnabled() {
19804		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedTransparentDataEncryptionListResultPage.NextWithContext")
19805		defer func() {
19806			sc := -1
19807			if page.Response().Response.Response != nil {
19808				sc = page.Response().Response.Response.StatusCode
19809			}
19810			tracing.EndSpan(ctx, sc, err)
19811		}()
19812	}
19813	for {
19814		next, err := page.fn(ctx, page.mtdelr)
19815		if err != nil {
19816			return err
19817		}
19818		page.mtdelr = next
19819		if !next.hasNextLink() || !next.IsEmpty() {
19820			break
19821		}
19822	}
19823	return nil
19824}
19825
19826// Next advances to the next page of values.  If there was an error making
19827// the request the page does not advance and the error is returned.
19828// Deprecated: Use NextWithContext() instead.
19829func (page *ManagedTransparentDataEncryptionListResultPage) Next() error {
19830	return page.NextWithContext(context.Background())
19831}
19832
19833// NotDone returns true if the page enumeration should be started or is not yet complete.
19834func (page ManagedTransparentDataEncryptionListResultPage) NotDone() bool {
19835	return !page.mtdelr.IsEmpty()
19836}
19837
19838// Response returns the raw server response from the last page request.
19839func (page ManagedTransparentDataEncryptionListResultPage) Response() ManagedTransparentDataEncryptionListResult {
19840	return page.mtdelr
19841}
19842
19843// Values returns the slice of values for the current page or nil if there are no values.
19844func (page ManagedTransparentDataEncryptionListResultPage) Values() []ManagedTransparentDataEncryption {
19845	if page.mtdelr.IsEmpty() {
19846		return nil
19847	}
19848	return *page.mtdelr.Value
19849}
19850
19851// Creates a new instance of the ManagedTransparentDataEncryptionListResultPage type.
19852func NewManagedTransparentDataEncryptionListResultPage(cur ManagedTransparentDataEncryptionListResult, getNextPage func(context.Context, ManagedTransparentDataEncryptionListResult) (ManagedTransparentDataEncryptionListResult, error)) ManagedTransparentDataEncryptionListResultPage {
19853	return ManagedTransparentDataEncryptionListResultPage{
19854		fn:     getNextPage,
19855		mtdelr: cur,
19856	}
19857}
19858
19859// ManagedTransparentDataEncryptionProperties properties of a transparent data encryption.
19860type ManagedTransparentDataEncryptionProperties struct {
19861	// State - Specifies the state of the transparent data encryption. Possible values include: 'TransparentDataEncryptionStateEnabled', 'TransparentDataEncryptionStateDisabled'
19862	State TransparentDataEncryptionState `json:"state,omitempty"`
19863}
19864
19865// MaxSizeCapability the maximum size capability.
19866type MaxSizeCapability struct {
19867	// Limit - READ-ONLY; The maximum size limit (see 'unit' for the units).
19868	Limit *int32 `json:"limit,omitempty"`
19869	// Unit - READ-ONLY; The units that the limit is expressed in. Possible values include: 'MaxSizeUnitMegabytes', 'MaxSizeUnitGigabytes', 'MaxSizeUnitTerabytes', 'MaxSizeUnitPetabytes'
19870	Unit MaxSizeUnit `json:"unit,omitempty"`
19871}
19872
19873// MarshalJSON is the custom marshaler for MaxSizeCapability.
19874func (msc MaxSizeCapability) MarshalJSON() ([]byte, error) {
19875	objectMap := make(map[string]interface{})
19876	return json.Marshal(objectMap)
19877}
19878
19879// MaxSizeRangeCapability the maximum size range capability.
19880type MaxSizeRangeCapability struct {
19881	// MinValue - READ-ONLY; Minimum value.
19882	MinValue *MaxSizeCapability `json:"minValue,omitempty"`
19883	// MaxValue - READ-ONLY; Maximum value.
19884	MaxValue *MaxSizeCapability `json:"maxValue,omitempty"`
19885	// ScaleSize - READ-ONLY; Scale/step size for discrete values between the minimum value and the maximum value.
19886	ScaleSize *MaxSizeCapability `json:"scaleSize,omitempty"`
19887	// LogSize - READ-ONLY; Size of transaction log.
19888	LogSize *LogSizeCapability `json:"logSize,omitempty"`
19889	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
19890	Status CapabilityStatus `json:"status,omitempty"`
19891	// Reason - The reason for the capability not being available.
19892	Reason *string `json:"reason,omitempty"`
19893}
19894
19895// MarshalJSON is the custom marshaler for MaxSizeRangeCapability.
19896func (msrc MaxSizeRangeCapability) MarshalJSON() ([]byte, error) {
19897	objectMap := make(map[string]interface{})
19898	if msrc.Reason != nil {
19899		objectMap["reason"] = msrc.Reason
19900	}
19901	return json.Marshal(objectMap)
19902}
19903
19904// Metric database metrics.
19905type Metric struct {
19906	// StartTime - READ-ONLY; The start time for the metric (ISO-8601 format).
19907	StartTime *date.Time `json:"startTime,omitempty"`
19908	// EndTime - READ-ONLY; The end time for the metric (ISO-8601 format).
19909	EndTime *date.Time `json:"endTime,omitempty"`
19910	// TimeGrain - READ-ONLY; The time step to be used to summarize the metric values.
19911	TimeGrain *string `json:"timeGrain,omitempty"`
19912	// Unit - READ-ONLY; The unit of the metric. Possible values include: 'UnitTypeCount', 'UnitTypeBytes', 'UnitTypeSeconds', 'UnitTypePercent', 'UnitTypeCountPerSecond', 'UnitTypeBytesPerSecond'
19913	Unit UnitType `json:"unit,omitempty"`
19914	// Name - READ-ONLY; The name information for the metric.
19915	Name *MetricName `json:"name,omitempty"`
19916	// MetricValues - READ-ONLY; The metric values for the specified time window and timestep.
19917	MetricValues *[]MetricValue `json:"metricValues,omitempty"`
19918}
19919
19920// MarshalJSON is the custom marshaler for Metric.
19921func (mVar Metric) MarshalJSON() ([]byte, error) {
19922	objectMap := make(map[string]interface{})
19923	return json.Marshal(objectMap)
19924}
19925
19926// MetricAvailability a metric availability value.
19927type MetricAvailability struct {
19928	// Retention - READ-ONLY; The length of retention for the database metric.
19929	Retention *string `json:"retention,omitempty"`
19930	// TimeGrain - READ-ONLY; The granularity of the database metric.
19931	TimeGrain *string `json:"timeGrain,omitempty"`
19932}
19933
19934// MarshalJSON is the custom marshaler for MetricAvailability.
19935func (ma MetricAvailability) MarshalJSON() ([]byte, error) {
19936	objectMap := make(map[string]interface{})
19937	return json.Marshal(objectMap)
19938}
19939
19940// MetricDefinition a database metric definition.
19941type MetricDefinition struct {
19942	// Name - READ-ONLY; The name information for the metric.
19943	Name *MetricName `json:"name,omitempty"`
19944	// PrimaryAggregationType - READ-ONLY; The primary aggregation type defining how metric values are displayed. Possible values include: 'PrimaryAggregationTypeNone', 'PrimaryAggregationTypeAverage', 'PrimaryAggregationTypeCount', 'PrimaryAggregationTypeMinimum', 'PrimaryAggregationTypeMaximum', 'PrimaryAggregationTypeTotal'
19945	PrimaryAggregationType PrimaryAggregationType `json:"primaryAggregationType,omitempty"`
19946	// ResourceURI - READ-ONLY; The resource uri of the database.
19947	ResourceURI *string `json:"resourceUri,omitempty"`
19948	// Unit - READ-ONLY; The unit of the metric. Possible values include: 'UnitDefinitionTypeCount', 'UnitDefinitionTypeBytes', 'UnitDefinitionTypeSeconds', 'UnitDefinitionTypePercent', 'UnitDefinitionTypeCountPerSecond', 'UnitDefinitionTypeBytesPerSecond'
19949	Unit UnitDefinitionType `json:"unit,omitempty"`
19950	// MetricAvailabilities - READ-ONLY; The list of database metric availabilities for the metric.
19951	MetricAvailabilities *[]MetricAvailability `json:"metricAvailabilities,omitempty"`
19952}
19953
19954// MarshalJSON is the custom marshaler for MetricDefinition.
19955func (md MetricDefinition) MarshalJSON() ([]byte, error) {
19956	objectMap := make(map[string]interface{})
19957	return json.Marshal(objectMap)
19958}
19959
19960// MetricDefinitionListResult the response to a list database metric definitions request.
19961type MetricDefinitionListResult struct {
19962	autorest.Response `json:"-"`
19963	// Value - The list of metric definitions for the database.
19964	Value *[]MetricDefinition `json:"value,omitempty"`
19965}
19966
19967// MetricListResult the response to a list database metrics request.
19968type MetricListResult struct {
19969	autorest.Response `json:"-"`
19970	// Value - The list of metrics for the database.
19971	Value *[]Metric `json:"value,omitempty"`
19972}
19973
19974// MetricName a database metric name.
19975type MetricName struct {
19976	// Value - READ-ONLY; The name of the database metric.
19977	Value *string `json:"value,omitempty"`
19978	// LocalizedValue - READ-ONLY; The friendly name of the database metric.
19979	LocalizedValue *string `json:"localizedValue,omitempty"`
19980}
19981
19982// MarshalJSON is the custom marshaler for MetricName.
19983func (mn MetricName) MarshalJSON() ([]byte, error) {
19984	objectMap := make(map[string]interface{})
19985	return json.Marshal(objectMap)
19986}
19987
19988// MetricValue represents database metrics.
19989type MetricValue struct {
19990	// Count - READ-ONLY; The number of values for the metric.
19991	Count *float64 `json:"count,omitempty"`
19992	// Average - READ-ONLY; The average value of the metric.
19993	Average *float64 `json:"average,omitempty"`
19994	// Maximum - READ-ONLY; The max value of the metric.
19995	Maximum *float64 `json:"maximum,omitempty"`
19996	// Minimum - READ-ONLY; The min value of the metric.
19997	Minimum *float64 `json:"minimum,omitempty"`
19998	// Timestamp - READ-ONLY; The metric timestamp (ISO-8601 format).
19999	Timestamp *date.Time `json:"timestamp,omitempty"`
20000	// Total - READ-ONLY; The total value of the metric.
20001	Total *float64 `json:"total,omitempty"`
20002}
20003
20004// MarshalJSON is the custom marshaler for MetricValue.
20005func (mv MetricValue) MarshalJSON() ([]byte, error) {
20006	objectMap := make(map[string]interface{})
20007	return json.Marshal(objectMap)
20008}
20009
20010// MinCapacityCapability the min capacity capability
20011type MinCapacityCapability struct {
20012	// Value - READ-ONLY; Min capacity value
20013	Value *float64 `json:"value,omitempty"`
20014	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
20015	Status CapabilityStatus `json:"status,omitempty"`
20016	// Reason - The reason for the capability not being available.
20017	Reason *string `json:"reason,omitempty"`
20018}
20019
20020// MarshalJSON is the custom marshaler for MinCapacityCapability.
20021func (mcc MinCapacityCapability) MarshalJSON() ([]byte, error) {
20022	objectMap := make(map[string]interface{})
20023	if mcc.Reason != nil {
20024		objectMap["reason"] = mcc.Reason
20025	}
20026	return json.Marshal(objectMap)
20027}
20028
20029// Name ARM Usage Name
20030type Name struct {
20031	// Value - Usage name value
20032	Value *string `json:"value,omitempty"`
20033	// LocalizedValue - Usage name localized value.
20034	LocalizedValue *string `json:"localizedValue,omitempty"`
20035}
20036
20037// NetworkIsolationSettings contains the ARM resources for which to create private endpoint connection.
20038type NetworkIsolationSettings struct {
20039	// StorageAccountResourceID - The resource id for the storage account used to store BACPAC file. If set, private endpoint connection will be created for the storage account. Must match storage account used for StorageUri parameter.
20040	StorageAccountResourceID *string `json:"storageAccountResourceId,omitempty"`
20041	// SQLServerResourceID - The resource id for the SQL server which is the target of this request. If set, private endpoint connection will be created for the SQL server. Must match server which is target of the operation.
20042	SQLServerResourceID *string `json:"sqlServerResourceId,omitempty"`
20043}
20044
20045// Operation SQL REST API operation definition.
20046type Operation struct {
20047	// Name - READ-ONLY; The name of the operation being performed on this particular object.
20048	Name *string `json:"name,omitempty"`
20049	// Display - READ-ONLY; The localized display information for this particular operation / action.
20050	Display *OperationDisplay `json:"display,omitempty"`
20051	// Origin - READ-ONLY; The intended executor of the operation. Possible values include: 'OperationOriginUser', 'OperationOriginSystem'
20052	Origin OperationOrigin `json:"origin,omitempty"`
20053	// Properties - READ-ONLY; Additional descriptions for the operation.
20054	Properties map[string]interface{} `json:"properties"`
20055}
20056
20057// MarshalJSON is the custom marshaler for Operation.
20058func (o Operation) MarshalJSON() ([]byte, error) {
20059	objectMap := make(map[string]interface{})
20060	return json.Marshal(objectMap)
20061}
20062
20063// OperationDisplay display metadata associated with the operation.
20064type OperationDisplay struct {
20065	// Provider - READ-ONLY; The localized friendly form of the resource provider name.
20066	Provider *string `json:"provider,omitempty"`
20067	// Resource - READ-ONLY; The localized friendly form of the resource type related to this action/operation.
20068	Resource *string `json:"resource,omitempty"`
20069	// Operation - READ-ONLY; The localized friendly name for the operation.
20070	Operation *string `json:"operation,omitempty"`
20071	// Description - READ-ONLY; The localized friendly description for the operation.
20072	Description *string `json:"description,omitempty"`
20073}
20074
20075// MarshalJSON is the custom marshaler for OperationDisplay.
20076func (od OperationDisplay) MarshalJSON() ([]byte, error) {
20077	objectMap := make(map[string]interface{})
20078	return json.Marshal(objectMap)
20079}
20080
20081// OperationImpact the impact of an operation, both in absolute and relative terms.
20082type OperationImpact struct {
20083	// Name - READ-ONLY; The name of the impact dimension.
20084	Name *string `json:"name,omitempty"`
20085	// Unit - READ-ONLY; The unit in which estimated impact to dimension is measured.
20086	Unit *string `json:"unit,omitempty"`
20087	// ChangeValueAbsolute - READ-ONLY; The absolute impact to dimension.
20088	ChangeValueAbsolute *float64 `json:"changeValueAbsolute,omitempty"`
20089	// ChangeValueRelative - READ-ONLY; The relative impact to dimension (null if not applicable)
20090	ChangeValueRelative *float64 `json:"changeValueRelative,omitempty"`
20091}
20092
20093// MarshalJSON is the custom marshaler for OperationImpact.
20094func (oi OperationImpact) MarshalJSON() ([]byte, error) {
20095	objectMap := make(map[string]interface{})
20096	return json.Marshal(objectMap)
20097}
20098
20099// OperationListResult result of the request to list SQL operations.
20100type OperationListResult struct {
20101	autorest.Response `json:"-"`
20102	// Value - READ-ONLY; Array of results.
20103	Value *[]Operation `json:"value,omitempty"`
20104	// NextLink - READ-ONLY; Link to retrieve next page of results.
20105	NextLink *string `json:"nextLink,omitempty"`
20106}
20107
20108// MarshalJSON is the custom marshaler for OperationListResult.
20109func (olr OperationListResult) MarshalJSON() ([]byte, error) {
20110	objectMap := make(map[string]interface{})
20111	return json.Marshal(objectMap)
20112}
20113
20114// OperationListResultIterator provides access to a complete listing of Operation values.
20115type OperationListResultIterator struct {
20116	i    int
20117	page OperationListResultPage
20118}
20119
20120// NextWithContext advances to the next value.  If there was an error making
20121// the request the iterator does not advance and the error is returned.
20122func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
20123	if tracing.IsEnabled() {
20124		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext")
20125		defer func() {
20126			sc := -1
20127			if iter.Response().Response.Response != nil {
20128				sc = iter.Response().Response.Response.StatusCode
20129			}
20130			tracing.EndSpan(ctx, sc, err)
20131		}()
20132	}
20133	iter.i++
20134	if iter.i < len(iter.page.Values()) {
20135		return nil
20136	}
20137	err = iter.page.NextWithContext(ctx)
20138	if err != nil {
20139		iter.i--
20140		return err
20141	}
20142	iter.i = 0
20143	return nil
20144}
20145
20146// Next advances to the next value.  If there was an error making
20147// the request the iterator does not advance and the error is returned.
20148// Deprecated: Use NextWithContext() instead.
20149func (iter *OperationListResultIterator) Next() error {
20150	return iter.NextWithContext(context.Background())
20151}
20152
20153// NotDone returns true if the enumeration should be started or is not yet complete.
20154func (iter OperationListResultIterator) NotDone() bool {
20155	return iter.page.NotDone() && iter.i < len(iter.page.Values())
20156}
20157
20158// Response returns the raw server response from the last page request.
20159func (iter OperationListResultIterator) Response() OperationListResult {
20160	return iter.page.Response()
20161}
20162
20163// Value returns the current value or a zero-initialized value if the
20164// iterator has advanced beyond the end of the collection.
20165func (iter OperationListResultIterator) Value() Operation {
20166	if !iter.page.NotDone() {
20167		return Operation{}
20168	}
20169	return iter.page.Values()[iter.i]
20170}
20171
20172// Creates a new instance of the OperationListResultIterator type.
20173func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
20174	return OperationListResultIterator{page: page}
20175}
20176
20177// IsEmpty returns true if the ListResult contains no values.
20178func (olr OperationListResult) IsEmpty() bool {
20179	return olr.Value == nil || len(*olr.Value) == 0
20180}
20181
20182// hasNextLink returns true if the NextLink is not empty.
20183func (olr OperationListResult) hasNextLink() bool {
20184	return olr.NextLink != nil && len(*olr.NextLink) != 0
20185}
20186
20187// operationListResultPreparer prepares a request to retrieve the next set of results.
20188// It returns nil if no more results exist.
20189func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) {
20190	if !olr.hasNextLink() {
20191		return nil, nil
20192	}
20193	return autorest.Prepare((&http.Request{}).WithContext(ctx),
20194		autorest.AsJSON(),
20195		autorest.AsGet(),
20196		autorest.WithBaseURL(to.String(olr.NextLink)))
20197}
20198
20199// OperationListResultPage contains a page of Operation values.
20200type OperationListResultPage struct {
20201	fn  func(context.Context, OperationListResult) (OperationListResult, error)
20202	olr OperationListResult
20203}
20204
20205// NextWithContext advances to the next page of values.  If there was an error making
20206// the request the page does not advance and the error is returned.
20207func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) {
20208	if tracing.IsEnabled() {
20209		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext")
20210		defer func() {
20211			sc := -1
20212			if page.Response().Response.Response != nil {
20213				sc = page.Response().Response.Response.StatusCode
20214			}
20215			tracing.EndSpan(ctx, sc, err)
20216		}()
20217	}
20218	for {
20219		next, err := page.fn(ctx, page.olr)
20220		if err != nil {
20221			return err
20222		}
20223		page.olr = next
20224		if !next.hasNextLink() || !next.IsEmpty() {
20225			break
20226		}
20227	}
20228	return nil
20229}
20230
20231// Next advances to the next page of values.  If there was an error making
20232// the request the page does not advance and the error is returned.
20233// Deprecated: Use NextWithContext() instead.
20234func (page *OperationListResultPage) Next() error {
20235	return page.NextWithContext(context.Background())
20236}
20237
20238// NotDone returns true if the page enumeration should be started or is not yet complete.
20239func (page OperationListResultPage) NotDone() bool {
20240	return !page.olr.IsEmpty()
20241}
20242
20243// Response returns the raw server response from the last page request.
20244func (page OperationListResultPage) Response() OperationListResult {
20245	return page.olr
20246}
20247
20248// Values returns the slice of values for the current page or nil if there are no values.
20249func (page OperationListResultPage) Values() []Operation {
20250	if page.olr.IsEmpty() {
20251		return nil
20252	}
20253	return *page.olr.Value
20254}
20255
20256// Creates a new instance of the OperationListResultPage type.
20257func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage {
20258	return OperationListResultPage{
20259		fn:  getNextPage,
20260		olr: cur,
20261	}
20262}
20263
20264// OperationsHealth operations health status in a location.
20265type OperationsHealth struct {
20266	// OperationsHealthProperties - Resource properties.
20267	*OperationsHealthProperties `json:"properties,omitempty"`
20268	// ID - READ-ONLY; Resource ID.
20269	ID *string `json:"id,omitempty"`
20270	// Name - READ-ONLY; Resource name.
20271	Name *string `json:"name,omitempty"`
20272	// Type - READ-ONLY; Resource type.
20273	Type *string `json:"type,omitempty"`
20274}
20275
20276// MarshalJSON is the custom marshaler for OperationsHealth.
20277func (oh OperationsHealth) MarshalJSON() ([]byte, error) {
20278	objectMap := make(map[string]interface{})
20279	if oh.OperationsHealthProperties != nil {
20280		objectMap["properties"] = oh.OperationsHealthProperties
20281	}
20282	return json.Marshal(objectMap)
20283}
20284
20285// UnmarshalJSON is the custom unmarshaler for OperationsHealth struct.
20286func (oh *OperationsHealth) UnmarshalJSON(body []byte) error {
20287	var m map[string]*json.RawMessage
20288	err := json.Unmarshal(body, &m)
20289	if err != nil {
20290		return err
20291	}
20292	for k, v := range m {
20293		switch k {
20294		case "properties":
20295			if v != nil {
20296				var operationsHealthProperties OperationsHealthProperties
20297				err = json.Unmarshal(*v, &operationsHealthProperties)
20298				if err != nil {
20299					return err
20300				}
20301				oh.OperationsHealthProperties = &operationsHealthProperties
20302			}
20303		case "id":
20304			if v != nil {
20305				var ID string
20306				err = json.Unmarshal(*v, &ID)
20307				if err != nil {
20308					return err
20309				}
20310				oh.ID = &ID
20311			}
20312		case "name":
20313			if v != nil {
20314				var name string
20315				err = json.Unmarshal(*v, &name)
20316				if err != nil {
20317					return err
20318				}
20319				oh.Name = &name
20320			}
20321		case "type":
20322			if v != nil {
20323				var typeVar string
20324				err = json.Unmarshal(*v, &typeVar)
20325				if err != nil {
20326					return err
20327				}
20328				oh.Type = &typeVar
20329			}
20330		}
20331	}
20332
20333	return nil
20334}
20335
20336// OperationsHealthListResult a list of service health statuses in a location.
20337type OperationsHealthListResult struct {
20338	autorest.Response `json:"-"`
20339	// Value - READ-ONLY; Array of results.
20340	Value *[]OperationsHealth `json:"value,omitempty"`
20341	// NextLink - READ-ONLY; Link to retrieve next page of results.
20342	NextLink *string `json:"nextLink,omitempty"`
20343}
20344
20345// MarshalJSON is the custom marshaler for OperationsHealthListResult.
20346func (ohlr OperationsHealthListResult) MarshalJSON() ([]byte, error) {
20347	objectMap := make(map[string]interface{})
20348	return json.Marshal(objectMap)
20349}
20350
20351// OperationsHealthListResultIterator provides access to a complete listing of OperationsHealth values.
20352type OperationsHealthListResultIterator struct {
20353	i    int
20354	page OperationsHealthListResultPage
20355}
20356
20357// NextWithContext advances to the next value.  If there was an error making
20358// the request the iterator does not advance and the error is returned.
20359func (iter *OperationsHealthListResultIterator) NextWithContext(ctx context.Context) (err error) {
20360	if tracing.IsEnabled() {
20361		ctx = tracing.StartSpan(ctx, fqdn+"/OperationsHealthListResultIterator.NextWithContext")
20362		defer func() {
20363			sc := -1
20364			if iter.Response().Response.Response != nil {
20365				sc = iter.Response().Response.Response.StatusCode
20366			}
20367			tracing.EndSpan(ctx, sc, err)
20368		}()
20369	}
20370	iter.i++
20371	if iter.i < len(iter.page.Values()) {
20372		return nil
20373	}
20374	err = iter.page.NextWithContext(ctx)
20375	if err != nil {
20376		iter.i--
20377		return err
20378	}
20379	iter.i = 0
20380	return nil
20381}
20382
20383// Next advances to the next value.  If there was an error making
20384// the request the iterator does not advance and the error is returned.
20385// Deprecated: Use NextWithContext() instead.
20386func (iter *OperationsHealthListResultIterator) Next() error {
20387	return iter.NextWithContext(context.Background())
20388}
20389
20390// NotDone returns true if the enumeration should be started or is not yet complete.
20391func (iter OperationsHealthListResultIterator) NotDone() bool {
20392	return iter.page.NotDone() && iter.i < len(iter.page.Values())
20393}
20394
20395// Response returns the raw server response from the last page request.
20396func (iter OperationsHealthListResultIterator) Response() OperationsHealthListResult {
20397	return iter.page.Response()
20398}
20399
20400// Value returns the current value or a zero-initialized value if the
20401// iterator has advanced beyond the end of the collection.
20402func (iter OperationsHealthListResultIterator) Value() OperationsHealth {
20403	if !iter.page.NotDone() {
20404		return OperationsHealth{}
20405	}
20406	return iter.page.Values()[iter.i]
20407}
20408
20409// Creates a new instance of the OperationsHealthListResultIterator type.
20410func NewOperationsHealthListResultIterator(page OperationsHealthListResultPage) OperationsHealthListResultIterator {
20411	return OperationsHealthListResultIterator{page: page}
20412}
20413
20414// IsEmpty returns true if the ListResult contains no values.
20415func (ohlr OperationsHealthListResult) IsEmpty() bool {
20416	return ohlr.Value == nil || len(*ohlr.Value) == 0
20417}
20418
20419// hasNextLink returns true if the NextLink is not empty.
20420func (ohlr OperationsHealthListResult) hasNextLink() bool {
20421	return ohlr.NextLink != nil && len(*ohlr.NextLink) != 0
20422}
20423
20424// operationsHealthListResultPreparer prepares a request to retrieve the next set of results.
20425// It returns nil if no more results exist.
20426func (ohlr OperationsHealthListResult) operationsHealthListResultPreparer(ctx context.Context) (*http.Request, error) {
20427	if !ohlr.hasNextLink() {
20428		return nil, nil
20429	}
20430	return autorest.Prepare((&http.Request{}).WithContext(ctx),
20431		autorest.AsJSON(),
20432		autorest.AsGet(),
20433		autorest.WithBaseURL(to.String(ohlr.NextLink)))
20434}
20435
20436// OperationsHealthListResultPage contains a page of OperationsHealth values.
20437type OperationsHealthListResultPage struct {
20438	fn   func(context.Context, OperationsHealthListResult) (OperationsHealthListResult, error)
20439	ohlr OperationsHealthListResult
20440}
20441
20442// NextWithContext advances to the next page of values.  If there was an error making
20443// the request the page does not advance and the error is returned.
20444func (page *OperationsHealthListResultPage) NextWithContext(ctx context.Context) (err error) {
20445	if tracing.IsEnabled() {
20446		ctx = tracing.StartSpan(ctx, fqdn+"/OperationsHealthListResultPage.NextWithContext")
20447		defer func() {
20448			sc := -1
20449			if page.Response().Response.Response != nil {
20450				sc = page.Response().Response.Response.StatusCode
20451			}
20452			tracing.EndSpan(ctx, sc, err)
20453		}()
20454	}
20455	for {
20456		next, err := page.fn(ctx, page.ohlr)
20457		if err != nil {
20458			return err
20459		}
20460		page.ohlr = next
20461		if !next.hasNextLink() || !next.IsEmpty() {
20462			break
20463		}
20464	}
20465	return nil
20466}
20467
20468// Next advances to the next page of values.  If there was an error making
20469// the request the page does not advance and the error is returned.
20470// Deprecated: Use NextWithContext() instead.
20471func (page *OperationsHealthListResultPage) Next() error {
20472	return page.NextWithContext(context.Background())
20473}
20474
20475// NotDone returns true if the page enumeration should be started or is not yet complete.
20476func (page OperationsHealthListResultPage) NotDone() bool {
20477	return !page.ohlr.IsEmpty()
20478}
20479
20480// Response returns the raw server response from the last page request.
20481func (page OperationsHealthListResultPage) Response() OperationsHealthListResult {
20482	return page.ohlr
20483}
20484
20485// Values returns the slice of values for the current page or nil if there are no values.
20486func (page OperationsHealthListResultPage) Values() []OperationsHealth {
20487	if page.ohlr.IsEmpty() {
20488		return nil
20489	}
20490	return *page.ohlr.Value
20491}
20492
20493// Creates a new instance of the OperationsHealthListResultPage type.
20494func NewOperationsHealthListResultPage(cur OperationsHealthListResult, getNextPage func(context.Context, OperationsHealthListResult) (OperationsHealthListResult, error)) OperationsHealthListResultPage {
20495	return OperationsHealthListResultPage{
20496		fn:   getNextPage,
20497		ohlr: cur,
20498	}
20499}
20500
20501// OperationsHealthProperties properties of an operation health.
20502type OperationsHealthProperties struct {
20503	// Name - READ-ONLY; Operation name for the service
20504	Name *string `json:"name,omitempty"`
20505	// Health - READ-ONLY; Operation health status of the service.
20506	Health *string `json:"health,omitempty"`
20507	// Description - READ-ONLY; Health status description.
20508	Description *string `json:"description,omitempty"`
20509}
20510
20511// MarshalJSON is the custom marshaler for OperationsHealthProperties.
20512func (ohp OperationsHealthProperties) MarshalJSON() ([]byte, error) {
20513	objectMap := make(map[string]interface{})
20514	return json.Marshal(objectMap)
20515}
20516
20517// OutboundFirewallRule an Azure SQL DB Server Outbound Firewall Rule.
20518type OutboundFirewallRule struct {
20519	autorest.Response `json:"-"`
20520	// OutboundFirewallRuleProperties - Resource properties.
20521	*OutboundFirewallRuleProperties `json:"properties,omitempty"`
20522	// ID - READ-ONLY; Resource ID.
20523	ID *string `json:"id,omitempty"`
20524	// Name - READ-ONLY; Resource name.
20525	Name *string `json:"name,omitempty"`
20526	// Type - READ-ONLY; Resource type.
20527	Type *string `json:"type,omitempty"`
20528}
20529
20530// MarshalJSON is the custom marshaler for OutboundFirewallRule.
20531func (ofr OutboundFirewallRule) MarshalJSON() ([]byte, error) {
20532	objectMap := make(map[string]interface{})
20533	if ofr.OutboundFirewallRuleProperties != nil {
20534		objectMap["properties"] = ofr.OutboundFirewallRuleProperties
20535	}
20536	return json.Marshal(objectMap)
20537}
20538
20539// UnmarshalJSON is the custom unmarshaler for OutboundFirewallRule struct.
20540func (ofr *OutboundFirewallRule) UnmarshalJSON(body []byte) error {
20541	var m map[string]*json.RawMessage
20542	err := json.Unmarshal(body, &m)
20543	if err != nil {
20544		return err
20545	}
20546	for k, v := range m {
20547		switch k {
20548		case "properties":
20549			if v != nil {
20550				var outboundFirewallRuleProperties OutboundFirewallRuleProperties
20551				err = json.Unmarshal(*v, &outboundFirewallRuleProperties)
20552				if err != nil {
20553					return err
20554				}
20555				ofr.OutboundFirewallRuleProperties = &outboundFirewallRuleProperties
20556			}
20557		case "id":
20558			if v != nil {
20559				var ID string
20560				err = json.Unmarshal(*v, &ID)
20561				if err != nil {
20562					return err
20563				}
20564				ofr.ID = &ID
20565			}
20566		case "name":
20567			if v != nil {
20568				var name string
20569				err = json.Unmarshal(*v, &name)
20570				if err != nil {
20571					return err
20572				}
20573				ofr.Name = &name
20574			}
20575		case "type":
20576			if v != nil {
20577				var typeVar string
20578				err = json.Unmarshal(*v, &typeVar)
20579				if err != nil {
20580					return err
20581				}
20582				ofr.Type = &typeVar
20583			}
20584		}
20585	}
20586
20587	return nil
20588}
20589
20590// OutboundFirewallRuleListResult a list of outbound rules.
20591type OutboundFirewallRuleListResult struct {
20592	autorest.Response `json:"-"`
20593	// Value - READ-ONLY; Array of results.
20594	Value *[]OutboundFirewallRule `json:"value,omitempty"`
20595	// NextLink - READ-ONLY; Link to retrieve next page of results.
20596	NextLink *string `json:"nextLink,omitempty"`
20597}
20598
20599// MarshalJSON is the custom marshaler for OutboundFirewallRuleListResult.
20600func (ofrlr OutboundFirewallRuleListResult) MarshalJSON() ([]byte, error) {
20601	objectMap := make(map[string]interface{})
20602	return json.Marshal(objectMap)
20603}
20604
20605// OutboundFirewallRuleListResultIterator provides access to a complete listing of OutboundFirewallRule
20606// values.
20607type OutboundFirewallRuleListResultIterator struct {
20608	i    int
20609	page OutboundFirewallRuleListResultPage
20610}
20611
20612// NextWithContext advances to the next value.  If there was an error making
20613// the request the iterator does not advance and the error is returned.
20614func (iter *OutboundFirewallRuleListResultIterator) NextWithContext(ctx context.Context) (err error) {
20615	if tracing.IsEnabled() {
20616		ctx = tracing.StartSpan(ctx, fqdn+"/OutboundFirewallRuleListResultIterator.NextWithContext")
20617		defer func() {
20618			sc := -1
20619			if iter.Response().Response.Response != nil {
20620				sc = iter.Response().Response.Response.StatusCode
20621			}
20622			tracing.EndSpan(ctx, sc, err)
20623		}()
20624	}
20625	iter.i++
20626	if iter.i < len(iter.page.Values()) {
20627		return nil
20628	}
20629	err = iter.page.NextWithContext(ctx)
20630	if err != nil {
20631		iter.i--
20632		return err
20633	}
20634	iter.i = 0
20635	return nil
20636}
20637
20638// Next advances to the next value.  If there was an error making
20639// the request the iterator does not advance and the error is returned.
20640// Deprecated: Use NextWithContext() instead.
20641func (iter *OutboundFirewallRuleListResultIterator) Next() error {
20642	return iter.NextWithContext(context.Background())
20643}
20644
20645// NotDone returns true if the enumeration should be started or is not yet complete.
20646func (iter OutboundFirewallRuleListResultIterator) NotDone() bool {
20647	return iter.page.NotDone() && iter.i < len(iter.page.Values())
20648}
20649
20650// Response returns the raw server response from the last page request.
20651func (iter OutboundFirewallRuleListResultIterator) Response() OutboundFirewallRuleListResult {
20652	return iter.page.Response()
20653}
20654
20655// Value returns the current value or a zero-initialized value if the
20656// iterator has advanced beyond the end of the collection.
20657func (iter OutboundFirewallRuleListResultIterator) Value() OutboundFirewallRule {
20658	if !iter.page.NotDone() {
20659		return OutboundFirewallRule{}
20660	}
20661	return iter.page.Values()[iter.i]
20662}
20663
20664// Creates a new instance of the OutboundFirewallRuleListResultIterator type.
20665func NewOutboundFirewallRuleListResultIterator(page OutboundFirewallRuleListResultPage) OutboundFirewallRuleListResultIterator {
20666	return OutboundFirewallRuleListResultIterator{page: page}
20667}
20668
20669// IsEmpty returns true if the ListResult contains no values.
20670func (ofrlr OutboundFirewallRuleListResult) IsEmpty() bool {
20671	return ofrlr.Value == nil || len(*ofrlr.Value) == 0
20672}
20673
20674// hasNextLink returns true if the NextLink is not empty.
20675func (ofrlr OutboundFirewallRuleListResult) hasNextLink() bool {
20676	return ofrlr.NextLink != nil && len(*ofrlr.NextLink) != 0
20677}
20678
20679// outboundFirewallRuleListResultPreparer prepares a request to retrieve the next set of results.
20680// It returns nil if no more results exist.
20681func (ofrlr OutboundFirewallRuleListResult) outboundFirewallRuleListResultPreparer(ctx context.Context) (*http.Request, error) {
20682	if !ofrlr.hasNextLink() {
20683		return nil, nil
20684	}
20685	return autorest.Prepare((&http.Request{}).WithContext(ctx),
20686		autorest.AsJSON(),
20687		autorest.AsGet(),
20688		autorest.WithBaseURL(to.String(ofrlr.NextLink)))
20689}
20690
20691// OutboundFirewallRuleListResultPage contains a page of OutboundFirewallRule values.
20692type OutboundFirewallRuleListResultPage struct {
20693	fn    func(context.Context, OutboundFirewallRuleListResult) (OutboundFirewallRuleListResult, error)
20694	ofrlr OutboundFirewallRuleListResult
20695}
20696
20697// NextWithContext advances to the next page of values.  If there was an error making
20698// the request the page does not advance and the error is returned.
20699func (page *OutboundFirewallRuleListResultPage) NextWithContext(ctx context.Context) (err error) {
20700	if tracing.IsEnabled() {
20701		ctx = tracing.StartSpan(ctx, fqdn+"/OutboundFirewallRuleListResultPage.NextWithContext")
20702		defer func() {
20703			sc := -1
20704			if page.Response().Response.Response != nil {
20705				sc = page.Response().Response.Response.StatusCode
20706			}
20707			tracing.EndSpan(ctx, sc, err)
20708		}()
20709	}
20710	for {
20711		next, err := page.fn(ctx, page.ofrlr)
20712		if err != nil {
20713			return err
20714		}
20715		page.ofrlr = next
20716		if !next.hasNextLink() || !next.IsEmpty() {
20717			break
20718		}
20719	}
20720	return nil
20721}
20722
20723// Next advances to the next page of values.  If there was an error making
20724// the request the page does not advance and the error is returned.
20725// Deprecated: Use NextWithContext() instead.
20726func (page *OutboundFirewallRuleListResultPage) Next() error {
20727	return page.NextWithContext(context.Background())
20728}
20729
20730// NotDone returns true if the page enumeration should be started or is not yet complete.
20731func (page OutboundFirewallRuleListResultPage) NotDone() bool {
20732	return !page.ofrlr.IsEmpty()
20733}
20734
20735// Response returns the raw server response from the last page request.
20736func (page OutboundFirewallRuleListResultPage) Response() OutboundFirewallRuleListResult {
20737	return page.ofrlr
20738}
20739
20740// Values returns the slice of values for the current page or nil if there are no values.
20741func (page OutboundFirewallRuleListResultPage) Values() []OutboundFirewallRule {
20742	if page.ofrlr.IsEmpty() {
20743		return nil
20744	}
20745	return *page.ofrlr.Value
20746}
20747
20748// Creates a new instance of the OutboundFirewallRuleListResultPage type.
20749func NewOutboundFirewallRuleListResultPage(cur OutboundFirewallRuleListResult, getNextPage func(context.Context, OutboundFirewallRuleListResult) (OutboundFirewallRuleListResult, error)) OutboundFirewallRuleListResultPage {
20750	return OutboundFirewallRuleListResultPage{
20751		fn:    getNextPage,
20752		ofrlr: cur,
20753	}
20754}
20755
20756// OutboundFirewallRuleProperties the properties of an outbound firewall rule.
20757type OutboundFirewallRuleProperties struct {
20758	// ProvisioningState - READ-ONLY; The state of the outbound rule.
20759	ProvisioningState *string `json:"provisioningState,omitempty"`
20760}
20761
20762// MarshalJSON is the custom marshaler for OutboundFirewallRuleProperties.
20763func (ofrp OutboundFirewallRuleProperties) MarshalJSON() ([]byte, error) {
20764	objectMap := make(map[string]interface{})
20765	return json.Marshal(objectMap)
20766}
20767
20768// OutboundFirewallRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
20769// long-running operation.
20770type OutboundFirewallRulesCreateOrUpdateFuture struct {
20771	azure.FutureAPI
20772	// Result returns the result of the asynchronous operation.
20773	// If the operation has not completed it will return an error.
20774	Result func(OutboundFirewallRulesClient) (OutboundFirewallRule, error)
20775}
20776
20777// UnmarshalJSON is the custom unmarshaller for CreateFuture.
20778func (future *OutboundFirewallRulesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
20779	var azFuture azure.Future
20780	if err := json.Unmarshal(body, &azFuture); err != nil {
20781		return err
20782	}
20783	future.FutureAPI = &azFuture
20784	future.Result = future.result
20785	return nil
20786}
20787
20788// result is the default implementation for OutboundFirewallRulesCreateOrUpdateFuture.Result.
20789func (future *OutboundFirewallRulesCreateOrUpdateFuture) result(client OutboundFirewallRulesClient) (ofr OutboundFirewallRule, err error) {
20790	var done bool
20791	done, err = future.DoneWithContext(context.Background(), client)
20792	if err != nil {
20793		err = autorest.NewErrorWithError(err, "sql.OutboundFirewallRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
20794		return
20795	}
20796	if !done {
20797		ofr.Response.Response = future.Response()
20798		err = azure.NewAsyncOpIncompleteError("sql.OutboundFirewallRulesCreateOrUpdateFuture")
20799		return
20800	}
20801	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
20802	if ofr.Response.Response, err = future.GetResult(sender); err == nil && ofr.Response.Response.StatusCode != http.StatusNoContent {
20803		ofr, err = client.CreateOrUpdateResponder(ofr.Response.Response)
20804		if err != nil {
20805			err = autorest.NewErrorWithError(err, "sql.OutboundFirewallRulesCreateOrUpdateFuture", "Result", ofr.Response.Response, "Failure responding to request")
20806		}
20807	}
20808	return
20809}
20810
20811// OutboundFirewallRulesDeleteFuture an abstraction for monitoring and retrieving the results of a
20812// long-running operation.
20813type OutboundFirewallRulesDeleteFuture struct {
20814	azure.FutureAPI
20815	// Result returns the result of the asynchronous operation.
20816	// If the operation has not completed it will return an error.
20817	Result func(OutboundFirewallRulesClient) (autorest.Response, error)
20818}
20819
20820// UnmarshalJSON is the custom unmarshaller for CreateFuture.
20821func (future *OutboundFirewallRulesDeleteFuture) UnmarshalJSON(body []byte) error {
20822	var azFuture azure.Future
20823	if err := json.Unmarshal(body, &azFuture); err != nil {
20824		return err
20825	}
20826	future.FutureAPI = &azFuture
20827	future.Result = future.result
20828	return nil
20829}
20830
20831// result is the default implementation for OutboundFirewallRulesDeleteFuture.Result.
20832func (future *OutboundFirewallRulesDeleteFuture) result(client OutboundFirewallRulesClient) (ar autorest.Response, err error) {
20833	var done bool
20834	done, err = future.DoneWithContext(context.Background(), client)
20835	if err != nil {
20836		err = autorest.NewErrorWithError(err, "sql.OutboundFirewallRulesDeleteFuture", "Result", future.Response(), "Polling failure")
20837		return
20838	}
20839	if !done {
20840		ar.Response = future.Response()
20841		err = azure.NewAsyncOpIncompleteError("sql.OutboundFirewallRulesDeleteFuture")
20842		return
20843	}
20844	ar.Response = future.Response()
20845	return
20846}
20847
20848// PartnerInfo partner server information for the failover group.
20849type PartnerInfo struct {
20850	// ID - Resource identifier of the partner server.
20851	ID *string `json:"id,omitempty"`
20852	// Location - READ-ONLY; Geo location of the partner server.
20853	Location *string `json:"location,omitempty"`
20854	// ReplicationRole - READ-ONLY; Replication role of the partner server. Possible values include: 'FailoverGroupReplicationRolePrimary', 'FailoverGroupReplicationRoleSecondary'
20855	ReplicationRole FailoverGroupReplicationRole `json:"replicationRole,omitempty"`
20856}
20857
20858// MarshalJSON is the custom marshaler for PartnerInfo.
20859func (pi PartnerInfo) MarshalJSON() ([]byte, error) {
20860	objectMap := make(map[string]interface{})
20861	if pi.ID != nil {
20862		objectMap["id"] = pi.ID
20863	}
20864	return json.Marshal(objectMap)
20865}
20866
20867// PartnerRegionInfo partner region information for the failover group.
20868type PartnerRegionInfo struct {
20869	// Location - Geo location of the partner managed instances.
20870	Location *string `json:"location,omitempty"`
20871	// ReplicationRole - READ-ONLY; Replication role of the partner managed instances. Possible values include: 'InstanceFailoverGroupReplicationRolePrimary', 'InstanceFailoverGroupReplicationRoleSecondary'
20872	ReplicationRole InstanceFailoverGroupReplicationRole `json:"replicationRole,omitempty"`
20873}
20874
20875// MarshalJSON is the custom marshaler for PartnerRegionInfo.
20876func (pri PartnerRegionInfo) MarshalJSON() ([]byte, error) {
20877	objectMap := make(map[string]interface{})
20878	if pri.Location != nil {
20879		objectMap["location"] = pri.Location
20880	}
20881	return json.Marshal(objectMap)
20882}
20883
20884// PerformanceLevelCapability the performance level capability.
20885type PerformanceLevelCapability struct {
20886	// Value - READ-ONLY; Performance level value.
20887	Value *float64 `json:"value,omitempty"`
20888	// Unit - READ-ONLY; Unit type used to measure performance level. Possible values include: 'PerformanceLevelUnitDTU', 'PerformanceLevelUnitVCores'
20889	Unit PerformanceLevelUnit `json:"unit,omitempty"`
20890}
20891
20892// MarshalJSON is the custom marshaler for PerformanceLevelCapability.
20893func (plc PerformanceLevelCapability) MarshalJSON() ([]byte, error) {
20894	objectMap := make(map[string]interface{})
20895	return json.Marshal(objectMap)
20896}
20897
20898// PrivateEndpointConnection a private endpoint connection
20899type PrivateEndpointConnection struct {
20900	autorest.Response `json:"-"`
20901	// PrivateEndpointConnectionProperties - Resource properties.
20902	*PrivateEndpointConnectionProperties `json:"properties,omitempty"`
20903	// ID - READ-ONLY; Resource ID.
20904	ID *string `json:"id,omitempty"`
20905	// Name - READ-ONLY; Resource name.
20906	Name *string `json:"name,omitempty"`
20907	// Type - READ-ONLY; Resource type.
20908	Type *string `json:"type,omitempty"`
20909}
20910
20911// MarshalJSON is the custom marshaler for PrivateEndpointConnection.
20912func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) {
20913	objectMap := make(map[string]interface{})
20914	if pec.PrivateEndpointConnectionProperties != nil {
20915		objectMap["properties"] = pec.PrivateEndpointConnectionProperties
20916	}
20917	return json.Marshal(objectMap)
20918}
20919
20920// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct.
20921func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error {
20922	var m map[string]*json.RawMessage
20923	err := json.Unmarshal(body, &m)
20924	if err != nil {
20925		return err
20926	}
20927	for k, v := range m {
20928		switch k {
20929		case "properties":
20930			if v != nil {
20931				var privateEndpointConnectionProperties PrivateEndpointConnectionProperties
20932				err = json.Unmarshal(*v, &privateEndpointConnectionProperties)
20933				if err != nil {
20934					return err
20935				}
20936				pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties
20937			}
20938		case "id":
20939			if v != nil {
20940				var ID string
20941				err = json.Unmarshal(*v, &ID)
20942				if err != nil {
20943					return err
20944				}
20945				pec.ID = &ID
20946			}
20947		case "name":
20948			if v != nil {
20949				var name string
20950				err = json.Unmarshal(*v, &name)
20951				if err != nil {
20952					return err
20953				}
20954				pec.Name = &name
20955			}
20956		case "type":
20957			if v != nil {
20958				var typeVar string
20959				err = json.Unmarshal(*v, &typeVar)
20960				if err != nil {
20961					return err
20962				}
20963				pec.Type = &typeVar
20964			}
20965		}
20966	}
20967
20968	return nil
20969}
20970
20971// PrivateEndpointConnectionListResult a list of private endpoint connections.
20972type PrivateEndpointConnectionListResult struct {
20973	autorest.Response `json:"-"`
20974	// Value - READ-ONLY; Array of results.
20975	Value *[]PrivateEndpointConnection `json:"value,omitempty"`
20976	// NextLink - READ-ONLY; Link to retrieve next page of results.
20977	NextLink *string `json:"nextLink,omitempty"`
20978}
20979
20980// MarshalJSON is the custom marshaler for PrivateEndpointConnectionListResult.
20981func (peclr PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) {
20982	objectMap := make(map[string]interface{})
20983	return json.Marshal(objectMap)
20984}
20985
20986// PrivateEndpointConnectionListResultIterator provides access to a complete listing of
20987// PrivateEndpointConnection values.
20988type PrivateEndpointConnectionListResultIterator struct {
20989	i    int
20990	page PrivateEndpointConnectionListResultPage
20991}
20992
20993// NextWithContext advances to the next value.  If there was an error making
20994// the request the iterator does not advance and the error is returned.
20995func (iter *PrivateEndpointConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) {
20996	if tracing.IsEnabled() {
20997		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultIterator.NextWithContext")
20998		defer func() {
20999			sc := -1
21000			if iter.Response().Response.Response != nil {
21001				sc = iter.Response().Response.Response.StatusCode
21002			}
21003			tracing.EndSpan(ctx, sc, err)
21004		}()
21005	}
21006	iter.i++
21007	if iter.i < len(iter.page.Values()) {
21008		return nil
21009	}
21010	err = iter.page.NextWithContext(ctx)
21011	if err != nil {
21012		iter.i--
21013		return err
21014	}
21015	iter.i = 0
21016	return nil
21017}
21018
21019// Next advances to the next value.  If there was an error making
21020// the request the iterator does not advance and the error is returned.
21021// Deprecated: Use NextWithContext() instead.
21022func (iter *PrivateEndpointConnectionListResultIterator) Next() error {
21023	return iter.NextWithContext(context.Background())
21024}
21025
21026// NotDone returns true if the enumeration should be started or is not yet complete.
21027func (iter PrivateEndpointConnectionListResultIterator) NotDone() bool {
21028	return iter.page.NotDone() && iter.i < len(iter.page.Values())
21029}
21030
21031// Response returns the raw server response from the last page request.
21032func (iter PrivateEndpointConnectionListResultIterator) Response() PrivateEndpointConnectionListResult {
21033	return iter.page.Response()
21034}
21035
21036// Value returns the current value or a zero-initialized value if the
21037// iterator has advanced beyond the end of the collection.
21038func (iter PrivateEndpointConnectionListResultIterator) Value() PrivateEndpointConnection {
21039	if !iter.page.NotDone() {
21040		return PrivateEndpointConnection{}
21041	}
21042	return iter.page.Values()[iter.i]
21043}
21044
21045// Creates a new instance of the PrivateEndpointConnectionListResultIterator type.
21046func NewPrivateEndpointConnectionListResultIterator(page PrivateEndpointConnectionListResultPage) PrivateEndpointConnectionListResultIterator {
21047	return PrivateEndpointConnectionListResultIterator{page: page}
21048}
21049
21050// IsEmpty returns true if the ListResult contains no values.
21051func (peclr PrivateEndpointConnectionListResult) IsEmpty() bool {
21052	return peclr.Value == nil || len(*peclr.Value) == 0
21053}
21054
21055// hasNextLink returns true if the NextLink is not empty.
21056func (peclr PrivateEndpointConnectionListResult) hasNextLink() bool {
21057	return peclr.NextLink != nil && len(*peclr.NextLink) != 0
21058}
21059
21060// privateEndpointConnectionListResultPreparer prepares a request to retrieve the next set of results.
21061// It returns nil if no more results exist.
21062func (peclr PrivateEndpointConnectionListResult) privateEndpointConnectionListResultPreparer(ctx context.Context) (*http.Request, error) {
21063	if !peclr.hasNextLink() {
21064		return nil, nil
21065	}
21066	return autorest.Prepare((&http.Request{}).WithContext(ctx),
21067		autorest.AsJSON(),
21068		autorest.AsGet(),
21069		autorest.WithBaseURL(to.String(peclr.NextLink)))
21070}
21071
21072// PrivateEndpointConnectionListResultPage contains a page of PrivateEndpointConnection values.
21073type PrivateEndpointConnectionListResultPage struct {
21074	fn    func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error)
21075	peclr PrivateEndpointConnectionListResult
21076}
21077
21078// NextWithContext advances to the next page of values.  If there was an error making
21079// the request the page does not advance and the error is returned.
21080func (page *PrivateEndpointConnectionListResultPage) NextWithContext(ctx context.Context) (err error) {
21081	if tracing.IsEnabled() {
21082		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultPage.NextWithContext")
21083		defer func() {
21084			sc := -1
21085			if page.Response().Response.Response != nil {
21086				sc = page.Response().Response.Response.StatusCode
21087			}
21088			tracing.EndSpan(ctx, sc, err)
21089		}()
21090	}
21091	for {
21092		next, err := page.fn(ctx, page.peclr)
21093		if err != nil {
21094			return err
21095		}
21096		page.peclr = next
21097		if !next.hasNextLink() || !next.IsEmpty() {
21098			break
21099		}
21100	}
21101	return nil
21102}
21103
21104// Next advances to the next page of values.  If there was an error making
21105// the request the page does not advance and the error is returned.
21106// Deprecated: Use NextWithContext() instead.
21107func (page *PrivateEndpointConnectionListResultPage) Next() error {
21108	return page.NextWithContext(context.Background())
21109}
21110
21111// NotDone returns true if the page enumeration should be started or is not yet complete.
21112func (page PrivateEndpointConnectionListResultPage) NotDone() bool {
21113	return !page.peclr.IsEmpty()
21114}
21115
21116// Response returns the raw server response from the last page request.
21117func (page PrivateEndpointConnectionListResultPage) Response() PrivateEndpointConnectionListResult {
21118	return page.peclr
21119}
21120
21121// Values returns the slice of values for the current page or nil if there are no values.
21122func (page PrivateEndpointConnectionListResultPage) Values() []PrivateEndpointConnection {
21123	if page.peclr.IsEmpty() {
21124		return nil
21125	}
21126	return *page.peclr.Value
21127}
21128
21129// Creates a new instance of the PrivateEndpointConnectionListResultPage type.
21130func NewPrivateEndpointConnectionListResultPage(cur PrivateEndpointConnectionListResult, getNextPage func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error)) PrivateEndpointConnectionListResultPage {
21131	return PrivateEndpointConnectionListResultPage{
21132		fn:    getNextPage,
21133		peclr: cur,
21134	}
21135}
21136
21137// PrivateEndpointConnectionProperties properties of a private endpoint connection.
21138type PrivateEndpointConnectionProperties struct {
21139	// PrivateEndpoint - Private endpoint which the connection belongs to.
21140	PrivateEndpoint *PrivateEndpointProperty `json:"privateEndpoint,omitempty"`
21141	// PrivateLinkServiceConnectionState - Connection state of the private endpoint connection.
21142	PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionStateProperty `json:"privateLinkServiceConnectionState,omitempty"`
21143	// ProvisioningState - READ-ONLY; State of the private endpoint connection. Possible values include: 'PrivateEndpointProvisioningStateApproving', 'PrivateEndpointProvisioningStateReady', 'PrivateEndpointProvisioningStateDropping', 'PrivateEndpointProvisioningStateFailed', 'PrivateEndpointProvisioningStateRejecting'
21144	ProvisioningState PrivateEndpointProvisioningState `json:"provisioningState,omitempty"`
21145}
21146
21147// MarshalJSON is the custom marshaler for PrivateEndpointConnectionProperties.
21148func (pecp PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) {
21149	objectMap := make(map[string]interface{})
21150	if pecp.PrivateEndpoint != nil {
21151		objectMap["privateEndpoint"] = pecp.PrivateEndpoint
21152	}
21153	if pecp.PrivateLinkServiceConnectionState != nil {
21154		objectMap["privateLinkServiceConnectionState"] = pecp.PrivateLinkServiceConnectionState
21155	}
21156	return json.Marshal(objectMap)
21157}
21158
21159// PrivateEndpointConnectionRequestStatus contains the private endpoint connection requests status.
21160type PrivateEndpointConnectionRequestStatus struct {
21161	// PrivateLinkServiceID - READ-ONLY; Resource id for which the private endpoint is created.
21162	PrivateLinkServiceID *string `json:"privateLinkServiceId,omitempty"`
21163	// PrivateEndpointConnectionName - READ-ONLY; The connection name for the private endpoint.
21164	PrivateEndpointConnectionName *string `json:"privateEndpointConnectionName,omitempty"`
21165	// Status - READ-ONLY; Status of this private endpoint connection.
21166	Status *string `json:"status,omitempty"`
21167}
21168
21169// MarshalJSON is the custom marshaler for PrivateEndpointConnectionRequestStatus.
21170func (pecrs PrivateEndpointConnectionRequestStatus) MarshalJSON() ([]byte, error) {
21171	objectMap := make(map[string]interface{})
21172	return json.Marshal(objectMap)
21173}
21174
21175// PrivateEndpointConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results
21176// of a long-running operation.
21177type PrivateEndpointConnectionsCreateOrUpdateFuture struct {
21178	azure.FutureAPI
21179	// Result returns the result of the asynchronous operation.
21180	// If the operation has not completed it will return an error.
21181	Result func(PrivateEndpointConnectionsClient) (PrivateEndpointConnection, error)
21182}
21183
21184// UnmarshalJSON is the custom unmarshaller for CreateFuture.
21185func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
21186	var azFuture azure.Future
21187	if err := json.Unmarshal(body, &azFuture); err != nil {
21188		return err
21189	}
21190	future.FutureAPI = &azFuture
21191	future.Result = future.result
21192	return nil
21193}
21194
21195// result is the default implementation for PrivateEndpointConnectionsCreateOrUpdateFuture.Result.
21196func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) result(client PrivateEndpointConnectionsClient) (pec PrivateEndpointConnection, err error) {
21197	var done bool
21198	done, err = future.DoneWithContext(context.Background(), client)
21199	if err != nil {
21200		err = autorest.NewErrorWithError(err, "sql.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
21201		return
21202	}
21203	if !done {
21204		pec.Response.Response = future.Response()
21205		err = azure.NewAsyncOpIncompleteError("sql.PrivateEndpointConnectionsCreateOrUpdateFuture")
21206		return
21207	}
21208	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
21209	if pec.Response.Response, err = future.GetResult(sender); err == nil && pec.Response.Response.StatusCode != http.StatusNoContent {
21210		pec, err = client.CreateOrUpdateResponder(pec.Response.Response)
21211		if err != nil {
21212			err = autorest.NewErrorWithError(err, "sql.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", pec.Response.Response, "Failure responding to request")
21213		}
21214	}
21215	return
21216}
21217
21218// PrivateEndpointConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a
21219// long-running operation.
21220type PrivateEndpointConnectionsDeleteFuture struct {
21221	azure.FutureAPI
21222	// Result returns the result of the asynchronous operation.
21223	// If the operation has not completed it will return an error.
21224	Result func(PrivateEndpointConnectionsClient) (autorest.Response, error)
21225}
21226
21227// UnmarshalJSON is the custom unmarshaller for CreateFuture.
21228func (future *PrivateEndpointConnectionsDeleteFuture) UnmarshalJSON(body []byte) error {
21229	var azFuture azure.Future
21230	if err := json.Unmarshal(body, &azFuture); err != nil {
21231		return err
21232	}
21233	future.FutureAPI = &azFuture
21234	future.Result = future.result
21235	return nil
21236}
21237
21238// result is the default implementation for PrivateEndpointConnectionsDeleteFuture.Result.
21239func (future *PrivateEndpointConnectionsDeleteFuture) result(client PrivateEndpointConnectionsClient) (ar autorest.Response, err error) {
21240	var done bool
21241	done, err = future.DoneWithContext(context.Background(), client)
21242	if err != nil {
21243		err = autorest.NewErrorWithError(err, "sql.PrivateEndpointConnectionsDeleteFuture", "Result", future.Response(), "Polling failure")
21244		return
21245	}
21246	if !done {
21247		ar.Response = future.Response()
21248		err = azure.NewAsyncOpIncompleteError("sql.PrivateEndpointConnectionsDeleteFuture")
21249		return
21250	}
21251	ar.Response = future.Response()
21252	return
21253}
21254
21255// PrivateEndpointProperty ...
21256type PrivateEndpointProperty struct {
21257	// ID - Resource id of the private endpoint.
21258	ID *string `json:"id,omitempty"`
21259}
21260
21261// PrivateLinkResource a private link resource
21262type PrivateLinkResource struct {
21263	autorest.Response `json:"-"`
21264	// Properties - READ-ONLY; The private link resource group id.
21265	Properties *PrivateLinkResourceProperties `json:"properties,omitempty"`
21266	// ID - READ-ONLY; Resource ID.
21267	ID *string `json:"id,omitempty"`
21268	// Name - READ-ONLY; Resource name.
21269	Name *string `json:"name,omitempty"`
21270	// Type - READ-ONLY; Resource type.
21271	Type *string `json:"type,omitempty"`
21272}
21273
21274// MarshalJSON is the custom marshaler for PrivateLinkResource.
21275func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) {
21276	objectMap := make(map[string]interface{})
21277	return json.Marshal(objectMap)
21278}
21279
21280// PrivateLinkResourceListResult a list of private link resources
21281type PrivateLinkResourceListResult struct {
21282	autorest.Response `json:"-"`
21283	// Value - READ-ONLY; Array of results.
21284	Value *[]PrivateLinkResource `json:"value,omitempty"`
21285	// NextLink - READ-ONLY; Link to retrieve next page of results.
21286	NextLink *string `json:"nextLink,omitempty"`
21287}
21288
21289// MarshalJSON is the custom marshaler for PrivateLinkResourceListResult.
21290func (plrlr PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) {
21291	objectMap := make(map[string]interface{})
21292	return json.Marshal(objectMap)
21293}
21294
21295// PrivateLinkResourceListResultIterator provides access to a complete listing of PrivateLinkResource
21296// values.
21297type PrivateLinkResourceListResultIterator struct {
21298	i    int
21299	page PrivateLinkResourceListResultPage
21300}
21301
21302// NextWithContext advances to the next value.  If there was an error making
21303// the request the iterator does not advance and the error is returned.
21304func (iter *PrivateLinkResourceListResultIterator) NextWithContext(ctx context.Context) (err error) {
21305	if tracing.IsEnabled() {
21306		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourceListResultIterator.NextWithContext")
21307		defer func() {
21308			sc := -1
21309			if iter.Response().Response.Response != nil {
21310				sc = iter.Response().Response.Response.StatusCode
21311			}
21312			tracing.EndSpan(ctx, sc, err)
21313		}()
21314	}
21315	iter.i++
21316	if iter.i < len(iter.page.Values()) {
21317		return nil
21318	}
21319	err = iter.page.NextWithContext(ctx)
21320	if err != nil {
21321		iter.i--
21322		return err
21323	}
21324	iter.i = 0
21325	return nil
21326}
21327
21328// Next advances to the next value.  If there was an error making
21329// the request the iterator does not advance and the error is returned.
21330// Deprecated: Use NextWithContext() instead.
21331func (iter *PrivateLinkResourceListResultIterator) Next() error {
21332	return iter.NextWithContext(context.Background())
21333}
21334
21335// NotDone returns true if the enumeration should be started or is not yet complete.
21336func (iter PrivateLinkResourceListResultIterator) NotDone() bool {
21337	return iter.page.NotDone() && iter.i < len(iter.page.Values())
21338}
21339
21340// Response returns the raw server response from the last page request.
21341func (iter PrivateLinkResourceListResultIterator) Response() PrivateLinkResourceListResult {
21342	return iter.page.Response()
21343}
21344
21345// Value returns the current value or a zero-initialized value if the
21346// iterator has advanced beyond the end of the collection.
21347func (iter PrivateLinkResourceListResultIterator) Value() PrivateLinkResource {
21348	if !iter.page.NotDone() {
21349		return PrivateLinkResource{}
21350	}
21351	return iter.page.Values()[iter.i]
21352}
21353
21354// Creates a new instance of the PrivateLinkResourceListResultIterator type.
21355func NewPrivateLinkResourceListResultIterator(page PrivateLinkResourceListResultPage) PrivateLinkResourceListResultIterator {
21356	return PrivateLinkResourceListResultIterator{page: page}
21357}
21358
21359// IsEmpty returns true if the ListResult contains no values.
21360func (plrlr PrivateLinkResourceListResult) IsEmpty() bool {
21361	return plrlr.Value == nil || len(*plrlr.Value) == 0
21362}
21363
21364// hasNextLink returns true if the NextLink is not empty.
21365func (plrlr PrivateLinkResourceListResult) hasNextLink() bool {
21366	return plrlr.NextLink != nil && len(*plrlr.NextLink) != 0
21367}
21368
21369// privateLinkResourceListResultPreparer prepares a request to retrieve the next set of results.
21370// It returns nil if no more results exist.
21371func (plrlr PrivateLinkResourceListResult) privateLinkResourceListResultPreparer(ctx context.Context) (*http.Request, error) {
21372	if !plrlr.hasNextLink() {
21373		return nil, nil
21374	}
21375	return autorest.Prepare((&http.Request{}).WithContext(ctx),
21376		autorest.AsJSON(),
21377		autorest.AsGet(),
21378		autorest.WithBaseURL(to.String(plrlr.NextLink)))
21379}
21380
21381// PrivateLinkResourceListResultPage contains a page of PrivateLinkResource values.
21382type PrivateLinkResourceListResultPage struct {
21383	fn    func(context.Context, PrivateLinkResourceListResult) (PrivateLinkResourceListResult, error)
21384	plrlr PrivateLinkResourceListResult
21385}
21386
21387// NextWithContext advances to the next page of values.  If there was an error making
21388// the request the page does not advance and the error is returned.
21389func (page *PrivateLinkResourceListResultPage) NextWithContext(ctx context.Context) (err error) {
21390	if tracing.IsEnabled() {
21391		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourceListResultPage.NextWithContext")
21392		defer func() {
21393			sc := -1
21394			if page.Response().Response.Response != nil {
21395				sc = page.Response().Response.Response.StatusCode
21396			}
21397			tracing.EndSpan(ctx, sc, err)
21398		}()
21399	}
21400	for {
21401		next, err := page.fn(ctx, page.plrlr)
21402		if err != nil {
21403			return err
21404		}
21405		page.plrlr = next
21406		if !next.hasNextLink() || !next.IsEmpty() {
21407			break
21408		}
21409	}
21410	return nil
21411}
21412
21413// Next advances to the next page of values.  If there was an error making
21414// the request the page does not advance and the error is returned.
21415// Deprecated: Use NextWithContext() instead.
21416func (page *PrivateLinkResourceListResultPage) Next() error {
21417	return page.NextWithContext(context.Background())
21418}
21419
21420// NotDone returns true if the page enumeration should be started or is not yet complete.
21421func (page PrivateLinkResourceListResultPage) NotDone() bool {
21422	return !page.plrlr.IsEmpty()
21423}
21424
21425// Response returns the raw server response from the last page request.
21426func (page PrivateLinkResourceListResultPage) Response() PrivateLinkResourceListResult {
21427	return page.plrlr
21428}
21429
21430// Values returns the slice of values for the current page or nil if there are no values.
21431func (page PrivateLinkResourceListResultPage) Values() []PrivateLinkResource {
21432	if page.plrlr.IsEmpty() {
21433		return nil
21434	}
21435	return *page.plrlr.Value
21436}
21437
21438// Creates a new instance of the PrivateLinkResourceListResultPage type.
21439func NewPrivateLinkResourceListResultPage(cur PrivateLinkResourceListResult, getNextPage func(context.Context, PrivateLinkResourceListResult) (PrivateLinkResourceListResult, error)) PrivateLinkResourceListResultPage {
21440	return PrivateLinkResourceListResultPage{
21441		fn:    getNextPage,
21442		plrlr: cur,
21443	}
21444}
21445
21446// PrivateLinkResourceProperties properties of a private link resource.
21447type PrivateLinkResourceProperties struct {
21448	// GroupID - READ-ONLY; The private link resource group id.
21449	GroupID *string `json:"groupId,omitempty"`
21450	// RequiredMembers - READ-ONLY; The private link resource required member names.
21451	RequiredMembers *[]string `json:"requiredMembers,omitempty"`
21452	// RequiredZoneNames - READ-ONLY; The private link resource required zone names.
21453	RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"`
21454}
21455
21456// MarshalJSON is the custom marshaler for PrivateLinkResourceProperties.
21457func (plrp PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) {
21458	objectMap := make(map[string]interface{})
21459	return json.Marshal(objectMap)
21460}
21461
21462// PrivateLinkServiceConnectionStateProperty ...
21463type PrivateLinkServiceConnectionStateProperty struct {
21464	// Status - The private link service connection status. Possible values include: 'PrivateLinkServiceConnectionStateStatusApproved', 'PrivateLinkServiceConnectionStateStatusPending', 'PrivateLinkServiceConnectionStateStatusRejected', 'PrivateLinkServiceConnectionStateStatusDisconnected'
21465	Status PrivateLinkServiceConnectionStateStatus `json:"status,omitempty"`
21466	// Description - The private link service connection description.
21467	Description *string `json:"description,omitempty"`
21468	// ActionsRequired - READ-ONLY; The actions required for private link service connection. Possible values include: 'PrivateLinkServiceConnectionStateActionsRequireNone'
21469	ActionsRequired PrivateLinkServiceConnectionStateActionsRequire `json:"actionsRequired,omitempty"`
21470}
21471
21472// MarshalJSON is the custom marshaler for PrivateLinkServiceConnectionStateProperty.
21473func (plscsp PrivateLinkServiceConnectionStateProperty) MarshalJSON() ([]byte, error) {
21474	objectMap := make(map[string]interface{})
21475	if plscsp.Status != "" {
21476		objectMap["status"] = plscsp.Status
21477	}
21478	if plscsp.Description != nil {
21479		objectMap["description"] = plscsp.Description
21480	}
21481	return json.Marshal(objectMap)
21482}
21483
21484// ProxyResource ARM proxy resource.
21485type ProxyResource struct {
21486	// ID - READ-ONLY; Resource ID.
21487	ID *string `json:"id,omitempty"`
21488	// Name - READ-ONLY; Resource name.
21489	Name *string `json:"name,omitempty"`
21490	// Type - READ-ONLY; Resource type.
21491	Type *string `json:"type,omitempty"`
21492}
21493
21494// MarshalJSON is the custom marshaler for ProxyResource.
21495func (pr ProxyResource) MarshalJSON() ([]byte, error) {
21496	objectMap := make(map[string]interface{})
21497	return json.Marshal(objectMap)
21498}
21499
21500// ProxyResourceWithWritableName ARM proxy resource.
21501type ProxyResourceWithWritableName struct {
21502	// ID - READ-ONLY; Resource ID.
21503	ID *string `json:"id,omitempty"`
21504	// Name - Resource name.
21505	Name *string `json:"name,omitempty"`
21506	// Type - READ-ONLY; Resource type.
21507	Type *string `json:"type,omitempty"`
21508}
21509
21510// MarshalJSON is the custom marshaler for ProxyResourceWithWritableName.
21511func (prwwn ProxyResourceWithWritableName) MarshalJSON() ([]byte, error) {
21512	objectMap := make(map[string]interface{})
21513	if prwwn.Name != nil {
21514		objectMap["name"] = prwwn.Name
21515	}
21516	return json.Marshal(objectMap)
21517}
21518
21519// QueryMetricInterval properties of a query metrics interval.
21520type QueryMetricInterval struct {
21521	// IntervalStartTime - READ-ONLY; The start time for the metric interval (ISO-8601 format).
21522	IntervalStartTime *string `json:"intervalStartTime,omitempty"`
21523	// IntervalType - READ-ONLY; Interval type (length). Possible values include: 'QueryTimeGrainTypePT1H', 'QueryTimeGrainTypeP1D'
21524	IntervalType QueryTimeGrainType `json:"intervalType,omitempty"`
21525	// ExecutionCount - READ-ONLY; Execution count of a query in this interval.
21526	ExecutionCount *int64 `json:"executionCount,omitempty"`
21527	// Metrics - List of metric objects for this interval
21528	Metrics *[]QueryMetricProperties `json:"metrics,omitempty"`
21529}
21530
21531// MarshalJSON is the custom marshaler for QueryMetricInterval.
21532func (qmi QueryMetricInterval) MarshalJSON() ([]byte, error) {
21533	objectMap := make(map[string]interface{})
21534	if qmi.Metrics != nil {
21535		objectMap["metrics"] = qmi.Metrics
21536	}
21537	return json.Marshal(objectMap)
21538}
21539
21540// QueryMetricProperties properties of a topquery metric in one interval.
21541type QueryMetricProperties struct {
21542	// Name - READ-ONLY; The name information for the metric.
21543	Name *string `json:"name,omitempty"`
21544	// DisplayName - READ-ONLY; The UI appropriate name for the metric.
21545	DisplayName *string `json:"displayName,omitempty"`
21546	// Unit - READ-ONLY; The unit of the metric. Possible values include: 'QueryMetricUnitTypePercentage', 'QueryMetricUnitTypeKB', 'QueryMetricUnitTypeMicroseconds', 'QueryMetricUnitTypeCount'
21547	Unit QueryMetricUnitType `json:"unit,omitempty"`
21548	// Value - READ-ONLY; The value of the metric.
21549	Value *float64 `json:"value,omitempty"`
21550	// Min - READ-ONLY; Metric value when min() aggregate function is used over the interval.
21551	Min *float64 `json:"min,omitempty"`
21552	// Max - READ-ONLY; Metric value when max() aggregate function is used over the interval.
21553	Max *float64 `json:"max,omitempty"`
21554	// Avg - READ-ONLY; Metric value when avg() aggregate function is used over the interval.
21555	Avg *float64 `json:"avg,omitempty"`
21556	// Sum - READ-ONLY; Metric value when sum() aggregate function is used over the interval.
21557	Sum *float64 `json:"sum,omitempty"`
21558	// Stdev - READ-ONLY; Metric value when stdev aggregate function is used over the interval.
21559	Stdev *float64 `json:"stdev,omitempty"`
21560}
21561
21562// MarshalJSON is the custom marshaler for QueryMetricProperties.
21563func (qmp QueryMetricProperties) MarshalJSON() ([]byte, error) {
21564	objectMap := make(map[string]interface{})
21565	return json.Marshal(objectMap)
21566}
21567
21568// QueryProperties properties of a database query.
21569type QueryProperties struct {
21570	// QueryText - Query text.
21571	QueryText *string `json:"queryText,omitempty"`
21572}
21573
21574// QueryStatistics ...
21575type QueryStatistics struct {
21576	// QueryStatisticsProperties - Resource properties.
21577	*QueryStatisticsProperties `json:"properties,omitempty"`
21578	// ID - READ-ONLY; Resource ID.
21579	ID *string `json:"id,omitempty"`
21580	// Name - READ-ONLY; Resource name.
21581	Name *string `json:"name,omitempty"`
21582	// Type - READ-ONLY; Resource type.
21583	Type *string `json:"type,omitempty"`
21584}
21585
21586// MarshalJSON is the custom marshaler for QueryStatistics.
21587func (qs QueryStatistics) MarshalJSON() ([]byte, error) {
21588	objectMap := make(map[string]interface{})
21589	if qs.QueryStatisticsProperties != nil {
21590		objectMap["properties"] = qs.QueryStatisticsProperties
21591	}
21592	return json.Marshal(objectMap)
21593}
21594
21595// UnmarshalJSON is the custom unmarshaler for QueryStatistics struct.
21596func (qs *QueryStatistics) UnmarshalJSON(body []byte) error {
21597	var m map[string]*json.RawMessage
21598	err := json.Unmarshal(body, &m)
21599	if err != nil {
21600		return err
21601	}
21602	for k, v := range m {
21603		switch k {
21604		case "properties":
21605			if v != nil {
21606				var queryStatisticsProperties QueryStatisticsProperties
21607				err = json.Unmarshal(*v, &queryStatisticsProperties)
21608				if err != nil {
21609					return err
21610				}
21611				qs.QueryStatisticsProperties = &queryStatisticsProperties
21612			}
21613		case "id":
21614			if v != nil {
21615				var ID string
21616				err = json.Unmarshal(*v, &ID)
21617				if err != nil {
21618					return err
21619				}
21620				qs.ID = &ID
21621			}
21622		case "name":
21623			if v != nil {
21624				var name string
21625				err = json.Unmarshal(*v, &name)
21626				if err != nil {
21627					return err
21628				}
21629				qs.Name = &name
21630			}
21631		case "type":
21632			if v != nil {
21633				var typeVar string
21634				err = json.Unmarshal(*v, &typeVar)
21635				if err != nil {
21636					return err
21637				}
21638				qs.Type = &typeVar
21639			}
21640		}
21641	}
21642
21643	return nil
21644}
21645
21646// QueryStatisticsProperties properties of a query execution statistics.
21647type QueryStatisticsProperties struct {
21648	// DatabaseName - READ-ONLY; Database name of the database in which this query was executed.
21649	DatabaseName *string `json:"databaseName,omitempty"`
21650	// QueryID - READ-ONLY; Unique query id (unique within one database).
21651	QueryID *string `json:"queryId,omitempty"`
21652	// StartTime - READ-ONLY; The start time for the metric (ISO-8601 format).
21653	StartTime *string `json:"startTime,omitempty"`
21654	// EndTime - READ-ONLY; The end time for the metric (ISO-8601 format).
21655	EndTime *string `json:"endTime,omitempty"`
21656	// Intervals - List of intervals with appropriate metric data
21657	Intervals *[]QueryMetricInterval `json:"intervals,omitempty"`
21658}
21659
21660// MarshalJSON is the custom marshaler for QueryStatisticsProperties.
21661func (qsp QueryStatisticsProperties) MarshalJSON() ([]byte, error) {
21662	objectMap := make(map[string]interface{})
21663	if qsp.Intervals != nil {
21664		objectMap["intervals"] = qsp.Intervals
21665	}
21666	return json.Marshal(objectMap)
21667}
21668
21669// ReadScaleCapability the read scale capability.
21670type ReadScaleCapability struct {
21671	// MaxNumberOfReplicas - READ-ONLY; The maximum number of read scale replicas.
21672	MaxNumberOfReplicas *int32 `json:"maxNumberOfReplicas,omitempty"`
21673	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
21674	Status CapabilityStatus `json:"status,omitempty"`
21675	// Reason - The reason for the capability not being available.
21676	Reason *string `json:"reason,omitempty"`
21677}
21678
21679// MarshalJSON is the custom marshaler for ReadScaleCapability.
21680func (rsc ReadScaleCapability) MarshalJSON() ([]byte, error) {
21681	objectMap := make(map[string]interface{})
21682	if rsc.Reason != nil {
21683		objectMap["reason"] = rsc.Reason
21684	}
21685	return json.Marshal(objectMap)
21686}
21687
21688// RecommendedAction database, Server or Elastic Pool Recommended Action.
21689type RecommendedAction struct {
21690	autorest.Response `json:"-"`
21691	// Kind - READ-ONLY; Resource kind.
21692	Kind *string `json:"kind,omitempty"`
21693	// Location - READ-ONLY; Resource location.
21694	Location *string `json:"location,omitempty"`
21695	// RecommendedActionProperties - Resource properties.
21696	*RecommendedActionProperties `json:"properties,omitempty"`
21697	// ID - READ-ONLY; Resource ID.
21698	ID *string `json:"id,omitempty"`
21699	// Name - READ-ONLY; Resource name.
21700	Name *string `json:"name,omitempty"`
21701	// Type - READ-ONLY; Resource type.
21702	Type *string `json:"type,omitempty"`
21703}
21704
21705// MarshalJSON is the custom marshaler for RecommendedAction.
21706func (ra RecommendedAction) MarshalJSON() ([]byte, error) {
21707	objectMap := make(map[string]interface{})
21708	if ra.RecommendedActionProperties != nil {
21709		objectMap["properties"] = ra.RecommendedActionProperties
21710	}
21711	return json.Marshal(objectMap)
21712}
21713
21714// UnmarshalJSON is the custom unmarshaler for RecommendedAction struct.
21715func (ra *RecommendedAction) UnmarshalJSON(body []byte) error {
21716	var m map[string]*json.RawMessage
21717	err := json.Unmarshal(body, &m)
21718	if err != nil {
21719		return err
21720	}
21721	for k, v := range m {
21722		switch k {
21723		case "kind":
21724			if v != nil {
21725				var kind string
21726				err = json.Unmarshal(*v, &kind)
21727				if err != nil {
21728					return err
21729				}
21730				ra.Kind = &kind
21731			}
21732		case "location":
21733			if v != nil {
21734				var location string
21735				err = json.Unmarshal(*v, &location)
21736				if err != nil {
21737					return err
21738				}
21739				ra.Location = &location
21740			}
21741		case "properties":
21742			if v != nil {
21743				var recommendedActionProperties RecommendedActionProperties
21744				err = json.Unmarshal(*v, &recommendedActionProperties)
21745				if err != nil {
21746					return err
21747				}
21748				ra.RecommendedActionProperties = &recommendedActionProperties
21749			}
21750		case "id":
21751			if v != nil {
21752				var ID string
21753				err = json.Unmarshal(*v, &ID)
21754				if err != nil {
21755					return err
21756				}
21757				ra.ID = &ID
21758			}
21759		case "name":
21760			if v != nil {
21761				var name string
21762				err = json.Unmarshal(*v, &name)
21763				if err != nil {
21764					return err
21765				}
21766				ra.Name = &name
21767			}
21768		case "type":
21769			if v != nil {
21770				var typeVar string
21771				err = json.Unmarshal(*v, &typeVar)
21772				if err != nil {
21773					return err
21774				}
21775				ra.Type = &typeVar
21776			}
21777		}
21778	}
21779
21780	return nil
21781}
21782
21783// RecommendedActionErrorInfo contains error information for an Azure SQL Database, Server or Elastic Pool
21784// Recommended Action.
21785type RecommendedActionErrorInfo struct {
21786	// ErrorCode - READ-ONLY; Gets the reason why the recommended action was put to error state. e.g., DatabaseHasQdsOff, IndexAlreadyExists
21787	ErrorCode *string `json:"errorCode,omitempty"`
21788	// IsRetryable - READ-ONLY; Gets whether the error could be ignored and recommended action could be retried. Possible values are: Yes/No. Possible values include: 'IsRetryableYes', 'IsRetryableNo'
21789	IsRetryable IsRetryable `json:"isRetryable,omitempty"`
21790}
21791
21792// MarshalJSON is the custom marshaler for RecommendedActionErrorInfo.
21793func (raei RecommendedActionErrorInfo) MarshalJSON() ([]byte, error) {
21794	objectMap := make(map[string]interface{})
21795	return json.Marshal(objectMap)
21796}
21797
21798// RecommendedActionImpactRecord contains information of estimated or observed impact on various metrics
21799// for an Azure SQL Database, Server or Elastic Pool Recommended Action.
21800type RecommendedActionImpactRecord struct {
21801	// DimensionName - READ-ONLY; Gets the name of the impact dimension. e.g., CPUChange, DiskSpaceChange, NumberOfQueriesAffected.
21802	DimensionName *string `json:"dimensionName,omitempty"`
21803	// Unit - READ-ONLY; Gets the name of the impact dimension. e.g., CPUChange, DiskSpaceChange, NumberOfQueriesAffected.
21804	Unit *string `json:"unit,omitempty"`
21805	// AbsoluteValue - READ-ONLY; Gets the absolute value of this dimension if applicable. e.g., Number of Queries affected
21806	AbsoluteValue *float64 `json:"absoluteValue,omitempty"`
21807	// ChangeValueAbsolute - READ-ONLY; Gets the absolute change in the value of this dimension. e.g., Absolute Disk space change in Megabytes
21808	ChangeValueAbsolute *float64 `json:"changeValueAbsolute,omitempty"`
21809	// ChangeValueRelative - READ-ONLY; Gets the relative change in the value of this dimension. e.g., Relative Disk space change in Percentage
21810	ChangeValueRelative *float64 `json:"changeValueRelative,omitempty"`
21811}
21812
21813// MarshalJSON is the custom marshaler for RecommendedActionImpactRecord.
21814func (rair RecommendedActionImpactRecord) MarshalJSON() ([]byte, error) {
21815	objectMap := make(map[string]interface{})
21816	return json.Marshal(objectMap)
21817}
21818
21819// RecommendedActionImplementationInfo contains information for manual implementation for an Azure SQL
21820// Database, Server or Elastic Pool Recommended Action.
21821type RecommendedActionImplementationInfo struct {
21822	// Method - READ-ONLY; Gets the method in which this recommended action can be manually implemented. e.g., TSql, AzurePowerShell. Possible values include: 'ImplementationMethodTSQL', 'ImplementationMethodAzurePowerShell'
21823	Method ImplementationMethod `json:"method,omitempty"`
21824	// Script - READ-ONLY; Gets the manual implementation script. e.g., T-SQL script that could be executed on the database.
21825	Script *string `json:"script,omitempty"`
21826}
21827
21828// MarshalJSON is the custom marshaler for RecommendedActionImplementationInfo.
21829func (raii RecommendedActionImplementationInfo) MarshalJSON() ([]byte, error) {
21830	objectMap := make(map[string]interface{})
21831	return json.Marshal(objectMap)
21832}
21833
21834// RecommendedActionMetricInfo contains time series of various impacted metrics for an Azure SQL Database,
21835// Server or Elastic Pool Recommended Action.
21836type RecommendedActionMetricInfo struct {
21837	// MetricName - READ-ONLY; Gets the name of the metric. e.g., CPU, Number of Queries.
21838	MetricName *string `json:"metricName,omitempty"`
21839	// Unit - READ-ONLY; Gets the unit in which metric is measured. e.g., DTU, Frequency
21840	Unit *string `json:"unit,omitempty"`
21841	// TimeGrain - READ-ONLY; Gets the duration of time interval for the value given by this MetricInfo. e.g., PT1H (1 hour)
21842	TimeGrain *string `json:"timeGrain,omitempty"`
21843	// StartTime - READ-ONLY; Gets the start time of time interval given by this MetricInfo.
21844	StartTime *date.Time `json:"startTime,omitempty"`
21845	// Value - READ-ONLY; Gets the value of the metric in the time interval given by this MetricInfo.
21846	Value *float64 `json:"value,omitempty"`
21847}
21848
21849// MarshalJSON is the custom marshaler for RecommendedActionMetricInfo.
21850func (rami RecommendedActionMetricInfo) MarshalJSON() ([]byte, error) {
21851	objectMap := make(map[string]interface{})
21852	return json.Marshal(objectMap)
21853}
21854
21855// RecommendedActionProperties properties for a Database, Server or Elastic Pool Recommended Action.
21856type RecommendedActionProperties struct {
21857	// RecommendationReason - READ-ONLY; Gets the reason for recommending this action. e.g., DuplicateIndex
21858	RecommendationReason *string `json:"recommendationReason,omitempty"`
21859	// ValidSince - READ-ONLY; Gets the time since when this recommended action is valid.
21860	ValidSince *date.Time `json:"validSince,omitempty"`
21861	// LastRefresh - READ-ONLY; Gets time when this recommended action was last refreshed.
21862	LastRefresh *date.Time `json:"lastRefresh,omitempty"`
21863	// State - Gets the info of the current state the recommended action is in.
21864	State *RecommendedActionStateInfo `json:"state,omitempty"`
21865	// IsExecutableAction - READ-ONLY; Gets if this recommended action is actionable by user
21866	IsExecutableAction *bool `json:"isExecutableAction,omitempty"`
21867	// IsRevertableAction - READ-ONLY; Gets if changes applied by this recommended action can be reverted by user
21868	IsRevertableAction *bool `json:"isRevertableAction,omitempty"`
21869	// IsArchivedAction - READ-ONLY; Gets if this recommended action was suggested some time ago but user chose to ignore this and system added a new recommended action again.
21870	IsArchivedAction *bool `json:"isArchivedAction,omitempty"`
21871	// ExecuteActionStartTime - READ-ONLY; Gets the time when system started applying this recommended action on the user resource. e.g., index creation start time
21872	ExecuteActionStartTime *date.Time `json:"executeActionStartTime,omitempty"`
21873	// ExecuteActionDuration - READ-ONLY; Gets the time taken for applying this recommended action on user resource. e.g., time taken for index creation
21874	ExecuteActionDuration *string `json:"executeActionDuration,omitempty"`
21875	// RevertActionStartTime - READ-ONLY; Gets the time when system started reverting changes of this recommended action on user resource. e.g., time when index drop is executed.
21876	RevertActionStartTime *date.Time `json:"revertActionStartTime,omitempty"`
21877	// RevertActionDuration - READ-ONLY; Gets the time taken for reverting changes of this recommended action on user resource. e.g., time taken for dropping the created index.
21878	RevertActionDuration *string `json:"revertActionDuration,omitempty"`
21879	// ExecuteActionInitiatedBy - READ-ONLY; Gets if approval for applying this recommended action was given by user/system. Possible values include: 'RecommendedActionInitiatedByUser', 'RecommendedActionInitiatedBySystem'
21880	ExecuteActionInitiatedBy RecommendedActionInitiatedBy `json:"executeActionInitiatedBy,omitempty"`
21881	// ExecuteActionInitiatedTime - READ-ONLY; Gets the time when this recommended action was approved for execution.
21882	ExecuteActionInitiatedTime *date.Time `json:"executeActionInitiatedTime,omitempty"`
21883	// RevertActionInitiatedBy - READ-ONLY; Gets if approval for reverting this recommended action was given by user/system. Possible values include: 'RecommendedActionInitiatedByUser', 'RecommendedActionInitiatedBySystem'
21884	RevertActionInitiatedBy RecommendedActionInitiatedBy `json:"revertActionInitiatedBy,omitempty"`
21885	// RevertActionInitiatedTime - READ-ONLY; Gets the time when this recommended action was approved for revert.
21886	RevertActionInitiatedTime *date.Time `json:"revertActionInitiatedTime,omitempty"`
21887	// Score - READ-ONLY; Gets the impact of this recommended action. Possible values are 1 - Low impact, 2 - Medium Impact and 3 - High Impact
21888	Score *int32 `json:"score,omitempty"`
21889	// ImplementationDetails - READ-ONLY; Gets the implementation details of this recommended action for user to apply it manually.
21890	ImplementationDetails *RecommendedActionImplementationInfo `json:"implementationDetails,omitempty"`
21891	// ErrorDetails - READ-ONLY; Gets the error details if and why this recommended action is put to error state.
21892	ErrorDetails *RecommendedActionErrorInfo `json:"errorDetails,omitempty"`
21893	// EstimatedImpact - READ-ONLY; Gets the estimated impact info for this recommended action e.g., Estimated CPU gain, Estimated Disk Space change
21894	EstimatedImpact *[]RecommendedActionImpactRecord `json:"estimatedImpact,omitempty"`
21895	// ObservedImpact - READ-ONLY; Gets the observed/actual impact info for this recommended action e.g., Actual CPU gain, Actual Disk Space change
21896	ObservedImpact *[]RecommendedActionImpactRecord `json:"observedImpact,omitempty"`
21897	// TimeSeries - READ-ONLY; Gets the time series info of metrics for this recommended action e.g., CPU consumption time series
21898	TimeSeries *[]RecommendedActionMetricInfo `json:"timeSeries,omitempty"`
21899	// LinkedObjects - READ-ONLY; Gets the linked objects, if any.
21900	LinkedObjects *[]string `json:"linkedObjects,omitempty"`
21901	// Details - READ-ONLY; Gets additional details specific to this recommended action.
21902	Details map[string]interface{} `json:"details"`
21903}
21904
21905// MarshalJSON is the custom marshaler for RecommendedActionProperties.
21906func (rap RecommendedActionProperties) MarshalJSON() ([]byte, error) {
21907	objectMap := make(map[string]interface{})
21908	if rap.State != nil {
21909		objectMap["state"] = rap.State
21910	}
21911	return json.Marshal(objectMap)
21912}
21913
21914// RecommendedActionStateInfo contains information of current state for an Azure SQL Database, Server or
21915// Elastic Pool Recommended Action.
21916type RecommendedActionStateInfo struct {
21917	// CurrentValue - Current state the recommended action is in. Some commonly used states are: Active      -> recommended action is active and no action has been taken yet. Pending     -> recommended action is approved for and is awaiting execution. Executing   -> recommended action is being applied on the user database. Verifying   -> recommended action was applied and is being verified of its usefulness by the system. Success     -> recommended action was applied and improvement found during verification. Pending Revert  -> verification found little or no improvement so recommended action is queued for revert or user has manually reverted. Reverting   -> changes made while applying recommended action are being reverted on the user database. Reverted    -> successfully reverted the changes made by recommended action on user database. Ignored     -> user explicitly ignored/discarded the recommended action. Possible values include: 'RecommendedActionCurrentStateActive', 'RecommendedActionCurrentStatePending', 'RecommendedActionCurrentStateExecuting', 'RecommendedActionCurrentStateVerifying', 'RecommendedActionCurrentStatePendingRevert', 'RecommendedActionCurrentStateRevertCancelled', 'RecommendedActionCurrentStateReverting', 'RecommendedActionCurrentStateReverted', 'RecommendedActionCurrentStateIgnored', 'RecommendedActionCurrentStateExpired', 'RecommendedActionCurrentStateMonitoring', 'RecommendedActionCurrentStateResolved', 'RecommendedActionCurrentStateSuccess', 'RecommendedActionCurrentStateError'
21918	CurrentValue RecommendedActionCurrentState `json:"currentValue,omitempty"`
21919	// ActionInitiatedBy - READ-ONLY; Gets who initiated the execution of this recommended action. Possible Value are: User    -> When user explicity notified system to apply the recommended action. System  -> When auto-execute status of this advisor was set to 'Enabled', in which case the system applied it. Possible values include: 'RecommendedActionInitiatedByUser', 'RecommendedActionInitiatedBySystem'
21920	ActionInitiatedBy RecommendedActionInitiatedBy `json:"actionInitiatedBy,omitempty"`
21921	// LastModified - READ-ONLY; Gets the time when the state was last modified
21922	LastModified *date.Time `json:"lastModified,omitempty"`
21923}
21924
21925// MarshalJSON is the custom marshaler for RecommendedActionStateInfo.
21926func (rasi RecommendedActionStateInfo) MarshalJSON() ([]byte, error) {
21927	objectMap := make(map[string]interface{})
21928	if rasi.CurrentValue != "" {
21929		objectMap["currentValue"] = rasi.CurrentValue
21930	}
21931	return json.Marshal(objectMap)
21932}
21933
21934// RecommendedSensitivityLabelUpdate a recommended sensitivity label update operation.
21935type RecommendedSensitivityLabelUpdate struct {
21936	// RecommendedSensitivityLabelUpdateProperties - Resource properties.
21937	*RecommendedSensitivityLabelUpdateProperties `json:"properties,omitempty"`
21938	// ID - READ-ONLY; Resource ID.
21939	ID *string `json:"id,omitempty"`
21940	// Name - READ-ONLY; Resource name.
21941	Name *string `json:"name,omitempty"`
21942	// Type - READ-ONLY; Resource type.
21943	Type *string `json:"type,omitempty"`
21944}
21945
21946// MarshalJSON is the custom marshaler for RecommendedSensitivityLabelUpdate.
21947func (rslu RecommendedSensitivityLabelUpdate) MarshalJSON() ([]byte, error) {
21948	objectMap := make(map[string]interface{})
21949	if rslu.RecommendedSensitivityLabelUpdateProperties != nil {
21950		objectMap["properties"] = rslu.RecommendedSensitivityLabelUpdateProperties
21951	}
21952	return json.Marshal(objectMap)
21953}
21954
21955// UnmarshalJSON is the custom unmarshaler for RecommendedSensitivityLabelUpdate struct.
21956func (rslu *RecommendedSensitivityLabelUpdate) UnmarshalJSON(body []byte) error {
21957	var m map[string]*json.RawMessage
21958	err := json.Unmarshal(body, &m)
21959	if err != nil {
21960		return err
21961	}
21962	for k, v := range m {
21963		switch k {
21964		case "properties":
21965			if v != nil {
21966				var recommendedSensitivityLabelUpdateProperties RecommendedSensitivityLabelUpdateProperties
21967				err = json.Unmarshal(*v, &recommendedSensitivityLabelUpdateProperties)
21968				if err != nil {
21969					return err
21970				}
21971				rslu.RecommendedSensitivityLabelUpdateProperties = &recommendedSensitivityLabelUpdateProperties
21972			}
21973		case "id":
21974			if v != nil {
21975				var ID string
21976				err = json.Unmarshal(*v, &ID)
21977				if err != nil {
21978					return err
21979				}
21980				rslu.ID = &ID
21981			}
21982		case "name":
21983			if v != nil {
21984				var name string
21985				err = json.Unmarshal(*v, &name)
21986				if err != nil {
21987					return err
21988				}
21989				rslu.Name = &name
21990			}
21991		case "type":
21992			if v != nil {
21993				var typeVar string
21994				err = json.Unmarshal(*v, &typeVar)
21995				if err != nil {
21996					return err
21997				}
21998				rslu.Type = &typeVar
21999			}
22000		}
22001	}
22002
22003	return nil
22004}
22005
22006// RecommendedSensitivityLabelUpdateList a list of recommended sensitivity label update operations.
22007type RecommendedSensitivityLabelUpdateList struct {
22008	Operations *[]RecommendedSensitivityLabelUpdate `json:"operations,omitempty"`
22009}
22010
22011// RecommendedSensitivityLabelUpdateProperties properties of an operation executed on a recommended
22012// sensitivity label.
22013type RecommendedSensitivityLabelUpdateProperties struct {
22014	// Op - Possible values include: 'RecommendedSensitivityLabelUpdateKindEnable', 'RecommendedSensitivityLabelUpdateKindDisable'
22015	Op RecommendedSensitivityLabelUpdateKind `json:"op,omitempty"`
22016	// Schema - Schema name of the column to update.
22017	Schema *string `json:"schema,omitempty"`
22018	// Table - Table name of the column to update.
22019	Table *string `json:"table,omitempty"`
22020	// Column - Column name to update.
22021	Column *string `json:"column,omitempty"`
22022}
22023
22024// RecoverableDatabase a recoverable database
22025type RecoverableDatabase struct {
22026	autorest.Response `json:"-"`
22027	// RecoverableDatabaseProperties - The properties of a recoverable database
22028	*RecoverableDatabaseProperties `json:"properties,omitempty"`
22029	// ID - READ-ONLY; Resource ID.
22030	ID *string `json:"id,omitempty"`
22031	// Name - READ-ONLY; Resource name.
22032	Name *string `json:"name,omitempty"`
22033	// Type - READ-ONLY; Resource type.
22034	Type *string `json:"type,omitempty"`
22035}
22036
22037// MarshalJSON is the custom marshaler for RecoverableDatabase.
22038func (rd RecoverableDatabase) MarshalJSON() ([]byte, error) {
22039	objectMap := make(map[string]interface{})
22040	if rd.RecoverableDatabaseProperties != nil {
22041		objectMap["properties"] = rd.RecoverableDatabaseProperties
22042	}
22043	return json.Marshal(objectMap)
22044}
22045
22046// UnmarshalJSON is the custom unmarshaler for RecoverableDatabase struct.
22047func (rd *RecoverableDatabase) UnmarshalJSON(body []byte) error {
22048	var m map[string]*json.RawMessage
22049	err := json.Unmarshal(body, &m)
22050	if err != nil {
22051		return err
22052	}
22053	for k, v := range m {
22054		switch k {
22055		case "properties":
22056			if v != nil {
22057				var recoverableDatabaseProperties RecoverableDatabaseProperties
22058				err = json.Unmarshal(*v, &recoverableDatabaseProperties)
22059				if err != nil {
22060					return err
22061				}
22062				rd.RecoverableDatabaseProperties = &recoverableDatabaseProperties
22063			}
22064		case "id":
22065			if v != nil {
22066				var ID string
22067				err = json.Unmarshal(*v, &ID)
22068				if err != nil {
22069					return err
22070				}
22071				rd.ID = &ID
22072			}
22073		case "name":
22074			if v != nil {
22075				var name string
22076				err = json.Unmarshal(*v, &name)
22077				if err != nil {
22078					return err
22079				}
22080				rd.Name = &name
22081			}
22082		case "type":
22083			if v != nil {
22084				var typeVar string
22085				err = json.Unmarshal(*v, &typeVar)
22086				if err != nil {
22087					return err
22088				}
22089				rd.Type = &typeVar
22090			}
22091		}
22092	}
22093
22094	return nil
22095}
22096
22097// RecoverableDatabaseListResult the response to a list recoverable databases request
22098type RecoverableDatabaseListResult struct {
22099	autorest.Response `json:"-"`
22100	// Value - A list of recoverable databases
22101	Value *[]RecoverableDatabase `json:"value,omitempty"`
22102}
22103
22104// RecoverableDatabaseProperties the properties of a recoverable database
22105type RecoverableDatabaseProperties struct {
22106	// Edition - READ-ONLY; The edition of the database
22107	Edition *string `json:"edition,omitempty"`
22108	// ServiceLevelObjective - READ-ONLY; The service level objective name of the database
22109	ServiceLevelObjective *string `json:"serviceLevelObjective,omitempty"`
22110	// ElasticPoolName - READ-ONLY; The elastic pool name of the database
22111	ElasticPoolName *string `json:"elasticPoolName,omitempty"`
22112	// LastAvailableBackupDate - READ-ONLY; The last available backup date of the database (ISO8601 format)
22113	LastAvailableBackupDate *date.Time `json:"lastAvailableBackupDate,omitempty"`
22114}
22115
22116// MarshalJSON is the custom marshaler for RecoverableDatabaseProperties.
22117func (rdp RecoverableDatabaseProperties) MarshalJSON() ([]byte, error) {
22118	objectMap := make(map[string]interface{})
22119	return json.Marshal(objectMap)
22120}
22121
22122// RecoverableManagedDatabase a recoverable managed database resource.
22123type RecoverableManagedDatabase struct {
22124	autorest.Response `json:"-"`
22125	// RecoverableManagedDatabaseProperties - Resource properties.
22126	*RecoverableManagedDatabaseProperties `json:"properties,omitempty"`
22127	// ID - READ-ONLY; Resource ID.
22128	ID *string `json:"id,omitempty"`
22129	// Name - READ-ONLY; Resource name.
22130	Name *string `json:"name,omitempty"`
22131	// Type - READ-ONLY; Resource type.
22132	Type *string `json:"type,omitempty"`
22133}
22134
22135// MarshalJSON is the custom marshaler for RecoverableManagedDatabase.
22136func (rmd RecoverableManagedDatabase) MarshalJSON() ([]byte, error) {
22137	objectMap := make(map[string]interface{})
22138	if rmd.RecoverableManagedDatabaseProperties != nil {
22139		objectMap["properties"] = rmd.RecoverableManagedDatabaseProperties
22140	}
22141	return json.Marshal(objectMap)
22142}
22143
22144// UnmarshalJSON is the custom unmarshaler for RecoverableManagedDatabase struct.
22145func (rmd *RecoverableManagedDatabase) UnmarshalJSON(body []byte) error {
22146	var m map[string]*json.RawMessage
22147	err := json.Unmarshal(body, &m)
22148	if err != nil {
22149		return err
22150	}
22151	for k, v := range m {
22152		switch k {
22153		case "properties":
22154			if v != nil {
22155				var recoverableManagedDatabaseProperties RecoverableManagedDatabaseProperties
22156				err = json.Unmarshal(*v, &recoverableManagedDatabaseProperties)
22157				if err != nil {
22158					return err
22159				}
22160				rmd.RecoverableManagedDatabaseProperties = &recoverableManagedDatabaseProperties
22161			}
22162		case "id":
22163			if v != nil {
22164				var ID string
22165				err = json.Unmarshal(*v, &ID)
22166				if err != nil {
22167					return err
22168				}
22169				rmd.ID = &ID
22170			}
22171		case "name":
22172			if v != nil {
22173				var name string
22174				err = json.Unmarshal(*v, &name)
22175				if err != nil {
22176					return err
22177				}
22178				rmd.Name = &name
22179			}
22180		case "type":
22181			if v != nil {
22182				var typeVar string
22183				err = json.Unmarshal(*v, &typeVar)
22184				if err != nil {
22185					return err
22186				}
22187				rmd.Type = &typeVar
22188			}
22189		}
22190	}
22191
22192	return nil
22193}
22194
22195// RecoverableManagedDatabaseListResult a list of recoverable managed databases.
22196type RecoverableManagedDatabaseListResult struct {
22197	autorest.Response `json:"-"`
22198	// Value - READ-ONLY; Array of results.
22199	Value *[]RecoverableManagedDatabase `json:"value,omitempty"`
22200	// NextLink - READ-ONLY; Link to retrieve next page of results.
22201	NextLink *string `json:"nextLink,omitempty"`
22202}
22203
22204// MarshalJSON is the custom marshaler for RecoverableManagedDatabaseListResult.
22205func (rmdlr RecoverableManagedDatabaseListResult) MarshalJSON() ([]byte, error) {
22206	objectMap := make(map[string]interface{})
22207	return json.Marshal(objectMap)
22208}
22209
22210// RecoverableManagedDatabaseListResultIterator provides access to a complete listing of
22211// RecoverableManagedDatabase values.
22212type RecoverableManagedDatabaseListResultIterator struct {
22213	i    int
22214	page RecoverableManagedDatabaseListResultPage
22215}
22216
22217// NextWithContext advances to the next value.  If there was an error making
22218// the request the iterator does not advance and the error is returned.
22219func (iter *RecoverableManagedDatabaseListResultIterator) NextWithContext(ctx context.Context) (err error) {
22220	if tracing.IsEnabled() {
22221		ctx = tracing.StartSpan(ctx, fqdn+"/RecoverableManagedDatabaseListResultIterator.NextWithContext")
22222		defer func() {
22223			sc := -1
22224			if iter.Response().Response.Response != nil {
22225				sc = iter.Response().Response.Response.StatusCode
22226			}
22227			tracing.EndSpan(ctx, sc, err)
22228		}()
22229	}
22230	iter.i++
22231	if iter.i < len(iter.page.Values()) {
22232		return nil
22233	}
22234	err = iter.page.NextWithContext(ctx)
22235	if err != nil {
22236		iter.i--
22237		return err
22238	}
22239	iter.i = 0
22240	return nil
22241}
22242
22243// Next advances to the next value.  If there was an error making
22244// the request the iterator does not advance and the error is returned.
22245// Deprecated: Use NextWithContext() instead.
22246func (iter *RecoverableManagedDatabaseListResultIterator) Next() error {
22247	return iter.NextWithContext(context.Background())
22248}
22249
22250// NotDone returns true if the enumeration should be started or is not yet complete.
22251func (iter RecoverableManagedDatabaseListResultIterator) NotDone() bool {
22252	return iter.page.NotDone() && iter.i < len(iter.page.Values())
22253}
22254
22255// Response returns the raw server response from the last page request.
22256func (iter RecoverableManagedDatabaseListResultIterator) Response() RecoverableManagedDatabaseListResult {
22257	return iter.page.Response()
22258}
22259
22260// Value returns the current value or a zero-initialized value if the
22261// iterator has advanced beyond the end of the collection.
22262func (iter RecoverableManagedDatabaseListResultIterator) Value() RecoverableManagedDatabase {
22263	if !iter.page.NotDone() {
22264		return RecoverableManagedDatabase{}
22265	}
22266	return iter.page.Values()[iter.i]
22267}
22268
22269// Creates a new instance of the RecoverableManagedDatabaseListResultIterator type.
22270func NewRecoverableManagedDatabaseListResultIterator(page RecoverableManagedDatabaseListResultPage) RecoverableManagedDatabaseListResultIterator {
22271	return RecoverableManagedDatabaseListResultIterator{page: page}
22272}
22273
22274// IsEmpty returns true if the ListResult contains no values.
22275func (rmdlr RecoverableManagedDatabaseListResult) IsEmpty() bool {
22276	return rmdlr.Value == nil || len(*rmdlr.Value) == 0
22277}
22278
22279// hasNextLink returns true if the NextLink is not empty.
22280func (rmdlr RecoverableManagedDatabaseListResult) hasNextLink() bool {
22281	return rmdlr.NextLink != nil && len(*rmdlr.NextLink) != 0
22282}
22283
22284// recoverableManagedDatabaseListResultPreparer prepares a request to retrieve the next set of results.
22285// It returns nil if no more results exist.
22286func (rmdlr RecoverableManagedDatabaseListResult) recoverableManagedDatabaseListResultPreparer(ctx context.Context) (*http.Request, error) {
22287	if !rmdlr.hasNextLink() {
22288		return nil, nil
22289	}
22290	return autorest.Prepare((&http.Request{}).WithContext(ctx),
22291		autorest.AsJSON(),
22292		autorest.AsGet(),
22293		autorest.WithBaseURL(to.String(rmdlr.NextLink)))
22294}
22295
22296// RecoverableManagedDatabaseListResultPage contains a page of RecoverableManagedDatabase values.
22297type RecoverableManagedDatabaseListResultPage struct {
22298	fn    func(context.Context, RecoverableManagedDatabaseListResult) (RecoverableManagedDatabaseListResult, error)
22299	rmdlr RecoverableManagedDatabaseListResult
22300}
22301
22302// NextWithContext advances to the next page of values.  If there was an error making
22303// the request the page does not advance and the error is returned.
22304func (page *RecoverableManagedDatabaseListResultPage) NextWithContext(ctx context.Context) (err error) {
22305	if tracing.IsEnabled() {
22306		ctx = tracing.StartSpan(ctx, fqdn+"/RecoverableManagedDatabaseListResultPage.NextWithContext")
22307		defer func() {
22308			sc := -1
22309			if page.Response().Response.Response != nil {
22310				sc = page.Response().Response.Response.StatusCode
22311			}
22312			tracing.EndSpan(ctx, sc, err)
22313		}()
22314	}
22315	for {
22316		next, err := page.fn(ctx, page.rmdlr)
22317		if err != nil {
22318			return err
22319		}
22320		page.rmdlr = next
22321		if !next.hasNextLink() || !next.IsEmpty() {
22322			break
22323		}
22324	}
22325	return nil
22326}
22327
22328// Next advances to the next page of values.  If there was an error making
22329// the request the page does not advance and the error is returned.
22330// Deprecated: Use NextWithContext() instead.
22331func (page *RecoverableManagedDatabaseListResultPage) Next() error {
22332	return page.NextWithContext(context.Background())
22333}
22334
22335// NotDone returns true if the page enumeration should be started or is not yet complete.
22336func (page RecoverableManagedDatabaseListResultPage) NotDone() bool {
22337	return !page.rmdlr.IsEmpty()
22338}
22339
22340// Response returns the raw server response from the last page request.
22341func (page RecoverableManagedDatabaseListResultPage) Response() RecoverableManagedDatabaseListResult {
22342	return page.rmdlr
22343}
22344
22345// Values returns the slice of values for the current page or nil if there are no values.
22346func (page RecoverableManagedDatabaseListResultPage) Values() []RecoverableManagedDatabase {
22347	if page.rmdlr.IsEmpty() {
22348		return nil
22349	}
22350	return *page.rmdlr.Value
22351}
22352
22353// Creates a new instance of the RecoverableManagedDatabaseListResultPage type.
22354func NewRecoverableManagedDatabaseListResultPage(cur RecoverableManagedDatabaseListResult, getNextPage func(context.Context, RecoverableManagedDatabaseListResult) (RecoverableManagedDatabaseListResult, error)) RecoverableManagedDatabaseListResultPage {
22355	return RecoverableManagedDatabaseListResultPage{
22356		fn:    getNextPage,
22357		rmdlr: cur,
22358	}
22359}
22360
22361// RecoverableManagedDatabaseProperties the recoverable managed database's properties.
22362type RecoverableManagedDatabaseProperties struct {
22363	// LastAvailableBackupDate - READ-ONLY; The last available backup date.
22364	LastAvailableBackupDate *string `json:"lastAvailableBackupDate,omitempty"`
22365}
22366
22367// MarshalJSON is the custom marshaler for RecoverableManagedDatabaseProperties.
22368func (rmdp RecoverableManagedDatabaseProperties) MarshalJSON() ([]byte, error) {
22369	objectMap := make(map[string]interface{})
22370	return json.Marshal(objectMap)
22371}
22372
22373// ReplicationLink a replication link.
22374type ReplicationLink struct {
22375	autorest.Response `json:"-"`
22376	// ReplicationLinkProperties - Resource properties.
22377	*ReplicationLinkProperties `json:"properties,omitempty"`
22378	// ID - READ-ONLY; Resource ID.
22379	ID *string `json:"id,omitempty"`
22380	// Name - READ-ONLY; Resource name.
22381	Name *string `json:"name,omitempty"`
22382	// Type - READ-ONLY; Resource type.
22383	Type *string `json:"type,omitempty"`
22384}
22385
22386// MarshalJSON is the custom marshaler for ReplicationLink.
22387func (rl ReplicationLink) MarshalJSON() ([]byte, error) {
22388	objectMap := make(map[string]interface{})
22389	if rl.ReplicationLinkProperties != nil {
22390		objectMap["properties"] = rl.ReplicationLinkProperties
22391	}
22392	return json.Marshal(objectMap)
22393}
22394
22395// UnmarshalJSON is the custom unmarshaler for ReplicationLink struct.
22396func (rl *ReplicationLink) UnmarshalJSON(body []byte) error {
22397	var m map[string]*json.RawMessage
22398	err := json.Unmarshal(body, &m)
22399	if err != nil {
22400		return err
22401	}
22402	for k, v := range m {
22403		switch k {
22404		case "properties":
22405			if v != nil {
22406				var replicationLinkProperties ReplicationLinkProperties
22407				err = json.Unmarshal(*v, &replicationLinkProperties)
22408				if err != nil {
22409					return err
22410				}
22411				rl.ReplicationLinkProperties = &replicationLinkProperties
22412			}
22413		case "id":
22414			if v != nil {
22415				var ID string
22416				err = json.Unmarshal(*v, &ID)
22417				if err != nil {
22418					return err
22419				}
22420				rl.ID = &ID
22421			}
22422		case "name":
22423			if v != nil {
22424				var name string
22425				err = json.Unmarshal(*v, &name)
22426				if err != nil {
22427					return err
22428				}
22429				rl.Name = &name
22430			}
22431		case "type":
22432			if v != nil {
22433				var typeVar string
22434				err = json.Unmarshal(*v, &typeVar)
22435				if err != nil {
22436					return err
22437				}
22438				rl.Type = &typeVar
22439			}
22440		}
22441	}
22442
22443	return nil
22444}
22445
22446// ReplicationLinkListResult a list of replication links.
22447type ReplicationLinkListResult struct {
22448	autorest.Response `json:"-"`
22449	// Value - READ-ONLY; Array of results.
22450	Value *[]ReplicationLink `json:"value,omitempty"`
22451	// NextLink - READ-ONLY; Link to retrieve next page of results.
22452	NextLink *string `json:"nextLink,omitempty"`
22453}
22454
22455// MarshalJSON is the custom marshaler for ReplicationLinkListResult.
22456func (rllr ReplicationLinkListResult) MarshalJSON() ([]byte, error) {
22457	objectMap := make(map[string]interface{})
22458	return json.Marshal(objectMap)
22459}
22460
22461// ReplicationLinkListResultIterator provides access to a complete listing of ReplicationLink values.
22462type ReplicationLinkListResultIterator struct {
22463	i    int
22464	page ReplicationLinkListResultPage
22465}
22466
22467// NextWithContext advances to the next value.  If there was an error making
22468// the request the iterator does not advance and the error is returned.
22469func (iter *ReplicationLinkListResultIterator) NextWithContext(ctx context.Context) (err error) {
22470	if tracing.IsEnabled() {
22471		ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationLinkListResultIterator.NextWithContext")
22472		defer func() {
22473			sc := -1
22474			if iter.Response().Response.Response != nil {
22475				sc = iter.Response().Response.Response.StatusCode
22476			}
22477			tracing.EndSpan(ctx, sc, err)
22478		}()
22479	}
22480	iter.i++
22481	if iter.i < len(iter.page.Values()) {
22482		return nil
22483	}
22484	err = iter.page.NextWithContext(ctx)
22485	if err != nil {
22486		iter.i--
22487		return err
22488	}
22489	iter.i = 0
22490	return nil
22491}
22492
22493// Next advances to the next value.  If there was an error making
22494// the request the iterator does not advance and the error is returned.
22495// Deprecated: Use NextWithContext() instead.
22496func (iter *ReplicationLinkListResultIterator) Next() error {
22497	return iter.NextWithContext(context.Background())
22498}
22499
22500// NotDone returns true if the enumeration should be started or is not yet complete.
22501func (iter ReplicationLinkListResultIterator) NotDone() bool {
22502	return iter.page.NotDone() && iter.i < len(iter.page.Values())
22503}
22504
22505// Response returns the raw server response from the last page request.
22506func (iter ReplicationLinkListResultIterator) Response() ReplicationLinkListResult {
22507	return iter.page.Response()
22508}
22509
22510// Value returns the current value or a zero-initialized value if the
22511// iterator has advanced beyond the end of the collection.
22512func (iter ReplicationLinkListResultIterator) Value() ReplicationLink {
22513	if !iter.page.NotDone() {
22514		return ReplicationLink{}
22515	}
22516	return iter.page.Values()[iter.i]
22517}
22518
22519// Creates a new instance of the ReplicationLinkListResultIterator type.
22520func NewReplicationLinkListResultIterator(page ReplicationLinkListResultPage) ReplicationLinkListResultIterator {
22521	return ReplicationLinkListResultIterator{page: page}
22522}
22523
22524// IsEmpty returns true if the ListResult contains no values.
22525func (rllr ReplicationLinkListResult) IsEmpty() bool {
22526	return rllr.Value == nil || len(*rllr.Value) == 0
22527}
22528
22529// hasNextLink returns true if the NextLink is not empty.
22530func (rllr ReplicationLinkListResult) hasNextLink() bool {
22531	return rllr.NextLink != nil && len(*rllr.NextLink) != 0
22532}
22533
22534// replicationLinkListResultPreparer prepares a request to retrieve the next set of results.
22535// It returns nil if no more results exist.
22536func (rllr ReplicationLinkListResult) replicationLinkListResultPreparer(ctx context.Context) (*http.Request, error) {
22537	if !rllr.hasNextLink() {
22538		return nil, nil
22539	}
22540	return autorest.Prepare((&http.Request{}).WithContext(ctx),
22541		autorest.AsJSON(),
22542		autorest.AsGet(),
22543		autorest.WithBaseURL(to.String(rllr.NextLink)))
22544}
22545
22546// ReplicationLinkListResultPage contains a page of ReplicationLink values.
22547type ReplicationLinkListResultPage struct {
22548	fn   func(context.Context, ReplicationLinkListResult) (ReplicationLinkListResult, error)
22549	rllr ReplicationLinkListResult
22550}
22551
22552// NextWithContext advances to the next page of values.  If there was an error making
22553// the request the page does not advance and the error is returned.
22554func (page *ReplicationLinkListResultPage) NextWithContext(ctx context.Context) (err error) {
22555	if tracing.IsEnabled() {
22556		ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationLinkListResultPage.NextWithContext")
22557		defer func() {
22558			sc := -1
22559			if page.Response().Response.Response != nil {
22560				sc = page.Response().Response.Response.StatusCode
22561			}
22562			tracing.EndSpan(ctx, sc, err)
22563		}()
22564	}
22565	for {
22566		next, err := page.fn(ctx, page.rllr)
22567		if err != nil {
22568			return err
22569		}
22570		page.rllr = next
22571		if !next.hasNextLink() || !next.IsEmpty() {
22572			break
22573		}
22574	}
22575	return nil
22576}
22577
22578// Next advances to the next page of values.  If there was an error making
22579// the request the page does not advance and the error is returned.
22580// Deprecated: Use NextWithContext() instead.
22581func (page *ReplicationLinkListResultPage) Next() error {
22582	return page.NextWithContext(context.Background())
22583}
22584
22585// NotDone returns true if the page enumeration should be started or is not yet complete.
22586func (page ReplicationLinkListResultPage) NotDone() bool {
22587	return !page.rllr.IsEmpty()
22588}
22589
22590// Response returns the raw server response from the last page request.
22591func (page ReplicationLinkListResultPage) Response() ReplicationLinkListResult {
22592	return page.rllr
22593}
22594
22595// Values returns the slice of values for the current page or nil if there are no values.
22596func (page ReplicationLinkListResultPage) Values() []ReplicationLink {
22597	if page.rllr.IsEmpty() {
22598		return nil
22599	}
22600	return *page.rllr.Value
22601}
22602
22603// Creates a new instance of the ReplicationLinkListResultPage type.
22604func NewReplicationLinkListResultPage(cur ReplicationLinkListResult, getNextPage func(context.Context, ReplicationLinkListResult) (ReplicationLinkListResult, error)) ReplicationLinkListResultPage {
22605	return ReplicationLinkListResultPage{
22606		fn:   getNextPage,
22607		rllr: cur,
22608	}
22609}
22610
22611// ReplicationLinkProperties properties of a replication link.
22612type ReplicationLinkProperties struct {
22613	// PartnerServer - READ-ONLY; Resource partner server.
22614	PartnerServer *string `json:"partnerServer,omitempty"`
22615	// PartnerDatabase - READ-ONLY; Resource partner database.
22616	PartnerDatabase *string `json:"partnerDatabase,omitempty"`
22617	// PartnerLocation - READ-ONLY; Resource partner location.
22618	PartnerLocation *string `json:"partnerLocation,omitempty"`
22619	// Role - READ-ONLY; Local replication role. Possible values include: 'ReplicationRolePrimary', 'ReplicationRoleSecondary', 'ReplicationRoleNonReadableSecondary', 'ReplicationRoleSource', 'ReplicationRoleCopy'
22620	Role ReplicationRole `json:"role,omitempty"`
22621	// PartnerRole - READ-ONLY; Partner replication role. Possible values include: 'ReplicationRolePrimary', 'ReplicationRoleSecondary', 'ReplicationRoleNonReadableSecondary', 'ReplicationRoleSource', 'ReplicationRoleCopy'
22622	PartnerRole ReplicationRole `json:"partnerRole,omitempty"`
22623	// ReplicationMode - READ-ONLY; Replication mode.
22624	ReplicationMode *string `json:"replicationMode,omitempty"`
22625	// StartTime - READ-ONLY; Time at which the link was created.
22626	StartTime *date.Time `json:"startTime,omitempty"`
22627	// PercentComplete - READ-ONLY; Seeding completion percentage for the link.
22628	PercentComplete *int32 `json:"percentComplete,omitempty"`
22629	// ReplicationState - READ-ONLY; Replication state (PENDING, SEEDING, CATCHUP, SUSPENDED). Possible values include: 'ReplicationStatePENDING', 'ReplicationStateSEEDING', 'ReplicationStateCATCHUP', 'ReplicationStateSUSPENDED'
22630	ReplicationState ReplicationState `json:"replicationState,omitempty"`
22631	// IsTerminationAllowed - READ-ONLY; Whether the user is currently allowed to terminate the link.
22632	IsTerminationAllowed *bool `json:"isTerminationAllowed,omitempty"`
22633	// LinkType - READ-ONLY; Link type (GEO, NAMED). Possible values include: 'ReplicationLinkTypeGEO', 'ReplicationLinkTypeNAMED'
22634	LinkType ReplicationLinkType `json:"linkType,omitempty"`
22635}
22636
22637// MarshalJSON is the custom marshaler for ReplicationLinkProperties.
22638func (rlp ReplicationLinkProperties) MarshalJSON() ([]byte, error) {
22639	objectMap := make(map[string]interface{})
22640	return json.Marshal(objectMap)
22641}
22642
22643// ReplicationLinksFailoverAllowDataLossFuture an abstraction for monitoring and retrieving the results of
22644// a long-running operation.
22645type ReplicationLinksFailoverAllowDataLossFuture struct {
22646	azure.FutureAPI
22647	// Result returns the result of the asynchronous operation.
22648	// If the operation has not completed it will return an error.
22649	Result func(ReplicationLinksClient) (autorest.Response, error)
22650}
22651
22652// UnmarshalJSON is the custom unmarshaller for CreateFuture.
22653func (future *ReplicationLinksFailoverAllowDataLossFuture) UnmarshalJSON(body []byte) error {
22654	var azFuture azure.Future
22655	if err := json.Unmarshal(body, &azFuture); err != nil {
22656		return err
22657	}
22658	future.FutureAPI = &azFuture
22659	future.Result = future.result
22660	return nil
22661}
22662
22663// result is the default implementation for ReplicationLinksFailoverAllowDataLossFuture.Result.
22664func (future *ReplicationLinksFailoverAllowDataLossFuture) result(client ReplicationLinksClient) (ar autorest.Response, err error) {
22665	var done bool
22666	done, err = future.DoneWithContext(context.Background(), client)
22667	if err != nil {
22668		err = autorest.NewErrorWithError(err, "sql.ReplicationLinksFailoverAllowDataLossFuture", "Result", future.Response(), "Polling failure")
22669		return
22670	}
22671	if !done {
22672		ar.Response = future.Response()
22673		err = azure.NewAsyncOpIncompleteError("sql.ReplicationLinksFailoverAllowDataLossFuture")
22674		return
22675	}
22676	ar.Response = future.Response()
22677	return
22678}
22679
22680// ReplicationLinksFailoverFuture an abstraction for monitoring and retrieving the results of a
22681// long-running operation.
22682type ReplicationLinksFailoverFuture struct {
22683	azure.FutureAPI
22684	// Result returns the result of the asynchronous operation.
22685	// If the operation has not completed it will return an error.
22686	Result func(ReplicationLinksClient) (autorest.Response, error)
22687}
22688
22689// UnmarshalJSON is the custom unmarshaller for CreateFuture.
22690func (future *ReplicationLinksFailoverFuture) UnmarshalJSON(body []byte) error {
22691	var azFuture azure.Future
22692	if err := json.Unmarshal(body, &azFuture); err != nil {
22693		return err
22694	}
22695	future.FutureAPI = &azFuture
22696	future.Result = future.result
22697	return nil
22698}
22699
22700// result is the default implementation for ReplicationLinksFailoverFuture.Result.
22701func (future *ReplicationLinksFailoverFuture) result(client ReplicationLinksClient) (ar autorest.Response, err error) {
22702	var done bool
22703	done, err = future.DoneWithContext(context.Background(), client)
22704	if err != nil {
22705		err = autorest.NewErrorWithError(err, "sql.ReplicationLinksFailoverFuture", "Result", future.Response(), "Polling failure")
22706		return
22707	}
22708	if !done {
22709		ar.Response = future.Response()
22710		err = azure.NewAsyncOpIncompleteError("sql.ReplicationLinksFailoverFuture")
22711		return
22712	}
22713	ar.Response = future.Response()
22714	return
22715}
22716
22717// ReplicationLinksUnlinkFuture an abstraction for monitoring and retrieving the results of a long-running
22718// operation.
22719type ReplicationLinksUnlinkFuture struct {
22720	azure.FutureAPI
22721	// Result returns the result of the asynchronous operation.
22722	// If the operation has not completed it will return an error.
22723	Result func(ReplicationLinksClient) (autorest.Response, error)
22724}
22725
22726// UnmarshalJSON is the custom unmarshaller for CreateFuture.
22727func (future *ReplicationLinksUnlinkFuture) UnmarshalJSON(body []byte) error {
22728	var azFuture azure.Future
22729	if err := json.Unmarshal(body, &azFuture); err != nil {
22730		return err
22731	}
22732	future.FutureAPI = &azFuture
22733	future.Result = future.result
22734	return nil
22735}
22736
22737// result is the default implementation for ReplicationLinksUnlinkFuture.Result.
22738func (future *ReplicationLinksUnlinkFuture) result(client ReplicationLinksClient) (ar autorest.Response, err error) {
22739	var done bool
22740	done, err = future.DoneWithContext(context.Background(), client)
22741	if err != nil {
22742		err = autorest.NewErrorWithError(err, "sql.ReplicationLinksUnlinkFuture", "Result", future.Response(), "Polling failure")
22743		return
22744	}
22745	if !done {
22746		ar.Response = future.Response()
22747		err = azure.NewAsyncOpIncompleteError("sql.ReplicationLinksUnlinkFuture")
22748		return
22749	}
22750	ar.Response = future.Response()
22751	return
22752}
22753
22754// Resource ARM resource.
22755type Resource struct {
22756	// ID - READ-ONLY; Resource ID.
22757	ID *string `json:"id,omitempty"`
22758	// Name - READ-ONLY; Resource name.
22759	Name *string `json:"name,omitempty"`
22760	// Type - READ-ONLY; Resource type.
22761	Type *string `json:"type,omitempty"`
22762}
22763
22764// MarshalJSON is the custom marshaler for Resource.
22765func (r Resource) MarshalJSON() ([]byte, error) {
22766	objectMap := make(map[string]interface{})
22767	return json.Marshal(objectMap)
22768}
22769
22770// ResourceIdentity azure Active Directory identity configuration for a resource.
22771type ResourceIdentity struct {
22772	// UserAssignedIdentities - The resource ids of the user assigned identities to use
22773	UserAssignedIdentities map[string]*UserIdentity `json:"userAssignedIdentities"`
22774	// PrincipalID - READ-ONLY; The Azure Active Directory principal id.
22775	PrincipalID *uuid.UUID `json:"principalId,omitempty"`
22776	// 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: 'IdentityTypeNone', 'IdentityTypeSystemAssigned', 'IdentityTypeUserAssigned'
22777	Type IdentityType `json:"type,omitempty"`
22778	// TenantID - READ-ONLY; The Azure Active Directory tenant id.
22779	TenantID *uuid.UUID `json:"tenantId,omitempty"`
22780}
22781
22782// MarshalJSON is the custom marshaler for ResourceIdentity.
22783func (ri ResourceIdentity) MarshalJSON() ([]byte, error) {
22784	objectMap := make(map[string]interface{})
22785	if ri.UserAssignedIdentities != nil {
22786		objectMap["userAssignedIdentities"] = ri.UserAssignedIdentities
22787	}
22788	if ri.Type != "" {
22789		objectMap["type"] = ri.Type
22790	}
22791	return json.Marshal(objectMap)
22792}
22793
22794// ResourceIdentityWithUserAssignedIdentities azure Active Directory identity configuration for a resource.
22795type ResourceIdentityWithUserAssignedIdentities struct {
22796	// UserAssignedIdentities - The resource ids of the user assigned identities to use
22797	UserAssignedIdentities map[string]*UserIdentity `json:"userAssignedIdentities"`
22798	// PrincipalID - READ-ONLY; The Azure Active Directory principal id.
22799	PrincipalID *uuid.UUID `json:"principalId,omitempty"`
22800	// 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: 'IdentityTypeNone', 'IdentityTypeSystemAssigned', 'IdentityTypeUserAssigned'
22801	Type IdentityType `json:"type,omitempty"`
22802	// TenantID - READ-ONLY; The Azure Active Directory tenant id.
22803	TenantID *uuid.UUID `json:"tenantId,omitempty"`
22804}
22805
22806// MarshalJSON is the custom marshaler for ResourceIdentityWithUserAssignedIdentities.
22807func (riwuai ResourceIdentityWithUserAssignedIdentities) MarshalJSON() ([]byte, error) {
22808	objectMap := make(map[string]interface{})
22809	if riwuai.UserAssignedIdentities != nil {
22810		objectMap["userAssignedIdentities"] = riwuai.UserAssignedIdentities
22811	}
22812	if riwuai.Type != "" {
22813		objectMap["type"] = riwuai.Type
22814	}
22815	return json.Marshal(objectMap)
22816}
22817
22818// ResourceMoveDefinition contains the information necessary to perform a resource move (rename).
22819type ResourceMoveDefinition struct {
22820	// ID - The target ID for the resource
22821	ID *string `json:"id,omitempty"`
22822}
22823
22824// ResourceWithWritableName ARM resource.
22825type ResourceWithWritableName struct {
22826	// ID - READ-ONLY; Resource ID.
22827	ID *string `json:"id,omitempty"`
22828	// Name - Resource name.
22829	Name *string `json:"name,omitempty"`
22830	// Type - READ-ONLY; Resource type.
22831	Type *string `json:"type,omitempty"`
22832}
22833
22834// MarshalJSON is the custom marshaler for ResourceWithWritableName.
22835func (rwwn ResourceWithWritableName) MarshalJSON() ([]byte, error) {
22836	objectMap := make(map[string]interface{})
22837	if rwwn.Name != nil {
22838		objectMap["name"] = rwwn.Name
22839	}
22840	return json.Marshal(objectMap)
22841}
22842
22843// RestorableDroppedDatabase a restorable dropped database resource.
22844type RestorableDroppedDatabase struct {
22845	autorest.Response `json:"-"`
22846	// Sku - The name and tier of the SKU.
22847	Sku *Sku `json:"sku,omitempty"`
22848	// Location - Resource location.
22849	Location *string `json:"location,omitempty"`
22850	// Tags - Resource tags.
22851	Tags map[string]*string `json:"tags"`
22852	// RestorableDroppedDatabaseProperties - Resource properties.
22853	*RestorableDroppedDatabaseProperties `json:"properties,omitempty"`
22854	// ID - READ-ONLY; Resource ID.
22855	ID *string `json:"id,omitempty"`
22856	// Name - READ-ONLY; Resource name.
22857	Name *string `json:"name,omitempty"`
22858	// Type - READ-ONLY; Resource type.
22859	Type *string `json:"type,omitempty"`
22860}
22861
22862// MarshalJSON is the custom marshaler for RestorableDroppedDatabase.
22863func (rdd RestorableDroppedDatabase) MarshalJSON() ([]byte, error) {
22864	objectMap := make(map[string]interface{})
22865	if rdd.Sku != nil {
22866		objectMap["sku"] = rdd.Sku
22867	}
22868	if rdd.Location != nil {
22869		objectMap["location"] = rdd.Location
22870	}
22871	if rdd.Tags != nil {
22872		objectMap["tags"] = rdd.Tags
22873	}
22874	if rdd.RestorableDroppedDatabaseProperties != nil {
22875		objectMap["properties"] = rdd.RestorableDroppedDatabaseProperties
22876	}
22877	return json.Marshal(objectMap)
22878}
22879
22880// UnmarshalJSON is the custom unmarshaler for RestorableDroppedDatabase struct.
22881func (rdd *RestorableDroppedDatabase) UnmarshalJSON(body []byte) error {
22882	var m map[string]*json.RawMessage
22883	err := json.Unmarshal(body, &m)
22884	if err != nil {
22885		return err
22886	}
22887	for k, v := range m {
22888		switch k {
22889		case "sku":
22890			if v != nil {
22891				var sku Sku
22892				err = json.Unmarshal(*v, &sku)
22893				if err != nil {
22894					return err
22895				}
22896				rdd.Sku = &sku
22897			}
22898		case "location":
22899			if v != nil {
22900				var location string
22901				err = json.Unmarshal(*v, &location)
22902				if err != nil {
22903					return err
22904				}
22905				rdd.Location = &location
22906			}
22907		case "tags":
22908			if v != nil {
22909				var tags map[string]*string
22910				err = json.Unmarshal(*v, &tags)
22911				if err != nil {
22912					return err
22913				}
22914				rdd.Tags = tags
22915			}
22916		case "properties":
22917			if v != nil {
22918				var restorableDroppedDatabaseProperties RestorableDroppedDatabaseProperties
22919				err = json.Unmarshal(*v, &restorableDroppedDatabaseProperties)
22920				if err != nil {
22921					return err
22922				}
22923				rdd.RestorableDroppedDatabaseProperties = &restorableDroppedDatabaseProperties
22924			}
22925		case "id":
22926			if v != nil {
22927				var ID string
22928				err = json.Unmarshal(*v, &ID)
22929				if err != nil {
22930					return err
22931				}
22932				rdd.ID = &ID
22933			}
22934		case "name":
22935			if v != nil {
22936				var name string
22937				err = json.Unmarshal(*v, &name)
22938				if err != nil {
22939					return err
22940				}
22941				rdd.Name = &name
22942			}
22943		case "type":
22944			if v != nil {
22945				var typeVar string
22946				err = json.Unmarshal(*v, &typeVar)
22947				if err != nil {
22948					return err
22949				}
22950				rdd.Type = &typeVar
22951			}
22952		}
22953	}
22954
22955	return nil
22956}
22957
22958// RestorableDroppedDatabaseListResult a list of restorable dropped databases.
22959type RestorableDroppedDatabaseListResult struct {
22960	autorest.Response `json:"-"`
22961	// Value - READ-ONLY; Array of results.
22962	Value *[]RestorableDroppedDatabase `json:"value,omitempty"`
22963	// NextLink - READ-ONLY; Link to retrieve next page of results.
22964	NextLink *string `json:"nextLink,omitempty"`
22965}
22966
22967// MarshalJSON is the custom marshaler for RestorableDroppedDatabaseListResult.
22968func (rddlr RestorableDroppedDatabaseListResult) MarshalJSON() ([]byte, error) {
22969	objectMap := make(map[string]interface{})
22970	return json.Marshal(objectMap)
22971}
22972
22973// RestorableDroppedDatabaseListResultIterator provides access to a complete listing of
22974// RestorableDroppedDatabase values.
22975type RestorableDroppedDatabaseListResultIterator struct {
22976	i    int
22977	page RestorableDroppedDatabaseListResultPage
22978}
22979
22980// NextWithContext advances to the next value.  If there was an error making
22981// the request the iterator does not advance and the error is returned.
22982func (iter *RestorableDroppedDatabaseListResultIterator) NextWithContext(ctx context.Context) (err error) {
22983	if tracing.IsEnabled() {
22984		ctx = tracing.StartSpan(ctx, fqdn+"/RestorableDroppedDatabaseListResultIterator.NextWithContext")
22985		defer func() {
22986			sc := -1
22987			if iter.Response().Response.Response != nil {
22988				sc = iter.Response().Response.Response.StatusCode
22989			}
22990			tracing.EndSpan(ctx, sc, err)
22991		}()
22992	}
22993	iter.i++
22994	if iter.i < len(iter.page.Values()) {
22995		return nil
22996	}
22997	err = iter.page.NextWithContext(ctx)
22998	if err != nil {
22999		iter.i--
23000		return err
23001	}
23002	iter.i = 0
23003	return nil
23004}
23005
23006// Next advances to the next value.  If there was an error making
23007// the request the iterator does not advance and the error is returned.
23008// Deprecated: Use NextWithContext() instead.
23009func (iter *RestorableDroppedDatabaseListResultIterator) Next() error {
23010	return iter.NextWithContext(context.Background())
23011}
23012
23013// NotDone returns true if the enumeration should be started or is not yet complete.
23014func (iter RestorableDroppedDatabaseListResultIterator) NotDone() bool {
23015	return iter.page.NotDone() && iter.i < len(iter.page.Values())
23016}
23017
23018// Response returns the raw server response from the last page request.
23019func (iter RestorableDroppedDatabaseListResultIterator) Response() RestorableDroppedDatabaseListResult {
23020	return iter.page.Response()
23021}
23022
23023// Value returns the current value or a zero-initialized value if the
23024// iterator has advanced beyond the end of the collection.
23025func (iter RestorableDroppedDatabaseListResultIterator) Value() RestorableDroppedDatabase {
23026	if !iter.page.NotDone() {
23027		return RestorableDroppedDatabase{}
23028	}
23029	return iter.page.Values()[iter.i]
23030}
23031
23032// Creates a new instance of the RestorableDroppedDatabaseListResultIterator type.
23033func NewRestorableDroppedDatabaseListResultIterator(page RestorableDroppedDatabaseListResultPage) RestorableDroppedDatabaseListResultIterator {
23034	return RestorableDroppedDatabaseListResultIterator{page: page}
23035}
23036
23037// IsEmpty returns true if the ListResult contains no values.
23038func (rddlr RestorableDroppedDatabaseListResult) IsEmpty() bool {
23039	return rddlr.Value == nil || len(*rddlr.Value) == 0
23040}
23041
23042// hasNextLink returns true if the NextLink is not empty.
23043func (rddlr RestorableDroppedDatabaseListResult) hasNextLink() bool {
23044	return rddlr.NextLink != nil && len(*rddlr.NextLink) != 0
23045}
23046
23047// restorableDroppedDatabaseListResultPreparer prepares a request to retrieve the next set of results.
23048// It returns nil if no more results exist.
23049func (rddlr RestorableDroppedDatabaseListResult) restorableDroppedDatabaseListResultPreparer(ctx context.Context) (*http.Request, error) {
23050	if !rddlr.hasNextLink() {
23051		return nil, nil
23052	}
23053	return autorest.Prepare((&http.Request{}).WithContext(ctx),
23054		autorest.AsJSON(),
23055		autorest.AsGet(),
23056		autorest.WithBaseURL(to.String(rddlr.NextLink)))
23057}
23058
23059// RestorableDroppedDatabaseListResultPage contains a page of RestorableDroppedDatabase values.
23060type RestorableDroppedDatabaseListResultPage struct {
23061	fn    func(context.Context, RestorableDroppedDatabaseListResult) (RestorableDroppedDatabaseListResult, error)
23062	rddlr RestorableDroppedDatabaseListResult
23063}
23064
23065// NextWithContext advances to the next page of values.  If there was an error making
23066// the request the page does not advance and the error is returned.
23067func (page *RestorableDroppedDatabaseListResultPage) NextWithContext(ctx context.Context) (err error) {
23068	if tracing.IsEnabled() {
23069		ctx = tracing.StartSpan(ctx, fqdn+"/RestorableDroppedDatabaseListResultPage.NextWithContext")
23070		defer func() {
23071			sc := -1
23072			if page.Response().Response.Response != nil {
23073				sc = page.Response().Response.Response.StatusCode
23074			}
23075			tracing.EndSpan(ctx, sc, err)
23076		}()
23077	}
23078	for {
23079		next, err := page.fn(ctx, page.rddlr)
23080		if err != nil {
23081			return err
23082		}
23083		page.rddlr = next
23084		if !next.hasNextLink() || !next.IsEmpty() {
23085			break
23086		}
23087	}
23088	return nil
23089}
23090
23091// Next advances to the next page of values.  If there was an error making
23092// the request the page does not advance and the error is returned.
23093// Deprecated: Use NextWithContext() instead.
23094func (page *RestorableDroppedDatabaseListResultPage) Next() error {
23095	return page.NextWithContext(context.Background())
23096}
23097
23098// NotDone returns true if the page enumeration should be started or is not yet complete.
23099func (page RestorableDroppedDatabaseListResultPage) NotDone() bool {
23100	return !page.rddlr.IsEmpty()
23101}
23102
23103// Response returns the raw server response from the last page request.
23104func (page RestorableDroppedDatabaseListResultPage) Response() RestorableDroppedDatabaseListResult {
23105	return page.rddlr
23106}
23107
23108// Values returns the slice of values for the current page or nil if there are no values.
23109func (page RestorableDroppedDatabaseListResultPage) Values() []RestorableDroppedDatabase {
23110	if page.rddlr.IsEmpty() {
23111		return nil
23112	}
23113	return *page.rddlr.Value
23114}
23115
23116// Creates a new instance of the RestorableDroppedDatabaseListResultPage type.
23117func NewRestorableDroppedDatabaseListResultPage(cur RestorableDroppedDatabaseListResult, getNextPage func(context.Context, RestorableDroppedDatabaseListResult) (RestorableDroppedDatabaseListResult, error)) RestorableDroppedDatabaseListResultPage {
23118	return RestorableDroppedDatabaseListResultPage{
23119		fn:    getNextPage,
23120		rddlr: cur,
23121	}
23122}
23123
23124// RestorableDroppedDatabaseProperties the restorable dropped database's properties.
23125type RestorableDroppedDatabaseProperties struct {
23126	// DatabaseName - READ-ONLY; The name of the database.
23127	DatabaseName *string `json:"databaseName,omitempty"`
23128	// MaxSizeBytes - READ-ONLY; The max size of the database expressed in bytes.
23129	MaxSizeBytes *int64 `json:"maxSizeBytes,omitempty"`
23130	// ElasticPoolID - READ-ONLY; DEPRECATED: The resource name of the elastic pool containing this database. This property is deprecated and the value will always be null.
23131	ElasticPoolID *string `json:"elasticPoolId,omitempty"`
23132	// CreationDate - READ-ONLY; The creation date of the database (ISO8601 format).
23133	CreationDate *date.Time `json:"creationDate,omitempty"`
23134	// DeletionDate - READ-ONLY; The deletion date of the database (ISO8601 format).
23135	DeletionDate *date.Time `json:"deletionDate,omitempty"`
23136	// EarliestRestoreDate - READ-ONLY; The earliest restore date of the database (ISO8601 format).
23137	EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"`
23138	// BackupStorageRedundancy - READ-ONLY; The storage account type used to store backups for this database. Possible values include: 'BackupStorageRedundancy1Geo', 'BackupStorageRedundancy1Local', 'BackupStorageRedundancy1Zone'
23139	BackupStorageRedundancy BackupStorageRedundancy1 `json:"backupStorageRedundancy,omitempty"`
23140}
23141
23142// MarshalJSON is the custom marshaler for RestorableDroppedDatabaseProperties.
23143func (rddp RestorableDroppedDatabaseProperties) MarshalJSON() ([]byte, error) {
23144	objectMap := make(map[string]interface{})
23145	return json.Marshal(objectMap)
23146}
23147
23148// RestorableDroppedManagedDatabase a restorable dropped managed database resource.
23149type RestorableDroppedManagedDatabase struct {
23150	autorest.Response `json:"-"`
23151	// RestorableDroppedManagedDatabaseProperties - Resource properties.
23152	*RestorableDroppedManagedDatabaseProperties `json:"properties,omitempty"`
23153	// Location - Resource location.
23154	Location *string `json:"location,omitempty"`
23155	// Tags - Resource tags.
23156	Tags map[string]*string `json:"tags"`
23157	// ID - READ-ONLY; Resource ID.
23158	ID *string `json:"id,omitempty"`
23159	// Name - READ-ONLY; Resource name.
23160	Name *string `json:"name,omitempty"`
23161	// Type - READ-ONLY; Resource type.
23162	Type *string `json:"type,omitempty"`
23163}
23164
23165// MarshalJSON is the custom marshaler for RestorableDroppedManagedDatabase.
23166func (rdmd RestorableDroppedManagedDatabase) MarshalJSON() ([]byte, error) {
23167	objectMap := make(map[string]interface{})
23168	if rdmd.RestorableDroppedManagedDatabaseProperties != nil {
23169		objectMap["properties"] = rdmd.RestorableDroppedManagedDatabaseProperties
23170	}
23171	if rdmd.Location != nil {
23172		objectMap["location"] = rdmd.Location
23173	}
23174	if rdmd.Tags != nil {
23175		objectMap["tags"] = rdmd.Tags
23176	}
23177	return json.Marshal(objectMap)
23178}
23179
23180// UnmarshalJSON is the custom unmarshaler for RestorableDroppedManagedDatabase struct.
23181func (rdmd *RestorableDroppedManagedDatabase) UnmarshalJSON(body []byte) error {
23182	var m map[string]*json.RawMessage
23183	err := json.Unmarshal(body, &m)
23184	if err != nil {
23185		return err
23186	}
23187	for k, v := range m {
23188		switch k {
23189		case "properties":
23190			if v != nil {
23191				var restorableDroppedManagedDatabaseProperties RestorableDroppedManagedDatabaseProperties
23192				err = json.Unmarshal(*v, &restorableDroppedManagedDatabaseProperties)
23193				if err != nil {
23194					return err
23195				}
23196				rdmd.RestorableDroppedManagedDatabaseProperties = &restorableDroppedManagedDatabaseProperties
23197			}
23198		case "location":
23199			if v != nil {
23200				var location string
23201				err = json.Unmarshal(*v, &location)
23202				if err != nil {
23203					return err
23204				}
23205				rdmd.Location = &location
23206			}
23207		case "tags":
23208			if v != nil {
23209				var tags map[string]*string
23210				err = json.Unmarshal(*v, &tags)
23211				if err != nil {
23212					return err
23213				}
23214				rdmd.Tags = tags
23215			}
23216		case "id":
23217			if v != nil {
23218				var ID string
23219				err = json.Unmarshal(*v, &ID)
23220				if err != nil {
23221					return err
23222				}
23223				rdmd.ID = &ID
23224			}
23225		case "name":
23226			if v != nil {
23227				var name string
23228				err = json.Unmarshal(*v, &name)
23229				if err != nil {
23230					return err
23231				}
23232				rdmd.Name = &name
23233			}
23234		case "type":
23235			if v != nil {
23236				var typeVar string
23237				err = json.Unmarshal(*v, &typeVar)
23238				if err != nil {
23239					return err
23240				}
23241				rdmd.Type = &typeVar
23242			}
23243		}
23244	}
23245
23246	return nil
23247}
23248
23249// RestorableDroppedManagedDatabaseListResult a list of restorable dropped managed databases.
23250type RestorableDroppedManagedDatabaseListResult struct {
23251	autorest.Response `json:"-"`
23252	// Value - READ-ONLY; Array of results.
23253	Value *[]RestorableDroppedManagedDatabase `json:"value,omitempty"`
23254	// NextLink - READ-ONLY; Link to retrieve next page of results.
23255	NextLink *string `json:"nextLink,omitempty"`
23256}
23257
23258// MarshalJSON is the custom marshaler for RestorableDroppedManagedDatabaseListResult.
23259func (rdmdlr RestorableDroppedManagedDatabaseListResult) MarshalJSON() ([]byte, error) {
23260	objectMap := make(map[string]interface{})
23261	return json.Marshal(objectMap)
23262}
23263
23264// RestorableDroppedManagedDatabaseListResultIterator provides access to a complete listing of
23265// RestorableDroppedManagedDatabase values.
23266type RestorableDroppedManagedDatabaseListResultIterator struct {
23267	i    int
23268	page RestorableDroppedManagedDatabaseListResultPage
23269}
23270
23271// NextWithContext advances to the next value.  If there was an error making
23272// the request the iterator does not advance and the error is returned.
23273func (iter *RestorableDroppedManagedDatabaseListResultIterator) NextWithContext(ctx context.Context) (err error) {
23274	if tracing.IsEnabled() {
23275		ctx = tracing.StartSpan(ctx, fqdn+"/RestorableDroppedManagedDatabaseListResultIterator.NextWithContext")
23276		defer func() {
23277			sc := -1
23278			if iter.Response().Response.Response != nil {
23279				sc = iter.Response().Response.Response.StatusCode
23280			}
23281			tracing.EndSpan(ctx, sc, err)
23282		}()
23283	}
23284	iter.i++
23285	if iter.i < len(iter.page.Values()) {
23286		return nil
23287	}
23288	err = iter.page.NextWithContext(ctx)
23289	if err != nil {
23290		iter.i--
23291		return err
23292	}
23293	iter.i = 0
23294	return nil
23295}
23296
23297// Next advances to the next value.  If there was an error making
23298// the request the iterator does not advance and the error is returned.
23299// Deprecated: Use NextWithContext() instead.
23300func (iter *RestorableDroppedManagedDatabaseListResultIterator) Next() error {
23301	return iter.NextWithContext(context.Background())
23302}
23303
23304// NotDone returns true if the enumeration should be started or is not yet complete.
23305func (iter RestorableDroppedManagedDatabaseListResultIterator) NotDone() bool {
23306	return iter.page.NotDone() && iter.i < len(iter.page.Values())
23307}
23308
23309// Response returns the raw server response from the last page request.
23310func (iter RestorableDroppedManagedDatabaseListResultIterator) Response() RestorableDroppedManagedDatabaseListResult {
23311	return iter.page.Response()
23312}
23313
23314// Value returns the current value or a zero-initialized value if the
23315// iterator has advanced beyond the end of the collection.
23316func (iter RestorableDroppedManagedDatabaseListResultIterator) Value() RestorableDroppedManagedDatabase {
23317	if !iter.page.NotDone() {
23318		return RestorableDroppedManagedDatabase{}
23319	}
23320	return iter.page.Values()[iter.i]
23321}
23322
23323// Creates a new instance of the RestorableDroppedManagedDatabaseListResultIterator type.
23324func NewRestorableDroppedManagedDatabaseListResultIterator(page RestorableDroppedManagedDatabaseListResultPage) RestorableDroppedManagedDatabaseListResultIterator {
23325	return RestorableDroppedManagedDatabaseListResultIterator{page: page}
23326}
23327
23328// IsEmpty returns true if the ListResult contains no values.
23329func (rdmdlr RestorableDroppedManagedDatabaseListResult) IsEmpty() bool {
23330	return rdmdlr.Value == nil || len(*rdmdlr.Value) == 0
23331}
23332
23333// hasNextLink returns true if the NextLink is not empty.
23334func (rdmdlr RestorableDroppedManagedDatabaseListResult) hasNextLink() bool {
23335	return rdmdlr.NextLink != nil && len(*rdmdlr.NextLink) != 0
23336}
23337
23338// restorableDroppedManagedDatabaseListResultPreparer prepares a request to retrieve the next set of results.
23339// It returns nil if no more results exist.
23340func (rdmdlr RestorableDroppedManagedDatabaseListResult) restorableDroppedManagedDatabaseListResultPreparer(ctx context.Context) (*http.Request, error) {
23341	if !rdmdlr.hasNextLink() {
23342		return nil, nil
23343	}
23344	return autorest.Prepare((&http.Request{}).WithContext(ctx),
23345		autorest.AsJSON(),
23346		autorest.AsGet(),
23347		autorest.WithBaseURL(to.String(rdmdlr.NextLink)))
23348}
23349
23350// RestorableDroppedManagedDatabaseListResultPage contains a page of RestorableDroppedManagedDatabase
23351// values.
23352type RestorableDroppedManagedDatabaseListResultPage struct {
23353	fn     func(context.Context, RestorableDroppedManagedDatabaseListResult) (RestorableDroppedManagedDatabaseListResult, error)
23354	rdmdlr RestorableDroppedManagedDatabaseListResult
23355}
23356
23357// NextWithContext advances to the next page of values.  If there was an error making
23358// the request the page does not advance and the error is returned.
23359func (page *RestorableDroppedManagedDatabaseListResultPage) NextWithContext(ctx context.Context) (err error) {
23360	if tracing.IsEnabled() {
23361		ctx = tracing.StartSpan(ctx, fqdn+"/RestorableDroppedManagedDatabaseListResultPage.NextWithContext")
23362		defer func() {
23363			sc := -1
23364			if page.Response().Response.Response != nil {
23365				sc = page.Response().Response.Response.StatusCode
23366			}
23367			tracing.EndSpan(ctx, sc, err)
23368		}()
23369	}
23370	for {
23371		next, err := page.fn(ctx, page.rdmdlr)
23372		if err != nil {
23373			return err
23374		}
23375		page.rdmdlr = next
23376		if !next.hasNextLink() || !next.IsEmpty() {
23377			break
23378		}
23379	}
23380	return nil
23381}
23382
23383// Next advances to the next page of values.  If there was an error making
23384// the request the page does not advance and the error is returned.
23385// Deprecated: Use NextWithContext() instead.
23386func (page *RestorableDroppedManagedDatabaseListResultPage) Next() error {
23387	return page.NextWithContext(context.Background())
23388}
23389
23390// NotDone returns true if the page enumeration should be started or is not yet complete.
23391func (page RestorableDroppedManagedDatabaseListResultPage) NotDone() bool {
23392	return !page.rdmdlr.IsEmpty()
23393}
23394
23395// Response returns the raw server response from the last page request.
23396func (page RestorableDroppedManagedDatabaseListResultPage) Response() RestorableDroppedManagedDatabaseListResult {
23397	return page.rdmdlr
23398}
23399
23400// Values returns the slice of values for the current page or nil if there are no values.
23401func (page RestorableDroppedManagedDatabaseListResultPage) Values() []RestorableDroppedManagedDatabase {
23402	if page.rdmdlr.IsEmpty() {
23403		return nil
23404	}
23405	return *page.rdmdlr.Value
23406}
23407
23408// Creates a new instance of the RestorableDroppedManagedDatabaseListResultPage type.
23409func NewRestorableDroppedManagedDatabaseListResultPage(cur RestorableDroppedManagedDatabaseListResult, getNextPage func(context.Context, RestorableDroppedManagedDatabaseListResult) (RestorableDroppedManagedDatabaseListResult, error)) RestorableDroppedManagedDatabaseListResultPage {
23410	return RestorableDroppedManagedDatabaseListResultPage{
23411		fn:     getNextPage,
23412		rdmdlr: cur,
23413	}
23414}
23415
23416// RestorableDroppedManagedDatabaseProperties the restorable dropped managed database's properties.
23417type RestorableDroppedManagedDatabaseProperties struct {
23418	// DatabaseName - READ-ONLY; The name of the database.
23419	DatabaseName *string `json:"databaseName,omitempty"`
23420	// CreationDate - READ-ONLY; The creation date of the database (ISO8601 format).
23421	CreationDate *date.Time `json:"creationDate,omitempty"`
23422	// DeletionDate - READ-ONLY; The deletion date of the database (ISO8601 format).
23423	DeletionDate *date.Time `json:"deletionDate,omitempty"`
23424	// EarliestRestoreDate - READ-ONLY; The earliest restore date of the database (ISO8601 format).
23425	EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"`
23426}
23427
23428// MarshalJSON is the custom marshaler for RestorableDroppedManagedDatabaseProperties.
23429func (rdmdp RestorableDroppedManagedDatabaseProperties) MarshalJSON() ([]byte, error) {
23430	objectMap := make(map[string]interface{})
23431	return json.Marshal(objectMap)
23432}
23433
23434// RestorePoint database restore points.
23435type RestorePoint struct {
23436	autorest.Response `json:"-"`
23437	// Location - READ-ONLY; Resource location.
23438	Location *string `json:"location,omitempty"`
23439	// RestorePointProperties - Resource properties.
23440	*RestorePointProperties `json:"properties,omitempty"`
23441	// ID - READ-ONLY; Resource ID.
23442	ID *string `json:"id,omitempty"`
23443	// Name - READ-ONLY; Resource name.
23444	Name *string `json:"name,omitempty"`
23445	// Type - READ-ONLY; Resource type.
23446	Type *string `json:"type,omitempty"`
23447}
23448
23449// MarshalJSON is the custom marshaler for RestorePoint.
23450func (rp RestorePoint) MarshalJSON() ([]byte, error) {
23451	objectMap := make(map[string]interface{})
23452	if rp.RestorePointProperties != nil {
23453		objectMap["properties"] = rp.RestorePointProperties
23454	}
23455	return json.Marshal(objectMap)
23456}
23457
23458// UnmarshalJSON is the custom unmarshaler for RestorePoint struct.
23459func (rp *RestorePoint) UnmarshalJSON(body []byte) error {
23460	var m map[string]*json.RawMessage
23461	err := json.Unmarshal(body, &m)
23462	if err != nil {
23463		return err
23464	}
23465	for k, v := range m {
23466		switch k {
23467		case "location":
23468			if v != nil {
23469				var location string
23470				err = json.Unmarshal(*v, &location)
23471				if err != nil {
23472					return err
23473				}
23474				rp.Location = &location
23475			}
23476		case "properties":
23477			if v != nil {
23478				var restorePointProperties RestorePointProperties
23479				err = json.Unmarshal(*v, &restorePointProperties)
23480				if err != nil {
23481					return err
23482				}
23483				rp.RestorePointProperties = &restorePointProperties
23484			}
23485		case "id":
23486			if v != nil {
23487				var ID string
23488				err = json.Unmarshal(*v, &ID)
23489				if err != nil {
23490					return err
23491				}
23492				rp.ID = &ID
23493			}
23494		case "name":
23495			if v != nil {
23496				var name string
23497				err = json.Unmarshal(*v, &name)
23498				if err != nil {
23499					return err
23500				}
23501				rp.Name = &name
23502			}
23503		case "type":
23504			if v != nil {
23505				var typeVar string
23506				err = json.Unmarshal(*v, &typeVar)
23507				if err != nil {
23508					return err
23509				}
23510				rp.Type = &typeVar
23511			}
23512		}
23513	}
23514
23515	return nil
23516}
23517
23518// RestorePointListResult a list of long term retention backups.
23519type RestorePointListResult struct {
23520	autorest.Response `json:"-"`
23521	// Value - READ-ONLY; Array of results.
23522	Value *[]RestorePoint `json:"value,omitempty"`
23523	// NextLink - READ-ONLY; Link to retrieve next page of results.
23524	NextLink *string `json:"nextLink,omitempty"`
23525}
23526
23527// MarshalJSON is the custom marshaler for RestorePointListResult.
23528func (rplr RestorePointListResult) MarshalJSON() ([]byte, error) {
23529	objectMap := make(map[string]interface{})
23530	return json.Marshal(objectMap)
23531}
23532
23533// RestorePointListResultIterator provides access to a complete listing of RestorePoint values.
23534type RestorePointListResultIterator struct {
23535	i    int
23536	page RestorePointListResultPage
23537}
23538
23539// NextWithContext advances to the next value.  If there was an error making
23540// the request the iterator does not advance and the error is returned.
23541func (iter *RestorePointListResultIterator) NextWithContext(ctx context.Context) (err error) {
23542	if tracing.IsEnabled() {
23543		ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointListResultIterator.NextWithContext")
23544		defer func() {
23545			sc := -1
23546			if iter.Response().Response.Response != nil {
23547				sc = iter.Response().Response.Response.StatusCode
23548			}
23549			tracing.EndSpan(ctx, sc, err)
23550		}()
23551	}
23552	iter.i++
23553	if iter.i < len(iter.page.Values()) {
23554		return nil
23555	}
23556	err = iter.page.NextWithContext(ctx)
23557	if err != nil {
23558		iter.i--
23559		return err
23560	}
23561	iter.i = 0
23562	return nil
23563}
23564
23565// Next advances to the next value.  If there was an error making
23566// the request the iterator does not advance and the error is returned.
23567// Deprecated: Use NextWithContext() instead.
23568func (iter *RestorePointListResultIterator) Next() error {
23569	return iter.NextWithContext(context.Background())
23570}
23571
23572// NotDone returns true if the enumeration should be started or is not yet complete.
23573func (iter RestorePointListResultIterator) NotDone() bool {
23574	return iter.page.NotDone() && iter.i < len(iter.page.Values())
23575}
23576
23577// Response returns the raw server response from the last page request.
23578func (iter RestorePointListResultIterator) Response() RestorePointListResult {
23579	return iter.page.Response()
23580}
23581
23582// Value returns the current value or a zero-initialized value if the
23583// iterator has advanced beyond the end of the collection.
23584func (iter RestorePointListResultIterator) Value() RestorePoint {
23585	if !iter.page.NotDone() {
23586		return RestorePoint{}
23587	}
23588	return iter.page.Values()[iter.i]
23589}
23590
23591// Creates a new instance of the RestorePointListResultIterator type.
23592func NewRestorePointListResultIterator(page RestorePointListResultPage) RestorePointListResultIterator {
23593	return RestorePointListResultIterator{page: page}
23594}
23595
23596// IsEmpty returns true if the ListResult contains no values.
23597func (rplr RestorePointListResult) IsEmpty() bool {
23598	return rplr.Value == nil || len(*rplr.Value) == 0
23599}
23600
23601// hasNextLink returns true if the NextLink is not empty.
23602func (rplr RestorePointListResult) hasNextLink() bool {
23603	return rplr.NextLink != nil && len(*rplr.NextLink) != 0
23604}
23605
23606// restorePointListResultPreparer prepares a request to retrieve the next set of results.
23607// It returns nil if no more results exist.
23608func (rplr RestorePointListResult) restorePointListResultPreparer(ctx context.Context) (*http.Request, error) {
23609	if !rplr.hasNextLink() {
23610		return nil, nil
23611	}
23612	return autorest.Prepare((&http.Request{}).WithContext(ctx),
23613		autorest.AsJSON(),
23614		autorest.AsGet(),
23615		autorest.WithBaseURL(to.String(rplr.NextLink)))
23616}
23617
23618// RestorePointListResultPage contains a page of RestorePoint values.
23619type RestorePointListResultPage struct {
23620	fn   func(context.Context, RestorePointListResult) (RestorePointListResult, error)
23621	rplr RestorePointListResult
23622}
23623
23624// NextWithContext advances to the next page of values.  If there was an error making
23625// the request the page does not advance and the error is returned.
23626func (page *RestorePointListResultPage) NextWithContext(ctx context.Context) (err error) {
23627	if tracing.IsEnabled() {
23628		ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointListResultPage.NextWithContext")
23629		defer func() {
23630			sc := -1
23631			if page.Response().Response.Response != nil {
23632				sc = page.Response().Response.Response.StatusCode
23633			}
23634			tracing.EndSpan(ctx, sc, err)
23635		}()
23636	}
23637	for {
23638		next, err := page.fn(ctx, page.rplr)
23639		if err != nil {
23640			return err
23641		}
23642		page.rplr = next
23643		if !next.hasNextLink() || !next.IsEmpty() {
23644			break
23645		}
23646	}
23647	return nil
23648}
23649
23650// Next advances to the next page of values.  If there was an error making
23651// the request the page does not advance and the error is returned.
23652// Deprecated: Use NextWithContext() instead.
23653func (page *RestorePointListResultPage) Next() error {
23654	return page.NextWithContext(context.Background())
23655}
23656
23657// NotDone returns true if the page enumeration should be started or is not yet complete.
23658func (page RestorePointListResultPage) NotDone() bool {
23659	return !page.rplr.IsEmpty()
23660}
23661
23662// Response returns the raw server response from the last page request.
23663func (page RestorePointListResultPage) Response() RestorePointListResult {
23664	return page.rplr
23665}
23666
23667// Values returns the slice of values for the current page or nil if there are no values.
23668func (page RestorePointListResultPage) Values() []RestorePoint {
23669	if page.rplr.IsEmpty() {
23670		return nil
23671	}
23672	return *page.rplr.Value
23673}
23674
23675// Creates a new instance of the RestorePointListResultPage type.
23676func NewRestorePointListResultPage(cur RestorePointListResult, getNextPage func(context.Context, RestorePointListResult) (RestorePointListResult, error)) RestorePointListResultPage {
23677	return RestorePointListResultPage{
23678		fn:   getNextPage,
23679		rplr: cur,
23680	}
23681}
23682
23683// RestorePointProperties properties of a database restore point
23684type RestorePointProperties struct {
23685	// RestorePointType - READ-ONLY; The type of restore point. Possible values include: 'RestorePointTypeCONTINUOUS', 'RestorePointTypeDISCRETE'
23686	RestorePointType RestorePointType `json:"restorePointType,omitempty"`
23687	// EarliestRestoreDate - READ-ONLY; The earliest time to which this database can be restored
23688	EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"`
23689	// RestorePointCreationDate - READ-ONLY; The time the backup was taken
23690	RestorePointCreationDate *date.Time `json:"restorePointCreationDate,omitempty"`
23691	// RestorePointLabel - READ-ONLY; The label of restore point for backup request by user
23692	RestorePointLabel *string `json:"restorePointLabel,omitempty"`
23693}
23694
23695// MarshalJSON is the custom marshaler for RestorePointProperties.
23696func (rpp RestorePointProperties) MarshalJSON() ([]byte, error) {
23697	objectMap := make(map[string]interface{})
23698	return json.Marshal(objectMap)
23699}
23700
23701// RestorePointsCreateFuture an abstraction for monitoring and retrieving the results of a long-running
23702// operation.
23703type RestorePointsCreateFuture struct {
23704	azure.FutureAPI
23705	// Result returns the result of the asynchronous operation.
23706	// If the operation has not completed it will return an error.
23707	Result func(RestorePointsClient) (RestorePoint, error)
23708}
23709
23710// UnmarshalJSON is the custom unmarshaller for CreateFuture.
23711func (future *RestorePointsCreateFuture) UnmarshalJSON(body []byte) error {
23712	var azFuture azure.Future
23713	if err := json.Unmarshal(body, &azFuture); err != nil {
23714		return err
23715	}
23716	future.FutureAPI = &azFuture
23717	future.Result = future.result
23718	return nil
23719}
23720
23721// result is the default implementation for RestorePointsCreateFuture.Result.
23722func (future *RestorePointsCreateFuture) result(client RestorePointsClient) (rp RestorePoint, err error) {
23723	var done bool
23724	done, err = future.DoneWithContext(context.Background(), client)
23725	if err != nil {
23726		err = autorest.NewErrorWithError(err, "sql.RestorePointsCreateFuture", "Result", future.Response(), "Polling failure")
23727		return
23728	}
23729	if !done {
23730		rp.Response.Response = future.Response()
23731		err = azure.NewAsyncOpIncompleteError("sql.RestorePointsCreateFuture")
23732		return
23733	}
23734	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
23735	if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent {
23736		rp, err = client.CreateResponder(rp.Response.Response)
23737		if err != nil {
23738			err = autorest.NewErrorWithError(err, "sql.RestorePointsCreateFuture", "Result", rp.Response.Response, "Failure responding to request")
23739		}
23740	}
23741	return
23742}
23743
23744// SecurityAlertPolicyProperties properties of a security alert policy.
23745type SecurityAlertPolicyProperties struct {
23746	// State - Specifies the state of the policy, whether it is enabled or disabled or a policy has not been applied yet on the specific database. Possible values include: 'SecurityAlertPolicyStateNew', 'SecurityAlertPolicyStateEnabled', 'SecurityAlertPolicyStateDisabled'
23747	State SecurityAlertPolicyState `json:"state,omitempty"`
23748	// DisabledAlerts - Specifies an array of alerts that are disabled. Allowed values are: Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action, Brute_Force
23749	DisabledAlerts *[]string `json:"disabledAlerts,omitempty"`
23750	// EmailAddresses - Specifies an array of e-mail addresses to which the alert is sent.
23751	EmailAddresses *[]string `json:"emailAddresses,omitempty"`
23752	// EmailAccountAdmins - Specifies that the alert is sent to the account administrators.
23753	EmailAccountAdmins *bool `json:"emailAccountAdmins,omitempty"`
23754	// StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs.
23755	StorageEndpoint *string `json:"storageEndpoint,omitempty"`
23756	// StorageAccountAccessKey - Specifies the identifier key of the Threat Detection audit storage account.
23757	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
23758	// RetentionDays - Specifies the number of days to keep in the Threat Detection audit logs.
23759	RetentionDays *int32 `json:"retentionDays,omitempty"`
23760	// CreationTime - READ-ONLY; Specifies the UTC creation time of the policy.
23761	CreationTime *date.Time `json:"creationTime,omitempty"`
23762}
23763
23764// MarshalJSON is the custom marshaler for SecurityAlertPolicyProperties.
23765func (sapp SecurityAlertPolicyProperties) MarshalJSON() ([]byte, error) {
23766	objectMap := make(map[string]interface{})
23767	if sapp.State != "" {
23768		objectMap["state"] = sapp.State
23769	}
23770	if sapp.DisabledAlerts != nil {
23771		objectMap["disabledAlerts"] = sapp.DisabledAlerts
23772	}
23773	if sapp.EmailAddresses != nil {
23774		objectMap["emailAddresses"] = sapp.EmailAddresses
23775	}
23776	if sapp.EmailAccountAdmins != nil {
23777		objectMap["emailAccountAdmins"] = sapp.EmailAccountAdmins
23778	}
23779	if sapp.StorageEndpoint != nil {
23780		objectMap["storageEndpoint"] = sapp.StorageEndpoint
23781	}
23782	if sapp.StorageAccountAccessKey != nil {
23783		objectMap["storageAccountAccessKey"] = sapp.StorageAccountAccessKey
23784	}
23785	if sapp.RetentionDays != nil {
23786		objectMap["retentionDays"] = sapp.RetentionDays
23787	}
23788	return json.Marshal(objectMap)
23789}
23790
23791// SecurityAlertsPolicyProperties properties of a security alert policy.
23792type SecurityAlertsPolicyProperties struct {
23793	// State - Specifies the state of the policy, whether it is enabled or disabled or a policy has not been applied yet on the specific database. Possible values include: 'SecurityAlertsPolicyStateEnabled', 'SecurityAlertsPolicyStateDisabled'
23794	State SecurityAlertsPolicyState `json:"state,omitempty"`
23795	// DisabledAlerts - Specifies an array of alerts that are disabled. Allowed values are: Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action, Brute_Force
23796	DisabledAlerts *[]string `json:"disabledAlerts,omitempty"`
23797	// EmailAddresses - Specifies an array of e-mail addresses to which the alert is sent.
23798	EmailAddresses *[]string `json:"emailAddresses,omitempty"`
23799	// EmailAccountAdmins - Specifies that the alert is sent to the account administrators.
23800	EmailAccountAdmins *bool `json:"emailAccountAdmins,omitempty"`
23801	// StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs.
23802	StorageEndpoint *string `json:"storageEndpoint,omitempty"`
23803	// StorageAccountAccessKey - Specifies the identifier key of the Threat Detection audit storage account.
23804	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
23805	// RetentionDays - Specifies the number of days to keep in the Threat Detection audit logs.
23806	RetentionDays *int32 `json:"retentionDays,omitempty"`
23807	// CreationTime - READ-ONLY; Specifies the UTC creation time of the policy.
23808	CreationTime *date.Time `json:"creationTime,omitempty"`
23809}
23810
23811// MarshalJSON is the custom marshaler for SecurityAlertsPolicyProperties.
23812func (sapp SecurityAlertsPolicyProperties) MarshalJSON() ([]byte, error) {
23813	objectMap := make(map[string]interface{})
23814	if sapp.State != "" {
23815		objectMap["state"] = sapp.State
23816	}
23817	if sapp.DisabledAlerts != nil {
23818		objectMap["disabledAlerts"] = sapp.DisabledAlerts
23819	}
23820	if sapp.EmailAddresses != nil {
23821		objectMap["emailAddresses"] = sapp.EmailAddresses
23822	}
23823	if sapp.EmailAccountAdmins != nil {
23824		objectMap["emailAccountAdmins"] = sapp.EmailAccountAdmins
23825	}
23826	if sapp.StorageEndpoint != nil {
23827		objectMap["storageEndpoint"] = sapp.StorageEndpoint
23828	}
23829	if sapp.StorageAccountAccessKey != nil {
23830		objectMap["storageAccountAccessKey"] = sapp.StorageAccountAccessKey
23831	}
23832	if sapp.RetentionDays != nil {
23833		objectMap["retentionDays"] = sapp.RetentionDays
23834	}
23835	return json.Marshal(objectMap)
23836}
23837
23838// SecurityEvent a security event.
23839type SecurityEvent struct {
23840	// SecurityEventProperties - Resource properties.
23841	*SecurityEventProperties `json:"properties,omitempty"`
23842	// ID - READ-ONLY; Resource ID.
23843	ID *string `json:"id,omitempty"`
23844	// Name - READ-ONLY; Resource name.
23845	Name *string `json:"name,omitempty"`
23846	// Type - READ-ONLY; Resource type.
23847	Type *string `json:"type,omitempty"`
23848}
23849
23850// MarshalJSON is the custom marshaler for SecurityEvent.
23851func (se SecurityEvent) MarshalJSON() ([]byte, error) {
23852	objectMap := make(map[string]interface{})
23853	if se.SecurityEventProperties != nil {
23854		objectMap["properties"] = se.SecurityEventProperties
23855	}
23856	return json.Marshal(objectMap)
23857}
23858
23859// UnmarshalJSON is the custom unmarshaler for SecurityEvent struct.
23860func (se *SecurityEvent) UnmarshalJSON(body []byte) error {
23861	var m map[string]*json.RawMessage
23862	err := json.Unmarshal(body, &m)
23863	if err != nil {
23864		return err
23865	}
23866	for k, v := range m {
23867		switch k {
23868		case "properties":
23869			if v != nil {
23870				var securityEventProperties SecurityEventProperties
23871				err = json.Unmarshal(*v, &securityEventProperties)
23872				if err != nil {
23873					return err
23874				}
23875				se.SecurityEventProperties = &securityEventProperties
23876			}
23877		case "id":
23878			if v != nil {
23879				var ID string
23880				err = json.Unmarshal(*v, &ID)
23881				if err != nil {
23882					return err
23883				}
23884				se.ID = &ID
23885			}
23886		case "name":
23887			if v != nil {
23888				var name string
23889				err = json.Unmarshal(*v, &name)
23890				if err != nil {
23891					return err
23892				}
23893				se.Name = &name
23894			}
23895		case "type":
23896			if v != nil {
23897				var typeVar string
23898				err = json.Unmarshal(*v, &typeVar)
23899				if err != nil {
23900					return err
23901				}
23902				se.Type = &typeVar
23903			}
23904		}
23905	}
23906
23907	return nil
23908}
23909
23910// SecurityEventCollection a list of security events.
23911type SecurityEventCollection struct {
23912	autorest.Response `json:"-"`
23913	// Value - READ-ONLY; Array of results.
23914	Value *[]SecurityEvent `json:"value,omitempty"`
23915	// NextLink - READ-ONLY; Link to retrieve next page of results.
23916	NextLink *string `json:"nextLink,omitempty"`
23917}
23918
23919// MarshalJSON is the custom marshaler for SecurityEventCollection.
23920func (sec SecurityEventCollection) MarshalJSON() ([]byte, error) {
23921	objectMap := make(map[string]interface{})
23922	return json.Marshal(objectMap)
23923}
23924
23925// SecurityEventCollectionIterator provides access to a complete listing of SecurityEvent values.
23926type SecurityEventCollectionIterator struct {
23927	i    int
23928	page SecurityEventCollectionPage
23929}
23930
23931// NextWithContext advances to the next value.  If there was an error making
23932// the request the iterator does not advance and the error is returned.
23933func (iter *SecurityEventCollectionIterator) NextWithContext(ctx context.Context) (err error) {
23934	if tracing.IsEnabled() {
23935		ctx = tracing.StartSpan(ctx, fqdn+"/SecurityEventCollectionIterator.NextWithContext")
23936		defer func() {
23937			sc := -1
23938			if iter.Response().Response.Response != nil {
23939				sc = iter.Response().Response.Response.StatusCode
23940			}
23941			tracing.EndSpan(ctx, sc, err)
23942		}()
23943	}
23944	iter.i++
23945	if iter.i < len(iter.page.Values()) {
23946		return nil
23947	}
23948	err = iter.page.NextWithContext(ctx)
23949	if err != nil {
23950		iter.i--
23951		return err
23952	}
23953	iter.i = 0
23954	return nil
23955}
23956
23957// Next advances to the next value.  If there was an error making
23958// the request the iterator does not advance and the error is returned.
23959// Deprecated: Use NextWithContext() instead.
23960func (iter *SecurityEventCollectionIterator) Next() error {
23961	return iter.NextWithContext(context.Background())
23962}
23963
23964// NotDone returns true if the enumeration should be started or is not yet complete.
23965func (iter SecurityEventCollectionIterator) NotDone() bool {
23966	return iter.page.NotDone() && iter.i < len(iter.page.Values())
23967}
23968
23969// Response returns the raw server response from the last page request.
23970func (iter SecurityEventCollectionIterator) Response() SecurityEventCollection {
23971	return iter.page.Response()
23972}
23973
23974// Value returns the current value or a zero-initialized value if the
23975// iterator has advanced beyond the end of the collection.
23976func (iter SecurityEventCollectionIterator) Value() SecurityEvent {
23977	if !iter.page.NotDone() {
23978		return SecurityEvent{}
23979	}
23980	return iter.page.Values()[iter.i]
23981}
23982
23983// Creates a new instance of the SecurityEventCollectionIterator type.
23984func NewSecurityEventCollectionIterator(page SecurityEventCollectionPage) SecurityEventCollectionIterator {
23985	return SecurityEventCollectionIterator{page: page}
23986}
23987
23988// IsEmpty returns true if the ListResult contains no values.
23989func (sec SecurityEventCollection) IsEmpty() bool {
23990	return sec.Value == nil || len(*sec.Value) == 0
23991}
23992
23993// hasNextLink returns true if the NextLink is not empty.
23994func (sec SecurityEventCollection) hasNextLink() bool {
23995	return sec.NextLink != nil && len(*sec.NextLink) != 0
23996}
23997
23998// securityEventCollectionPreparer prepares a request to retrieve the next set of results.
23999// It returns nil if no more results exist.
24000func (sec SecurityEventCollection) securityEventCollectionPreparer(ctx context.Context) (*http.Request, error) {
24001	if !sec.hasNextLink() {
24002		return nil, nil
24003	}
24004	return autorest.Prepare((&http.Request{}).WithContext(ctx),
24005		autorest.AsJSON(),
24006		autorest.AsGet(),
24007		autorest.WithBaseURL(to.String(sec.NextLink)))
24008}
24009
24010// SecurityEventCollectionPage contains a page of SecurityEvent values.
24011type SecurityEventCollectionPage struct {
24012	fn  func(context.Context, SecurityEventCollection) (SecurityEventCollection, error)
24013	sec SecurityEventCollection
24014}
24015
24016// NextWithContext advances to the next page of values.  If there was an error making
24017// the request the page does not advance and the error is returned.
24018func (page *SecurityEventCollectionPage) NextWithContext(ctx context.Context) (err error) {
24019	if tracing.IsEnabled() {
24020		ctx = tracing.StartSpan(ctx, fqdn+"/SecurityEventCollectionPage.NextWithContext")
24021		defer func() {
24022			sc := -1
24023			if page.Response().Response.Response != nil {
24024				sc = page.Response().Response.Response.StatusCode
24025			}
24026			tracing.EndSpan(ctx, sc, err)
24027		}()
24028	}
24029	for {
24030		next, err := page.fn(ctx, page.sec)
24031		if err != nil {
24032			return err
24033		}
24034		page.sec = next
24035		if !next.hasNextLink() || !next.IsEmpty() {
24036			break
24037		}
24038	}
24039	return nil
24040}
24041
24042// Next advances to the next page of values.  If there was an error making
24043// the request the page does not advance and the error is returned.
24044// Deprecated: Use NextWithContext() instead.
24045func (page *SecurityEventCollectionPage) Next() error {
24046	return page.NextWithContext(context.Background())
24047}
24048
24049// NotDone returns true if the page enumeration should be started or is not yet complete.
24050func (page SecurityEventCollectionPage) NotDone() bool {
24051	return !page.sec.IsEmpty()
24052}
24053
24054// Response returns the raw server response from the last page request.
24055func (page SecurityEventCollectionPage) Response() SecurityEventCollection {
24056	return page.sec
24057}
24058
24059// Values returns the slice of values for the current page or nil if there are no values.
24060func (page SecurityEventCollectionPage) Values() []SecurityEvent {
24061	if page.sec.IsEmpty() {
24062		return nil
24063	}
24064	return *page.sec.Value
24065}
24066
24067// Creates a new instance of the SecurityEventCollectionPage type.
24068func NewSecurityEventCollectionPage(cur SecurityEventCollection, getNextPage func(context.Context, SecurityEventCollection) (SecurityEventCollection, error)) SecurityEventCollectionPage {
24069	return SecurityEventCollectionPage{
24070		fn:  getNextPage,
24071		sec: cur,
24072	}
24073}
24074
24075// SecurityEventProperties the properties of a security event.
24076type SecurityEventProperties struct {
24077	// EventTime - READ-ONLY; The time when the security event occurred.
24078	EventTime *date.Time `json:"eventTime,omitempty"`
24079	// SecurityEventType - READ-ONLY; The type of the security event. Possible values include: 'SecurityEventTypeUndefined', 'SecurityEventTypeSQLInjectionVulnerability', 'SecurityEventTypeSQLInjectionExploit'
24080	SecurityEventType SecurityEventType `json:"securityEventType,omitempty"`
24081	// Subscription - READ-ONLY; The subscription name
24082	Subscription *string `json:"subscription,omitempty"`
24083	// Server - READ-ONLY; The server name
24084	Server *string `json:"server,omitempty"`
24085	// Database - READ-ONLY; The database name
24086	Database *string `json:"database,omitempty"`
24087	// ClientIP - READ-ONLY; The IP address of the client who executed the statement.
24088	ClientIP *string `json:"clientIp,omitempty"`
24089	// ApplicationName - READ-ONLY; The application used to execute the statement.
24090	ApplicationName *string `json:"applicationName,omitempty"`
24091	// PrincipalName - READ-ONLY; The principal user who executed the statement
24092	PrincipalName *string `json:"principalName,omitempty"`
24093	// SecurityEventSQLInjectionAdditionalProperties - READ-ONLY; The sql injection additional properties, populated only if the type of the security event is sql injection.
24094	SecurityEventSQLInjectionAdditionalProperties *SecurityEventSQLInjectionAdditionalProperties `json:"securityEventSqlInjectionAdditionalProperties,omitempty"`
24095}
24096
24097// MarshalJSON is the custom marshaler for SecurityEventProperties.
24098func (sep SecurityEventProperties) MarshalJSON() ([]byte, error) {
24099	objectMap := make(map[string]interface{})
24100	return json.Marshal(objectMap)
24101}
24102
24103// SecurityEventsFilterParameters the properties that are supported in the $filter operation.
24104type SecurityEventsFilterParameters struct {
24105	// EventTime - Filter on the event time.
24106	EventTime *date.Time `json:"eventTime,omitempty"`
24107	// ShowServerRecords - Whether to show server records or not.
24108	ShowServerRecords *bool `json:"showServerRecords,omitempty"`
24109}
24110
24111// SecurityEventSQLInjectionAdditionalProperties the properties of a security event sql injection
24112// additional properties.
24113type SecurityEventSQLInjectionAdditionalProperties struct {
24114	// ThreatID - READ-ONLY; The threat ID.
24115	ThreatID *string `json:"threatId,omitempty"`
24116	// Statement - READ-ONLY; The statement
24117	Statement *string `json:"statement,omitempty"`
24118	// StatementHighlightOffset - READ-ONLY; The statement highlight offset
24119	StatementHighlightOffset *int32 `json:"statementHighlightOffset,omitempty"`
24120	// StatementHighlightLength - READ-ONLY; The statement highlight length
24121	StatementHighlightLength *int32 `json:"statementHighlightLength,omitempty"`
24122	// ErrorCode - READ-ONLY; The sql error code
24123	ErrorCode *int32 `json:"errorCode,omitempty"`
24124	// ErrorSeverity - READ-ONLY; The sql error severity
24125	ErrorSeverity *int32 `json:"errorSeverity,omitempty"`
24126	// ErrorMessage - READ-ONLY; The sql error message
24127	ErrorMessage *string `json:"errorMessage,omitempty"`
24128}
24129
24130// MarshalJSON is the custom marshaler for SecurityEventSQLInjectionAdditionalProperties.
24131func (sesiap SecurityEventSQLInjectionAdditionalProperties) MarshalJSON() ([]byte, error) {
24132	objectMap := make(map[string]interface{})
24133	return json.Marshal(objectMap)
24134}
24135
24136// SensitivityLabel a sensitivity label.
24137type SensitivityLabel struct {
24138	autorest.Response `json:"-"`
24139	// ManagedBy - READ-ONLY; Resource that manages the sensitivity label.
24140	ManagedBy *string `json:"managedBy,omitempty"`
24141	// SensitivityLabelProperties - Resource properties.
24142	*SensitivityLabelProperties `json:"properties,omitempty"`
24143	// ID - READ-ONLY; Resource ID.
24144	ID *string `json:"id,omitempty"`
24145	// Name - READ-ONLY; Resource name.
24146	Name *string `json:"name,omitempty"`
24147	// Type - READ-ONLY; Resource type.
24148	Type *string `json:"type,omitempty"`
24149}
24150
24151// MarshalJSON is the custom marshaler for SensitivityLabel.
24152func (sl SensitivityLabel) MarshalJSON() ([]byte, error) {
24153	objectMap := make(map[string]interface{})
24154	if sl.SensitivityLabelProperties != nil {
24155		objectMap["properties"] = sl.SensitivityLabelProperties
24156	}
24157	return json.Marshal(objectMap)
24158}
24159
24160// UnmarshalJSON is the custom unmarshaler for SensitivityLabel struct.
24161func (sl *SensitivityLabel) UnmarshalJSON(body []byte) error {
24162	var m map[string]*json.RawMessage
24163	err := json.Unmarshal(body, &m)
24164	if err != nil {
24165		return err
24166	}
24167	for k, v := range m {
24168		switch k {
24169		case "managedBy":
24170			if v != nil {
24171				var managedBy string
24172				err = json.Unmarshal(*v, &managedBy)
24173				if err != nil {
24174					return err
24175				}
24176				sl.ManagedBy = &managedBy
24177			}
24178		case "properties":
24179			if v != nil {
24180				var sensitivityLabelProperties SensitivityLabelProperties
24181				err = json.Unmarshal(*v, &sensitivityLabelProperties)
24182				if err != nil {
24183					return err
24184				}
24185				sl.SensitivityLabelProperties = &sensitivityLabelProperties
24186			}
24187		case "id":
24188			if v != nil {
24189				var ID string
24190				err = json.Unmarshal(*v, &ID)
24191				if err != nil {
24192					return err
24193				}
24194				sl.ID = &ID
24195			}
24196		case "name":
24197			if v != nil {
24198				var name string
24199				err = json.Unmarshal(*v, &name)
24200				if err != nil {
24201					return err
24202				}
24203				sl.Name = &name
24204			}
24205		case "type":
24206			if v != nil {
24207				var typeVar string
24208				err = json.Unmarshal(*v, &typeVar)
24209				if err != nil {
24210					return err
24211				}
24212				sl.Type = &typeVar
24213			}
24214		}
24215	}
24216
24217	return nil
24218}
24219
24220// SensitivityLabelListResult a list of sensitivity labels.
24221type SensitivityLabelListResult struct {
24222	autorest.Response `json:"-"`
24223	// Value - READ-ONLY; Array of results.
24224	Value *[]SensitivityLabel `json:"value,omitempty"`
24225	// NextLink - READ-ONLY; Link to retrieve next page of results.
24226	NextLink *string `json:"nextLink,omitempty"`
24227}
24228
24229// MarshalJSON is the custom marshaler for SensitivityLabelListResult.
24230func (sllr SensitivityLabelListResult) MarshalJSON() ([]byte, error) {
24231	objectMap := make(map[string]interface{})
24232	return json.Marshal(objectMap)
24233}
24234
24235// SensitivityLabelListResultIterator provides access to a complete listing of SensitivityLabel values.
24236type SensitivityLabelListResultIterator struct {
24237	i    int
24238	page SensitivityLabelListResultPage
24239}
24240
24241// NextWithContext advances to the next value.  If there was an error making
24242// the request the iterator does not advance and the error is returned.
24243func (iter *SensitivityLabelListResultIterator) NextWithContext(ctx context.Context) (err error) {
24244	if tracing.IsEnabled() {
24245		ctx = tracing.StartSpan(ctx, fqdn+"/SensitivityLabelListResultIterator.NextWithContext")
24246		defer func() {
24247			sc := -1
24248			if iter.Response().Response.Response != nil {
24249				sc = iter.Response().Response.Response.StatusCode
24250			}
24251			tracing.EndSpan(ctx, sc, err)
24252		}()
24253	}
24254	iter.i++
24255	if iter.i < len(iter.page.Values()) {
24256		return nil
24257	}
24258	err = iter.page.NextWithContext(ctx)
24259	if err != nil {
24260		iter.i--
24261		return err
24262	}
24263	iter.i = 0
24264	return nil
24265}
24266
24267// Next advances to the next value.  If there was an error making
24268// the request the iterator does not advance and the error is returned.
24269// Deprecated: Use NextWithContext() instead.
24270func (iter *SensitivityLabelListResultIterator) Next() error {
24271	return iter.NextWithContext(context.Background())
24272}
24273
24274// NotDone returns true if the enumeration should be started or is not yet complete.
24275func (iter SensitivityLabelListResultIterator) NotDone() bool {
24276	return iter.page.NotDone() && iter.i < len(iter.page.Values())
24277}
24278
24279// Response returns the raw server response from the last page request.
24280func (iter SensitivityLabelListResultIterator) Response() SensitivityLabelListResult {
24281	return iter.page.Response()
24282}
24283
24284// Value returns the current value or a zero-initialized value if the
24285// iterator has advanced beyond the end of the collection.
24286func (iter SensitivityLabelListResultIterator) Value() SensitivityLabel {
24287	if !iter.page.NotDone() {
24288		return SensitivityLabel{}
24289	}
24290	return iter.page.Values()[iter.i]
24291}
24292
24293// Creates a new instance of the SensitivityLabelListResultIterator type.
24294func NewSensitivityLabelListResultIterator(page SensitivityLabelListResultPage) SensitivityLabelListResultIterator {
24295	return SensitivityLabelListResultIterator{page: page}
24296}
24297
24298// IsEmpty returns true if the ListResult contains no values.
24299func (sllr SensitivityLabelListResult) IsEmpty() bool {
24300	return sllr.Value == nil || len(*sllr.Value) == 0
24301}
24302
24303// hasNextLink returns true if the NextLink is not empty.
24304func (sllr SensitivityLabelListResult) hasNextLink() bool {
24305	return sllr.NextLink != nil && len(*sllr.NextLink) != 0
24306}
24307
24308// sensitivityLabelListResultPreparer prepares a request to retrieve the next set of results.
24309// It returns nil if no more results exist.
24310func (sllr SensitivityLabelListResult) sensitivityLabelListResultPreparer(ctx context.Context) (*http.Request, error) {
24311	if !sllr.hasNextLink() {
24312		return nil, nil
24313	}
24314	return autorest.Prepare((&http.Request{}).WithContext(ctx),
24315		autorest.AsJSON(),
24316		autorest.AsGet(),
24317		autorest.WithBaseURL(to.String(sllr.NextLink)))
24318}
24319
24320// SensitivityLabelListResultPage contains a page of SensitivityLabel values.
24321type SensitivityLabelListResultPage struct {
24322	fn   func(context.Context, SensitivityLabelListResult) (SensitivityLabelListResult, error)
24323	sllr SensitivityLabelListResult
24324}
24325
24326// NextWithContext advances to the next page of values.  If there was an error making
24327// the request the page does not advance and the error is returned.
24328func (page *SensitivityLabelListResultPage) NextWithContext(ctx context.Context) (err error) {
24329	if tracing.IsEnabled() {
24330		ctx = tracing.StartSpan(ctx, fqdn+"/SensitivityLabelListResultPage.NextWithContext")
24331		defer func() {
24332			sc := -1
24333			if page.Response().Response.Response != nil {
24334				sc = page.Response().Response.Response.StatusCode
24335			}
24336			tracing.EndSpan(ctx, sc, err)
24337		}()
24338	}
24339	for {
24340		next, err := page.fn(ctx, page.sllr)
24341		if err != nil {
24342			return err
24343		}
24344		page.sllr = next
24345		if !next.hasNextLink() || !next.IsEmpty() {
24346			break
24347		}
24348	}
24349	return nil
24350}
24351
24352// Next advances to the next page of values.  If there was an error making
24353// the request the page does not advance and the error is returned.
24354// Deprecated: Use NextWithContext() instead.
24355func (page *SensitivityLabelListResultPage) Next() error {
24356	return page.NextWithContext(context.Background())
24357}
24358
24359// NotDone returns true if the page enumeration should be started or is not yet complete.
24360func (page SensitivityLabelListResultPage) NotDone() bool {
24361	return !page.sllr.IsEmpty()
24362}
24363
24364// Response returns the raw server response from the last page request.
24365func (page SensitivityLabelListResultPage) Response() SensitivityLabelListResult {
24366	return page.sllr
24367}
24368
24369// Values returns the slice of values for the current page or nil if there are no values.
24370func (page SensitivityLabelListResultPage) Values() []SensitivityLabel {
24371	if page.sllr.IsEmpty() {
24372		return nil
24373	}
24374	return *page.sllr.Value
24375}
24376
24377// Creates a new instance of the SensitivityLabelListResultPage type.
24378func NewSensitivityLabelListResultPage(cur SensitivityLabelListResult, getNextPage func(context.Context, SensitivityLabelListResult) (SensitivityLabelListResult, error)) SensitivityLabelListResultPage {
24379	return SensitivityLabelListResultPage{
24380		fn:   getNextPage,
24381		sllr: cur,
24382	}
24383}
24384
24385// SensitivityLabelProperties properties of a sensitivity label.
24386type SensitivityLabelProperties struct {
24387	// SchemaName - READ-ONLY; The schema name.
24388	SchemaName *string `json:"schemaName,omitempty"`
24389	// TableName - READ-ONLY; The table name.
24390	TableName *string `json:"tableName,omitempty"`
24391	// ColumnName - READ-ONLY; The column name.
24392	ColumnName *string `json:"columnName,omitempty"`
24393	// LabelName - The label name.
24394	LabelName *string `json:"labelName,omitempty"`
24395	// LabelID - The label ID.
24396	LabelID *string `json:"labelId,omitempty"`
24397	// InformationType - The information type.
24398	InformationType *string `json:"informationType,omitempty"`
24399	// InformationTypeID - The information type ID.
24400	InformationTypeID *string `json:"informationTypeId,omitempty"`
24401	// IsDisabled - READ-ONLY; Is sensitivity recommendation disabled. Applicable for recommended sensitivity label only. Specifies whether the sensitivity recommendation on this column is disabled (dismissed) or not.
24402	IsDisabled *bool `json:"isDisabled,omitempty"`
24403	// Rank - Possible values include: 'SensitivityLabelRankNone', 'SensitivityLabelRankLow', 'SensitivityLabelRankMedium', 'SensitivityLabelRankHigh', 'SensitivityLabelRankCritical'
24404	Rank SensitivityLabelRank `json:"rank,omitempty"`
24405}
24406
24407// MarshalJSON is the custom marshaler for SensitivityLabelProperties.
24408func (slp SensitivityLabelProperties) MarshalJSON() ([]byte, error) {
24409	objectMap := make(map[string]interface{})
24410	if slp.LabelName != nil {
24411		objectMap["labelName"] = slp.LabelName
24412	}
24413	if slp.LabelID != nil {
24414		objectMap["labelId"] = slp.LabelID
24415	}
24416	if slp.InformationType != nil {
24417		objectMap["informationType"] = slp.InformationType
24418	}
24419	if slp.InformationTypeID != nil {
24420		objectMap["informationTypeId"] = slp.InformationTypeID
24421	}
24422	if slp.Rank != "" {
24423		objectMap["rank"] = slp.Rank
24424	}
24425	return json.Marshal(objectMap)
24426}
24427
24428// SensitivityLabelUpdate a sensitivity label update operation.
24429type SensitivityLabelUpdate struct {
24430	// SensitivityLabelUpdateProperties - Resource properties.
24431	*SensitivityLabelUpdateProperties `json:"properties,omitempty"`
24432	// ID - READ-ONLY; Resource ID.
24433	ID *string `json:"id,omitempty"`
24434	// Name - READ-ONLY; Resource name.
24435	Name *string `json:"name,omitempty"`
24436	// Type - READ-ONLY; Resource type.
24437	Type *string `json:"type,omitempty"`
24438}
24439
24440// MarshalJSON is the custom marshaler for SensitivityLabelUpdate.
24441func (slu SensitivityLabelUpdate) MarshalJSON() ([]byte, error) {
24442	objectMap := make(map[string]interface{})
24443	if slu.SensitivityLabelUpdateProperties != nil {
24444		objectMap["properties"] = slu.SensitivityLabelUpdateProperties
24445	}
24446	return json.Marshal(objectMap)
24447}
24448
24449// UnmarshalJSON is the custom unmarshaler for SensitivityLabelUpdate struct.
24450func (slu *SensitivityLabelUpdate) UnmarshalJSON(body []byte) error {
24451	var m map[string]*json.RawMessage
24452	err := json.Unmarshal(body, &m)
24453	if err != nil {
24454		return err
24455	}
24456	for k, v := range m {
24457		switch k {
24458		case "properties":
24459			if v != nil {
24460				var sensitivityLabelUpdateProperties SensitivityLabelUpdateProperties
24461				err = json.Unmarshal(*v, &sensitivityLabelUpdateProperties)
24462				if err != nil {
24463					return err
24464				}
24465				slu.SensitivityLabelUpdateProperties = &sensitivityLabelUpdateProperties
24466			}
24467		case "id":
24468			if v != nil {
24469				var ID string
24470				err = json.Unmarshal(*v, &ID)
24471				if err != nil {
24472					return err
24473				}
24474				slu.ID = &ID
24475			}
24476		case "name":
24477			if v != nil {
24478				var name string
24479				err = json.Unmarshal(*v, &name)
24480				if err != nil {
24481					return err
24482				}
24483				slu.Name = &name
24484			}
24485		case "type":
24486			if v != nil {
24487				var typeVar string
24488				err = json.Unmarshal(*v, &typeVar)
24489				if err != nil {
24490					return err
24491				}
24492				slu.Type = &typeVar
24493			}
24494		}
24495	}
24496
24497	return nil
24498}
24499
24500// SensitivityLabelUpdateList a list of sensitivity label update operations.
24501type SensitivityLabelUpdateList struct {
24502	Operations *[]SensitivityLabelUpdate `json:"operations,omitempty"`
24503}
24504
24505// SensitivityLabelUpdateProperties properties of an operation executed on a sensitivity label.
24506type SensitivityLabelUpdateProperties struct {
24507	// Op - Possible values include: 'SensitivityLabelUpdateKindSet', 'SensitivityLabelUpdateKindRemove'
24508	Op SensitivityLabelUpdateKind `json:"op,omitempty"`
24509	// Schema - Schema name of the column to update.
24510	Schema *string `json:"schema,omitempty"`
24511	// Table - Table name of the column to update.
24512	Table *string `json:"table,omitempty"`
24513	// Column - Column name to update.
24514	Column *string `json:"column,omitempty"`
24515	// SensitivityLabel - The sensitivity label information to apply on a column.
24516	SensitivityLabel *SensitivityLabel `json:"sensitivityLabel,omitempty"`
24517}
24518
24519// Server an Azure SQL Database server.
24520type Server struct {
24521	autorest.Response `json:"-"`
24522	// Identity - The Azure Active Directory identity of the server.
24523	Identity *ResourceIdentity `json:"identity,omitempty"`
24524	// Kind - READ-ONLY; Kind of sql server. This is metadata used for the Azure portal experience.
24525	Kind *string `json:"kind,omitempty"`
24526	// ServerProperties - Resource properties.
24527	*ServerProperties `json:"properties,omitempty"`
24528	// Location - Resource location.
24529	Location *string `json:"location,omitempty"`
24530	// Tags - Resource tags.
24531	Tags map[string]*string `json:"tags"`
24532	// ID - READ-ONLY; Resource ID.
24533	ID *string `json:"id,omitempty"`
24534	// Name - READ-ONLY; Resource name.
24535	Name *string `json:"name,omitempty"`
24536	// Type - READ-ONLY; Resource type.
24537	Type *string `json:"type,omitempty"`
24538}
24539
24540// MarshalJSON is the custom marshaler for Server.
24541func (s Server) MarshalJSON() ([]byte, error) {
24542	objectMap := make(map[string]interface{})
24543	if s.Identity != nil {
24544		objectMap["identity"] = s.Identity
24545	}
24546	if s.ServerProperties != nil {
24547		objectMap["properties"] = s.ServerProperties
24548	}
24549	if s.Location != nil {
24550		objectMap["location"] = s.Location
24551	}
24552	if s.Tags != nil {
24553		objectMap["tags"] = s.Tags
24554	}
24555	return json.Marshal(objectMap)
24556}
24557
24558// UnmarshalJSON is the custom unmarshaler for Server struct.
24559func (s *Server) UnmarshalJSON(body []byte) error {
24560	var m map[string]*json.RawMessage
24561	err := json.Unmarshal(body, &m)
24562	if err != nil {
24563		return err
24564	}
24565	for k, v := range m {
24566		switch k {
24567		case "identity":
24568			if v != nil {
24569				var identity ResourceIdentity
24570				err = json.Unmarshal(*v, &identity)
24571				if err != nil {
24572					return err
24573				}
24574				s.Identity = &identity
24575			}
24576		case "kind":
24577			if v != nil {
24578				var kind string
24579				err = json.Unmarshal(*v, &kind)
24580				if err != nil {
24581					return err
24582				}
24583				s.Kind = &kind
24584			}
24585		case "properties":
24586			if v != nil {
24587				var serverProperties ServerProperties
24588				err = json.Unmarshal(*v, &serverProperties)
24589				if err != nil {
24590					return err
24591				}
24592				s.ServerProperties = &serverProperties
24593			}
24594		case "location":
24595			if v != nil {
24596				var location string
24597				err = json.Unmarshal(*v, &location)
24598				if err != nil {
24599					return err
24600				}
24601				s.Location = &location
24602			}
24603		case "tags":
24604			if v != nil {
24605				var tags map[string]*string
24606				err = json.Unmarshal(*v, &tags)
24607				if err != nil {
24608					return err
24609				}
24610				s.Tags = tags
24611			}
24612		case "id":
24613			if v != nil {
24614				var ID string
24615				err = json.Unmarshal(*v, &ID)
24616				if err != nil {
24617					return err
24618				}
24619				s.ID = &ID
24620			}
24621		case "name":
24622			if v != nil {
24623				var name string
24624				err = json.Unmarshal(*v, &name)
24625				if err != nil {
24626					return err
24627				}
24628				s.Name = &name
24629			}
24630		case "type":
24631			if v != nil {
24632				var typeVar string
24633				err = json.Unmarshal(*v, &typeVar)
24634				if err != nil {
24635					return err
24636				}
24637				s.Type = &typeVar
24638			}
24639		}
24640	}
24641
24642	return nil
24643}
24644
24645// ServerAutomaticTuning server-level Automatic Tuning.
24646type ServerAutomaticTuning struct {
24647	autorest.Response `json:"-"`
24648	// AutomaticTuningServerProperties - Resource properties.
24649	*AutomaticTuningServerProperties `json:"properties,omitempty"`
24650	// ID - READ-ONLY; Resource ID.
24651	ID *string `json:"id,omitempty"`
24652	// Name - READ-ONLY; Resource name.
24653	Name *string `json:"name,omitempty"`
24654	// Type - READ-ONLY; Resource type.
24655	Type *string `json:"type,omitempty"`
24656}
24657
24658// MarshalJSON is the custom marshaler for ServerAutomaticTuning.
24659func (sat ServerAutomaticTuning) MarshalJSON() ([]byte, error) {
24660	objectMap := make(map[string]interface{})
24661	if sat.AutomaticTuningServerProperties != nil {
24662		objectMap["properties"] = sat.AutomaticTuningServerProperties
24663	}
24664	return json.Marshal(objectMap)
24665}
24666
24667// UnmarshalJSON is the custom unmarshaler for ServerAutomaticTuning struct.
24668func (sat *ServerAutomaticTuning) UnmarshalJSON(body []byte) error {
24669	var m map[string]*json.RawMessage
24670	err := json.Unmarshal(body, &m)
24671	if err != nil {
24672		return err
24673	}
24674	for k, v := range m {
24675		switch k {
24676		case "properties":
24677			if v != nil {
24678				var automaticTuningServerProperties AutomaticTuningServerProperties
24679				err = json.Unmarshal(*v, &automaticTuningServerProperties)
24680				if err != nil {
24681					return err
24682				}
24683				sat.AutomaticTuningServerProperties = &automaticTuningServerProperties
24684			}
24685		case "id":
24686			if v != nil {
24687				var ID string
24688				err = json.Unmarshal(*v, &ID)
24689				if err != nil {
24690					return err
24691				}
24692				sat.ID = &ID
24693			}
24694		case "name":
24695			if v != nil {
24696				var name string
24697				err = json.Unmarshal(*v, &name)
24698				if err != nil {
24699					return err
24700				}
24701				sat.Name = &name
24702			}
24703		case "type":
24704			if v != nil {
24705				var typeVar string
24706				err = json.Unmarshal(*v, &typeVar)
24707				if err != nil {
24708					return err
24709				}
24710				sat.Type = &typeVar
24711			}
24712		}
24713	}
24714
24715	return nil
24716}
24717
24718// ServerAzureADAdministrator azure Active Directory administrator.
24719type ServerAzureADAdministrator struct {
24720	autorest.Response `json:"-"`
24721	// AdministratorProperties - Resource properties.
24722	*AdministratorProperties `json:"properties,omitempty"`
24723	// ID - READ-ONLY; Resource ID.
24724	ID *string `json:"id,omitempty"`
24725	// Name - READ-ONLY; Resource name.
24726	Name *string `json:"name,omitempty"`
24727	// Type - READ-ONLY; Resource type.
24728	Type *string `json:"type,omitempty"`
24729}
24730
24731// MarshalJSON is the custom marshaler for ServerAzureADAdministrator.
24732func (saaa ServerAzureADAdministrator) MarshalJSON() ([]byte, error) {
24733	objectMap := make(map[string]interface{})
24734	if saaa.AdministratorProperties != nil {
24735		objectMap["properties"] = saaa.AdministratorProperties
24736	}
24737	return json.Marshal(objectMap)
24738}
24739
24740// UnmarshalJSON is the custom unmarshaler for ServerAzureADAdministrator struct.
24741func (saaa *ServerAzureADAdministrator) UnmarshalJSON(body []byte) error {
24742	var m map[string]*json.RawMessage
24743	err := json.Unmarshal(body, &m)
24744	if err != nil {
24745		return err
24746	}
24747	for k, v := range m {
24748		switch k {
24749		case "properties":
24750			if v != nil {
24751				var administratorProperties AdministratorProperties
24752				err = json.Unmarshal(*v, &administratorProperties)
24753				if err != nil {
24754					return err
24755				}
24756				saaa.AdministratorProperties = &administratorProperties
24757			}
24758		case "id":
24759			if v != nil {
24760				var ID string
24761				err = json.Unmarshal(*v, &ID)
24762				if err != nil {
24763					return err
24764				}
24765				saaa.ID = &ID
24766			}
24767		case "name":
24768			if v != nil {
24769				var name string
24770				err = json.Unmarshal(*v, &name)
24771				if err != nil {
24772					return err
24773				}
24774				saaa.Name = &name
24775			}
24776		case "type":
24777			if v != nil {
24778				var typeVar string
24779				err = json.Unmarshal(*v, &typeVar)
24780				if err != nil {
24781					return err
24782				}
24783				saaa.Type = &typeVar
24784			}
24785		}
24786	}
24787
24788	return nil
24789}
24790
24791// ServerAzureADAdministratorsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results
24792// of a long-running operation.
24793type ServerAzureADAdministratorsCreateOrUpdateFuture struct {
24794	azure.FutureAPI
24795	// Result returns the result of the asynchronous operation.
24796	// If the operation has not completed it will return an error.
24797	Result func(ServerAzureADAdministratorsClient) (ServerAzureADAdministrator, error)
24798}
24799
24800// UnmarshalJSON is the custom unmarshaller for CreateFuture.
24801func (future *ServerAzureADAdministratorsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
24802	var azFuture azure.Future
24803	if err := json.Unmarshal(body, &azFuture); err != nil {
24804		return err
24805	}
24806	future.FutureAPI = &azFuture
24807	future.Result = future.result
24808	return nil
24809}
24810
24811// result is the default implementation for ServerAzureADAdministratorsCreateOrUpdateFuture.Result.
24812func (future *ServerAzureADAdministratorsCreateOrUpdateFuture) result(client ServerAzureADAdministratorsClient) (saaa ServerAzureADAdministrator, err error) {
24813	var done bool
24814	done, err = future.DoneWithContext(context.Background(), client)
24815	if err != nil {
24816		err = autorest.NewErrorWithError(err, "sql.ServerAzureADAdministratorsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
24817		return
24818	}
24819	if !done {
24820		saaa.Response.Response = future.Response()
24821		err = azure.NewAsyncOpIncompleteError("sql.ServerAzureADAdministratorsCreateOrUpdateFuture")
24822		return
24823	}
24824	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
24825	if saaa.Response.Response, err = future.GetResult(sender); err == nil && saaa.Response.Response.StatusCode != http.StatusNoContent {
24826		saaa, err = client.CreateOrUpdateResponder(saaa.Response.Response)
24827		if err != nil {
24828			err = autorest.NewErrorWithError(err, "sql.ServerAzureADAdministratorsCreateOrUpdateFuture", "Result", saaa.Response.Response, "Failure responding to request")
24829		}
24830	}
24831	return
24832}
24833
24834// ServerAzureADAdministratorsDeleteFuture an abstraction for monitoring and retrieving the results of a
24835// long-running operation.
24836type ServerAzureADAdministratorsDeleteFuture struct {
24837	azure.FutureAPI
24838	// Result returns the result of the asynchronous operation.
24839	// If the operation has not completed it will return an error.
24840	Result func(ServerAzureADAdministratorsClient) (autorest.Response, error)
24841}
24842
24843// UnmarshalJSON is the custom unmarshaller for CreateFuture.
24844func (future *ServerAzureADAdministratorsDeleteFuture) UnmarshalJSON(body []byte) error {
24845	var azFuture azure.Future
24846	if err := json.Unmarshal(body, &azFuture); err != nil {
24847		return err
24848	}
24849	future.FutureAPI = &azFuture
24850	future.Result = future.result
24851	return nil
24852}
24853
24854// result is the default implementation for ServerAzureADAdministratorsDeleteFuture.Result.
24855func (future *ServerAzureADAdministratorsDeleteFuture) result(client ServerAzureADAdministratorsClient) (ar autorest.Response, err error) {
24856	var done bool
24857	done, err = future.DoneWithContext(context.Background(), client)
24858	if err != nil {
24859		err = autorest.NewErrorWithError(err, "sql.ServerAzureADAdministratorsDeleteFuture", "Result", future.Response(), "Polling failure")
24860		return
24861	}
24862	if !done {
24863		ar.Response = future.Response()
24864		err = azure.NewAsyncOpIncompleteError("sql.ServerAzureADAdministratorsDeleteFuture")
24865		return
24866	}
24867	ar.Response = future.Response()
24868	return
24869}
24870
24871// ServerAzureADOnlyAuthentication azure Active Directory only authentication.
24872type ServerAzureADOnlyAuthentication struct {
24873	autorest.Response `json:"-"`
24874	// AzureADOnlyAuthProperties - Resource properties.
24875	*AzureADOnlyAuthProperties `json:"properties,omitempty"`
24876	// ID - READ-ONLY; Resource ID.
24877	ID *string `json:"id,omitempty"`
24878	// Name - READ-ONLY; Resource name.
24879	Name *string `json:"name,omitempty"`
24880	// Type - READ-ONLY; Resource type.
24881	Type *string `json:"type,omitempty"`
24882}
24883
24884// MarshalJSON is the custom marshaler for ServerAzureADOnlyAuthentication.
24885func (saaoa ServerAzureADOnlyAuthentication) MarshalJSON() ([]byte, error) {
24886	objectMap := make(map[string]interface{})
24887	if saaoa.AzureADOnlyAuthProperties != nil {
24888		objectMap["properties"] = saaoa.AzureADOnlyAuthProperties
24889	}
24890	return json.Marshal(objectMap)
24891}
24892
24893// UnmarshalJSON is the custom unmarshaler for ServerAzureADOnlyAuthentication struct.
24894func (saaoa *ServerAzureADOnlyAuthentication) UnmarshalJSON(body []byte) error {
24895	var m map[string]*json.RawMessage
24896	err := json.Unmarshal(body, &m)
24897	if err != nil {
24898		return err
24899	}
24900	for k, v := range m {
24901		switch k {
24902		case "properties":
24903			if v != nil {
24904				var azureADOnlyAuthProperties AzureADOnlyAuthProperties
24905				err = json.Unmarshal(*v, &azureADOnlyAuthProperties)
24906				if err != nil {
24907					return err
24908				}
24909				saaoa.AzureADOnlyAuthProperties = &azureADOnlyAuthProperties
24910			}
24911		case "id":
24912			if v != nil {
24913				var ID string
24914				err = json.Unmarshal(*v, &ID)
24915				if err != nil {
24916					return err
24917				}
24918				saaoa.ID = &ID
24919			}
24920		case "name":
24921			if v != nil {
24922				var name string
24923				err = json.Unmarshal(*v, &name)
24924				if err != nil {
24925					return err
24926				}
24927				saaoa.Name = &name
24928			}
24929		case "type":
24930			if v != nil {
24931				var typeVar string
24932				err = json.Unmarshal(*v, &typeVar)
24933				if err != nil {
24934					return err
24935				}
24936				saaoa.Type = &typeVar
24937			}
24938		}
24939	}
24940
24941	return nil
24942}
24943
24944// ServerAzureADOnlyAuthenticationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the
24945// results of a long-running operation.
24946type ServerAzureADOnlyAuthenticationsCreateOrUpdateFuture struct {
24947	azure.FutureAPI
24948	// Result returns the result of the asynchronous operation.
24949	// If the operation has not completed it will return an error.
24950	Result func(ServerAzureADOnlyAuthenticationsClient) (ServerAzureADOnlyAuthentication, error)
24951}
24952
24953// UnmarshalJSON is the custom unmarshaller for CreateFuture.
24954func (future *ServerAzureADOnlyAuthenticationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
24955	var azFuture azure.Future
24956	if err := json.Unmarshal(body, &azFuture); err != nil {
24957		return err
24958	}
24959	future.FutureAPI = &azFuture
24960	future.Result = future.result
24961	return nil
24962}
24963
24964// result is the default implementation for ServerAzureADOnlyAuthenticationsCreateOrUpdateFuture.Result.
24965func (future *ServerAzureADOnlyAuthenticationsCreateOrUpdateFuture) result(client ServerAzureADOnlyAuthenticationsClient) (saaoa ServerAzureADOnlyAuthentication, err error) {
24966	var done bool
24967	done, err = future.DoneWithContext(context.Background(), client)
24968	if err != nil {
24969		err = autorest.NewErrorWithError(err, "sql.ServerAzureADOnlyAuthenticationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
24970		return
24971	}
24972	if !done {
24973		saaoa.Response.Response = future.Response()
24974		err = azure.NewAsyncOpIncompleteError("sql.ServerAzureADOnlyAuthenticationsCreateOrUpdateFuture")
24975		return
24976	}
24977	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
24978	if saaoa.Response.Response, err = future.GetResult(sender); err == nil && saaoa.Response.Response.StatusCode != http.StatusNoContent {
24979		saaoa, err = client.CreateOrUpdateResponder(saaoa.Response.Response)
24980		if err != nil {
24981			err = autorest.NewErrorWithError(err, "sql.ServerAzureADOnlyAuthenticationsCreateOrUpdateFuture", "Result", saaoa.Response.Response, "Failure responding to request")
24982		}
24983	}
24984	return
24985}
24986
24987// ServerAzureADOnlyAuthenticationsDeleteFuture an abstraction for monitoring and retrieving the results of
24988// a long-running operation.
24989type ServerAzureADOnlyAuthenticationsDeleteFuture struct {
24990	azure.FutureAPI
24991	// Result returns the result of the asynchronous operation.
24992	// If the operation has not completed it will return an error.
24993	Result func(ServerAzureADOnlyAuthenticationsClient) (autorest.Response, error)
24994}
24995
24996// UnmarshalJSON is the custom unmarshaller for CreateFuture.
24997func (future *ServerAzureADOnlyAuthenticationsDeleteFuture) UnmarshalJSON(body []byte) error {
24998	var azFuture azure.Future
24999	if err := json.Unmarshal(body, &azFuture); err != nil {
25000		return err
25001	}
25002	future.FutureAPI = &azFuture
25003	future.Result = future.result
25004	return nil
25005}
25006
25007// result is the default implementation for ServerAzureADOnlyAuthenticationsDeleteFuture.Result.
25008func (future *ServerAzureADOnlyAuthenticationsDeleteFuture) result(client ServerAzureADOnlyAuthenticationsClient) (ar autorest.Response, err error) {
25009	var done bool
25010	done, err = future.DoneWithContext(context.Background(), client)
25011	if err != nil {
25012		err = autorest.NewErrorWithError(err, "sql.ServerAzureADOnlyAuthenticationsDeleteFuture", "Result", future.Response(), "Polling failure")
25013		return
25014	}
25015	if !done {
25016		ar.Response = future.Response()
25017		err = azure.NewAsyncOpIncompleteError("sql.ServerAzureADOnlyAuthenticationsDeleteFuture")
25018		return
25019	}
25020	ar.Response = future.Response()
25021	return
25022}
25023
25024// ServerBlobAuditingPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results
25025// of a long-running operation.
25026type ServerBlobAuditingPoliciesCreateOrUpdateFuture struct {
25027	azure.FutureAPI
25028	// Result returns the result of the asynchronous operation.
25029	// If the operation has not completed it will return an error.
25030	Result func(ServerBlobAuditingPoliciesClient) (ServerBlobAuditingPolicy, error)
25031}
25032
25033// UnmarshalJSON is the custom unmarshaller for CreateFuture.
25034func (future *ServerBlobAuditingPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
25035	var azFuture azure.Future
25036	if err := json.Unmarshal(body, &azFuture); err != nil {
25037		return err
25038	}
25039	future.FutureAPI = &azFuture
25040	future.Result = future.result
25041	return nil
25042}
25043
25044// result is the default implementation for ServerBlobAuditingPoliciesCreateOrUpdateFuture.Result.
25045func (future *ServerBlobAuditingPoliciesCreateOrUpdateFuture) result(client ServerBlobAuditingPoliciesClient) (sbap ServerBlobAuditingPolicy, err error) {
25046	var done bool
25047	done, err = future.DoneWithContext(context.Background(), client)
25048	if err != nil {
25049		err = autorest.NewErrorWithError(err, "sql.ServerBlobAuditingPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
25050		return
25051	}
25052	if !done {
25053		sbap.Response.Response = future.Response()
25054		err = azure.NewAsyncOpIncompleteError("sql.ServerBlobAuditingPoliciesCreateOrUpdateFuture")
25055		return
25056	}
25057	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
25058	if sbap.Response.Response, err = future.GetResult(sender); err == nil && sbap.Response.Response.StatusCode != http.StatusNoContent {
25059		sbap, err = client.CreateOrUpdateResponder(sbap.Response.Response)
25060		if err != nil {
25061			err = autorest.NewErrorWithError(err, "sql.ServerBlobAuditingPoliciesCreateOrUpdateFuture", "Result", sbap.Response.Response, "Failure responding to request")
25062		}
25063	}
25064	return
25065}
25066
25067// ServerBlobAuditingPolicy a server blob auditing policy.
25068type ServerBlobAuditingPolicy struct {
25069	autorest.Response `json:"-"`
25070	// ServerBlobAuditingPolicyProperties - Resource properties.
25071	*ServerBlobAuditingPolicyProperties `json:"properties,omitempty"`
25072	// ID - READ-ONLY; Resource ID.
25073	ID *string `json:"id,omitempty"`
25074	// Name - READ-ONLY; Resource name.
25075	Name *string `json:"name,omitempty"`
25076	// Type - READ-ONLY; Resource type.
25077	Type *string `json:"type,omitempty"`
25078}
25079
25080// MarshalJSON is the custom marshaler for ServerBlobAuditingPolicy.
25081func (sbap ServerBlobAuditingPolicy) MarshalJSON() ([]byte, error) {
25082	objectMap := make(map[string]interface{})
25083	if sbap.ServerBlobAuditingPolicyProperties != nil {
25084		objectMap["properties"] = sbap.ServerBlobAuditingPolicyProperties
25085	}
25086	return json.Marshal(objectMap)
25087}
25088
25089// UnmarshalJSON is the custom unmarshaler for ServerBlobAuditingPolicy struct.
25090func (sbap *ServerBlobAuditingPolicy) UnmarshalJSON(body []byte) error {
25091	var m map[string]*json.RawMessage
25092	err := json.Unmarshal(body, &m)
25093	if err != nil {
25094		return err
25095	}
25096	for k, v := range m {
25097		switch k {
25098		case "properties":
25099			if v != nil {
25100				var serverBlobAuditingPolicyProperties ServerBlobAuditingPolicyProperties
25101				err = json.Unmarshal(*v, &serverBlobAuditingPolicyProperties)
25102				if err != nil {
25103					return err
25104				}
25105				sbap.ServerBlobAuditingPolicyProperties = &serverBlobAuditingPolicyProperties
25106			}
25107		case "id":
25108			if v != nil {
25109				var ID string
25110				err = json.Unmarshal(*v, &ID)
25111				if err != nil {
25112					return err
25113				}
25114				sbap.ID = &ID
25115			}
25116		case "name":
25117			if v != nil {
25118				var name string
25119				err = json.Unmarshal(*v, &name)
25120				if err != nil {
25121					return err
25122				}
25123				sbap.Name = &name
25124			}
25125		case "type":
25126			if v != nil {
25127				var typeVar string
25128				err = json.Unmarshal(*v, &typeVar)
25129				if err != nil {
25130					return err
25131				}
25132				sbap.Type = &typeVar
25133			}
25134		}
25135	}
25136
25137	return nil
25138}
25139
25140// ServerBlobAuditingPolicyListResult a list of server auditing settings.
25141type ServerBlobAuditingPolicyListResult struct {
25142	autorest.Response `json:"-"`
25143	// Value - READ-ONLY; Array of results.
25144	Value *[]ServerBlobAuditingPolicy `json:"value,omitempty"`
25145	// NextLink - READ-ONLY; Link to retrieve next page of results.
25146	NextLink *string `json:"nextLink,omitempty"`
25147}
25148
25149// MarshalJSON is the custom marshaler for ServerBlobAuditingPolicyListResult.
25150func (sbaplr ServerBlobAuditingPolicyListResult) MarshalJSON() ([]byte, error) {
25151	objectMap := make(map[string]interface{})
25152	return json.Marshal(objectMap)
25153}
25154
25155// ServerBlobAuditingPolicyListResultIterator provides access to a complete listing of
25156// ServerBlobAuditingPolicy values.
25157type ServerBlobAuditingPolicyListResultIterator struct {
25158	i    int
25159	page ServerBlobAuditingPolicyListResultPage
25160}
25161
25162// NextWithContext advances to the next value.  If there was an error making
25163// the request the iterator does not advance and the error is returned.
25164func (iter *ServerBlobAuditingPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
25165	if tracing.IsEnabled() {
25166		ctx = tracing.StartSpan(ctx, fqdn+"/ServerBlobAuditingPolicyListResultIterator.NextWithContext")
25167		defer func() {
25168			sc := -1
25169			if iter.Response().Response.Response != nil {
25170				sc = iter.Response().Response.Response.StatusCode
25171			}
25172			tracing.EndSpan(ctx, sc, err)
25173		}()
25174	}
25175	iter.i++
25176	if iter.i < len(iter.page.Values()) {
25177		return nil
25178	}
25179	err = iter.page.NextWithContext(ctx)
25180	if err != nil {
25181		iter.i--
25182		return err
25183	}
25184	iter.i = 0
25185	return nil
25186}
25187
25188// Next advances to the next value.  If there was an error making
25189// the request the iterator does not advance and the error is returned.
25190// Deprecated: Use NextWithContext() instead.
25191func (iter *ServerBlobAuditingPolicyListResultIterator) Next() error {
25192	return iter.NextWithContext(context.Background())
25193}
25194
25195// NotDone returns true if the enumeration should be started or is not yet complete.
25196func (iter ServerBlobAuditingPolicyListResultIterator) NotDone() bool {
25197	return iter.page.NotDone() && iter.i < len(iter.page.Values())
25198}
25199
25200// Response returns the raw server response from the last page request.
25201func (iter ServerBlobAuditingPolicyListResultIterator) Response() ServerBlobAuditingPolicyListResult {
25202	return iter.page.Response()
25203}
25204
25205// Value returns the current value or a zero-initialized value if the
25206// iterator has advanced beyond the end of the collection.
25207func (iter ServerBlobAuditingPolicyListResultIterator) Value() ServerBlobAuditingPolicy {
25208	if !iter.page.NotDone() {
25209		return ServerBlobAuditingPolicy{}
25210	}
25211	return iter.page.Values()[iter.i]
25212}
25213
25214// Creates a new instance of the ServerBlobAuditingPolicyListResultIterator type.
25215func NewServerBlobAuditingPolicyListResultIterator(page ServerBlobAuditingPolicyListResultPage) ServerBlobAuditingPolicyListResultIterator {
25216	return ServerBlobAuditingPolicyListResultIterator{page: page}
25217}
25218
25219// IsEmpty returns true if the ListResult contains no values.
25220func (sbaplr ServerBlobAuditingPolicyListResult) IsEmpty() bool {
25221	return sbaplr.Value == nil || len(*sbaplr.Value) == 0
25222}
25223
25224// hasNextLink returns true if the NextLink is not empty.
25225func (sbaplr ServerBlobAuditingPolicyListResult) hasNextLink() bool {
25226	return sbaplr.NextLink != nil && len(*sbaplr.NextLink) != 0
25227}
25228
25229// serverBlobAuditingPolicyListResultPreparer prepares a request to retrieve the next set of results.
25230// It returns nil if no more results exist.
25231func (sbaplr ServerBlobAuditingPolicyListResult) serverBlobAuditingPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
25232	if !sbaplr.hasNextLink() {
25233		return nil, nil
25234	}
25235	return autorest.Prepare((&http.Request{}).WithContext(ctx),
25236		autorest.AsJSON(),
25237		autorest.AsGet(),
25238		autorest.WithBaseURL(to.String(sbaplr.NextLink)))
25239}
25240
25241// ServerBlobAuditingPolicyListResultPage contains a page of ServerBlobAuditingPolicy values.
25242type ServerBlobAuditingPolicyListResultPage struct {
25243	fn     func(context.Context, ServerBlobAuditingPolicyListResult) (ServerBlobAuditingPolicyListResult, error)
25244	sbaplr ServerBlobAuditingPolicyListResult
25245}
25246
25247// NextWithContext advances to the next page of values.  If there was an error making
25248// the request the page does not advance and the error is returned.
25249func (page *ServerBlobAuditingPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
25250	if tracing.IsEnabled() {
25251		ctx = tracing.StartSpan(ctx, fqdn+"/ServerBlobAuditingPolicyListResultPage.NextWithContext")
25252		defer func() {
25253			sc := -1
25254			if page.Response().Response.Response != nil {
25255				sc = page.Response().Response.Response.StatusCode
25256			}
25257			tracing.EndSpan(ctx, sc, err)
25258		}()
25259	}
25260	for {
25261		next, err := page.fn(ctx, page.sbaplr)
25262		if err != nil {
25263			return err
25264		}
25265		page.sbaplr = next
25266		if !next.hasNextLink() || !next.IsEmpty() {
25267			break
25268		}
25269	}
25270	return nil
25271}
25272
25273// Next advances to the next page of values.  If there was an error making
25274// the request the page does not advance and the error is returned.
25275// Deprecated: Use NextWithContext() instead.
25276func (page *ServerBlobAuditingPolicyListResultPage) Next() error {
25277	return page.NextWithContext(context.Background())
25278}
25279
25280// NotDone returns true if the page enumeration should be started or is not yet complete.
25281func (page ServerBlobAuditingPolicyListResultPage) NotDone() bool {
25282	return !page.sbaplr.IsEmpty()
25283}
25284
25285// Response returns the raw server response from the last page request.
25286func (page ServerBlobAuditingPolicyListResultPage) Response() ServerBlobAuditingPolicyListResult {
25287	return page.sbaplr
25288}
25289
25290// Values returns the slice of values for the current page or nil if there are no values.
25291func (page ServerBlobAuditingPolicyListResultPage) Values() []ServerBlobAuditingPolicy {
25292	if page.sbaplr.IsEmpty() {
25293		return nil
25294	}
25295	return *page.sbaplr.Value
25296}
25297
25298// Creates a new instance of the ServerBlobAuditingPolicyListResultPage type.
25299func NewServerBlobAuditingPolicyListResultPage(cur ServerBlobAuditingPolicyListResult, getNextPage func(context.Context, ServerBlobAuditingPolicyListResult) (ServerBlobAuditingPolicyListResult, error)) ServerBlobAuditingPolicyListResultPage {
25300	return ServerBlobAuditingPolicyListResultPage{
25301		fn:     getNextPage,
25302		sbaplr: cur,
25303	}
25304}
25305
25306// ServerBlobAuditingPolicyProperties properties of a server blob auditing policy.
25307type ServerBlobAuditingPolicyProperties struct {
25308	// IsDevopsAuditEnabled - Specifies the state of devops audit. If state is Enabled, devops logs will be sent to Azure Monitor.
25309	// In order to send the events to Azure Monitor, specify 'State' as 'Enabled', 'IsAzureMonitorTargetEnabled' as true and 'IsDevopsAuditEnabled' as true
25310	//
25311	// When using REST API to configure auditing, Diagnostic Settings with 'DevOpsOperationsAudit' diagnostic logs category on the master database should also be created.
25312	//
25313	// Diagnostic Settings URI format:
25314	// PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/master/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview
25315	//
25316	// For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207)
25317	// or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)
25318	IsDevopsAuditEnabled *bool `json:"isDevopsAuditEnabled,omitempty"`
25319	// RetentionDays - Specifies the number of days to keep in the audit logs in the storage account.
25320	RetentionDays *int32 `json:"retentionDays,omitempty"`
25321	// AuditActionsAndGroups - Specifies the Actions-Groups and Actions to audit.
25322	//
25323	// 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:
25324	//
25325	// BATCH_COMPLETED_GROUP,
25326	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP,
25327	// FAILED_DATABASE_AUTHENTICATION_GROUP.
25328	//
25329	// This above combination is also the set that is configured by default when enabling auditing from the Azure portal.
25330	//
25331	// 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):
25332	//
25333	// APPLICATION_ROLE_CHANGE_PASSWORD_GROUP
25334	// BACKUP_RESTORE_GROUP
25335	// DATABASE_LOGOUT_GROUP
25336	// DATABASE_OBJECT_CHANGE_GROUP
25337	// DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP
25338	// DATABASE_OBJECT_PERMISSION_CHANGE_GROUP
25339	// DATABASE_OPERATION_GROUP
25340	// DATABASE_PERMISSION_CHANGE_GROUP
25341	// DATABASE_PRINCIPAL_CHANGE_GROUP
25342	// DATABASE_PRINCIPAL_IMPERSONATION_GROUP
25343	// DATABASE_ROLE_MEMBER_CHANGE_GROUP
25344	// FAILED_DATABASE_AUTHENTICATION_GROUP
25345	// SCHEMA_OBJECT_ACCESS_GROUP
25346	// SCHEMA_OBJECT_CHANGE_GROUP
25347	// SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP
25348	// SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP
25349	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP
25350	// USER_CHANGE_PASSWORD_GROUP
25351	// BATCH_STARTED_GROUP
25352	// BATCH_COMPLETED_GROUP
25353	//
25354	// 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.
25355	//
25356	// 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).
25357	//
25358	// 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:
25359	// SELECT
25360	// UPDATE
25361	// INSERT
25362	// DELETE
25363	// EXECUTE
25364	// RECEIVE
25365	// REFERENCES
25366	//
25367	// The general form for defining an action to be audited is:
25368	// {action} ON {object} BY {principal}
25369	//
25370	// 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.
25371	//
25372	// For example:
25373	// SELECT on dbo.myTable by public
25374	// SELECT on DATABASE::myDatabase by public
25375	// SELECT on SCHEMA::mySchema by public
25376	//
25377	// 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)
25378	AuditActionsAndGroups *[]string `json:"auditActionsAndGroups,omitempty"`
25379	// IsStorageSecondaryKeyInUse - Specifies whether storageAccountAccessKey value is the storage's secondary key.
25380	IsStorageSecondaryKeyInUse *bool `json:"isStorageSecondaryKeyInUse,omitempty"`
25381	// IsAzureMonitorTargetEnabled - Specifies whether audit events are sent to Azure Monitor.
25382	// In order to send the events to Azure Monitor, specify 'State' as 'Enabled' and 'IsAzureMonitorTargetEnabled' as true.
25383	//
25384	// When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created.
25385	// Note that for server level audit you should use the 'master' database as {databaseName}.
25386	//
25387	// Diagnostic Settings URI format:
25388	// PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview
25389	//
25390	// For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207)
25391	// or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)
25392	IsAzureMonitorTargetEnabled *bool `json:"isAzureMonitorTargetEnabled,omitempty"`
25393	// QueueDelayMs - Specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed.
25394	// The default minimum value is 1000 (1 second). The maximum is 2,147,483,647.
25395	QueueDelayMs *int32 `json:"queueDelayMs,omitempty"`
25396	// State - Specifies the state of the audit. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. Possible values include: 'BlobAuditingPolicyStateEnabled', 'BlobAuditingPolicyStateDisabled'
25397	State BlobAuditingPolicyState `json:"state,omitempty"`
25398	// StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required.
25399	StorageEndpoint *string `json:"storageEndpoint,omitempty"`
25400	// StorageAccountAccessKey - Specifies the identifier key of the auditing storage account.
25401	// If state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage.
25402	// Prerequisites for using managed identity authentication:
25403	// 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD).
25404	// 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity.
25405	// For more information, see [Auditing to storage using Managed Identity authentication](https://go.microsoft.com/fwlink/?linkid=2114355)
25406	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
25407	// StorageAccountSubscriptionID - Specifies the blob storage subscription Id.
25408	StorageAccountSubscriptionID *uuid.UUID `json:"storageAccountSubscriptionId,omitempty"`
25409}
25410
25411// ServerCommunicationLink server communication link.
25412type ServerCommunicationLink struct {
25413	autorest.Response `json:"-"`
25414	// ServerCommunicationLinkProperties - The properties of resource.
25415	*ServerCommunicationLinkProperties `json:"properties,omitempty"`
25416	// Location - READ-ONLY; Communication link location.
25417	Location *string `json:"location,omitempty"`
25418	// Kind - READ-ONLY; Communication link kind.  This property is used for Azure Portal metadata.
25419	Kind *string `json:"kind,omitempty"`
25420	// ID - READ-ONLY; Resource ID.
25421	ID *string `json:"id,omitempty"`
25422	// Name - READ-ONLY; Resource name.
25423	Name *string `json:"name,omitempty"`
25424	// Type - READ-ONLY; Resource type.
25425	Type *string `json:"type,omitempty"`
25426}
25427
25428// MarshalJSON is the custom marshaler for ServerCommunicationLink.
25429func (scl ServerCommunicationLink) MarshalJSON() ([]byte, error) {
25430	objectMap := make(map[string]interface{})
25431	if scl.ServerCommunicationLinkProperties != nil {
25432		objectMap["properties"] = scl.ServerCommunicationLinkProperties
25433	}
25434	return json.Marshal(objectMap)
25435}
25436
25437// UnmarshalJSON is the custom unmarshaler for ServerCommunicationLink struct.
25438func (scl *ServerCommunicationLink) UnmarshalJSON(body []byte) error {
25439	var m map[string]*json.RawMessage
25440	err := json.Unmarshal(body, &m)
25441	if err != nil {
25442		return err
25443	}
25444	for k, v := range m {
25445		switch k {
25446		case "properties":
25447			if v != nil {
25448				var serverCommunicationLinkProperties ServerCommunicationLinkProperties
25449				err = json.Unmarshal(*v, &serverCommunicationLinkProperties)
25450				if err != nil {
25451					return err
25452				}
25453				scl.ServerCommunicationLinkProperties = &serverCommunicationLinkProperties
25454			}
25455		case "location":
25456			if v != nil {
25457				var location string
25458				err = json.Unmarshal(*v, &location)
25459				if err != nil {
25460					return err
25461				}
25462				scl.Location = &location
25463			}
25464		case "kind":
25465			if v != nil {
25466				var kind string
25467				err = json.Unmarshal(*v, &kind)
25468				if err != nil {
25469					return err
25470				}
25471				scl.Kind = &kind
25472			}
25473		case "id":
25474			if v != nil {
25475				var ID string
25476				err = json.Unmarshal(*v, &ID)
25477				if err != nil {
25478					return err
25479				}
25480				scl.ID = &ID
25481			}
25482		case "name":
25483			if v != nil {
25484				var name string
25485				err = json.Unmarshal(*v, &name)
25486				if err != nil {
25487					return err
25488				}
25489				scl.Name = &name
25490			}
25491		case "type":
25492			if v != nil {
25493				var typeVar string
25494				err = json.Unmarshal(*v, &typeVar)
25495				if err != nil {
25496					return err
25497				}
25498				scl.Type = &typeVar
25499			}
25500		}
25501	}
25502
25503	return nil
25504}
25505
25506// ServerCommunicationLinkListResult a list of server communication links.
25507type ServerCommunicationLinkListResult struct {
25508	autorest.Response `json:"-"`
25509	// Value - The list of server communication links.
25510	Value *[]ServerCommunicationLink `json:"value,omitempty"`
25511}
25512
25513// ServerCommunicationLinkProperties the properties of a server communication link.
25514type ServerCommunicationLinkProperties struct {
25515	// State - READ-ONLY; The state.
25516	State *string `json:"state,omitempty"`
25517	// PartnerServer - The name of the partner server.
25518	PartnerServer *string `json:"partnerServer,omitempty"`
25519}
25520
25521// MarshalJSON is the custom marshaler for ServerCommunicationLinkProperties.
25522func (sclp ServerCommunicationLinkProperties) MarshalJSON() ([]byte, error) {
25523	objectMap := make(map[string]interface{})
25524	if sclp.PartnerServer != nil {
25525		objectMap["partnerServer"] = sclp.PartnerServer
25526	}
25527	return json.Marshal(objectMap)
25528}
25529
25530// ServerCommunicationLinksCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of
25531// a long-running operation.
25532type ServerCommunicationLinksCreateOrUpdateFuture struct {
25533	azure.FutureAPI
25534	// Result returns the result of the asynchronous operation.
25535	// If the operation has not completed it will return an error.
25536	Result func(ServerCommunicationLinksClient) (ServerCommunicationLink, error)
25537}
25538
25539// UnmarshalJSON is the custom unmarshaller for CreateFuture.
25540func (future *ServerCommunicationLinksCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
25541	var azFuture azure.Future
25542	if err := json.Unmarshal(body, &azFuture); err != nil {
25543		return err
25544	}
25545	future.FutureAPI = &azFuture
25546	future.Result = future.result
25547	return nil
25548}
25549
25550// result is the default implementation for ServerCommunicationLinksCreateOrUpdateFuture.Result.
25551func (future *ServerCommunicationLinksCreateOrUpdateFuture) result(client ServerCommunicationLinksClient) (scl ServerCommunicationLink, err error) {
25552	var done bool
25553	done, err = future.DoneWithContext(context.Background(), client)
25554	if err != nil {
25555		err = autorest.NewErrorWithError(err, "sql.ServerCommunicationLinksCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
25556		return
25557	}
25558	if !done {
25559		scl.Response.Response = future.Response()
25560		err = azure.NewAsyncOpIncompleteError("sql.ServerCommunicationLinksCreateOrUpdateFuture")
25561		return
25562	}
25563	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
25564	if scl.Response.Response, err = future.GetResult(sender); err == nil && scl.Response.Response.StatusCode != http.StatusNoContent {
25565		scl, err = client.CreateOrUpdateResponder(scl.Response.Response)
25566		if err != nil {
25567			err = autorest.NewErrorWithError(err, "sql.ServerCommunicationLinksCreateOrUpdateFuture", "Result", scl.Response.Response, "Failure responding to request")
25568		}
25569	}
25570	return
25571}
25572
25573// ServerConnectionPolicy a server secure connection policy.
25574type ServerConnectionPolicy struct {
25575	autorest.Response `json:"-"`
25576	// Kind - READ-ONLY; Metadata used for the Azure portal experience.
25577	Kind *string `json:"kind,omitempty"`
25578	// Location - READ-ONLY; Resource location.
25579	Location *string `json:"location,omitempty"`
25580	// ServerConnectionPolicyProperties - The properties of the server secure connection policy.
25581	*ServerConnectionPolicyProperties `json:"properties,omitempty"`
25582	// ID - READ-ONLY; Resource ID.
25583	ID *string `json:"id,omitempty"`
25584	// Name - READ-ONLY; Resource name.
25585	Name *string `json:"name,omitempty"`
25586	// Type - READ-ONLY; Resource type.
25587	Type *string `json:"type,omitempty"`
25588}
25589
25590// MarshalJSON is the custom marshaler for ServerConnectionPolicy.
25591func (scp ServerConnectionPolicy) MarshalJSON() ([]byte, error) {
25592	objectMap := make(map[string]interface{})
25593	if scp.ServerConnectionPolicyProperties != nil {
25594		objectMap["properties"] = scp.ServerConnectionPolicyProperties
25595	}
25596	return json.Marshal(objectMap)
25597}
25598
25599// UnmarshalJSON is the custom unmarshaler for ServerConnectionPolicy struct.
25600func (scp *ServerConnectionPolicy) UnmarshalJSON(body []byte) error {
25601	var m map[string]*json.RawMessage
25602	err := json.Unmarshal(body, &m)
25603	if err != nil {
25604		return err
25605	}
25606	for k, v := range m {
25607		switch k {
25608		case "kind":
25609			if v != nil {
25610				var kind string
25611				err = json.Unmarshal(*v, &kind)
25612				if err != nil {
25613					return err
25614				}
25615				scp.Kind = &kind
25616			}
25617		case "location":
25618			if v != nil {
25619				var location string
25620				err = json.Unmarshal(*v, &location)
25621				if err != nil {
25622					return err
25623				}
25624				scp.Location = &location
25625			}
25626		case "properties":
25627			if v != nil {
25628				var serverConnectionPolicyProperties ServerConnectionPolicyProperties
25629				err = json.Unmarshal(*v, &serverConnectionPolicyProperties)
25630				if err != nil {
25631					return err
25632				}
25633				scp.ServerConnectionPolicyProperties = &serverConnectionPolicyProperties
25634			}
25635		case "id":
25636			if v != nil {
25637				var ID string
25638				err = json.Unmarshal(*v, &ID)
25639				if err != nil {
25640					return err
25641				}
25642				scp.ID = &ID
25643			}
25644		case "name":
25645			if v != nil {
25646				var name string
25647				err = json.Unmarshal(*v, &name)
25648				if err != nil {
25649					return err
25650				}
25651				scp.Name = &name
25652			}
25653		case "type":
25654			if v != nil {
25655				var typeVar string
25656				err = json.Unmarshal(*v, &typeVar)
25657				if err != nil {
25658					return err
25659				}
25660				scp.Type = &typeVar
25661			}
25662		}
25663	}
25664
25665	return nil
25666}
25667
25668// ServerConnectionPolicyProperties the properties of a server secure connection policy.
25669type ServerConnectionPolicyProperties struct {
25670	// ConnectionType - The server connection type. Possible values include: 'ServerConnectionTypeDefault', 'ServerConnectionTypeProxy', 'ServerConnectionTypeRedirect'
25671	ConnectionType ServerConnectionType `json:"connectionType,omitempty"`
25672}
25673
25674// ServerDevOpsAuditingSettings a server DevOps auditing settings.
25675type ServerDevOpsAuditingSettings struct {
25676	autorest.Response `json:"-"`
25677	// SystemData - READ-ONLY; SystemData of ServerDevOpsAuditSettingsResource.
25678	SystemData *SystemData `json:"systemData,omitempty"`
25679	// ServerDevOpsAuditSettingsProperties - Resource properties.
25680	*ServerDevOpsAuditSettingsProperties `json:"properties,omitempty"`
25681	// ID - READ-ONLY; Resource ID.
25682	ID *string `json:"id,omitempty"`
25683	// Name - READ-ONLY; Resource name.
25684	Name *string `json:"name,omitempty"`
25685	// Type - READ-ONLY; Resource type.
25686	Type *string `json:"type,omitempty"`
25687}
25688
25689// MarshalJSON is the custom marshaler for ServerDevOpsAuditingSettings.
25690func (sdoas ServerDevOpsAuditingSettings) MarshalJSON() ([]byte, error) {
25691	objectMap := make(map[string]interface{})
25692	if sdoas.ServerDevOpsAuditSettingsProperties != nil {
25693		objectMap["properties"] = sdoas.ServerDevOpsAuditSettingsProperties
25694	}
25695	return json.Marshal(objectMap)
25696}
25697
25698// UnmarshalJSON is the custom unmarshaler for ServerDevOpsAuditingSettings struct.
25699func (sdoas *ServerDevOpsAuditingSettings) UnmarshalJSON(body []byte) error {
25700	var m map[string]*json.RawMessage
25701	err := json.Unmarshal(body, &m)
25702	if err != nil {
25703		return err
25704	}
25705	for k, v := range m {
25706		switch k {
25707		case "systemData":
25708			if v != nil {
25709				var systemData SystemData
25710				err = json.Unmarshal(*v, &systemData)
25711				if err != nil {
25712					return err
25713				}
25714				sdoas.SystemData = &systemData
25715			}
25716		case "properties":
25717			if v != nil {
25718				var serverDevOpsAuditSettingsProperties ServerDevOpsAuditSettingsProperties
25719				err = json.Unmarshal(*v, &serverDevOpsAuditSettingsProperties)
25720				if err != nil {
25721					return err
25722				}
25723				sdoas.ServerDevOpsAuditSettingsProperties = &serverDevOpsAuditSettingsProperties
25724			}
25725		case "id":
25726			if v != nil {
25727				var ID string
25728				err = json.Unmarshal(*v, &ID)
25729				if err != nil {
25730					return err
25731				}
25732				sdoas.ID = &ID
25733			}
25734		case "name":
25735			if v != nil {
25736				var name string
25737				err = json.Unmarshal(*v, &name)
25738				if err != nil {
25739					return err
25740				}
25741				sdoas.Name = &name
25742			}
25743		case "type":
25744			if v != nil {
25745				var typeVar string
25746				err = json.Unmarshal(*v, &typeVar)
25747				if err != nil {
25748					return err
25749				}
25750				sdoas.Type = &typeVar
25751			}
25752		}
25753	}
25754
25755	return nil
25756}
25757
25758// ServerDevOpsAuditSettingsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results
25759// of a long-running operation.
25760type ServerDevOpsAuditSettingsCreateOrUpdateFuture struct {
25761	azure.FutureAPI
25762	// Result returns the result of the asynchronous operation.
25763	// If the operation has not completed it will return an error.
25764	Result func(ServerDevOpsAuditSettingsClient) (ServerDevOpsAuditingSettings, error)
25765}
25766
25767// UnmarshalJSON is the custom unmarshaller for CreateFuture.
25768func (future *ServerDevOpsAuditSettingsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
25769	var azFuture azure.Future
25770	if err := json.Unmarshal(body, &azFuture); err != nil {
25771		return err
25772	}
25773	future.FutureAPI = &azFuture
25774	future.Result = future.result
25775	return nil
25776}
25777
25778// result is the default implementation for ServerDevOpsAuditSettingsCreateOrUpdateFuture.Result.
25779func (future *ServerDevOpsAuditSettingsCreateOrUpdateFuture) result(client ServerDevOpsAuditSettingsClient) (sdoas ServerDevOpsAuditingSettings, err error) {
25780	var done bool
25781	done, err = future.DoneWithContext(context.Background(), client)
25782	if err != nil {
25783		err = autorest.NewErrorWithError(err, "sql.ServerDevOpsAuditSettingsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
25784		return
25785	}
25786	if !done {
25787		sdoas.Response.Response = future.Response()
25788		err = azure.NewAsyncOpIncompleteError("sql.ServerDevOpsAuditSettingsCreateOrUpdateFuture")
25789		return
25790	}
25791	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
25792	if sdoas.Response.Response, err = future.GetResult(sender); err == nil && sdoas.Response.Response.StatusCode != http.StatusNoContent {
25793		sdoas, err = client.CreateOrUpdateResponder(sdoas.Response.Response)
25794		if err != nil {
25795			err = autorest.NewErrorWithError(err, "sql.ServerDevOpsAuditSettingsCreateOrUpdateFuture", "Result", sdoas.Response.Response, "Failure responding to request")
25796		}
25797	}
25798	return
25799}
25800
25801// ServerDevOpsAuditSettingsListResult a list of server DevOps audit settings.
25802type ServerDevOpsAuditSettingsListResult struct {
25803	autorest.Response `json:"-"`
25804	// Value - READ-ONLY; Array of results.
25805	Value *[]ServerDevOpsAuditingSettings `json:"value,omitempty"`
25806	// NextLink - READ-ONLY; Link to retrieve next page of results.
25807	NextLink *string `json:"nextLink,omitempty"`
25808}
25809
25810// MarshalJSON is the custom marshaler for ServerDevOpsAuditSettingsListResult.
25811func (sdoaslr ServerDevOpsAuditSettingsListResult) MarshalJSON() ([]byte, error) {
25812	objectMap := make(map[string]interface{})
25813	return json.Marshal(objectMap)
25814}
25815
25816// ServerDevOpsAuditSettingsListResultIterator provides access to a complete listing of
25817// ServerDevOpsAuditingSettings values.
25818type ServerDevOpsAuditSettingsListResultIterator struct {
25819	i    int
25820	page ServerDevOpsAuditSettingsListResultPage
25821}
25822
25823// NextWithContext advances to the next value.  If there was an error making
25824// the request the iterator does not advance and the error is returned.
25825func (iter *ServerDevOpsAuditSettingsListResultIterator) NextWithContext(ctx context.Context) (err error) {
25826	if tracing.IsEnabled() {
25827		ctx = tracing.StartSpan(ctx, fqdn+"/ServerDevOpsAuditSettingsListResultIterator.NextWithContext")
25828		defer func() {
25829			sc := -1
25830			if iter.Response().Response.Response != nil {
25831				sc = iter.Response().Response.Response.StatusCode
25832			}
25833			tracing.EndSpan(ctx, sc, err)
25834		}()
25835	}
25836	iter.i++
25837	if iter.i < len(iter.page.Values()) {
25838		return nil
25839	}
25840	err = iter.page.NextWithContext(ctx)
25841	if err != nil {
25842		iter.i--
25843		return err
25844	}
25845	iter.i = 0
25846	return nil
25847}
25848
25849// Next advances to the next value.  If there was an error making
25850// the request the iterator does not advance and the error is returned.
25851// Deprecated: Use NextWithContext() instead.
25852func (iter *ServerDevOpsAuditSettingsListResultIterator) Next() error {
25853	return iter.NextWithContext(context.Background())
25854}
25855
25856// NotDone returns true if the enumeration should be started or is not yet complete.
25857func (iter ServerDevOpsAuditSettingsListResultIterator) NotDone() bool {
25858	return iter.page.NotDone() && iter.i < len(iter.page.Values())
25859}
25860
25861// Response returns the raw server response from the last page request.
25862func (iter ServerDevOpsAuditSettingsListResultIterator) Response() ServerDevOpsAuditSettingsListResult {
25863	return iter.page.Response()
25864}
25865
25866// Value returns the current value or a zero-initialized value if the
25867// iterator has advanced beyond the end of the collection.
25868func (iter ServerDevOpsAuditSettingsListResultIterator) Value() ServerDevOpsAuditingSettings {
25869	if !iter.page.NotDone() {
25870		return ServerDevOpsAuditingSettings{}
25871	}
25872	return iter.page.Values()[iter.i]
25873}
25874
25875// Creates a new instance of the ServerDevOpsAuditSettingsListResultIterator type.
25876func NewServerDevOpsAuditSettingsListResultIterator(page ServerDevOpsAuditSettingsListResultPage) ServerDevOpsAuditSettingsListResultIterator {
25877	return ServerDevOpsAuditSettingsListResultIterator{page: page}
25878}
25879
25880// IsEmpty returns true if the ListResult contains no values.
25881func (sdoaslr ServerDevOpsAuditSettingsListResult) IsEmpty() bool {
25882	return sdoaslr.Value == nil || len(*sdoaslr.Value) == 0
25883}
25884
25885// hasNextLink returns true if the NextLink is not empty.
25886func (sdoaslr ServerDevOpsAuditSettingsListResult) hasNextLink() bool {
25887	return sdoaslr.NextLink != nil && len(*sdoaslr.NextLink) != 0
25888}
25889
25890// serverDevOpsAuditSettingsListResultPreparer prepares a request to retrieve the next set of results.
25891// It returns nil if no more results exist.
25892func (sdoaslr ServerDevOpsAuditSettingsListResult) serverDevOpsAuditSettingsListResultPreparer(ctx context.Context) (*http.Request, error) {
25893	if !sdoaslr.hasNextLink() {
25894		return nil, nil
25895	}
25896	return autorest.Prepare((&http.Request{}).WithContext(ctx),
25897		autorest.AsJSON(),
25898		autorest.AsGet(),
25899		autorest.WithBaseURL(to.String(sdoaslr.NextLink)))
25900}
25901
25902// ServerDevOpsAuditSettingsListResultPage contains a page of ServerDevOpsAuditingSettings values.
25903type ServerDevOpsAuditSettingsListResultPage struct {
25904	fn      func(context.Context, ServerDevOpsAuditSettingsListResult) (ServerDevOpsAuditSettingsListResult, error)
25905	sdoaslr ServerDevOpsAuditSettingsListResult
25906}
25907
25908// NextWithContext advances to the next page of values.  If there was an error making
25909// the request the page does not advance and the error is returned.
25910func (page *ServerDevOpsAuditSettingsListResultPage) NextWithContext(ctx context.Context) (err error) {
25911	if tracing.IsEnabled() {
25912		ctx = tracing.StartSpan(ctx, fqdn+"/ServerDevOpsAuditSettingsListResultPage.NextWithContext")
25913		defer func() {
25914			sc := -1
25915			if page.Response().Response.Response != nil {
25916				sc = page.Response().Response.Response.StatusCode
25917			}
25918			tracing.EndSpan(ctx, sc, err)
25919		}()
25920	}
25921	for {
25922		next, err := page.fn(ctx, page.sdoaslr)
25923		if err != nil {
25924			return err
25925		}
25926		page.sdoaslr = next
25927		if !next.hasNextLink() || !next.IsEmpty() {
25928			break
25929		}
25930	}
25931	return nil
25932}
25933
25934// Next advances to the next page of values.  If there was an error making
25935// the request the page does not advance and the error is returned.
25936// Deprecated: Use NextWithContext() instead.
25937func (page *ServerDevOpsAuditSettingsListResultPage) Next() error {
25938	return page.NextWithContext(context.Background())
25939}
25940
25941// NotDone returns true if the page enumeration should be started or is not yet complete.
25942func (page ServerDevOpsAuditSettingsListResultPage) NotDone() bool {
25943	return !page.sdoaslr.IsEmpty()
25944}
25945
25946// Response returns the raw server response from the last page request.
25947func (page ServerDevOpsAuditSettingsListResultPage) Response() ServerDevOpsAuditSettingsListResult {
25948	return page.sdoaslr
25949}
25950
25951// Values returns the slice of values for the current page or nil if there are no values.
25952func (page ServerDevOpsAuditSettingsListResultPage) Values() []ServerDevOpsAuditingSettings {
25953	if page.sdoaslr.IsEmpty() {
25954		return nil
25955	}
25956	return *page.sdoaslr.Value
25957}
25958
25959// Creates a new instance of the ServerDevOpsAuditSettingsListResultPage type.
25960func NewServerDevOpsAuditSettingsListResultPage(cur ServerDevOpsAuditSettingsListResult, getNextPage func(context.Context, ServerDevOpsAuditSettingsListResult) (ServerDevOpsAuditSettingsListResult, error)) ServerDevOpsAuditSettingsListResultPage {
25961	return ServerDevOpsAuditSettingsListResultPage{
25962		fn:      getNextPage,
25963		sdoaslr: cur,
25964	}
25965}
25966
25967// ServerDevOpsAuditSettingsProperties properties of a server DevOps audit settings.
25968type ServerDevOpsAuditSettingsProperties struct {
25969	// IsAzureMonitorTargetEnabled - Specifies whether DevOps audit events are sent to Azure Monitor.
25970	// In order to send the events to Azure Monitor, specify 'State' as 'Enabled' and 'IsAzureMonitorTargetEnabled' as true.
25971	//
25972	// When using REST API to configure DevOps audit, Diagnostic Settings with 'DevOpsOperationsAudit' diagnostic logs category on the master database should be also created.
25973	//
25974	// Diagnostic Settings URI format:
25975	// PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/master/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview
25976	//
25977	// For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207)
25978	// or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)
25979	IsAzureMonitorTargetEnabled *bool `json:"isAzureMonitorTargetEnabled,omitempty"`
25980	// State - Specifies the state of the audit. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. Possible values include: 'BlobAuditingPolicyStateEnabled', 'BlobAuditingPolicyStateDisabled'
25981	State BlobAuditingPolicyState `json:"state,omitempty"`
25982	// StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required.
25983	StorageEndpoint *string `json:"storageEndpoint,omitempty"`
25984	// StorageAccountAccessKey - Specifies the identifier key of the auditing storage account.
25985	// If state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage.
25986	// Prerequisites for using managed identity authentication:
25987	// 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD).
25988	// 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity.
25989	// For more information, see [Auditing to storage using Managed Identity authentication](https://go.microsoft.com/fwlink/?linkid=2114355)
25990	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
25991	// StorageAccountSubscriptionID - Specifies the blob storage subscription Id.
25992	StorageAccountSubscriptionID *uuid.UUID `json:"storageAccountSubscriptionId,omitempty"`
25993}
25994
25995// ServerDNSAlias a server DNS alias.
25996type ServerDNSAlias struct {
25997	autorest.Response `json:"-"`
25998	// ServerDNSAliasProperties - Resource properties.
25999	*ServerDNSAliasProperties `json:"properties,omitempty"`
26000	// ID - READ-ONLY; Resource ID.
26001	ID *string `json:"id,omitempty"`
26002	// Name - READ-ONLY; Resource name.
26003	Name *string `json:"name,omitempty"`
26004	// Type - READ-ONLY; Resource type.
26005	Type *string `json:"type,omitempty"`
26006}
26007
26008// MarshalJSON is the custom marshaler for ServerDNSAlias.
26009func (sda ServerDNSAlias) MarshalJSON() ([]byte, error) {
26010	objectMap := make(map[string]interface{})
26011	if sda.ServerDNSAliasProperties != nil {
26012		objectMap["properties"] = sda.ServerDNSAliasProperties
26013	}
26014	return json.Marshal(objectMap)
26015}
26016
26017// UnmarshalJSON is the custom unmarshaler for ServerDNSAlias struct.
26018func (sda *ServerDNSAlias) UnmarshalJSON(body []byte) error {
26019	var m map[string]*json.RawMessage
26020	err := json.Unmarshal(body, &m)
26021	if err != nil {
26022		return err
26023	}
26024	for k, v := range m {
26025		switch k {
26026		case "properties":
26027			if v != nil {
26028				var serverDNSAliasProperties ServerDNSAliasProperties
26029				err = json.Unmarshal(*v, &serverDNSAliasProperties)
26030				if err != nil {
26031					return err
26032				}
26033				sda.ServerDNSAliasProperties = &serverDNSAliasProperties
26034			}
26035		case "id":
26036			if v != nil {
26037				var ID string
26038				err = json.Unmarshal(*v, &ID)
26039				if err != nil {
26040					return err
26041				}
26042				sda.ID = &ID
26043			}
26044		case "name":
26045			if v != nil {
26046				var name string
26047				err = json.Unmarshal(*v, &name)
26048				if err != nil {
26049					return err
26050				}
26051				sda.Name = &name
26052			}
26053		case "type":
26054			if v != nil {
26055				var typeVar string
26056				err = json.Unmarshal(*v, &typeVar)
26057				if err != nil {
26058					return err
26059				}
26060				sda.Type = &typeVar
26061			}
26062		}
26063	}
26064
26065	return nil
26066}
26067
26068// ServerDNSAliasAcquisition a server dns alias acquisition request.
26069type ServerDNSAliasAcquisition struct {
26070	// OldServerDNSAliasID - The id of the server alias that will be acquired to point to this server instead.
26071	OldServerDNSAliasID *string `json:"oldServerDnsAliasId,omitempty"`
26072}
26073
26074// ServerDNSAliasesAcquireFuture an abstraction for monitoring and retrieving the results of a long-running
26075// operation.
26076type ServerDNSAliasesAcquireFuture struct {
26077	azure.FutureAPI
26078	// Result returns the result of the asynchronous operation.
26079	// If the operation has not completed it will return an error.
26080	Result func(ServerDNSAliasesClient) (ServerDNSAlias, error)
26081}
26082
26083// UnmarshalJSON is the custom unmarshaller for CreateFuture.
26084func (future *ServerDNSAliasesAcquireFuture) UnmarshalJSON(body []byte) error {
26085	var azFuture azure.Future
26086	if err := json.Unmarshal(body, &azFuture); err != nil {
26087		return err
26088	}
26089	future.FutureAPI = &azFuture
26090	future.Result = future.result
26091	return nil
26092}
26093
26094// result is the default implementation for ServerDNSAliasesAcquireFuture.Result.
26095func (future *ServerDNSAliasesAcquireFuture) result(client ServerDNSAliasesClient) (sda ServerDNSAlias, err error) {
26096	var done bool
26097	done, err = future.DoneWithContext(context.Background(), client)
26098	if err != nil {
26099		err = autorest.NewErrorWithError(err, "sql.ServerDNSAliasesAcquireFuture", "Result", future.Response(), "Polling failure")
26100		return
26101	}
26102	if !done {
26103		sda.Response.Response = future.Response()
26104		err = azure.NewAsyncOpIncompleteError("sql.ServerDNSAliasesAcquireFuture")
26105		return
26106	}
26107	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
26108	if sda.Response.Response, err = future.GetResult(sender); err == nil && sda.Response.Response.StatusCode != http.StatusNoContent {
26109		sda, err = client.AcquireResponder(sda.Response.Response)
26110		if err != nil {
26111			err = autorest.NewErrorWithError(err, "sql.ServerDNSAliasesAcquireFuture", "Result", sda.Response.Response, "Failure responding to request")
26112		}
26113	}
26114	return
26115}
26116
26117// ServerDNSAliasesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
26118// long-running operation.
26119type ServerDNSAliasesCreateOrUpdateFuture struct {
26120	azure.FutureAPI
26121	// Result returns the result of the asynchronous operation.
26122	// If the operation has not completed it will return an error.
26123	Result func(ServerDNSAliasesClient) (ServerDNSAlias, error)
26124}
26125
26126// UnmarshalJSON is the custom unmarshaller for CreateFuture.
26127func (future *ServerDNSAliasesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
26128	var azFuture azure.Future
26129	if err := json.Unmarshal(body, &azFuture); err != nil {
26130		return err
26131	}
26132	future.FutureAPI = &azFuture
26133	future.Result = future.result
26134	return nil
26135}
26136
26137// result is the default implementation for ServerDNSAliasesCreateOrUpdateFuture.Result.
26138func (future *ServerDNSAliasesCreateOrUpdateFuture) result(client ServerDNSAliasesClient) (sda ServerDNSAlias, err error) {
26139	var done bool
26140	done, err = future.DoneWithContext(context.Background(), client)
26141	if err != nil {
26142		err = autorest.NewErrorWithError(err, "sql.ServerDNSAliasesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
26143		return
26144	}
26145	if !done {
26146		sda.Response.Response = future.Response()
26147		err = azure.NewAsyncOpIncompleteError("sql.ServerDNSAliasesCreateOrUpdateFuture")
26148		return
26149	}
26150	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
26151	if sda.Response.Response, err = future.GetResult(sender); err == nil && sda.Response.Response.StatusCode != http.StatusNoContent {
26152		sda, err = client.CreateOrUpdateResponder(sda.Response.Response)
26153		if err != nil {
26154			err = autorest.NewErrorWithError(err, "sql.ServerDNSAliasesCreateOrUpdateFuture", "Result", sda.Response.Response, "Failure responding to request")
26155		}
26156	}
26157	return
26158}
26159
26160// ServerDNSAliasesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
26161// operation.
26162type ServerDNSAliasesDeleteFuture struct {
26163	azure.FutureAPI
26164	// Result returns the result of the asynchronous operation.
26165	// If the operation has not completed it will return an error.
26166	Result func(ServerDNSAliasesClient) (autorest.Response, error)
26167}
26168
26169// UnmarshalJSON is the custom unmarshaller for CreateFuture.
26170func (future *ServerDNSAliasesDeleteFuture) UnmarshalJSON(body []byte) error {
26171	var azFuture azure.Future
26172	if err := json.Unmarshal(body, &azFuture); err != nil {
26173		return err
26174	}
26175	future.FutureAPI = &azFuture
26176	future.Result = future.result
26177	return nil
26178}
26179
26180// result is the default implementation for ServerDNSAliasesDeleteFuture.Result.
26181func (future *ServerDNSAliasesDeleteFuture) result(client ServerDNSAliasesClient) (ar autorest.Response, err error) {
26182	var done bool
26183	done, err = future.DoneWithContext(context.Background(), client)
26184	if err != nil {
26185		err = autorest.NewErrorWithError(err, "sql.ServerDNSAliasesDeleteFuture", "Result", future.Response(), "Polling failure")
26186		return
26187	}
26188	if !done {
26189		ar.Response = future.Response()
26190		err = azure.NewAsyncOpIncompleteError("sql.ServerDNSAliasesDeleteFuture")
26191		return
26192	}
26193	ar.Response = future.Response()
26194	return
26195}
26196
26197// ServerDNSAliasListResult a list of server DNS aliases.
26198type ServerDNSAliasListResult struct {
26199	autorest.Response `json:"-"`
26200	// Value - READ-ONLY; Array of results.
26201	Value *[]ServerDNSAlias `json:"value,omitempty"`
26202	// NextLink - READ-ONLY; Link to retrieve next page of results.
26203	NextLink *string `json:"nextLink,omitempty"`
26204}
26205
26206// MarshalJSON is the custom marshaler for ServerDNSAliasListResult.
26207func (sdalr ServerDNSAliasListResult) MarshalJSON() ([]byte, error) {
26208	objectMap := make(map[string]interface{})
26209	return json.Marshal(objectMap)
26210}
26211
26212// ServerDNSAliasListResultIterator provides access to a complete listing of ServerDNSAlias values.
26213type ServerDNSAliasListResultIterator struct {
26214	i    int
26215	page ServerDNSAliasListResultPage
26216}
26217
26218// NextWithContext advances to the next value.  If there was an error making
26219// the request the iterator does not advance and the error is returned.
26220func (iter *ServerDNSAliasListResultIterator) NextWithContext(ctx context.Context) (err error) {
26221	if tracing.IsEnabled() {
26222		ctx = tracing.StartSpan(ctx, fqdn+"/ServerDNSAliasListResultIterator.NextWithContext")
26223		defer func() {
26224			sc := -1
26225			if iter.Response().Response.Response != nil {
26226				sc = iter.Response().Response.Response.StatusCode
26227			}
26228			tracing.EndSpan(ctx, sc, err)
26229		}()
26230	}
26231	iter.i++
26232	if iter.i < len(iter.page.Values()) {
26233		return nil
26234	}
26235	err = iter.page.NextWithContext(ctx)
26236	if err != nil {
26237		iter.i--
26238		return err
26239	}
26240	iter.i = 0
26241	return nil
26242}
26243
26244// Next advances to the next value.  If there was an error making
26245// the request the iterator does not advance and the error is returned.
26246// Deprecated: Use NextWithContext() instead.
26247func (iter *ServerDNSAliasListResultIterator) Next() error {
26248	return iter.NextWithContext(context.Background())
26249}
26250
26251// NotDone returns true if the enumeration should be started or is not yet complete.
26252func (iter ServerDNSAliasListResultIterator) NotDone() bool {
26253	return iter.page.NotDone() && iter.i < len(iter.page.Values())
26254}
26255
26256// Response returns the raw server response from the last page request.
26257func (iter ServerDNSAliasListResultIterator) Response() ServerDNSAliasListResult {
26258	return iter.page.Response()
26259}
26260
26261// Value returns the current value or a zero-initialized value if the
26262// iterator has advanced beyond the end of the collection.
26263func (iter ServerDNSAliasListResultIterator) Value() ServerDNSAlias {
26264	if !iter.page.NotDone() {
26265		return ServerDNSAlias{}
26266	}
26267	return iter.page.Values()[iter.i]
26268}
26269
26270// Creates a new instance of the ServerDNSAliasListResultIterator type.
26271func NewServerDNSAliasListResultIterator(page ServerDNSAliasListResultPage) ServerDNSAliasListResultIterator {
26272	return ServerDNSAliasListResultIterator{page: page}
26273}
26274
26275// IsEmpty returns true if the ListResult contains no values.
26276func (sdalr ServerDNSAliasListResult) IsEmpty() bool {
26277	return sdalr.Value == nil || len(*sdalr.Value) == 0
26278}
26279
26280// hasNextLink returns true if the NextLink is not empty.
26281func (sdalr ServerDNSAliasListResult) hasNextLink() bool {
26282	return sdalr.NextLink != nil && len(*sdalr.NextLink) != 0
26283}
26284
26285// serverDNSAliasListResultPreparer prepares a request to retrieve the next set of results.
26286// It returns nil if no more results exist.
26287func (sdalr ServerDNSAliasListResult) serverDNSAliasListResultPreparer(ctx context.Context) (*http.Request, error) {
26288	if !sdalr.hasNextLink() {
26289		return nil, nil
26290	}
26291	return autorest.Prepare((&http.Request{}).WithContext(ctx),
26292		autorest.AsJSON(),
26293		autorest.AsGet(),
26294		autorest.WithBaseURL(to.String(sdalr.NextLink)))
26295}
26296
26297// ServerDNSAliasListResultPage contains a page of ServerDNSAlias values.
26298type ServerDNSAliasListResultPage struct {
26299	fn    func(context.Context, ServerDNSAliasListResult) (ServerDNSAliasListResult, error)
26300	sdalr ServerDNSAliasListResult
26301}
26302
26303// NextWithContext advances to the next page of values.  If there was an error making
26304// the request the page does not advance and the error is returned.
26305func (page *ServerDNSAliasListResultPage) NextWithContext(ctx context.Context) (err error) {
26306	if tracing.IsEnabled() {
26307		ctx = tracing.StartSpan(ctx, fqdn+"/ServerDNSAliasListResultPage.NextWithContext")
26308		defer func() {
26309			sc := -1
26310			if page.Response().Response.Response != nil {
26311				sc = page.Response().Response.Response.StatusCode
26312			}
26313			tracing.EndSpan(ctx, sc, err)
26314		}()
26315	}
26316	for {
26317		next, err := page.fn(ctx, page.sdalr)
26318		if err != nil {
26319			return err
26320		}
26321		page.sdalr = next
26322		if !next.hasNextLink() || !next.IsEmpty() {
26323			break
26324		}
26325	}
26326	return nil
26327}
26328
26329// Next advances to the next page of values.  If there was an error making
26330// the request the page does not advance and the error is returned.
26331// Deprecated: Use NextWithContext() instead.
26332func (page *ServerDNSAliasListResultPage) Next() error {
26333	return page.NextWithContext(context.Background())
26334}
26335
26336// NotDone returns true if the page enumeration should be started or is not yet complete.
26337func (page ServerDNSAliasListResultPage) NotDone() bool {
26338	return !page.sdalr.IsEmpty()
26339}
26340
26341// Response returns the raw server response from the last page request.
26342func (page ServerDNSAliasListResultPage) Response() ServerDNSAliasListResult {
26343	return page.sdalr
26344}
26345
26346// Values returns the slice of values for the current page or nil if there are no values.
26347func (page ServerDNSAliasListResultPage) Values() []ServerDNSAlias {
26348	if page.sdalr.IsEmpty() {
26349		return nil
26350	}
26351	return *page.sdalr.Value
26352}
26353
26354// Creates a new instance of the ServerDNSAliasListResultPage type.
26355func NewServerDNSAliasListResultPage(cur ServerDNSAliasListResult, getNextPage func(context.Context, ServerDNSAliasListResult) (ServerDNSAliasListResult, error)) ServerDNSAliasListResultPage {
26356	return ServerDNSAliasListResultPage{
26357		fn:    getNextPage,
26358		sdalr: cur,
26359	}
26360}
26361
26362// ServerDNSAliasProperties properties of a server DNS alias.
26363type ServerDNSAliasProperties struct {
26364	// AzureDNSRecord - READ-ONLY; The fully qualified DNS record for alias
26365	AzureDNSRecord *string `json:"azureDnsRecord,omitempty"`
26366}
26367
26368// MarshalJSON is the custom marshaler for ServerDNSAliasProperties.
26369func (sdap ServerDNSAliasProperties) MarshalJSON() ([]byte, error) {
26370	objectMap := make(map[string]interface{})
26371	return json.Marshal(objectMap)
26372}
26373
26374// ServerExternalAdministrator properties of a active directory administrator.
26375type ServerExternalAdministrator struct {
26376	// AdministratorType - Type of the sever administrator. Possible values include: 'AdministratorTypeActiveDirectory'
26377	AdministratorType AdministratorType `json:"administratorType,omitempty"`
26378	// PrincipalType - Principal Type of the sever administrator. Possible values include: 'PrincipalTypeUser', 'PrincipalTypeGroup', 'PrincipalTypeApplication'
26379	PrincipalType PrincipalType `json:"principalType,omitempty"`
26380	// Login - Login name of the server administrator.
26381	Login *string `json:"login,omitempty"`
26382	// Sid - SID (object ID) of the server administrator.
26383	Sid *uuid.UUID `json:"sid,omitempty"`
26384	// TenantID - Tenant ID of the administrator.
26385	TenantID *uuid.UUID `json:"tenantId,omitempty"`
26386	// AzureADOnlyAuthentication - Azure Active Directory only Authentication enabled.
26387	AzureADOnlyAuthentication *bool `json:"azureADOnlyAuthentication,omitempty"`
26388}
26389
26390// ServerFirewallRuleProperties the properties of a server firewall rule.
26391type ServerFirewallRuleProperties struct {
26392	// StartIPAddress - The start IP address of the firewall rule. Must be IPv4 format. Use value '0.0.0.0' for all Azure-internal IP addresses.
26393	StartIPAddress *string `json:"startIpAddress,omitempty"`
26394	// 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' for all Azure-internal IP addresses.
26395	EndIPAddress *string `json:"endIpAddress,omitempty"`
26396}
26397
26398// ServerInfo server info for the server trust group.
26399type ServerInfo struct {
26400	// ServerID - Server Id.
26401	ServerID *string `json:"serverId,omitempty"`
26402}
26403
26404// ServerKey a server key.
26405type ServerKey struct {
26406	autorest.Response `json:"-"`
26407	// Kind - READ-ONLY; Kind of encryption protector. This is metadata used for the Azure portal experience.
26408	Kind *string `json:"kind,omitempty"`
26409	// Location - READ-ONLY; Resource location.
26410	Location *string `json:"location,omitempty"`
26411	// ServerKeyProperties - Resource properties.
26412	*ServerKeyProperties `json:"properties,omitempty"`
26413	// ID - READ-ONLY; Resource ID.
26414	ID *string `json:"id,omitempty"`
26415	// Name - READ-ONLY; Resource name.
26416	Name *string `json:"name,omitempty"`
26417	// Type - READ-ONLY; Resource type.
26418	Type *string `json:"type,omitempty"`
26419}
26420
26421// MarshalJSON is the custom marshaler for ServerKey.
26422func (sk ServerKey) MarshalJSON() ([]byte, error) {
26423	objectMap := make(map[string]interface{})
26424	if sk.ServerKeyProperties != nil {
26425		objectMap["properties"] = sk.ServerKeyProperties
26426	}
26427	return json.Marshal(objectMap)
26428}
26429
26430// UnmarshalJSON is the custom unmarshaler for ServerKey struct.
26431func (sk *ServerKey) UnmarshalJSON(body []byte) error {
26432	var m map[string]*json.RawMessage
26433	err := json.Unmarshal(body, &m)
26434	if err != nil {
26435		return err
26436	}
26437	for k, v := range m {
26438		switch k {
26439		case "kind":
26440			if v != nil {
26441				var kind string
26442				err = json.Unmarshal(*v, &kind)
26443				if err != nil {
26444					return err
26445				}
26446				sk.Kind = &kind
26447			}
26448		case "location":
26449			if v != nil {
26450				var location string
26451				err = json.Unmarshal(*v, &location)
26452				if err != nil {
26453					return err
26454				}
26455				sk.Location = &location
26456			}
26457		case "properties":
26458			if v != nil {
26459				var serverKeyProperties ServerKeyProperties
26460				err = json.Unmarshal(*v, &serverKeyProperties)
26461				if err != nil {
26462					return err
26463				}
26464				sk.ServerKeyProperties = &serverKeyProperties
26465			}
26466		case "id":
26467			if v != nil {
26468				var ID string
26469				err = json.Unmarshal(*v, &ID)
26470				if err != nil {
26471					return err
26472				}
26473				sk.ID = &ID
26474			}
26475		case "name":
26476			if v != nil {
26477				var name string
26478				err = json.Unmarshal(*v, &name)
26479				if err != nil {
26480					return err
26481				}
26482				sk.Name = &name
26483			}
26484		case "type":
26485			if v != nil {
26486				var typeVar string
26487				err = json.Unmarshal(*v, &typeVar)
26488				if err != nil {
26489					return err
26490				}
26491				sk.Type = &typeVar
26492			}
26493		}
26494	}
26495
26496	return nil
26497}
26498
26499// ServerKeyListResult a list of server keys.
26500type ServerKeyListResult struct {
26501	autorest.Response `json:"-"`
26502	// Value - READ-ONLY; Array of results.
26503	Value *[]ServerKey `json:"value,omitempty"`
26504	// NextLink - READ-ONLY; Link to retrieve next page of results.
26505	NextLink *string `json:"nextLink,omitempty"`
26506}
26507
26508// MarshalJSON is the custom marshaler for ServerKeyListResult.
26509func (sklr ServerKeyListResult) MarshalJSON() ([]byte, error) {
26510	objectMap := make(map[string]interface{})
26511	return json.Marshal(objectMap)
26512}
26513
26514// ServerKeyListResultIterator provides access to a complete listing of ServerKey values.
26515type ServerKeyListResultIterator struct {
26516	i    int
26517	page ServerKeyListResultPage
26518}
26519
26520// NextWithContext advances to the next value.  If there was an error making
26521// the request the iterator does not advance and the error is returned.
26522func (iter *ServerKeyListResultIterator) NextWithContext(ctx context.Context) (err error) {
26523	if tracing.IsEnabled() {
26524		ctx = tracing.StartSpan(ctx, fqdn+"/ServerKeyListResultIterator.NextWithContext")
26525		defer func() {
26526			sc := -1
26527			if iter.Response().Response.Response != nil {
26528				sc = iter.Response().Response.Response.StatusCode
26529			}
26530			tracing.EndSpan(ctx, sc, err)
26531		}()
26532	}
26533	iter.i++
26534	if iter.i < len(iter.page.Values()) {
26535		return nil
26536	}
26537	err = iter.page.NextWithContext(ctx)
26538	if err != nil {
26539		iter.i--
26540		return err
26541	}
26542	iter.i = 0
26543	return nil
26544}
26545
26546// Next advances to the next value.  If there was an error making
26547// the request the iterator does not advance and the error is returned.
26548// Deprecated: Use NextWithContext() instead.
26549func (iter *ServerKeyListResultIterator) Next() error {
26550	return iter.NextWithContext(context.Background())
26551}
26552
26553// NotDone returns true if the enumeration should be started or is not yet complete.
26554func (iter ServerKeyListResultIterator) NotDone() bool {
26555	return iter.page.NotDone() && iter.i < len(iter.page.Values())
26556}
26557
26558// Response returns the raw server response from the last page request.
26559func (iter ServerKeyListResultIterator) Response() ServerKeyListResult {
26560	return iter.page.Response()
26561}
26562
26563// Value returns the current value or a zero-initialized value if the
26564// iterator has advanced beyond the end of the collection.
26565func (iter ServerKeyListResultIterator) Value() ServerKey {
26566	if !iter.page.NotDone() {
26567		return ServerKey{}
26568	}
26569	return iter.page.Values()[iter.i]
26570}
26571
26572// Creates a new instance of the ServerKeyListResultIterator type.
26573func NewServerKeyListResultIterator(page ServerKeyListResultPage) ServerKeyListResultIterator {
26574	return ServerKeyListResultIterator{page: page}
26575}
26576
26577// IsEmpty returns true if the ListResult contains no values.
26578func (sklr ServerKeyListResult) IsEmpty() bool {
26579	return sklr.Value == nil || len(*sklr.Value) == 0
26580}
26581
26582// hasNextLink returns true if the NextLink is not empty.
26583func (sklr ServerKeyListResult) hasNextLink() bool {
26584	return sklr.NextLink != nil && len(*sklr.NextLink) != 0
26585}
26586
26587// serverKeyListResultPreparer prepares a request to retrieve the next set of results.
26588// It returns nil if no more results exist.
26589func (sklr ServerKeyListResult) serverKeyListResultPreparer(ctx context.Context) (*http.Request, error) {
26590	if !sklr.hasNextLink() {
26591		return nil, nil
26592	}
26593	return autorest.Prepare((&http.Request{}).WithContext(ctx),
26594		autorest.AsJSON(),
26595		autorest.AsGet(),
26596		autorest.WithBaseURL(to.String(sklr.NextLink)))
26597}
26598
26599// ServerKeyListResultPage contains a page of ServerKey values.
26600type ServerKeyListResultPage struct {
26601	fn   func(context.Context, ServerKeyListResult) (ServerKeyListResult, error)
26602	sklr ServerKeyListResult
26603}
26604
26605// NextWithContext advances to the next page of values.  If there was an error making
26606// the request the page does not advance and the error is returned.
26607func (page *ServerKeyListResultPage) NextWithContext(ctx context.Context) (err error) {
26608	if tracing.IsEnabled() {
26609		ctx = tracing.StartSpan(ctx, fqdn+"/ServerKeyListResultPage.NextWithContext")
26610		defer func() {
26611			sc := -1
26612			if page.Response().Response.Response != nil {
26613				sc = page.Response().Response.Response.StatusCode
26614			}
26615			tracing.EndSpan(ctx, sc, err)
26616		}()
26617	}
26618	for {
26619		next, err := page.fn(ctx, page.sklr)
26620		if err != nil {
26621			return err
26622		}
26623		page.sklr = next
26624		if !next.hasNextLink() || !next.IsEmpty() {
26625			break
26626		}
26627	}
26628	return nil
26629}
26630
26631// Next advances to the next page of values.  If there was an error making
26632// the request the page does not advance and the error is returned.
26633// Deprecated: Use NextWithContext() instead.
26634func (page *ServerKeyListResultPage) Next() error {
26635	return page.NextWithContext(context.Background())
26636}
26637
26638// NotDone returns true if the page enumeration should be started or is not yet complete.
26639func (page ServerKeyListResultPage) NotDone() bool {
26640	return !page.sklr.IsEmpty()
26641}
26642
26643// Response returns the raw server response from the last page request.
26644func (page ServerKeyListResultPage) Response() ServerKeyListResult {
26645	return page.sklr
26646}
26647
26648// Values returns the slice of values for the current page or nil if there are no values.
26649func (page ServerKeyListResultPage) Values() []ServerKey {
26650	if page.sklr.IsEmpty() {
26651		return nil
26652	}
26653	return *page.sklr.Value
26654}
26655
26656// Creates a new instance of the ServerKeyListResultPage type.
26657func NewServerKeyListResultPage(cur ServerKeyListResult, getNextPage func(context.Context, ServerKeyListResult) (ServerKeyListResult, error)) ServerKeyListResultPage {
26658	return ServerKeyListResultPage{
26659		fn:   getNextPage,
26660		sklr: cur,
26661	}
26662}
26663
26664// ServerKeyProperties properties for a server key execution.
26665type ServerKeyProperties struct {
26666	// Subregion - READ-ONLY; Subregion of the server key.
26667	Subregion *string `json:"subregion,omitempty"`
26668	// ServerKeyType - The server key type like 'ServiceManaged', 'AzureKeyVault'. Possible values include: 'ServerKeyTypeServiceManaged', 'ServerKeyTypeAzureKeyVault'
26669	ServerKeyType ServerKeyType `json:"serverKeyType,omitempty"`
26670	// URI - The URI of the server key. If the ServerKeyType is AzureKeyVault, then the URI is required.
26671	URI *string `json:"uri,omitempty"`
26672	// Thumbprint - READ-ONLY; Thumbprint of the server key.
26673	Thumbprint *string `json:"thumbprint,omitempty"`
26674	// CreationDate - READ-ONLY; The server key creation date.
26675	CreationDate *date.Time `json:"creationDate,omitempty"`
26676	// AutoRotationEnabled - READ-ONLY; Key auto rotation opt-in flag. Either true or false.
26677	AutoRotationEnabled *bool `json:"autoRotationEnabled,omitempty"`
26678}
26679
26680// MarshalJSON is the custom marshaler for ServerKeyProperties.
26681func (skp ServerKeyProperties) MarshalJSON() ([]byte, error) {
26682	objectMap := make(map[string]interface{})
26683	if skp.ServerKeyType != "" {
26684		objectMap["serverKeyType"] = skp.ServerKeyType
26685	}
26686	if skp.URI != nil {
26687		objectMap["uri"] = skp.URI
26688	}
26689	return json.Marshal(objectMap)
26690}
26691
26692// ServerKeysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
26693// long-running operation.
26694type ServerKeysCreateOrUpdateFuture struct {
26695	azure.FutureAPI
26696	// Result returns the result of the asynchronous operation.
26697	// If the operation has not completed it will return an error.
26698	Result func(ServerKeysClient) (ServerKey, error)
26699}
26700
26701// UnmarshalJSON is the custom unmarshaller for CreateFuture.
26702func (future *ServerKeysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
26703	var azFuture azure.Future
26704	if err := json.Unmarshal(body, &azFuture); err != nil {
26705		return err
26706	}
26707	future.FutureAPI = &azFuture
26708	future.Result = future.result
26709	return nil
26710}
26711
26712// result is the default implementation for ServerKeysCreateOrUpdateFuture.Result.
26713func (future *ServerKeysCreateOrUpdateFuture) result(client ServerKeysClient) (sk ServerKey, err error) {
26714	var done bool
26715	done, err = future.DoneWithContext(context.Background(), client)
26716	if err != nil {
26717		err = autorest.NewErrorWithError(err, "sql.ServerKeysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
26718		return
26719	}
26720	if !done {
26721		sk.Response.Response = future.Response()
26722		err = azure.NewAsyncOpIncompleteError("sql.ServerKeysCreateOrUpdateFuture")
26723		return
26724	}
26725	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
26726	if sk.Response.Response, err = future.GetResult(sender); err == nil && sk.Response.Response.StatusCode != http.StatusNoContent {
26727		sk, err = client.CreateOrUpdateResponder(sk.Response.Response)
26728		if err != nil {
26729			err = autorest.NewErrorWithError(err, "sql.ServerKeysCreateOrUpdateFuture", "Result", sk.Response.Response, "Failure responding to request")
26730		}
26731	}
26732	return
26733}
26734
26735// ServerKeysDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
26736// operation.
26737type ServerKeysDeleteFuture struct {
26738	azure.FutureAPI
26739	// Result returns the result of the asynchronous operation.
26740	// If the operation has not completed it will return an error.
26741	Result func(ServerKeysClient) (autorest.Response, error)
26742}
26743
26744// UnmarshalJSON is the custom unmarshaller for CreateFuture.
26745func (future *ServerKeysDeleteFuture) UnmarshalJSON(body []byte) error {
26746	var azFuture azure.Future
26747	if err := json.Unmarshal(body, &azFuture); err != nil {
26748		return err
26749	}
26750	future.FutureAPI = &azFuture
26751	future.Result = future.result
26752	return nil
26753}
26754
26755// result is the default implementation for ServerKeysDeleteFuture.Result.
26756func (future *ServerKeysDeleteFuture) result(client ServerKeysClient) (ar autorest.Response, err error) {
26757	var done bool
26758	done, err = future.DoneWithContext(context.Background(), client)
26759	if err != nil {
26760		err = autorest.NewErrorWithError(err, "sql.ServerKeysDeleteFuture", "Result", future.Response(), "Polling failure")
26761		return
26762	}
26763	if !done {
26764		ar.Response = future.Response()
26765		err = azure.NewAsyncOpIncompleteError("sql.ServerKeysDeleteFuture")
26766		return
26767	}
26768	ar.Response = future.Response()
26769	return
26770}
26771
26772// ServerListResult a list of servers.
26773type ServerListResult struct {
26774	autorest.Response `json:"-"`
26775	// Value - READ-ONLY; Array of results.
26776	Value *[]Server `json:"value,omitempty"`
26777	// NextLink - READ-ONLY; Link to retrieve next page of results.
26778	NextLink *string `json:"nextLink,omitempty"`
26779}
26780
26781// MarshalJSON is the custom marshaler for ServerListResult.
26782func (slr ServerListResult) MarshalJSON() ([]byte, error) {
26783	objectMap := make(map[string]interface{})
26784	return json.Marshal(objectMap)
26785}
26786
26787// ServerListResultIterator provides access to a complete listing of Server values.
26788type ServerListResultIterator struct {
26789	i    int
26790	page ServerListResultPage
26791}
26792
26793// NextWithContext advances to the next value.  If there was an error making
26794// the request the iterator does not advance and the error is returned.
26795func (iter *ServerListResultIterator) NextWithContext(ctx context.Context) (err error) {
26796	if tracing.IsEnabled() {
26797		ctx = tracing.StartSpan(ctx, fqdn+"/ServerListResultIterator.NextWithContext")
26798		defer func() {
26799			sc := -1
26800			if iter.Response().Response.Response != nil {
26801				sc = iter.Response().Response.Response.StatusCode
26802			}
26803			tracing.EndSpan(ctx, sc, err)
26804		}()
26805	}
26806	iter.i++
26807	if iter.i < len(iter.page.Values()) {
26808		return nil
26809	}
26810	err = iter.page.NextWithContext(ctx)
26811	if err != nil {
26812		iter.i--
26813		return err
26814	}
26815	iter.i = 0
26816	return nil
26817}
26818
26819// Next advances to the next value.  If there was an error making
26820// the request the iterator does not advance and the error is returned.
26821// Deprecated: Use NextWithContext() instead.
26822func (iter *ServerListResultIterator) Next() error {
26823	return iter.NextWithContext(context.Background())
26824}
26825
26826// NotDone returns true if the enumeration should be started or is not yet complete.
26827func (iter ServerListResultIterator) NotDone() bool {
26828	return iter.page.NotDone() && iter.i < len(iter.page.Values())
26829}
26830
26831// Response returns the raw server response from the last page request.
26832func (iter ServerListResultIterator) Response() ServerListResult {
26833	return iter.page.Response()
26834}
26835
26836// Value returns the current value or a zero-initialized value if the
26837// iterator has advanced beyond the end of the collection.
26838func (iter ServerListResultIterator) Value() Server {
26839	if !iter.page.NotDone() {
26840		return Server{}
26841	}
26842	return iter.page.Values()[iter.i]
26843}
26844
26845// Creates a new instance of the ServerListResultIterator type.
26846func NewServerListResultIterator(page ServerListResultPage) ServerListResultIterator {
26847	return ServerListResultIterator{page: page}
26848}
26849
26850// IsEmpty returns true if the ListResult contains no values.
26851func (slr ServerListResult) IsEmpty() bool {
26852	return slr.Value == nil || len(*slr.Value) == 0
26853}
26854
26855// hasNextLink returns true if the NextLink is not empty.
26856func (slr ServerListResult) hasNextLink() bool {
26857	return slr.NextLink != nil && len(*slr.NextLink) != 0
26858}
26859
26860// serverListResultPreparer prepares a request to retrieve the next set of results.
26861// It returns nil if no more results exist.
26862func (slr ServerListResult) serverListResultPreparer(ctx context.Context) (*http.Request, error) {
26863	if !slr.hasNextLink() {
26864		return nil, nil
26865	}
26866	return autorest.Prepare((&http.Request{}).WithContext(ctx),
26867		autorest.AsJSON(),
26868		autorest.AsGet(),
26869		autorest.WithBaseURL(to.String(slr.NextLink)))
26870}
26871
26872// ServerListResultPage contains a page of Server values.
26873type ServerListResultPage struct {
26874	fn  func(context.Context, ServerListResult) (ServerListResult, error)
26875	slr ServerListResult
26876}
26877
26878// NextWithContext advances to the next page of values.  If there was an error making
26879// the request the page does not advance and the error is returned.
26880func (page *ServerListResultPage) NextWithContext(ctx context.Context) (err error) {
26881	if tracing.IsEnabled() {
26882		ctx = tracing.StartSpan(ctx, fqdn+"/ServerListResultPage.NextWithContext")
26883		defer func() {
26884			sc := -1
26885			if page.Response().Response.Response != nil {
26886				sc = page.Response().Response.Response.StatusCode
26887			}
26888			tracing.EndSpan(ctx, sc, err)
26889		}()
26890	}
26891	for {
26892		next, err := page.fn(ctx, page.slr)
26893		if err != nil {
26894			return err
26895		}
26896		page.slr = next
26897		if !next.hasNextLink() || !next.IsEmpty() {
26898			break
26899		}
26900	}
26901	return nil
26902}
26903
26904// Next advances to the next page of values.  If there was an error making
26905// the request the page does not advance and the error is returned.
26906// Deprecated: Use NextWithContext() instead.
26907func (page *ServerListResultPage) Next() error {
26908	return page.NextWithContext(context.Background())
26909}
26910
26911// NotDone returns true if the page enumeration should be started or is not yet complete.
26912func (page ServerListResultPage) NotDone() bool {
26913	return !page.slr.IsEmpty()
26914}
26915
26916// Response returns the raw server response from the last page request.
26917func (page ServerListResultPage) Response() ServerListResult {
26918	return page.slr
26919}
26920
26921// Values returns the slice of values for the current page or nil if there are no values.
26922func (page ServerListResultPage) Values() []Server {
26923	if page.slr.IsEmpty() {
26924		return nil
26925	}
26926	return *page.slr.Value
26927}
26928
26929// Creates a new instance of the ServerListResultPage type.
26930func NewServerListResultPage(cur ServerListResult, getNextPage func(context.Context, ServerListResult) (ServerListResult, error)) ServerListResultPage {
26931	return ServerListResultPage{
26932		fn:  getNextPage,
26933		slr: cur,
26934	}
26935}
26936
26937// ServerOperation a server operation.
26938type ServerOperation struct {
26939	// ServerOperationProperties - Resource properties.
26940	*ServerOperationProperties `json:"properties,omitempty"`
26941	// ID - READ-ONLY; Resource ID.
26942	ID *string `json:"id,omitempty"`
26943	// Name - READ-ONLY; Resource name.
26944	Name *string `json:"name,omitempty"`
26945	// Type - READ-ONLY; Resource type.
26946	Type *string `json:"type,omitempty"`
26947}
26948
26949// MarshalJSON is the custom marshaler for ServerOperation.
26950func (so ServerOperation) MarshalJSON() ([]byte, error) {
26951	objectMap := make(map[string]interface{})
26952	if so.ServerOperationProperties != nil {
26953		objectMap["properties"] = so.ServerOperationProperties
26954	}
26955	return json.Marshal(objectMap)
26956}
26957
26958// UnmarshalJSON is the custom unmarshaler for ServerOperation struct.
26959func (so *ServerOperation) UnmarshalJSON(body []byte) error {
26960	var m map[string]*json.RawMessage
26961	err := json.Unmarshal(body, &m)
26962	if err != nil {
26963		return err
26964	}
26965	for k, v := range m {
26966		switch k {
26967		case "properties":
26968			if v != nil {
26969				var serverOperationProperties ServerOperationProperties
26970				err = json.Unmarshal(*v, &serverOperationProperties)
26971				if err != nil {
26972					return err
26973				}
26974				so.ServerOperationProperties = &serverOperationProperties
26975			}
26976		case "id":
26977			if v != nil {
26978				var ID string
26979				err = json.Unmarshal(*v, &ID)
26980				if err != nil {
26981					return err
26982				}
26983				so.ID = &ID
26984			}
26985		case "name":
26986			if v != nil {
26987				var name string
26988				err = json.Unmarshal(*v, &name)
26989				if err != nil {
26990					return err
26991				}
26992				so.Name = &name
26993			}
26994		case "type":
26995			if v != nil {
26996				var typeVar string
26997				err = json.Unmarshal(*v, &typeVar)
26998				if err != nil {
26999					return err
27000				}
27001				so.Type = &typeVar
27002			}
27003		}
27004	}
27005
27006	return nil
27007}
27008
27009// ServerOperationListResult the response to a list server operations request
27010type ServerOperationListResult struct {
27011	autorest.Response `json:"-"`
27012	// Value - READ-ONLY; Array of results.
27013	Value *[]ServerOperation `json:"value,omitempty"`
27014	// NextLink - READ-ONLY; Link to retrieve next page of results.
27015	NextLink *string `json:"nextLink,omitempty"`
27016}
27017
27018// MarshalJSON is the custom marshaler for ServerOperationListResult.
27019func (solr ServerOperationListResult) MarshalJSON() ([]byte, error) {
27020	objectMap := make(map[string]interface{})
27021	return json.Marshal(objectMap)
27022}
27023
27024// ServerOperationListResultIterator provides access to a complete listing of ServerOperation values.
27025type ServerOperationListResultIterator struct {
27026	i    int
27027	page ServerOperationListResultPage
27028}
27029
27030// NextWithContext advances to the next value.  If there was an error making
27031// the request the iterator does not advance and the error is returned.
27032func (iter *ServerOperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
27033	if tracing.IsEnabled() {
27034		ctx = tracing.StartSpan(ctx, fqdn+"/ServerOperationListResultIterator.NextWithContext")
27035		defer func() {
27036			sc := -1
27037			if iter.Response().Response.Response != nil {
27038				sc = iter.Response().Response.Response.StatusCode
27039			}
27040			tracing.EndSpan(ctx, sc, err)
27041		}()
27042	}
27043	iter.i++
27044	if iter.i < len(iter.page.Values()) {
27045		return nil
27046	}
27047	err = iter.page.NextWithContext(ctx)
27048	if err != nil {
27049		iter.i--
27050		return err
27051	}
27052	iter.i = 0
27053	return nil
27054}
27055
27056// Next advances to the next value.  If there was an error making
27057// the request the iterator does not advance and the error is returned.
27058// Deprecated: Use NextWithContext() instead.
27059func (iter *ServerOperationListResultIterator) Next() error {
27060	return iter.NextWithContext(context.Background())
27061}
27062
27063// NotDone returns true if the enumeration should be started or is not yet complete.
27064func (iter ServerOperationListResultIterator) NotDone() bool {
27065	return iter.page.NotDone() && iter.i < len(iter.page.Values())
27066}
27067
27068// Response returns the raw server response from the last page request.
27069func (iter ServerOperationListResultIterator) Response() ServerOperationListResult {
27070	return iter.page.Response()
27071}
27072
27073// Value returns the current value or a zero-initialized value if the
27074// iterator has advanced beyond the end of the collection.
27075func (iter ServerOperationListResultIterator) Value() ServerOperation {
27076	if !iter.page.NotDone() {
27077		return ServerOperation{}
27078	}
27079	return iter.page.Values()[iter.i]
27080}
27081
27082// Creates a new instance of the ServerOperationListResultIterator type.
27083func NewServerOperationListResultIterator(page ServerOperationListResultPage) ServerOperationListResultIterator {
27084	return ServerOperationListResultIterator{page: page}
27085}
27086
27087// IsEmpty returns true if the ListResult contains no values.
27088func (solr ServerOperationListResult) IsEmpty() bool {
27089	return solr.Value == nil || len(*solr.Value) == 0
27090}
27091
27092// hasNextLink returns true if the NextLink is not empty.
27093func (solr ServerOperationListResult) hasNextLink() bool {
27094	return solr.NextLink != nil && len(*solr.NextLink) != 0
27095}
27096
27097// serverOperationListResultPreparer prepares a request to retrieve the next set of results.
27098// It returns nil if no more results exist.
27099func (solr ServerOperationListResult) serverOperationListResultPreparer(ctx context.Context) (*http.Request, error) {
27100	if !solr.hasNextLink() {
27101		return nil, nil
27102	}
27103	return autorest.Prepare((&http.Request{}).WithContext(ctx),
27104		autorest.AsJSON(),
27105		autorest.AsGet(),
27106		autorest.WithBaseURL(to.String(solr.NextLink)))
27107}
27108
27109// ServerOperationListResultPage contains a page of ServerOperation values.
27110type ServerOperationListResultPage struct {
27111	fn   func(context.Context, ServerOperationListResult) (ServerOperationListResult, error)
27112	solr ServerOperationListResult
27113}
27114
27115// NextWithContext advances to the next page of values.  If there was an error making
27116// the request the page does not advance and the error is returned.
27117func (page *ServerOperationListResultPage) NextWithContext(ctx context.Context) (err error) {
27118	if tracing.IsEnabled() {
27119		ctx = tracing.StartSpan(ctx, fqdn+"/ServerOperationListResultPage.NextWithContext")
27120		defer func() {
27121			sc := -1
27122			if page.Response().Response.Response != nil {
27123				sc = page.Response().Response.Response.StatusCode
27124			}
27125			tracing.EndSpan(ctx, sc, err)
27126		}()
27127	}
27128	for {
27129		next, err := page.fn(ctx, page.solr)
27130		if err != nil {
27131			return err
27132		}
27133		page.solr = next
27134		if !next.hasNextLink() || !next.IsEmpty() {
27135			break
27136		}
27137	}
27138	return nil
27139}
27140
27141// Next advances to the next page of values.  If there was an error making
27142// the request the page does not advance and the error is returned.
27143// Deprecated: Use NextWithContext() instead.
27144func (page *ServerOperationListResultPage) Next() error {
27145	return page.NextWithContext(context.Background())
27146}
27147
27148// NotDone returns true if the page enumeration should be started or is not yet complete.
27149func (page ServerOperationListResultPage) NotDone() bool {
27150	return !page.solr.IsEmpty()
27151}
27152
27153// Response returns the raw server response from the last page request.
27154func (page ServerOperationListResultPage) Response() ServerOperationListResult {
27155	return page.solr
27156}
27157
27158// Values returns the slice of values for the current page or nil if there are no values.
27159func (page ServerOperationListResultPage) Values() []ServerOperation {
27160	if page.solr.IsEmpty() {
27161		return nil
27162	}
27163	return *page.solr.Value
27164}
27165
27166// Creates a new instance of the ServerOperationListResultPage type.
27167func NewServerOperationListResultPage(cur ServerOperationListResult, getNextPage func(context.Context, ServerOperationListResult) (ServerOperationListResult, error)) ServerOperationListResultPage {
27168	return ServerOperationListResultPage{
27169		fn:   getNextPage,
27170		solr: cur,
27171	}
27172}
27173
27174// ServerOperationProperties the properties of a server operation.
27175type ServerOperationProperties struct {
27176	// Operation - READ-ONLY; The name of operation.
27177	Operation *string `json:"operation,omitempty"`
27178	// OperationFriendlyName - READ-ONLY; The friendly name of operation.
27179	OperationFriendlyName *string `json:"operationFriendlyName,omitempty"`
27180	// PercentComplete - READ-ONLY; The percentage of the operation completed.
27181	PercentComplete *int32 `json:"percentComplete,omitempty"`
27182	// ServerName - READ-ONLY; The name of the server.
27183	ServerName *string `json:"serverName,omitempty"`
27184	// StartTime - READ-ONLY; The operation start time.
27185	StartTime *date.Time `json:"startTime,omitempty"`
27186	// State - READ-ONLY; The operation state. Possible values include: 'ManagementOperationStatePending', 'ManagementOperationStateInProgress', 'ManagementOperationStateSucceeded', 'ManagementOperationStateFailed', 'ManagementOperationStateCancelInProgress', 'ManagementOperationStateCancelled'
27187	State ManagementOperationState `json:"state,omitempty"`
27188	// ErrorCode - READ-ONLY; The operation error code.
27189	ErrorCode *int32 `json:"errorCode,omitempty"`
27190	// ErrorDescription - READ-ONLY; The operation error description.
27191	ErrorDescription *string `json:"errorDescription,omitempty"`
27192	// ErrorSeverity - READ-ONLY; The operation error severity.
27193	ErrorSeverity *int32 `json:"errorSeverity,omitempty"`
27194	// IsUserError - READ-ONLY; Whether or not the error is a user error.
27195	IsUserError *bool `json:"isUserError,omitempty"`
27196	// EstimatedCompletionTime - READ-ONLY; The estimated completion time of the operation.
27197	EstimatedCompletionTime *date.Time `json:"estimatedCompletionTime,omitempty"`
27198	// Description - READ-ONLY; The operation description.
27199	Description *string `json:"description,omitempty"`
27200	// IsCancellable - READ-ONLY; Whether the operation can be cancelled.
27201	IsCancellable *bool `json:"isCancellable,omitempty"`
27202}
27203
27204// MarshalJSON is the custom marshaler for ServerOperationProperties.
27205func (sop ServerOperationProperties) MarshalJSON() ([]byte, error) {
27206	objectMap := make(map[string]interface{})
27207	return json.Marshal(objectMap)
27208}
27209
27210// ServerPrivateEndpointConnection a private endpoint connection under a server
27211type ServerPrivateEndpointConnection struct {
27212	// ID - READ-ONLY; Resource ID.
27213	ID *string `json:"id,omitempty"`
27214	// Properties - READ-ONLY; Private endpoint connection properties
27215	Properties *PrivateEndpointConnectionProperties `json:"properties,omitempty"`
27216}
27217
27218// MarshalJSON is the custom marshaler for ServerPrivateEndpointConnection.
27219func (spec ServerPrivateEndpointConnection) MarshalJSON() ([]byte, error) {
27220	objectMap := make(map[string]interface{})
27221	return json.Marshal(objectMap)
27222}
27223
27224// ServerProperties the properties of a server.
27225type ServerProperties struct {
27226	// AdministratorLogin - Administrator username for the server. Once created it cannot be changed.
27227	AdministratorLogin *string `json:"administratorLogin,omitempty"`
27228	// AdministratorLoginPassword - The administrator login password (required for server creation).
27229	AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"`
27230	// Version - The version of the server.
27231	Version *string `json:"version,omitempty"`
27232	// State - READ-ONLY; The state of the server.
27233	State *string `json:"state,omitempty"`
27234	// FullyQualifiedDomainName - READ-ONLY; The fully qualified domain name of the server.
27235	FullyQualifiedDomainName *string `json:"fullyQualifiedDomainName,omitempty"`
27236	// PrivateEndpointConnections - READ-ONLY; List of private endpoint connections on a server
27237	PrivateEndpointConnections *[]ServerPrivateEndpointConnection `json:"privateEndpointConnections,omitempty"`
27238	// MinimalTLSVersion - Minimal TLS version. Allowed values: '1.0', '1.1', '1.2'
27239	MinimalTLSVersion *string `json:"minimalTlsVersion,omitempty"`
27240	// PublicNetworkAccess - Whether or not public endpoint access is allowed for this server.  Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: 'ServerNetworkAccessFlagEnabled', 'ServerNetworkAccessFlagDisabled'
27241	PublicNetworkAccess ServerNetworkAccessFlag `json:"publicNetworkAccess,omitempty"`
27242	// WorkspaceFeature - READ-ONLY; Whether or not existing server has a workspace created and if it allows connection from workspace. Possible values include: 'ServerWorkspaceFeatureConnected', 'ServerWorkspaceFeatureDisconnected'
27243	WorkspaceFeature ServerWorkspaceFeature `json:"workspaceFeature,omitempty"`
27244	// PrimaryUserAssignedIdentityID - The resource id of a user assigned identity to be used by default.
27245	PrimaryUserAssignedIdentityID *string `json:"primaryUserAssignedIdentityId,omitempty"`
27246	// FederatedClientID - The Client id used for cross tenant CMK scenario
27247	FederatedClientID *uuid.UUID `json:"federatedClientId,omitempty"`
27248	// KeyID - A CMK URI of the key to use for encryption.
27249	KeyID *string `json:"keyId,omitempty"`
27250	// Administrators - The Azure Active Directory identity of the server.
27251	Administrators *ServerExternalAdministrator `json:"administrators,omitempty"`
27252	// RestrictOutboundNetworkAccess - Whether or not to restrict outbound network access for this server.  Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: 'ServerNetworkAccessFlagEnabled', 'ServerNetworkAccessFlagDisabled'
27253	RestrictOutboundNetworkAccess ServerNetworkAccessFlag `json:"restrictOutboundNetworkAccess,omitempty"`
27254}
27255
27256// MarshalJSON is the custom marshaler for ServerProperties.
27257func (sp ServerProperties) MarshalJSON() ([]byte, error) {
27258	objectMap := make(map[string]interface{})
27259	if sp.AdministratorLogin != nil {
27260		objectMap["administratorLogin"] = sp.AdministratorLogin
27261	}
27262	if sp.AdministratorLoginPassword != nil {
27263		objectMap["administratorLoginPassword"] = sp.AdministratorLoginPassword
27264	}
27265	if sp.Version != nil {
27266		objectMap["version"] = sp.Version
27267	}
27268	if sp.MinimalTLSVersion != nil {
27269		objectMap["minimalTlsVersion"] = sp.MinimalTLSVersion
27270	}
27271	if sp.PublicNetworkAccess != "" {
27272		objectMap["publicNetworkAccess"] = sp.PublicNetworkAccess
27273	}
27274	if sp.PrimaryUserAssignedIdentityID != nil {
27275		objectMap["primaryUserAssignedIdentityId"] = sp.PrimaryUserAssignedIdentityID
27276	}
27277	if sp.FederatedClientID != nil {
27278		objectMap["federatedClientId"] = sp.FederatedClientID
27279	}
27280	if sp.KeyID != nil {
27281		objectMap["keyId"] = sp.KeyID
27282	}
27283	if sp.Administrators != nil {
27284		objectMap["administrators"] = sp.Administrators
27285	}
27286	if sp.RestrictOutboundNetworkAccess != "" {
27287		objectMap["restrictOutboundNetworkAccess"] = sp.RestrictOutboundNetworkAccess
27288	}
27289	return json.Marshal(objectMap)
27290}
27291
27292// ServersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
27293// operation.
27294type ServersCreateOrUpdateFuture struct {
27295	azure.FutureAPI
27296	// Result returns the result of the asynchronous operation.
27297	// If the operation has not completed it will return an error.
27298	Result func(ServersClient) (Server, error)
27299}
27300
27301// UnmarshalJSON is the custom unmarshaller for CreateFuture.
27302func (future *ServersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
27303	var azFuture azure.Future
27304	if err := json.Unmarshal(body, &azFuture); err != nil {
27305		return err
27306	}
27307	future.FutureAPI = &azFuture
27308	future.Result = future.result
27309	return nil
27310}
27311
27312// result is the default implementation for ServersCreateOrUpdateFuture.Result.
27313func (future *ServersCreateOrUpdateFuture) result(client ServersClient) (s Server, err error) {
27314	var done bool
27315	done, err = future.DoneWithContext(context.Background(), client)
27316	if err != nil {
27317		err = autorest.NewErrorWithError(err, "sql.ServersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
27318		return
27319	}
27320	if !done {
27321		s.Response.Response = future.Response()
27322		err = azure.NewAsyncOpIncompleteError("sql.ServersCreateOrUpdateFuture")
27323		return
27324	}
27325	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
27326	if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent {
27327		s, err = client.CreateOrUpdateResponder(s.Response.Response)
27328		if err != nil {
27329			err = autorest.NewErrorWithError(err, "sql.ServersCreateOrUpdateFuture", "Result", s.Response.Response, "Failure responding to request")
27330		}
27331	}
27332	return
27333}
27334
27335// ServersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
27336// operation.
27337type ServersDeleteFuture struct {
27338	azure.FutureAPI
27339	// Result returns the result of the asynchronous operation.
27340	// If the operation has not completed it will return an error.
27341	Result func(ServersClient) (autorest.Response, error)
27342}
27343
27344// UnmarshalJSON is the custom unmarshaller for CreateFuture.
27345func (future *ServersDeleteFuture) UnmarshalJSON(body []byte) error {
27346	var azFuture azure.Future
27347	if err := json.Unmarshal(body, &azFuture); err != nil {
27348		return err
27349	}
27350	future.FutureAPI = &azFuture
27351	future.Result = future.result
27352	return nil
27353}
27354
27355// result is the default implementation for ServersDeleteFuture.Result.
27356func (future *ServersDeleteFuture) result(client ServersClient) (ar autorest.Response, err error) {
27357	var done bool
27358	done, err = future.DoneWithContext(context.Background(), client)
27359	if err != nil {
27360		err = autorest.NewErrorWithError(err, "sql.ServersDeleteFuture", "Result", future.Response(), "Polling failure")
27361		return
27362	}
27363	if !done {
27364		ar.Response = future.Response()
27365		err = azure.NewAsyncOpIncompleteError("sql.ServersDeleteFuture")
27366		return
27367	}
27368	ar.Response = future.Response()
27369	return
27370}
27371
27372// ServerSecurityAlertPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results
27373// of a long-running operation.
27374type ServerSecurityAlertPoliciesCreateOrUpdateFuture struct {
27375	azure.FutureAPI
27376	// Result returns the result of the asynchronous operation.
27377	// If the operation has not completed it will return an error.
27378	Result func(ServerSecurityAlertPoliciesClient) (ServerSecurityAlertPolicy, error)
27379}
27380
27381// UnmarshalJSON is the custom unmarshaller for CreateFuture.
27382func (future *ServerSecurityAlertPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
27383	var azFuture azure.Future
27384	if err := json.Unmarshal(body, &azFuture); err != nil {
27385		return err
27386	}
27387	future.FutureAPI = &azFuture
27388	future.Result = future.result
27389	return nil
27390}
27391
27392// result is the default implementation for ServerSecurityAlertPoliciesCreateOrUpdateFuture.Result.
27393func (future *ServerSecurityAlertPoliciesCreateOrUpdateFuture) result(client ServerSecurityAlertPoliciesClient) (ssap ServerSecurityAlertPolicy, err error) {
27394	var done bool
27395	done, err = future.DoneWithContext(context.Background(), client)
27396	if err != nil {
27397		err = autorest.NewErrorWithError(err, "sql.ServerSecurityAlertPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
27398		return
27399	}
27400	if !done {
27401		ssap.Response.Response = future.Response()
27402		err = azure.NewAsyncOpIncompleteError("sql.ServerSecurityAlertPoliciesCreateOrUpdateFuture")
27403		return
27404	}
27405	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
27406	if ssap.Response.Response, err = future.GetResult(sender); err == nil && ssap.Response.Response.StatusCode != http.StatusNoContent {
27407		ssap, err = client.CreateOrUpdateResponder(ssap.Response.Response)
27408		if err != nil {
27409			err = autorest.NewErrorWithError(err, "sql.ServerSecurityAlertPoliciesCreateOrUpdateFuture", "Result", ssap.Response.Response, "Failure responding to request")
27410		}
27411	}
27412	return
27413}
27414
27415// ServerSecurityAlertPolicy a server security alert policy.
27416type ServerSecurityAlertPolicy struct {
27417	autorest.Response `json:"-"`
27418	// SystemData - READ-ONLY; SystemData of SecurityAlertPolicyResource.
27419	SystemData *SystemData `json:"systemData,omitempty"`
27420	// SecurityAlertsPolicyProperties - Resource properties.
27421	*SecurityAlertsPolicyProperties `json:"properties,omitempty"`
27422	// ID - READ-ONLY; Resource ID.
27423	ID *string `json:"id,omitempty"`
27424	// Name - READ-ONLY; Resource name.
27425	Name *string `json:"name,omitempty"`
27426	// Type - READ-ONLY; Resource type.
27427	Type *string `json:"type,omitempty"`
27428}
27429
27430// MarshalJSON is the custom marshaler for ServerSecurityAlertPolicy.
27431func (ssap ServerSecurityAlertPolicy) MarshalJSON() ([]byte, error) {
27432	objectMap := make(map[string]interface{})
27433	if ssap.SecurityAlertsPolicyProperties != nil {
27434		objectMap["properties"] = ssap.SecurityAlertsPolicyProperties
27435	}
27436	return json.Marshal(objectMap)
27437}
27438
27439// UnmarshalJSON is the custom unmarshaler for ServerSecurityAlertPolicy struct.
27440func (ssap *ServerSecurityAlertPolicy) UnmarshalJSON(body []byte) error {
27441	var m map[string]*json.RawMessage
27442	err := json.Unmarshal(body, &m)
27443	if err != nil {
27444		return err
27445	}
27446	for k, v := range m {
27447		switch k {
27448		case "systemData":
27449			if v != nil {
27450				var systemData SystemData
27451				err = json.Unmarshal(*v, &systemData)
27452				if err != nil {
27453					return err
27454				}
27455				ssap.SystemData = &systemData
27456			}
27457		case "properties":
27458			if v != nil {
27459				var securityAlertsPolicyProperties SecurityAlertsPolicyProperties
27460				err = json.Unmarshal(*v, &securityAlertsPolicyProperties)
27461				if err != nil {
27462					return err
27463				}
27464				ssap.SecurityAlertsPolicyProperties = &securityAlertsPolicyProperties
27465			}
27466		case "id":
27467			if v != nil {
27468				var ID string
27469				err = json.Unmarshal(*v, &ID)
27470				if err != nil {
27471					return err
27472				}
27473				ssap.ID = &ID
27474			}
27475		case "name":
27476			if v != nil {
27477				var name string
27478				err = json.Unmarshal(*v, &name)
27479				if err != nil {
27480					return err
27481				}
27482				ssap.Name = &name
27483			}
27484		case "type":
27485			if v != nil {
27486				var typeVar string
27487				err = json.Unmarshal(*v, &typeVar)
27488				if err != nil {
27489					return err
27490				}
27491				ssap.Type = &typeVar
27492			}
27493		}
27494	}
27495
27496	return nil
27497}
27498
27499// ServersImportDatabaseFuture an abstraction for monitoring and retrieving the results of a long-running
27500// operation.
27501type ServersImportDatabaseFuture struct {
27502	azure.FutureAPI
27503	// Result returns the result of the asynchronous operation.
27504	// If the operation has not completed it will return an error.
27505	Result func(ServersClient) (ImportExportOperationResult, error)
27506}
27507
27508// UnmarshalJSON is the custom unmarshaller for CreateFuture.
27509func (future *ServersImportDatabaseFuture) UnmarshalJSON(body []byte) error {
27510	var azFuture azure.Future
27511	if err := json.Unmarshal(body, &azFuture); err != nil {
27512		return err
27513	}
27514	future.FutureAPI = &azFuture
27515	future.Result = future.result
27516	return nil
27517}
27518
27519// result is the default implementation for ServersImportDatabaseFuture.Result.
27520func (future *ServersImportDatabaseFuture) result(client ServersClient) (ieor ImportExportOperationResult, err error) {
27521	var done bool
27522	done, err = future.DoneWithContext(context.Background(), client)
27523	if err != nil {
27524		err = autorest.NewErrorWithError(err, "sql.ServersImportDatabaseFuture", "Result", future.Response(), "Polling failure")
27525		return
27526	}
27527	if !done {
27528		ieor.Response.Response = future.Response()
27529		err = azure.NewAsyncOpIncompleteError("sql.ServersImportDatabaseFuture")
27530		return
27531	}
27532	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
27533	if ieor.Response.Response, err = future.GetResult(sender); err == nil && ieor.Response.Response.StatusCode != http.StatusNoContent {
27534		ieor, err = client.ImportDatabaseResponder(ieor.Response.Response)
27535		if err != nil {
27536			err = autorest.NewErrorWithError(err, "sql.ServersImportDatabaseFuture", "Result", ieor.Response.Response, "Failure responding to request")
27537		}
27538	}
27539	return
27540}
27541
27542// ServersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
27543// operation.
27544type ServersUpdateFuture struct {
27545	azure.FutureAPI
27546	// Result returns the result of the asynchronous operation.
27547	// If the operation has not completed it will return an error.
27548	Result func(ServersClient) (Server, error)
27549}
27550
27551// UnmarshalJSON is the custom unmarshaller for CreateFuture.
27552func (future *ServersUpdateFuture) UnmarshalJSON(body []byte) error {
27553	var azFuture azure.Future
27554	if err := json.Unmarshal(body, &azFuture); err != nil {
27555		return err
27556	}
27557	future.FutureAPI = &azFuture
27558	future.Result = future.result
27559	return nil
27560}
27561
27562// result is the default implementation for ServersUpdateFuture.Result.
27563func (future *ServersUpdateFuture) result(client ServersClient) (s Server, err error) {
27564	var done bool
27565	done, err = future.DoneWithContext(context.Background(), client)
27566	if err != nil {
27567		err = autorest.NewErrorWithError(err, "sql.ServersUpdateFuture", "Result", future.Response(), "Polling failure")
27568		return
27569	}
27570	if !done {
27571		s.Response.Response = future.Response()
27572		err = azure.NewAsyncOpIncompleteError("sql.ServersUpdateFuture")
27573		return
27574	}
27575	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
27576	if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent {
27577		s, err = client.UpdateResponder(s.Response.Response)
27578		if err != nil {
27579			err = autorest.NewErrorWithError(err, "sql.ServersUpdateFuture", "Result", s.Response.Response, "Failure responding to request")
27580		}
27581	}
27582	return
27583}
27584
27585// ServerTrustGroup a server trust group.
27586type ServerTrustGroup struct {
27587	autorest.Response `json:"-"`
27588	// ServerTrustGroupProperties - Resource properties.
27589	*ServerTrustGroupProperties `json:"properties,omitempty"`
27590	// ID - READ-ONLY; Resource ID.
27591	ID *string `json:"id,omitempty"`
27592	// Name - READ-ONLY; Resource name.
27593	Name *string `json:"name,omitempty"`
27594	// Type - READ-ONLY; Resource type.
27595	Type *string `json:"type,omitempty"`
27596}
27597
27598// MarshalJSON is the custom marshaler for ServerTrustGroup.
27599func (stg ServerTrustGroup) MarshalJSON() ([]byte, error) {
27600	objectMap := make(map[string]interface{})
27601	if stg.ServerTrustGroupProperties != nil {
27602		objectMap["properties"] = stg.ServerTrustGroupProperties
27603	}
27604	return json.Marshal(objectMap)
27605}
27606
27607// UnmarshalJSON is the custom unmarshaler for ServerTrustGroup struct.
27608func (stg *ServerTrustGroup) UnmarshalJSON(body []byte) error {
27609	var m map[string]*json.RawMessage
27610	err := json.Unmarshal(body, &m)
27611	if err != nil {
27612		return err
27613	}
27614	for k, v := range m {
27615		switch k {
27616		case "properties":
27617			if v != nil {
27618				var serverTrustGroupProperties ServerTrustGroupProperties
27619				err = json.Unmarshal(*v, &serverTrustGroupProperties)
27620				if err != nil {
27621					return err
27622				}
27623				stg.ServerTrustGroupProperties = &serverTrustGroupProperties
27624			}
27625		case "id":
27626			if v != nil {
27627				var ID string
27628				err = json.Unmarshal(*v, &ID)
27629				if err != nil {
27630					return err
27631				}
27632				stg.ID = &ID
27633			}
27634		case "name":
27635			if v != nil {
27636				var name string
27637				err = json.Unmarshal(*v, &name)
27638				if err != nil {
27639					return err
27640				}
27641				stg.Name = &name
27642			}
27643		case "type":
27644			if v != nil {
27645				var typeVar string
27646				err = json.Unmarshal(*v, &typeVar)
27647				if err != nil {
27648					return err
27649				}
27650				stg.Type = &typeVar
27651			}
27652		}
27653	}
27654
27655	return nil
27656}
27657
27658// ServerTrustGroupListResult a list of server trust groups.
27659type ServerTrustGroupListResult struct {
27660	autorest.Response `json:"-"`
27661	// Value - READ-ONLY; Array of results.
27662	Value *[]ServerTrustGroup `json:"value,omitempty"`
27663	// NextLink - READ-ONLY; Link to retrieve next page of results.
27664	NextLink *string `json:"nextLink,omitempty"`
27665}
27666
27667// MarshalJSON is the custom marshaler for ServerTrustGroupListResult.
27668func (stglr ServerTrustGroupListResult) MarshalJSON() ([]byte, error) {
27669	objectMap := make(map[string]interface{})
27670	return json.Marshal(objectMap)
27671}
27672
27673// ServerTrustGroupListResultIterator provides access to a complete listing of ServerTrustGroup values.
27674type ServerTrustGroupListResultIterator struct {
27675	i    int
27676	page ServerTrustGroupListResultPage
27677}
27678
27679// NextWithContext advances to the next value.  If there was an error making
27680// the request the iterator does not advance and the error is returned.
27681func (iter *ServerTrustGroupListResultIterator) NextWithContext(ctx context.Context) (err error) {
27682	if tracing.IsEnabled() {
27683		ctx = tracing.StartSpan(ctx, fqdn+"/ServerTrustGroupListResultIterator.NextWithContext")
27684		defer func() {
27685			sc := -1
27686			if iter.Response().Response.Response != nil {
27687				sc = iter.Response().Response.Response.StatusCode
27688			}
27689			tracing.EndSpan(ctx, sc, err)
27690		}()
27691	}
27692	iter.i++
27693	if iter.i < len(iter.page.Values()) {
27694		return nil
27695	}
27696	err = iter.page.NextWithContext(ctx)
27697	if err != nil {
27698		iter.i--
27699		return err
27700	}
27701	iter.i = 0
27702	return nil
27703}
27704
27705// Next advances to the next value.  If there was an error making
27706// the request the iterator does not advance and the error is returned.
27707// Deprecated: Use NextWithContext() instead.
27708func (iter *ServerTrustGroupListResultIterator) Next() error {
27709	return iter.NextWithContext(context.Background())
27710}
27711
27712// NotDone returns true if the enumeration should be started or is not yet complete.
27713func (iter ServerTrustGroupListResultIterator) NotDone() bool {
27714	return iter.page.NotDone() && iter.i < len(iter.page.Values())
27715}
27716
27717// Response returns the raw server response from the last page request.
27718func (iter ServerTrustGroupListResultIterator) Response() ServerTrustGroupListResult {
27719	return iter.page.Response()
27720}
27721
27722// Value returns the current value or a zero-initialized value if the
27723// iterator has advanced beyond the end of the collection.
27724func (iter ServerTrustGroupListResultIterator) Value() ServerTrustGroup {
27725	if !iter.page.NotDone() {
27726		return ServerTrustGroup{}
27727	}
27728	return iter.page.Values()[iter.i]
27729}
27730
27731// Creates a new instance of the ServerTrustGroupListResultIterator type.
27732func NewServerTrustGroupListResultIterator(page ServerTrustGroupListResultPage) ServerTrustGroupListResultIterator {
27733	return ServerTrustGroupListResultIterator{page: page}
27734}
27735
27736// IsEmpty returns true if the ListResult contains no values.
27737func (stglr ServerTrustGroupListResult) IsEmpty() bool {
27738	return stglr.Value == nil || len(*stglr.Value) == 0
27739}
27740
27741// hasNextLink returns true if the NextLink is not empty.
27742func (stglr ServerTrustGroupListResult) hasNextLink() bool {
27743	return stglr.NextLink != nil && len(*stglr.NextLink) != 0
27744}
27745
27746// serverTrustGroupListResultPreparer prepares a request to retrieve the next set of results.
27747// It returns nil if no more results exist.
27748func (stglr ServerTrustGroupListResult) serverTrustGroupListResultPreparer(ctx context.Context) (*http.Request, error) {
27749	if !stglr.hasNextLink() {
27750		return nil, nil
27751	}
27752	return autorest.Prepare((&http.Request{}).WithContext(ctx),
27753		autorest.AsJSON(),
27754		autorest.AsGet(),
27755		autorest.WithBaseURL(to.String(stglr.NextLink)))
27756}
27757
27758// ServerTrustGroupListResultPage contains a page of ServerTrustGroup values.
27759type ServerTrustGroupListResultPage struct {
27760	fn    func(context.Context, ServerTrustGroupListResult) (ServerTrustGroupListResult, error)
27761	stglr ServerTrustGroupListResult
27762}
27763
27764// NextWithContext advances to the next page of values.  If there was an error making
27765// the request the page does not advance and the error is returned.
27766func (page *ServerTrustGroupListResultPage) NextWithContext(ctx context.Context) (err error) {
27767	if tracing.IsEnabled() {
27768		ctx = tracing.StartSpan(ctx, fqdn+"/ServerTrustGroupListResultPage.NextWithContext")
27769		defer func() {
27770			sc := -1
27771			if page.Response().Response.Response != nil {
27772				sc = page.Response().Response.Response.StatusCode
27773			}
27774			tracing.EndSpan(ctx, sc, err)
27775		}()
27776	}
27777	for {
27778		next, err := page.fn(ctx, page.stglr)
27779		if err != nil {
27780			return err
27781		}
27782		page.stglr = next
27783		if !next.hasNextLink() || !next.IsEmpty() {
27784			break
27785		}
27786	}
27787	return nil
27788}
27789
27790// Next advances to the next page of values.  If there was an error making
27791// the request the page does not advance and the error is returned.
27792// Deprecated: Use NextWithContext() instead.
27793func (page *ServerTrustGroupListResultPage) Next() error {
27794	return page.NextWithContext(context.Background())
27795}
27796
27797// NotDone returns true if the page enumeration should be started or is not yet complete.
27798func (page ServerTrustGroupListResultPage) NotDone() bool {
27799	return !page.stglr.IsEmpty()
27800}
27801
27802// Response returns the raw server response from the last page request.
27803func (page ServerTrustGroupListResultPage) Response() ServerTrustGroupListResult {
27804	return page.stglr
27805}
27806
27807// Values returns the slice of values for the current page or nil if there are no values.
27808func (page ServerTrustGroupListResultPage) Values() []ServerTrustGroup {
27809	if page.stglr.IsEmpty() {
27810		return nil
27811	}
27812	return *page.stglr.Value
27813}
27814
27815// Creates a new instance of the ServerTrustGroupListResultPage type.
27816func NewServerTrustGroupListResultPage(cur ServerTrustGroupListResult, getNextPage func(context.Context, ServerTrustGroupListResult) (ServerTrustGroupListResult, error)) ServerTrustGroupListResultPage {
27817	return ServerTrustGroupListResultPage{
27818		fn:    getNextPage,
27819		stglr: cur,
27820	}
27821}
27822
27823// ServerTrustGroupProperties properties of a server trust group.
27824type ServerTrustGroupProperties struct {
27825	// GroupMembers - Group members information for the server trust group.
27826	GroupMembers *[]ServerInfo `json:"groupMembers,omitempty"`
27827	// TrustScopes - Trust scope of the server trust group.
27828	TrustScopes *[]string `json:"trustScopes,omitempty"`
27829}
27830
27831// ServerTrustGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
27832// long-running operation.
27833type ServerTrustGroupsCreateOrUpdateFuture struct {
27834	azure.FutureAPI
27835	// Result returns the result of the asynchronous operation.
27836	// If the operation has not completed it will return an error.
27837	Result func(ServerTrustGroupsClient) (ServerTrustGroup, error)
27838}
27839
27840// UnmarshalJSON is the custom unmarshaller for CreateFuture.
27841func (future *ServerTrustGroupsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
27842	var azFuture azure.Future
27843	if err := json.Unmarshal(body, &azFuture); err != nil {
27844		return err
27845	}
27846	future.FutureAPI = &azFuture
27847	future.Result = future.result
27848	return nil
27849}
27850
27851// result is the default implementation for ServerTrustGroupsCreateOrUpdateFuture.Result.
27852func (future *ServerTrustGroupsCreateOrUpdateFuture) result(client ServerTrustGroupsClient) (stg ServerTrustGroup, err error) {
27853	var done bool
27854	done, err = future.DoneWithContext(context.Background(), client)
27855	if err != nil {
27856		err = autorest.NewErrorWithError(err, "sql.ServerTrustGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
27857		return
27858	}
27859	if !done {
27860		stg.Response.Response = future.Response()
27861		err = azure.NewAsyncOpIncompleteError("sql.ServerTrustGroupsCreateOrUpdateFuture")
27862		return
27863	}
27864	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
27865	if stg.Response.Response, err = future.GetResult(sender); err == nil && stg.Response.Response.StatusCode != http.StatusNoContent {
27866		stg, err = client.CreateOrUpdateResponder(stg.Response.Response)
27867		if err != nil {
27868			err = autorest.NewErrorWithError(err, "sql.ServerTrustGroupsCreateOrUpdateFuture", "Result", stg.Response.Response, "Failure responding to request")
27869		}
27870	}
27871	return
27872}
27873
27874// ServerTrustGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
27875// operation.
27876type ServerTrustGroupsDeleteFuture struct {
27877	azure.FutureAPI
27878	// Result returns the result of the asynchronous operation.
27879	// If the operation has not completed it will return an error.
27880	Result func(ServerTrustGroupsClient) (autorest.Response, error)
27881}
27882
27883// UnmarshalJSON is the custom unmarshaller for CreateFuture.
27884func (future *ServerTrustGroupsDeleteFuture) UnmarshalJSON(body []byte) error {
27885	var azFuture azure.Future
27886	if err := json.Unmarshal(body, &azFuture); err != nil {
27887		return err
27888	}
27889	future.FutureAPI = &azFuture
27890	future.Result = future.result
27891	return nil
27892}
27893
27894// result is the default implementation for ServerTrustGroupsDeleteFuture.Result.
27895func (future *ServerTrustGroupsDeleteFuture) result(client ServerTrustGroupsClient) (ar autorest.Response, err error) {
27896	var done bool
27897	done, err = future.DoneWithContext(context.Background(), client)
27898	if err != nil {
27899		err = autorest.NewErrorWithError(err, "sql.ServerTrustGroupsDeleteFuture", "Result", future.Response(), "Polling failure")
27900		return
27901	}
27902	if !done {
27903		ar.Response = future.Response()
27904		err = azure.NewAsyncOpIncompleteError("sql.ServerTrustGroupsDeleteFuture")
27905		return
27906	}
27907	ar.Response = future.Response()
27908	return
27909}
27910
27911// ServerUpdate an update request for an Azure SQL Database server.
27912type ServerUpdate struct {
27913	// Identity - Server identity
27914	Identity *ResourceIdentity `json:"identity,omitempty"`
27915	// ServerProperties - Resource properties.
27916	*ServerProperties `json:"properties,omitempty"`
27917	// Tags - Resource tags.
27918	Tags map[string]*string `json:"tags"`
27919}
27920
27921// MarshalJSON is the custom marshaler for ServerUpdate.
27922func (su ServerUpdate) MarshalJSON() ([]byte, error) {
27923	objectMap := make(map[string]interface{})
27924	if su.Identity != nil {
27925		objectMap["identity"] = su.Identity
27926	}
27927	if su.ServerProperties != nil {
27928		objectMap["properties"] = su.ServerProperties
27929	}
27930	if su.Tags != nil {
27931		objectMap["tags"] = su.Tags
27932	}
27933	return json.Marshal(objectMap)
27934}
27935
27936// UnmarshalJSON is the custom unmarshaler for ServerUpdate struct.
27937func (su *ServerUpdate) UnmarshalJSON(body []byte) error {
27938	var m map[string]*json.RawMessage
27939	err := json.Unmarshal(body, &m)
27940	if err != nil {
27941		return err
27942	}
27943	for k, v := range m {
27944		switch k {
27945		case "identity":
27946			if v != nil {
27947				var identity ResourceIdentity
27948				err = json.Unmarshal(*v, &identity)
27949				if err != nil {
27950					return err
27951				}
27952				su.Identity = &identity
27953			}
27954		case "properties":
27955			if v != nil {
27956				var serverProperties ServerProperties
27957				err = json.Unmarshal(*v, &serverProperties)
27958				if err != nil {
27959					return err
27960				}
27961				su.ServerProperties = &serverProperties
27962			}
27963		case "tags":
27964			if v != nil {
27965				var tags map[string]*string
27966				err = json.Unmarshal(*v, &tags)
27967				if err != nil {
27968					return err
27969				}
27970				su.Tags = tags
27971			}
27972		}
27973	}
27974
27975	return nil
27976}
27977
27978// ServerUsage represents server metrics.
27979type ServerUsage struct {
27980	// Name - READ-ONLY; Name of the server usage metric.
27981	Name *string `json:"name,omitempty"`
27982	// ResourceName - READ-ONLY; The name of the resource.
27983	ResourceName *string `json:"resourceName,omitempty"`
27984	// DisplayName - READ-ONLY; The metric display name.
27985	DisplayName *string `json:"displayName,omitempty"`
27986	// CurrentValue - READ-ONLY; The current value of the metric.
27987	CurrentValue *float64 `json:"currentValue,omitempty"`
27988	// Limit - READ-ONLY; The current limit of the metric.
27989	Limit *float64 `json:"limit,omitempty"`
27990	// Unit - READ-ONLY; The units of the metric.
27991	Unit *string `json:"unit,omitempty"`
27992	// NextResetTime - READ-ONLY; The next reset time for the metric (ISO8601 format).
27993	NextResetTime *date.Time `json:"nextResetTime,omitempty"`
27994}
27995
27996// MarshalJSON is the custom marshaler for ServerUsage.
27997func (su ServerUsage) MarshalJSON() ([]byte, error) {
27998	objectMap := make(map[string]interface{})
27999	return json.Marshal(objectMap)
28000}
28001
28002// ServerUsageListResult represents the response to a list server metrics request.
28003type ServerUsageListResult struct {
28004	autorest.Response `json:"-"`
28005	// Value - The list of server metrics for the server.
28006	Value *[]ServerUsage `json:"value,omitempty"`
28007}
28008
28009// ServerVersionCapability the server capability
28010type ServerVersionCapability struct {
28011	// Name - READ-ONLY; The server version name.
28012	Name *string `json:"name,omitempty"`
28013	// SupportedEditions - READ-ONLY; The list of supported database editions.
28014	SupportedEditions *[]EditionCapability `json:"supportedEditions,omitempty"`
28015	// SupportedElasticPoolEditions - READ-ONLY; The list of supported elastic pool editions.
28016	SupportedElasticPoolEditions *[]ElasticPoolEditionCapability `json:"supportedElasticPoolEditions,omitempty"`
28017	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
28018	Status CapabilityStatus `json:"status,omitempty"`
28019	// Reason - The reason for the capability not being available.
28020	Reason *string `json:"reason,omitempty"`
28021}
28022
28023// MarshalJSON is the custom marshaler for ServerVersionCapability.
28024func (svc ServerVersionCapability) MarshalJSON() ([]byte, error) {
28025	objectMap := make(map[string]interface{})
28026	if svc.Reason != nil {
28027		objectMap["reason"] = svc.Reason
28028	}
28029	return json.Marshal(objectMap)
28030}
28031
28032// ServerVulnerabilityAssessment a server vulnerability assessment.
28033type ServerVulnerabilityAssessment struct {
28034	autorest.Response `json:"-"`
28035	// ServerVulnerabilityAssessmentProperties - Resource properties.
28036	*ServerVulnerabilityAssessmentProperties `json:"properties,omitempty"`
28037	// ID - READ-ONLY; Resource ID.
28038	ID *string `json:"id,omitempty"`
28039	// Name - READ-ONLY; Resource name.
28040	Name *string `json:"name,omitempty"`
28041	// Type - READ-ONLY; Resource type.
28042	Type *string `json:"type,omitempty"`
28043}
28044
28045// MarshalJSON is the custom marshaler for ServerVulnerabilityAssessment.
28046func (sva ServerVulnerabilityAssessment) MarshalJSON() ([]byte, error) {
28047	objectMap := make(map[string]interface{})
28048	if sva.ServerVulnerabilityAssessmentProperties != nil {
28049		objectMap["properties"] = sva.ServerVulnerabilityAssessmentProperties
28050	}
28051	return json.Marshal(objectMap)
28052}
28053
28054// UnmarshalJSON is the custom unmarshaler for ServerVulnerabilityAssessment struct.
28055func (sva *ServerVulnerabilityAssessment) UnmarshalJSON(body []byte) error {
28056	var m map[string]*json.RawMessage
28057	err := json.Unmarshal(body, &m)
28058	if err != nil {
28059		return err
28060	}
28061	for k, v := range m {
28062		switch k {
28063		case "properties":
28064			if v != nil {
28065				var serverVulnerabilityAssessmentProperties ServerVulnerabilityAssessmentProperties
28066				err = json.Unmarshal(*v, &serverVulnerabilityAssessmentProperties)
28067				if err != nil {
28068					return err
28069				}
28070				sva.ServerVulnerabilityAssessmentProperties = &serverVulnerabilityAssessmentProperties
28071			}
28072		case "id":
28073			if v != nil {
28074				var ID string
28075				err = json.Unmarshal(*v, &ID)
28076				if err != nil {
28077					return err
28078				}
28079				sva.ID = &ID
28080			}
28081		case "name":
28082			if v != nil {
28083				var name string
28084				err = json.Unmarshal(*v, &name)
28085				if err != nil {
28086					return err
28087				}
28088				sva.Name = &name
28089			}
28090		case "type":
28091			if v != nil {
28092				var typeVar string
28093				err = json.Unmarshal(*v, &typeVar)
28094				if err != nil {
28095					return err
28096				}
28097				sva.Type = &typeVar
28098			}
28099		}
28100	}
28101
28102	return nil
28103}
28104
28105// ServerVulnerabilityAssessmentListResult a list of the server's vulnerability assessments.
28106type ServerVulnerabilityAssessmentListResult struct {
28107	autorest.Response `json:"-"`
28108	// Value - READ-ONLY; Array of results.
28109	Value *[]ServerVulnerabilityAssessment `json:"value,omitempty"`
28110	// NextLink - READ-ONLY; Link to retrieve next page of results.
28111	NextLink *string `json:"nextLink,omitempty"`
28112}
28113
28114// MarshalJSON is the custom marshaler for ServerVulnerabilityAssessmentListResult.
28115func (svalr ServerVulnerabilityAssessmentListResult) MarshalJSON() ([]byte, error) {
28116	objectMap := make(map[string]interface{})
28117	return json.Marshal(objectMap)
28118}
28119
28120// ServerVulnerabilityAssessmentListResultIterator provides access to a complete listing of
28121// ServerVulnerabilityAssessment values.
28122type ServerVulnerabilityAssessmentListResultIterator struct {
28123	i    int
28124	page ServerVulnerabilityAssessmentListResultPage
28125}
28126
28127// NextWithContext advances to the next value.  If there was an error making
28128// the request the iterator does not advance and the error is returned.
28129func (iter *ServerVulnerabilityAssessmentListResultIterator) NextWithContext(ctx context.Context) (err error) {
28130	if tracing.IsEnabled() {
28131		ctx = tracing.StartSpan(ctx, fqdn+"/ServerVulnerabilityAssessmentListResultIterator.NextWithContext")
28132		defer func() {
28133			sc := -1
28134			if iter.Response().Response.Response != nil {
28135				sc = iter.Response().Response.Response.StatusCode
28136			}
28137			tracing.EndSpan(ctx, sc, err)
28138		}()
28139	}
28140	iter.i++
28141	if iter.i < len(iter.page.Values()) {
28142		return nil
28143	}
28144	err = iter.page.NextWithContext(ctx)
28145	if err != nil {
28146		iter.i--
28147		return err
28148	}
28149	iter.i = 0
28150	return nil
28151}
28152
28153// Next advances to the next value.  If there was an error making
28154// the request the iterator does not advance and the error is returned.
28155// Deprecated: Use NextWithContext() instead.
28156func (iter *ServerVulnerabilityAssessmentListResultIterator) Next() error {
28157	return iter.NextWithContext(context.Background())
28158}
28159
28160// NotDone returns true if the enumeration should be started or is not yet complete.
28161func (iter ServerVulnerabilityAssessmentListResultIterator) NotDone() bool {
28162	return iter.page.NotDone() && iter.i < len(iter.page.Values())
28163}
28164
28165// Response returns the raw server response from the last page request.
28166func (iter ServerVulnerabilityAssessmentListResultIterator) Response() ServerVulnerabilityAssessmentListResult {
28167	return iter.page.Response()
28168}
28169
28170// Value returns the current value or a zero-initialized value if the
28171// iterator has advanced beyond the end of the collection.
28172func (iter ServerVulnerabilityAssessmentListResultIterator) Value() ServerVulnerabilityAssessment {
28173	if !iter.page.NotDone() {
28174		return ServerVulnerabilityAssessment{}
28175	}
28176	return iter.page.Values()[iter.i]
28177}
28178
28179// Creates a new instance of the ServerVulnerabilityAssessmentListResultIterator type.
28180func NewServerVulnerabilityAssessmentListResultIterator(page ServerVulnerabilityAssessmentListResultPage) ServerVulnerabilityAssessmentListResultIterator {
28181	return ServerVulnerabilityAssessmentListResultIterator{page: page}
28182}
28183
28184// IsEmpty returns true if the ListResult contains no values.
28185func (svalr ServerVulnerabilityAssessmentListResult) IsEmpty() bool {
28186	return svalr.Value == nil || len(*svalr.Value) == 0
28187}
28188
28189// hasNextLink returns true if the NextLink is not empty.
28190func (svalr ServerVulnerabilityAssessmentListResult) hasNextLink() bool {
28191	return svalr.NextLink != nil && len(*svalr.NextLink) != 0
28192}
28193
28194// serverVulnerabilityAssessmentListResultPreparer prepares a request to retrieve the next set of results.
28195// It returns nil if no more results exist.
28196func (svalr ServerVulnerabilityAssessmentListResult) serverVulnerabilityAssessmentListResultPreparer(ctx context.Context) (*http.Request, error) {
28197	if !svalr.hasNextLink() {
28198		return nil, nil
28199	}
28200	return autorest.Prepare((&http.Request{}).WithContext(ctx),
28201		autorest.AsJSON(),
28202		autorest.AsGet(),
28203		autorest.WithBaseURL(to.String(svalr.NextLink)))
28204}
28205
28206// ServerVulnerabilityAssessmentListResultPage contains a page of ServerVulnerabilityAssessment values.
28207type ServerVulnerabilityAssessmentListResultPage struct {
28208	fn    func(context.Context, ServerVulnerabilityAssessmentListResult) (ServerVulnerabilityAssessmentListResult, error)
28209	svalr ServerVulnerabilityAssessmentListResult
28210}
28211
28212// NextWithContext advances to the next page of values.  If there was an error making
28213// the request the page does not advance and the error is returned.
28214func (page *ServerVulnerabilityAssessmentListResultPage) NextWithContext(ctx context.Context) (err error) {
28215	if tracing.IsEnabled() {
28216		ctx = tracing.StartSpan(ctx, fqdn+"/ServerVulnerabilityAssessmentListResultPage.NextWithContext")
28217		defer func() {
28218			sc := -1
28219			if page.Response().Response.Response != nil {
28220				sc = page.Response().Response.Response.StatusCode
28221			}
28222			tracing.EndSpan(ctx, sc, err)
28223		}()
28224	}
28225	for {
28226		next, err := page.fn(ctx, page.svalr)
28227		if err != nil {
28228			return err
28229		}
28230		page.svalr = next
28231		if !next.hasNextLink() || !next.IsEmpty() {
28232			break
28233		}
28234	}
28235	return nil
28236}
28237
28238// Next advances to the next page of values.  If there was an error making
28239// the request the page does not advance and the error is returned.
28240// Deprecated: Use NextWithContext() instead.
28241func (page *ServerVulnerabilityAssessmentListResultPage) Next() error {
28242	return page.NextWithContext(context.Background())
28243}
28244
28245// NotDone returns true if the page enumeration should be started or is not yet complete.
28246func (page ServerVulnerabilityAssessmentListResultPage) NotDone() bool {
28247	return !page.svalr.IsEmpty()
28248}
28249
28250// Response returns the raw server response from the last page request.
28251func (page ServerVulnerabilityAssessmentListResultPage) Response() ServerVulnerabilityAssessmentListResult {
28252	return page.svalr
28253}
28254
28255// Values returns the slice of values for the current page or nil if there are no values.
28256func (page ServerVulnerabilityAssessmentListResultPage) Values() []ServerVulnerabilityAssessment {
28257	if page.svalr.IsEmpty() {
28258		return nil
28259	}
28260	return *page.svalr.Value
28261}
28262
28263// Creates a new instance of the ServerVulnerabilityAssessmentListResultPage type.
28264func NewServerVulnerabilityAssessmentListResultPage(cur ServerVulnerabilityAssessmentListResult, getNextPage func(context.Context, ServerVulnerabilityAssessmentListResult) (ServerVulnerabilityAssessmentListResult, error)) ServerVulnerabilityAssessmentListResultPage {
28265	return ServerVulnerabilityAssessmentListResultPage{
28266		fn:    getNextPage,
28267		svalr: cur,
28268	}
28269}
28270
28271// ServerVulnerabilityAssessmentProperties properties of a server Vulnerability Assessment.
28272type ServerVulnerabilityAssessmentProperties struct {
28273	// StorageContainerPath - A blob storage container path to hold the scan results (e.g. https://myStorage.blob.core.windows.net/VaScans/).
28274	StorageContainerPath *string `json:"storageContainerPath,omitempty"`
28275	// 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. Applies only if the storage account is not behind a Vnet or a firewall
28276	StorageContainerSasKey *string `json:"storageContainerSasKey,omitempty"`
28277	// StorageAccountAccessKey - Specifies the identifier key of the storage account for vulnerability assessment scan results. If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is required. Applies only if the storage account is not behind a Vnet or a firewall
28278	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
28279	// RecurringScans - The recurring scans settings
28280	RecurringScans *VulnerabilityAssessmentRecurringScansProperties `json:"recurringScans,omitempty"`
28281}
28282
28283// ServiceObjective represents a database service objective.
28284type ServiceObjective struct {
28285	autorest.Response `json:"-"`
28286	// ServiceObjectiveProperties - Represents the properties of the resource.
28287	*ServiceObjectiveProperties `json:"properties,omitempty"`
28288	// ID - READ-ONLY; Resource ID.
28289	ID *string `json:"id,omitempty"`
28290	// Name - READ-ONLY; Resource name.
28291	Name *string `json:"name,omitempty"`
28292	// Type - READ-ONLY; Resource type.
28293	Type *string `json:"type,omitempty"`
28294}
28295
28296// MarshalJSON is the custom marshaler for ServiceObjective.
28297func (so ServiceObjective) MarshalJSON() ([]byte, error) {
28298	objectMap := make(map[string]interface{})
28299	if so.ServiceObjectiveProperties != nil {
28300		objectMap["properties"] = so.ServiceObjectiveProperties
28301	}
28302	return json.Marshal(objectMap)
28303}
28304
28305// UnmarshalJSON is the custom unmarshaler for ServiceObjective struct.
28306func (so *ServiceObjective) UnmarshalJSON(body []byte) error {
28307	var m map[string]*json.RawMessage
28308	err := json.Unmarshal(body, &m)
28309	if err != nil {
28310		return err
28311	}
28312	for k, v := range m {
28313		switch k {
28314		case "properties":
28315			if v != nil {
28316				var serviceObjectiveProperties ServiceObjectiveProperties
28317				err = json.Unmarshal(*v, &serviceObjectiveProperties)
28318				if err != nil {
28319					return err
28320				}
28321				so.ServiceObjectiveProperties = &serviceObjectiveProperties
28322			}
28323		case "id":
28324			if v != nil {
28325				var ID string
28326				err = json.Unmarshal(*v, &ID)
28327				if err != nil {
28328					return err
28329				}
28330				so.ID = &ID
28331			}
28332		case "name":
28333			if v != nil {
28334				var name string
28335				err = json.Unmarshal(*v, &name)
28336				if err != nil {
28337					return err
28338				}
28339				so.Name = &name
28340			}
28341		case "type":
28342			if v != nil {
28343				var typeVar string
28344				err = json.Unmarshal(*v, &typeVar)
28345				if err != nil {
28346					return err
28347				}
28348				so.Type = &typeVar
28349			}
28350		}
28351	}
28352
28353	return nil
28354}
28355
28356// ServiceObjectiveCapability the service objectives capability.
28357type ServiceObjectiveCapability struct {
28358	// ID - READ-ONLY; The unique ID of the service objective.
28359	ID *uuid.UUID `json:"id,omitempty"`
28360	// Name - READ-ONLY; The service objective name.
28361	Name *string `json:"name,omitempty"`
28362	// SupportedMaxSizes - READ-ONLY; The list of supported maximum database sizes.
28363	SupportedMaxSizes *[]MaxSizeRangeCapability `json:"supportedMaxSizes,omitempty"`
28364	// PerformanceLevel - READ-ONLY; The performance level.
28365	PerformanceLevel *PerformanceLevelCapability `json:"performanceLevel,omitempty"`
28366	// Sku - READ-ONLY; The sku.
28367	Sku *Sku `json:"sku,omitempty"`
28368	// SupportedLicenseTypes - READ-ONLY; List of supported license types.
28369	SupportedLicenseTypes *[]LicenseTypeCapability `json:"supportedLicenseTypes,omitempty"`
28370	// IncludedMaxSize - READ-ONLY; The included (free) max size.
28371	IncludedMaxSize *MaxSizeCapability `json:"includedMaxSize,omitempty"`
28372	// ZoneRedundant - READ-ONLY; Whether or not zone redundancy is supported for the service objective.
28373	ZoneRedundant *bool `json:"zoneRedundant,omitempty"`
28374	// SupportedAutoPauseDelay - READ-ONLY; Supported time range for auto pause delay
28375	SupportedAutoPauseDelay *AutoPauseDelayTimeRange `json:"supportedAutoPauseDelay,omitempty"`
28376	// SupportedMinCapacities - READ-ONLY; List of supported min capacities
28377	SupportedMinCapacities *[]MinCapacityCapability `json:"supportedMinCapacities,omitempty"`
28378	// ComputeModel - READ-ONLY; The compute model
28379	ComputeModel *string `json:"computeModel,omitempty"`
28380	// SupportedMaintenanceConfigurations - READ-ONLY; List of supported maintenance configurations
28381	SupportedMaintenanceConfigurations *[]MaintenanceConfigurationCapability `json:"supportedMaintenanceConfigurations,omitempty"`
28382	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
28383	Status CapabilityStatus `json:"status,omitempty"`
28384	// Reason - The reason for the capability not being available.
28385	Reason *string `json:"reason,omitempty"`
28386}
28387
28388// MarshalJSON is the custom marshaler for ServiceObjectiveCapability.
28389func (soc ServiceObjectiveCapability) MarshalJSON() ([]byte, error) {
28390	objectMap := make(map[string]interface{})
28391	if soc.Reason != nil {
28392		objectMap["reason"] = soc.Reason
28393	}
28394	return json.Marshal(objectMap)
28395}
28396
28397// ServiceObjectiveListResult represents the response to a get database service objectives request.
28398type ServiceObjectiveListResult struct {
28399	autorest.Response `json:"-"`
28400	// Value - The list of database service objectives.
28401	Value *[]ServiceObjective `json:"value,omitempty"`
28402}
28403
28404// ServiceObjectiveProperties represents the properties of a database service objective.
28405type ServiceObjectiveProperties struct {
28406	// ServiceObjectiveName - READ-ONLY; The name for the service objective.
28407	ServiceObjectiveName *string `json:"serviceObjectiveName,omitempty"`
28408	// IsDefault - READ-ONLY; Gets whether the service level objective is the default service objective.
28409	IsDefault *bool `json:"isDefault,omitempty"`
28410	// IsSystem - READ-ONLY; Gets whether the service level objective is a system service objective.
28411	IsSystem *bool `json:"isSystem,omitempty"`
28412	// Description - READ-ONLY; The description for the service level objective.
28413	Description *string `json:"description,omitempty"`
28414	// Enabled - READ-ONLY; Gets whether the service level objective is enabled.
28415	Enabled *bool `json:"enabled,omitempty"`
28416}
28417
28418// MarshalJSON is the custom marshaler for ServiceObjectiveProperties.
28419func (sop ServiceObjectiveProperties) MarshalJSON() ([]byte, error) {
28420	objectMap := make(map[string]interface{})
28421	return json.Marshal(objectMap)
28422}
28423
28424// Sku an ARM Resource SKU.
28425type Sku struct {
28426	// Name - The name of the SKU, typically, a letter + Number code, e.g. P3.
28427	Name *string `json:"name,omitempty"`
28428	// Tier - The tier or edition of the particular SKU, e.g. Basic, Premium.
28429	Tier *string `json:"tier,omitempty"`
28430	// Size - Size of the particular SKU
28431	Size *string `json:"size,omitempty"`
28432	// Family - If the service has different generations of hardware, for the same SKU, then that can be captured here.
28433	Family *string `json:"family,omitempty"`
28434	// Capacity - Capacity of the particular SKU.
28435	Capacity *int32 `json:"capacity,omitempty"`
28436}
28437
28438// SloUsageMetric a Slo Usage Metric.
28439type SloUsageMetric struct {
28440	// ServiceLevelObjective - READ-ONLY; 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'
28441	ServiceLevelObjective ServiceObjectiveName `json:"serviceLevelObjective,omitempty"`
28442	// ServiceLevelObjectiveID - READ-ONLY; The serviceLevelObjectiveId for SLO usage metric.
28443	ServiceLevelObjectiveID *uuid.UUID `json:"serviceLevelObjectiveId,omitempty"`
28444	// InRangeTimeRatio - READ-ONLY; Gets or sets inRangeTimeRatio for SLO usage metric.
28445	InRangeTimeRatio *float64 `json:"inRangeTimeRatio,omitempty"`
28446}
28447
28448// MarshalJSON is the custom marshaler for SloUsageMetric.
28449func (sum SloUsageMetric) MarshalJSON() ([]byte, error) {
28450	objectMap := make(map[string]interface{})
28451	return json.Marshal(objectMap)
28452}
28453
28454// StorageCapability the storage account type capability.
28455type StorageCapability struct {
28456	// StorageAccountType - READ-ONLY; The storage account type for the database's backups. Possible values include: 'StorageAccountType1GRS', 'StorageAccountType1LRS', 'StorageAccountType1ZRS'
28457	StorageAccountType StorageAccountType1 `json:"storageAccountType,omitempty"`
28458	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
28459	Status CapabilityStatus `json:"status,omitempty"`
28460	// Reason - The reason for the capability not being available.
28461	Reason *string `json:"reason,omitempty"`
28462}
28463
28464// MarshalJSON is the custom marshaler for StorageCapability.
28465func (sc StorageCapability) MarshalJSON() ([]byte, error) {
28466	objectMap := make(map[string]interface{})
28467	if sc.Reason != nil {
28468		objectMap["reason"] = sc.Reason
28469	}
28470	return json.Marshal(objectMap)
28471}
28472
28473// SubscriptionUsage usage Metric of a Subscription in a Location.
28474type SubscriptionUsage struct {
28475	autorest.Response `json:"-"`
28476	// SubscriptionUsageProperties - Resource properties.
28477	*SubscriptionUsageProperties `json:"properties,omitempty"`
28478	// ID - READ-ONLY; Resource ID.
28479	ID *string `json:"id,omitempty"`
28480	// Name - READ-ONLY; Resource name.
28481	Name *string `json:"name,omitempty"`
28482	// Type - READ-ONLY; Resource type.
28483	Type *string `json:"type,omitempty"`
28484}
28485
28486// MarshalJSON is the custom marshaler for SubscriptionUsage.
28487func (su SubscriptionUsage) MarshalJSON() ([]byte, error) {
28488	objectMap := make(map[string]interface{})
28489	if su.SubscriptionUsageProperties != nil {
28490		objectMap["properties"] = su.SubscriptionUsageProperties
28491	}
28492	return json.Marshal(objectMap)
28493}
28494
28495// UnmarshalJSON is the custom unmarshaler for SubscriptionUsage struct.
28496func (su *SubscriptionUsage) UnmarshalJSON(body []byte) error {
28497	var m map[string]*json.RawMessage
28498	err := json.Unmarshal(body, &m)
28499	if err != nil {
28500		return err
28501	}
28502	for k, v := range m {
28503		switch k {
28504		case "properties":
28505			if v != nil {
28506				var subscriptionUsageProperties SubscriptionUsageProperties
28507				err = json.Unmarshal(*v, &subscriptionUsageProperties)
28508				if err != nil {
28509					return err
28510				}
28511				su.SubscriptionUsageProperties = &subscriptionUsageProperties
28512			}
28513		case "id":
28514			if v != nil {
28515				var ID string
28516				err = json.Unmarshal(*v, &ID)
28517				if err != nil {
28518					return err
28519				}
28520				su.ID = &ID
28521			}
28522		case "name":
28523			if v != nil {
28524				var name string
28525				err = json.Unmarshal(*v, &name)
28526				if err != nil {
28527					return err
28528				}
28529				su.Name = &name
28530			}
28531		case "type":
28532			if v != nil {
28533				var typeVar string
28534				err = json.Unmarshal(*v, &typeVar)
28535				if err != nil {
28536					return err
28537				}
28538				su.Type = &typeVar
28539			}
28540		}
28541	}
28542
28543	return nil
28544}
28545
28546// SubscriptionUsageListResult a list of subscription usage metrics in a location.
28547type SubscriptionUsageListResult struct {
28548	autorest.Response `json:"-"`
28549	// Value - READ-ONLY; Array of results.
28550	Value *[]SubscriptionUsage `json:"value,omitempty"`
28551	// NextLink - READ-ONLY; Link to retrieve next page of results.
28552	NextLink *string `json:"nextLink,omitempty"`
28553}
28554
28555// MarshalJSON is the custom marshaler for SubscriptionUsageListResult.
28556func (sulr SubscriptionUsageListResult) MarshalJSON() ([]byte, error) {
28557	objectMap := make(map[string]interface{})
28558	return json.Marshal(objectMap)
28559}
28560
28561// SubscriptionUsageListResultIterator provides access to a complete listing of SubscriptionUsage values.
28562type SubscriptionUsageListResultIterator struct {
28563	i    int
28564	page SubscriptionUsageListResultPage
28565}
28566
28567// NextWithContext advances to the next value.  If there was an error making
28568// the request the iterator does not advance and the error is returned.
28569func (iter *SubscriptionUsageListResultIterator) NextWithContext(ctx context.Context) (err error) {
28570	if tracing.IsEnabled() {
28571		ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionUsageListResultIterator.NextWithContext")
28572		defer func() {
28573			sc := -1
28574			if iter.Response().Response.Response != nil {
28575				sc = iter.Response().Response.Response.StatusCode
28576			}
28577			tracing.EndSpan(ctx, sc, err)
28578		}()
28579	}
28580	iter.i++
28581	if iter.i < len(iter.page.Values()) {
28582		return nil
28583	}
28584	err = iter.page.NextWithContext(ctx)
28585	if err != nil {
28586		iter.i--
28587		return err
28588	}
28589	iter.i = 0
28590	return nil
28591}
28592
28593// Next advances to the next value.  If there was an error making
28594// the request the iterator does not advance and the error is returned.
28595// Deprecated: Use NextWithContext() instead.
28596func (iter *SubscriptionUsageListResultIterator) Next() error {
28597	return iter.NextWithContext(context.Background())
28598}
28599
28600// NotDone returns true if the enumeration should be started or is not yet complete.
28601func (iter SubscriptionUsageListResultIterator) NotDone() bool {
28602	return iter.page.NotDone() && iter.i < len(iter.page.Values())
28603}
28604
28605// Response returns the raw server response from the last page request.
28606func (iter SubscriptionUsageListResultIterator) Response() SubscriptionUsageListResult {
28607	return iter.page.Response()
28608}
28609
28610// Value returns the current value or a zero-initialized value if the
28611// iterator has advanced beyond the end of the collection.
28612func (iter SubscriptionUsageListResultIterator) Value() SubscriptionUsage {
28613	if !iter.page.NotDone() {
28614		return SubscriptionUsage{}
28615	}
28616	return iter.page.Values()[iter.i]
28617}
28618
28619// Creates a new instance of the SubscriptionUsageListResultIterator type.
28620func NewSubscriptionUsageListResultIterator(page SubscriptionUsageListResultPage) SubscriptionUsageListResultIterator {
28621	return SubscriptionUsageListResultIterator{page: page}
28622}
28623
28624// IsEmpty returns true if the ListResult contains no values.
28625func (sulr SubscriptionUsageListResult) IsEmpty() bool {
28626	return sulr.Value == nil || len(*sulr.Value) == 0
28627}
28628
28629// hasNextLink returns true if the NextLink is not empty.
28630func (sulr SubscriptionUsageListResult) hasNextLink() bool {
28631	return sulr.NextLink != nil && len(*sulr.NextLink) != 0
28632}
28633
28634// subscriptionUsageListResultPreparer prepares a request to retrieve the next set of results.
28635// It returns nil if no more results exist.
28636func (sulr SubscriptionUsageListResult) subscriptionUsageListResultPreparer(ctx context.Context) (*http.Request, error) {
28637	if !sulr.hasNextLink() {
28638		return nil, nil
28639	}
28640	return autorest.Prepare((&http.Request{}).WithContext(ctx),
28641		autorest.AsJSON(),
28642		autorest.AsGet(),
28643		autorest.WithBaseURL(to.String(sulr.NextLink)))
28644}
28645
28646// SubscriptionUsageListResultPage contains a page of SubscriptionUsage values.
28647type SubscriptionUsageListResultPage struct {
28648	fn   func(context.Context, SubscriptionUsageListResult) (SubscriptionUsageListResult, error)
28649	sulr SubscriptionUsageListResult
28650}
28651
28652// NextWithContext advances to the next page of values.  If there was an error making
28653// the request the page does not advance and the error is returned.
28654func (page *SubscriptionUsageListResultPage) NextWithContext(ctx context.Context) (err error) {
28655	if tracing.IsEnabled() {
28656		ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionUsageListResultPage.NextWithContext")
28657		defer func() {
28658			sc := -1
28659			if page.Response().Response.Response != nil {
28660				sc = page.Response().Response.Response.StatusCode
28661			}
28662			tracing.EndSpan(ctx, sc, err)
28663		}()
28664	}
28665	for {
28666		next, err := page.fn(ctx, page.sulr)
28667		if err != nil {
28668			return err
28669		}
28670		page.sulr = next
28671		if !next.hasNextLink() || !next.IsEmpty() {
28672			break
28673		}
28674	}
28675	return nil
28676}
28677
28678// Next advances to the next page of values.  If there was an error making
28679// the request the page does not advance and the error is returned.
28680// Deprecated: Use NextWithContext() instead.
28681func (page *SubscriptionUsageListResultPage) Next() error {
28682	return page.NextWithContext(context.Background())
28683}
28684
28685// NotDone returns true if the page enumeration should be started or is not yet complete.
28686func (page SubscriptionUsageListResultPage) NotDone() bool {
28687	return !page.sulr.IsEmpty()
28688}
28689
28690// Response returns the raw server response from the last page request.
28691func (page SubscriptionUsageListResultPage) Response() SubscriptionUsageListResult {
28692	return page.sulr
28693}
28694
28695// Values returns the slice of values for the current page or nil if there are no values.
28696func (page SubscriptionUsageListResultPage) Values() []SubscriptionUsage {
28697	if page.sulr.IsEmpty() {
28698		return nil
28699	}
28700	return *page.sulr.Value
28701}
28702
28703// Creates a new instance of the SubscriptionUsageListResultPage type.
28704func NewSubscriptionUsageListResultPage(cur SubscriptionUsageListResult, getNextPage func(context.Context, SubscriptionUsageListResult) (SubscriptionUsageListResult, error)) SubscriptionUsageListResultPage {
28705	return SubscriptionUsageListResultPage{
28706		fn:   getNextPage,
28707		sulr: cur,
28708	}
28709}
28710
28711// SubscriptionUsageProperties properties of a subscription usage.
28712type SubscriptionUsageProperties struct {
28713	// DisplayName - READ-ONLY; User-readable name of the metric.
28714	DisplayName *string `json:"displayName,omitempty"`
28715	// CurrentValue - READ-ONLY; Current value of the metric.
28716	CurrentValue *float64 `json:"currentValue,omitempty"`
28717	// Limit - READ-ONLY; Boundary value of the metric.
28718	Limit *float64 `json:"limit,omitempty"`
28719	// Unit - READ-ONLY; Unit of the metric.
28720	Unit *string `json:"unit,omitempty"`
28721}
28722
28723// MarshalJSON is the custom marshaler for SubscriptionUsageProperties.
28724func (sup SubscriptionUsageProperties) MarshalJSON() ([]byte, error) {
28725	objectMap := make(map[string]interface{})
28726	return json.Marshal(objectMap)
28727}
28728
28729// SyncAgent an Azure SQL Database sync agent.
28730type SyncAgent struct {
28731	autorest.Response `json:"-"`
28732	// SyncAgentProperties - Resource properties.
28733	*SyncAgentProperties `json:"properties,omitempty"`
28734	// ID - READ-ONLY; Resource ID.
28735	ID *string `json:"id,omitempty"`
28736	// Name - READ-ONLY; Resource name.
28737	Name *string `json:"name,omitempty"`
28738	// Type - READ-ONLY; Resource type.
28739	Type *string `json:"type,omitempty"`
28740}
28741
28742// MarshalJSON is the custom marshaler for SyncAgent.
28743func (sa SyncAgent) MarshalJSON() ([]byte, error) {
28744	objectMap := make(map[string]interface{})
28745	if sa.SyncAgentProperties != nil {
28746		objectMap["properties"] = sa.SyncAgentProperties
28747	}
28748	return json.Marshal(objectMap)
28749}
28750
28751// UnmarshalJSON is the custom unmarshaler for SyncAgent struct.
28752func (sa *SyncAgent) UnmarshalJSON(body []byte) error {
28753	var m map[string]*json.RawMessage
28754	err := json.Unmarshal(body, &m)
28755	if err != nil {
28756		return err
28757	}
28758	for k, v := range m {
28759		switch k {
28760		case "properties":
28761			if v != nil {
28762				var syncAgentProperties SyncAgentProperties
28763				err = json.Unmarshal(*v, &syncAgentProperties)
28764				if err != nil {
28765					return err
28766				}
28767				sa.SyncAgentProperties = &syncAgentProperties
28768			}
28769		case "id":
28770			if v != nil {
28771				var ID string
28772				err = json.Unmarshal(*v, &ID)
28773				if err != nil {
28774					return err
28775				}
28776				sa.ID = &ID
28777			}
28778		case "name":
28779			if v != nil {
28780				var name string
28781				err = json.Unmarshal(*v, &name)
28782				if err != nil {
28783					return err
28784				}
28785				sa.Name = &name
28786			}
28787		case "type":
28788			if v != nil {
28789				var typeVar string
28790				err = json.Unmarshal(*v, &typeVar)
28791				if err != nil {
28792					return err
28793				}
28794				sa.Type = &typeVar
28795			}
28796		}
28797	}
28798
28799	return nil
28800}
28801
28802// SyncAgentKeyProperties properties of an Azure SQL Database sync agent key.
28803type SyncAgentKeyProperties struct {
28804	autorest.Response `json:"-"`
28805	// SyncAgentKey - READ-ONLY; Key of sync agent.
28806	SyncAgentKey *string `json:"syncAgentKey,omitempty"`
28807}
28808
28809// MarshalJSON is the custom marshaler for SyncAgentKeyProperties.
28810func (sakp SyncAgentKeyProperties) MarshalJSON() ([]byte, error) {
28811	objectMap := make(map[string]interface{})
28812	return json.Marshal(objectMap)
28813}
28814
28815// SyncAgentLinkedDatabase an Azure SQL Database sync agent linked database.
28816type SyncAgentLinkedDatabase struct {
28817	// SyncAgentLinkedDatabaseProperties - Resource properties.
28818	*SyncAgentLinkedDatabaseProperties `json:"properties,omitempty"`
28819	// ID - READ-ONLY; Resource ID.
28820	ID *string `json:"id,omitempty"`
28821	// Name - READ-ONLY; Resource name.
28822	Name *string `json:"name,omitempty"`
28823	// Type - READ-ONLY; Resource type.
28824	Type *string `json:"type,omitempty"`
28825}
28826
28827// MarshalJSON is the custom marshaler for SyncAgentLinkedDatabase.
28828func (sald SyncAgentLinkedDatabase) MarshalJSON() ([]byte, error) {
28829	objectMap := make(map[string]interface{})
28830	if sald.SyncAgentLinkedDatabaseProperties != nil {
28831		objectMap["properties"] = sald.SyncAgentLinkedDatabaseProperties
28832	}
28833	return json.Marshal(objectMap)
28834}
28835
28836// UnmarshalJSON is the custom unmarshaler for SyncAgentLinkedDatabase struct.
28837func (sald *SyncAgentLinkedDatabase) UnmarshalJSON(body []byte) error {
28838	var m map[string]*json.RawMessage
28839	err := json.Unmarshal(body, &m)
28840	if err != nil {
28841		return err
28842	}
28843	for k, v := range m {
28844		switch k {
28845		case "properties":
28846			if v != nil {
28847				var syncAgentLinkedDatabaseProperties SyncAgentLinkedDatabaseProperties
28848				err = json.Unmarshal(*v, &syncAgentLinkedDatabaseProperties)
28849				if err != nil {
28850					return err
28851				}
28852				sald.SyncAgentLinkedDatabaseProperties = &syncAgentLinkedDatabaseProperties
28853			}
28854		case "id":
28855			if v != nil {
28856				var ID string
28857				err = json.Unmarshal(*v, &ID)
28858				if err != nil {
28859					return err
28860				}
28861				sald.ID = &ID
28862			}
28863		case "name":
28864			if v != nil {
28865				var name string
28866				err = json.Unmarshal(*v, &name)
28867				if err != nil {
28868					return err
28869				}
28870				sald.Name = &name
28871			}
28872		case "type":
28873			if v != nil {
28874				var typeVar string
28875				err = json.Unmarshal(*v, &typeVar)
28876				if err != nil {
28877					return err
28878				}
28879				sald.Type = &typeVar
28880			}
28881		}
28882	}
28883
28884	return nil
28885}
28886
28887// SyncAgentLinkedDatabaseListResult a list of sync agent linked databases.
28888type SyncAgentLinkedDatabaseListResult struct {
28889	autorest.Response `json:"-"`
28890	// Value - READ-ONLY; Array of results.
28891	Value *[]SyncAgentLinkedDatabase `json:"value,omitempty"`
28892	// NextLink - READ-ONLY; Link to retrieve next page of results.
28893	NextLink *string `json:"nextLink,omitempty"`
28894}
28895
28896// MarshalJSON is the custom marshaler for SyncAgentLinkedDatabaseListResult.
28897func (saldlr SyncAgentLinkedDatabaseListResult) MarshalJSON() ([]byte, error) {
28898	objectMap := make(map[string]interface{})
28899	return json.Marshal(objectMap)
28900}
28901
28902// SyncAgentLinkedDatabaseListResultIterator provides access to a complete listing of
28903// SyncAgentLinkedDatabase values.
28904type SyncAgentLinkedDatabaseListResultIterator struct {
28905	i    int
28906	page SyncAgentLinkedDatabaseListResultPage
28907}
28908
28909// NextWithContext advances to the next value.  If there was an error making
28910// the request the iterator does not advance and the error is returned.
28911func (iter *SyncAgentLinkedDatabaseListResultIterator) NextWithContext(ctx context.Context) (err error) {
28912	if tracing.IsEnabled() {
28913		ctx = tracing.StartSpan(ctx, fqdn+"/SyncAgentLinkedDatabaseListResultIterator.NextWithContext")
28914		defer func() {
28915			sc := -1
28916			if iter.Response().Response.Response != nil {
28917				sc = iter.Response().Response.Response.StatusCode
28918			}
28919			tracing.EndSpan(ctx, sc, err)
28920		}()
28921	}
28922	iter.i++
28923	if iter.i < len(iter.page.Values()) {
28924		return nil
28925	}
28926	err = iter.page.NextWithContext(ctx)
28927	if err != nil {
28928		iter.i--
28929		return err
28930	}
28931	iter.i = 0
28932	return nil
28933}
28934
28935// Next advances to the next value.  If there was an error making
28936// the request the iterator does not advance and the error is returned.
28937// Deprecated: Use NextWithContext() instead.
28938func (iter *SyncAgentLinkedDatabaseListResultIterator) Next() error {
28939	return iter.NextWithContext(context.Background())
28940}
28941
28942// NotDone returns true if the enumeration should be started or is not yet complete.
28943func (iter SyncAgentLinkedDatabaseListResultIterator) NotDone() bool {
28944	return iter.page.NotDone() && iter.i < len(iter.page.Values())
28945}
28946
28947// Response returns the raw server response from the last page request.
28948func (iter SyncAgentLinkedDatabaseListResultIterator) Response() SyncAgentLinkedDatabaseListResult {
28949	return iter.page.Response()
28950}
28951
28952// Value returns the current value or a zero-initialized value if the
28953// iterator has advanced beyond the end of the collection.
28954func (iter SyncAgentLinkedDatabaseListResultIterator) Value() SyncAgentLinkedDatabase {
28955	if !iter.page.NotDone() {
28956		return SyncAgentLinkedDatabase{}
28957	}
28958	return iter.page.Values()[iter.i]
28959}
28960
28961// Creates a new instance of the SyncAgentLinkedDatabaseListResultIterator type.
28962func NewSyncAgentLinkedDatabaseListResultIterator(page SyncAgentLinkedDatabaseListResultPage) SyncAgentLinkedDatabaseListResultIterator {
28963	return SyncAgentLinkedDatabaseListResultIterator{page: page}
28964}
28965
28966// IsEmpty returns true if the ListResult contains no values.
28967func (saldlr SyncAgentLinkedDatabaseListResult) IsEmpty() bool {
28968	return saldlr.Value == nil || len(*saldlr.Value) == 0
28969}
28970
28971// hasNextLink returns true if the NextLink is not empty.
28972func (saldlr SyncAgentLinkedDatabaseListResult) hasNextLink() bool {
28973	return saldlr.NextLink != nil && len(*saldlr.NextLink) != 0
28974}
28975
28976// syncAgentLinkedDatabaseListResultPreparer prepares a request to retrieve the next set of results.
28977// It returns nil if no more results exist.
28978func (saldlr SyncAgentLinkedDatabaseListResult) syncAgentLinkedDatabaseListResultPreparer(ctx context.Context) (*http.Request, error) {
28979	if !saldlr.hasNextLink() {
28980		return nil, nil
28981	}
28982	return autorest.Prepare((&http.Request{}).WithContext(ctx),
28983		autorest.AsJSON(),
28984		autorest.AsGet(),
28985		autorest.WithBaseURL(to.String(saldlr.NextLink)))
28986}
28987
28988// SyncAgentLinkedDatabaseListResultPage contains a page of SyncAgentLinkedDatabase values.
28989type SyncAgentLinkedDatabaseListResultPage struct {
28990	fn     func(context.Context, SyncAgentLinkedDatabaseListResult) (SyncAgentLinkedDatabaseListResult, error)
28991	saldlr SyncAgentLinkedDatabaseListResult
28992}
28993
28994// NextWithContext advances to the next page of values.  If there was an error making
28995// the request the page does not advance and the error is returned.
28996func (page *SyncAgentLinkedDatabaseListResultPage) NextWithContext(ctx context.Context) (err error) {
28997	if tracing.IsEnabled() {
28998		ctx = tracing.StartSpan(ctx, fqdn+"/SyncAgentLinkedDatabaseListResultPage.NextWithContext")
28999		defer func() {
29000			sc := -1
29001			if page.Response().Response.Response != nil {
29002				sc = page.Response().Response.Response.StatusCode
29003			}
29004			tracing.EndSpan(ctx, sc, err)
29005		}()
29006	}
29007	for {
29008		next, err := page.fn(ctx, page.saldlr)
29009		if err != nil {
29010			return err
29011		}
29012		page.saldlr = next
29013		if !next.hasNextLink() || !next.IsEmpty() {
29014			break
29015		}
29016	}
29017	return nil
29018}
29019
29020// Next advances to the next page of values.  If there was an error making
29021// the request the page does not advance and the error is returned.
29022// Deprecated: Use NextWithContext() instead.
29023func (page *SyncAgentLinkedDatabaseListResultPage) Next() error {
29024	return page.NextWithContext(context.Background())
29025}
29026
29027// NotDone returns true if the page enumeration should be started or is not yet complete.
29028func (page SyncAgentLinkedDatabaseListResultPage) NotDone() bool {
29029	return !page.saldlr.IsEmpty()
29030}
29031
29032// Response returns the raw server response from the last page request.
29033func (page SyncAgentLinkedDatabaseListResultPage) Response() SyncAgentLinkedDatabaseListResult {
29034	return page.saldlr
29035}
29036
29037// Values returns the slice of values for the current page or nil if there are no values.
29038func (page SyncAgentLinkedDatabaseListResultPage) Values() []SyncAgentLinkedDatabase {
29039	if page.saldlr.IsEmpty() {
29040		return nil
29041	}
29042	return *page.saldlr.Value
29043}
29044
29045// Creates a new instance of the SyncAgentLinkedDatabaseListResultPage type.
29046func NewSyncAgentLinkedDatabaseListResultPage(cur SyncAgentLinkedDatabaseListResult, getNextPage func(context.Context, SyncAgentLinkedDatabaseListResult) (SyncAgentLinkedDatabaseListResult, error)) SyncAgentLinkedDatabaseListResultPage {
29047	return SyncAgentLinkedDatabaseListResultPage{
29048		fn:     getNextPage,
29049		saldlr: cur,
29050	}
29051}
29052
29053// SyncAgentLinkedDatabaseProperties properties of an Azure SQL Database sync agent linked database.
29054type SyncAgentLinkedDatabaseProperties struct {
29055	// DatabaseType - READ-ONLY; Type of the sync agent linked database. Possible values include: 'SyncMemberDbTypeAzureSQLDatabase', 'SyncMemberDbTypeSQLServerDatabase'
29056	DatabaseType SyncMemberDbType `json:"databaseType,omitempty"`
29057	// DatabaseID - READ-ONLY; Id of the sync agent linked database.
29058	DatabaseID *string `json:"databaseId,omitempty"`
29059	// Description - READ-ONLY; Description of the sync agent linked database.
29060	Description *string `json:"description,omitempty"`
29061	// ServerName - READ-ONLY; Server name of the sync agent linked database.
29062	ServerName *string `json:"serverName,omitempty"`
29063	// DatabaseName - READ-ONLY; Database name of the sync agent linked database.
29064	DatabaseName *string `json:"databaseName,omitempty"`
29065	// UserName - READ-ONLY; User name of the sync agent linked database.
29066	UserName *string `json:"userName,omitempty"`
29067}
29068
29069// MarshalJSON is the custom marshaler for SyncAgentLinkedDatabaseProperties.
29070func (saldp SyncAgentLinkedDatabaseProperties) MarshalJSON() ([]byte, error) {
29071	objectMap := make(map[string]interface{})
29072	return json.Marshal(objectMap)
29073}
29074
29075// SyncAgentListResult a list of sync agents.
29076type SyncAgentListResult struct {
29077	autorest.Response `json:"-"`
29078	// Value - READ-ONLY; Array of results.
29079	Value *[]SyncAgent `json:"value,omitempty"`
29080	// NextLink - READ-ONLY; Link to retrieve next page of results.
29081	NextLink *string `json:"nextLink,omitempty"`
29082}
29083
29084// MarshalJSON is the custom marshaler for SyncAgentListResult.
29085func (salr SyncAgentListResult) MarshalJSON() ([]byte, error) {
29086	objectMap := make(map[string]interface{})
29087	return json.Marshal(objectMap)
29088}
29089
29090// SyncAgentListResultIterator provides access to a complete listing of SyncAgent values.
29091type SyncAgentListResultIterator struct {
29092	i    int
29093	page SyncAgentListResultPage
29094}
29095
29096// NextWithContext advances to the next value.  If there was an error making
29097// the request the iterator does not advance and the error is returned.
29098func (iter *SyncAgentListResultIterator) NextWithContext(ctx context.Context) (err error) {
29099	if tracing.IsEnabled() {
29100		ctx = tracing.StartSpan(ctx, fqdn+"/SyncAgentListResultIterator.NextWithContext")
29101		defer func() {
29102			sc := -1
29103			if iter.Response().Response.Response != nil {
29104				sc = iter.Response().Response.Response.StatusCode
29105			}
29106			tracing.EndSpan(ctx, sc, err)
29107		}()
29108	}
29109	iter.i++
29110	if iter.i < len(iter.page.Values()) {
29111		return nil
29112	}
29113	err = iter.page.NextWithContext(ctx)
29114	if err != nil {
29115		iter.i--
29116		return err
29117	}
29118	iter.i = 0
29119	return nil
29120}
29121
29122// Next advances to the next value.  If there was an error making
29123// the request the iterator does not advance and the error is returned.
29124// Deprecated: Use NextWithContext() instead.
29125func (iter *SyncAgentListResultIterator) Next() error {
29126	return iter.NextWithContext(context.Background())
29127}
29128
29129// NotDone returns true if the enumeration should be started or is not yet complete.
29130func (iter SyncAgentListResultIterator) NotDone() bool {
29131	return iter.page.NotDone() && iter.i < len(iter.page.Values())
29132}
29133
29134// Response returns the raw server response from the last page request.
29135func (iter SyncAgentListResultIterator) Response() SyncAgentListResult {
29136	return iter.page.Response()
29137}
29138
29139// Value returns the current value or a zero-initialized value if the
29140// iterator has advanced beyond the end of the collection.
29141func (iter SyncAgentListResultIterator) Value() SyncAgent {
29142	if !iter.page.NotDone() {
29143		return SyncAgent{}
29144	}
29145	return iter.page.Values()[iter.i]
29146}
29147
29148// Creates a new instance of the SyncAgentListResultIterator type.
29149func NewSyncAgentListResultIterator(page SyncAgentListResultPage) SyncAgentListResultIterator {
29150	return SyncAgentListResultIterator{page: page}
29151}
29152
29153// IsEmpty returns true if the ListResult contains no values.
29154func (salr SyncAgentListResult) IsEmpty() bool {
29155	return salr.Value == nil || len(*salr.Value) == 0
29156}
29157
29158// hasNextLink returns true if the NextLink is not empty.
29159func (salr SyncAgentListResult) hasNextLink() bool {
29160	return salr.NextLink != nil && len(*salr.NextLink) != 0
29161}
29162
29163// syncAgentListResultPreparer prepares a request to retrieve the next set of results.
29164// It returns nil if no more results exist.
29165func (salr SyncAgentListResult) syncAgentListResultPreparer(ctx context.Context) (*http.Request, error) {
29166	if !salr.hasNextLink() {
29167		return nil, nil
29168	}
29169	return autorest.Prepare((&http.Request{}).WithContext(ctx),
29170		autorest.AsJSON(),
29171		autorest.AsGet(),
29172		autorest.WithBaseURL(to.String(salr.NextLink)))
29173}
29174
29175// SyncAgentListResultPage contains a page of SyncAgent values.
29176type SyncAgentListResultPage struct {
29177	fn   func(context.Context, SyncAgentListResult) (SyncAgentListResult, error)
29178	salr SyncAgentListResult
29179}
29180
29181// NextWithContext advances to the next page of values.  If there was an error making
29182// the request the page does not advance and the error is returned.
29183func (page *SyncAgentListResultPage) NextWithContext(ctx context.Context) (err error) {
29184	if tracing.IsEnabled() {
29185		ctx = tracing.StartSpan(ctx, fqdn+"/SyncAgentListResultPage.NextWithContext")
29186		defer func() {
29187			sc := -1
29188			if page.Response().Response.Response != nil {
29189				sc = page.Response().Response.Response.StatusCode
29190			}
29191			tracing.EndSpan(ctx, sc, err)
29192		}()
29193	}
29194	for {
29195		next, err := page.fn(ctx, page.salr)
29196		if err != nil {
29197			return err
29198		}
29199		page.salr = next
29200		if !next.hasNextLink() || !next.IsEmpty() {
29201			break
29202		}
29203	}
29204	return nil
29205}
29206
29207// Next advances to the next page of values.  If there was an error making
29208// the request the page does not advance and the error is returned.
29209// Deprecated: Use NextWithContext() instead.
29210func (page *SyncAgentListResultPage) Next() error {
29211	return page.NextWithContext(context.Background())
29212}
29213
29214// NotDone returns true if the page enumeration should be started or is not yet complete.
29215func (page SyncAgentListResultPage) NotDone() bool {
29216	return !page.salr.IsEmpty()
29217}
29218
29219// Response returns the raw server response from the last page request.
29220func (page SyncAgentListResultPage) Response() SyncAgentListResult {
29221	return page.salr
29222}
29223
29224// Values returns the slice of values for the current page or nil if there are no values.
29225func (page SyncAgentListResultPage) Values() []SyncAgent {
29226	if page.salr.IsEmpty() {
29227		return nil
29228	}
29229	return *page.salr.Value
29230}
29231
29232// Creates a new instance of the SyncAgentListResultPage type.
29233func NewSyncAgentListResultPage(cur SyncAgentListResult, getNextPage func(context.Context, SyncAgentListResult) (SyncAgentListResult, error)) SyncAgentListResultPage {
29234	return SyncAgentListResultPage{
29235		fn:   getNextPage,
29236		salr: cur,
29237	}
29238}
29239
29240// SyncAgentProperties properties of an Azure SQL Database sync agent.
29241type SyncAgentProperties struct {
29242	// Name - READ-ONLY; Name of the sync agent.
29243	Name *string `json:"name,omitempty"`
29244	// SyncDatabaseID - ARM resource id of the sync database in the sync agent.
29245	SyncDatabaseID *string `json:"syncDatabaseId,omitempty"`
29246	// LastAliveTime - READ-ONLY; Last alive time of the sync agent.
29247	LastAliveTime *date.Time `json:"lastAliveTime,omitempty"`
29248	// State - READ-ONLY; State of the sync agent. Possible values include: 'SyncAgentStateOnline', 'SyncAgentStateOffline', 'SyncAgentStateNeverConnected'
29249	State SyncAgentState `json:"state,omitempty"`
29250	// IsUpToDate - READ-ONLY; If the sync agent version is up to date.
29251	IsUpToDate *bool `json:"isUpToDate,omitempty"`
29252	// ExpiryTime - READ-ONLY; Expiration time of the sync agent version.
29253	ExpiryTime *date.Time `json:"expiryTime,omitempty"`
29254	// Version - READ-ONLY; Version of the sync agent.
29255	Version *string `json:"version,omitempty"`
29256}
29257
29258// MarshalJSON is the custom marshaler for SyncAgentProperties.
29259func (sap SyncAgentProperties) MarshalJSON() ([]byte, error) {
29260	objectMap := make(map[string]interface{})
29261	if sap.SyncDatabaseID != nil {
29262		objectMap["syncDatabaseId"] = sap.SyncDatabaseID
29263	}
29264	return json.Marshal(objectMap)
29265}
29266
29267// SyncAgentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
29268// long-running operation.
29269type SyncAgentsCreateOrUpdateFuture struct {
29270	azure.FutureAPI
29271	// Result returns the result of the asynchronous operation.
29272	// If the operation has not completed it will return an error.
29273	Result func(SyncAgentsClient) (SyncAgent, error)
29274}
29275
29276// UnmarshalJSON is the custom unmarshaller for CreateFuture.
29277func (future *SyncAgentsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
29278	var azFuture azure.Future
29279	if err := json.Unmarshal(body, &azFuture); err != nil {
29280		return err
29281	}
29282	future.FutureAPI = &azFuture
29283	future.Result = future.result
29284	return nil
29285}
29286
29287// result is the default implementation for SyncAgentsCreateOrUpdateFuture.Result.
29288func (future *SyncAgentsCreateOrUpdateFuture) result(client SyncAgentsClient) (sa SyncAgent, err error) {
29289	var done bool
29290	done, err = future.DoneWithContext(context.Background(), client)
29291	if err != nil {
29292		err = autorest.NewErrorWithError(err, "sql.SyncAgentsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
29293		return
29294	}
29295	if !done {
29296		sa.Response.Response = future.Response()
29297		err = azure.NewAsyncOpIncompleteError("sql.SyncAgentsCreateOrUpdateFuture")
29298		return
29299	}
29300	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
29301	if sa.Response.Response, err = future.GetResult(sender); err == nil && sa.Response.Response.StatusCode != http.StatusNoContent {
29302		sa, err = client.CreateOrUpdateResponder(sa.Response.Response)
29303		if err != nil {
29304			err = autorest.NewErrorWithError(err, "sql.SyncAgentsCreateOrUpdateFuture", "Result", sa.Response.Response, "Failure responding to request")
29305		}
29306	}
29307	return
29308}
29309
29310// SyncAgentsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
29311// operation.
29312type SyncAgentsDeleteFuture struct {
29313	azure.FutureAPI
29314	// Result returns the result of the asynchronous operation.
29315	// If the operation has not completed it will return an error.
29316	Result func(SyncAgentsClient) (autorest.Response, error)
29317}
29318
29319// UnmarshalJSON is the custom unmarshaller for CreateFuture.
29320func (future *SyncAgentsDeleteFuture) UnmarshalJSON(body []byte) error {
29321	var azFuture azure.Future
29322	if err := json.Unmarshal(body, &azFuture); err != nil {
29323		return err
29324	}
29325	future.FutureAPI = &azFuture
29326	future.Result = future.result
29327	return nil
29328}
29329
29330// result is the default implementation for SyncAgentsDeleteFuture.Result.
29331func (future *SyncAgentsDeleteFuture) result(client SyncAgentsClient) (ar autorest.Response, err error) {
29332	var done bool
29333	done, err = future.DoneWithContext(context.Background(), client)
29334	if err != nil {
29335		err = autorest.NewErrorWithError(err, "sql.SyncAgentsDeleteFuture", "Result", future.Response(), "Polling failure")
29336		return
29337	}
29338	if !done {
29339		ar.Response = future.Response()
29340		err = azure.NewAsyncOpIncompleteError("sql.SyncAgentsDeleteFuture")
29341		return
29342	}
29343	ar.Response = future.Response()
29344	return
29345}
29346
29347// SyncDatabaseIDListResult a list of sync database ID properties.
29348type SyncDatabaseIDListResult struct {
29349	autorest.Response `json:"-"`
29350	// Value - READ-ONLY; Array of results.
29351	Value *[]SyncDatabaseIDProperties `json:"value,omitempty"`
29352	// NextLink - READ-ONLY; Link to retrieve next page of results.
29353	NextLink *string `json:"nextLink,omitempty"`
29354}
29355
29356// MarshalJSON is the custom marshaler for SyncDatabaseIDListResult.
29357func (sdilr SyncDatabaseIDListResult) MarshalJSON() ([]byte, error) {
29358	objectMap := make(map[string]interface{})
29359	return json.Marshal(objectMap)
29360}
29361
29362// SyncDatabaseIDListResultIterator provides access to a complete listing of SyncDatabaseIDProperties
29363// values.
29364type SyncDatabaseIDListResultIterator struct {
29365	i    int
29366	page SyncDatabaseIDListResultPage
29367}
29368
29369// NextWithContext advances to the next value.  If there was an error making
29370// the request the iterator does not advance and the error is returned.
29371func (iter *SyncDatabaseIDListResultIterator) NextWithContext(ctx context.Context) (err error) {
29372	if tracing.IsEnabled() {
29373		ctx = tracing.StartSpan(ctx, fqdn+"/SyncDatabaseIDListResultIterator.NextWithContext")
29374		defer func() {
29375			sc := -1
29376			if iter.Response().Response.Response != nil {
29377				sc = iter.Response().Response.Response.StatusCode
29378			}
29379			tracing.EndSpan(ctx, sc, err)
29380		}()
29381	}
29382	iter.i++
29383	if iter.i < len(iter.page.Values()) {
29384		return nil
29385	}
29386	err = iter.page.NextWithContext(ctx)
29387	if err != nil {
29388		iter.i--
29389		return err
29390	}
29391	iter.i = 0
29392	return nil
29393}
29394
29395// Next advances to the next value.  If there was an error making
29396// the request the iterator does not advance and the error is returned.
29397// Deprecated: Use NextWithContext() instead.
29398func (iter *SyncDatabaseIDListResultIterator) Next() error {
29399	return iter.NextWithContext(context.Background())
29400}
29401
29402// NotDone returns true if the enumeration should be started or is not yet complete.
29403func (iter SyncDatabaseIDListResultIterator) NotDone() bool {
29404	return iter.page.NotDone() && iter.i < len(iter.page.Values())
29405}
29406
29407// Response returns the raw server response from the last page request.
29408func (iter SyncDatabaseIDListResultIterator) Response() SyncDatabaseIDListResult {
29409	return iter.page.Response()
29410}
29411
29412// Value returns the current value or a zero-initialized value if the
29413// iterator has advanced beyond the end of the collection.
29414func (iter SyncDatabaseIDListResultIterator) Value() SyncDatabaseIDProperties {
29415	if !iter.page.NotDone() {
29416		return SyncDatabaseIDProperties{}
29417	}
29418	return iter.page.Values()[iter.i]
29419}
29420
29421// Creates a new instance of the SyncDatabaseIDListResultIterator type.
29422func NewSyncDatabaseIDListResultIterator(page SyncDatabaseIDListResultPage) SyncDatabaseIDListResultIterator {
29423	return SyncDatabaseIDListResultIterator{page: page}
29424}
29425
29426// IsEmpty returns true if the ListResult contains no values.
29427func (sdilr SyncDatabaseIDListResult) IsEmpty() bool {
29428	return sdilr.Value == nil || len(*sdilr.Value) == 0
29429}
29430
29431// hasNextLink returns true if the NextLink is not empty.
29432func (sdilr SyncDatabaseIDListResult) hasNextLink() bool {
29433	return sdilr.NextLink != nil && len(*sdilr.NextLink) != 0
29434}
29435
29436// syncDatabaseIDListResultPreparer prepares a request to retrieve the next set of results.
29437// It returns nil if no more results exist.
29438func (sdilr SyncDatabaseIDListResult) syncDatabaseIDListResultPreparer(ctx context.Context) (*http.Request, error) {
29439	if !sdilr.hasNextLink() {
29440		return nil, nil
29441	}
29442	return autorest.Prepare((&http.Request{}).WithContext(ctx),
29443		autorest.AsJSON(),
29444		autorest.AsGet(),
29445		autorest.WithBaseURL(to.String(sdilr.NextLink)))
29446}
29447
29448// SyncDatabaseIDListResultPage contains a page of SyncDatabaseIDProperties values.
29449type SyncDatabaseIDListResultPage struct {
29450	fn    func(context.Context, SyncDatabaseIDListResult) (SyncDatabaseIDListResult, error)
29451	sdilr SyncDatabaseIDListResult
29452}
29453
29454// NextWithContext advances to the next page of values.  If there was an error making
29455// the request the page does not advance and the error is returned.
29456func (page *SyncDatabaseIDListResultPage) NextWithContext(ctx context.Context) (err error) {
29457	if tracing.IsEnabled() {
29458		ctx = tracing.StartSpan(ctx, fqdn+"/SyncDatabaseIDListResultPage.NextWithContext")
29459		defer func() {
29460			sc := -1
29461			if page.Response().Response.Response != nil {
29462				sc = page.Response().Response.Response.StatusCode
29463			}
29464			tracing.EndSpan(ctx, sc, err)
29465		}()
29466	}
29467	for {
29468		next, err := page.fn(ctx, page.sdilr)
29469		if err != nil {
29470			return err
29471		}
29472		page.sdilr = next
29473		if !next.hasNextLink() || !next.IsEmpty() {
29474			break
29475		}
29476	}
29477	return nil
29478}
29479
29480// Next advances to the next page of values.  If there was an error making
29481// the request the page does not advance and the error is returned.
29482// Deprecated: Use NextWithContext() instead.
29483func (page *SyncDatabaseIDListResultPage) Next() error {
29484	return page.NextWithContext(context.Background())
29485}
29486
29487// NotDone returns true if the page enumeration should be started or is not yet complete.
29488func (page SyncDatabaseIDListResultPage) NotDone() bool {
29489	return !page.sdilr.IsEmpty()
29490}
29491
29492// Response returns the raw server response from the last page request.
29493func (page SyncDatabaseIDListResultPage) Response() SyncDatabaseIDListResult {
29494	return page.sdilr
29495}
29496
29497// Values returns the slice of values for the current page or nil if there are no values.
29498func (page SyncDatabaseIDListResultPage) Values() []SyncDatabaseIDProperties {
29499	if page.sdilr.IsEmpty() {
29500		return nil
29501	}
29502	return *page.sdilr.Value
29503}
29504
29505// Creates a new instance of the SyncDatabaseIDListResultPage type.
29506func NewSyncDatabaseIDListResultPage(cur SyncDatabaseIDListResult, getNextPage func(context.Context, SyncDatabaseIDListResult) (SyncDatabaseIDListResult, error)) SyncDatabaseIDListResultPage {
29507	return SyncDatabaseIDListResultPage{
29508		fn:    getNextPage,
29509		sdilr: cur,
29510	}
29511}
29512
29513// SyncDatabaseIDProperties properties of the sync database id.
29514type SyncDatabaseIDProperties struct {
29515	// ID - READ-ONLY; ARM resource id of sync database.
29516	ID *string `json:"id,omitempty"`
29517}
29518
29519// MarshalJSON is the custom marshaler for SyncDatabaseIDProperties.
29520func (sdip SyncDatabaseIDProperties) MarshalJSON() ([]byte, error) {
29521	objectMap := make(map[string]interface{})
29522	return json.Marshal(objectMap)
29523}
29524
29525// SyncFullSchemaProperties properties of the database full schema.
29526type SyncFullSchemaProperties struct {
29527	// Tables - READ-ONLY; List of tables in the database full schema.
29528	Tables *[]SyncFullSchemaTable `json:"tables,omitempty"`
29529	// LastUpdateTime - READ-ONLY; Last update time of the database schema.
29530	LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"`
29531}
29532
29533// MarshalJSON is the custom marshaler for SyncFullSchemaProperties.
29534func (sfsp SyncFullSchemaProperties) MarshalJSON() ([]byte, error) {
29535	objectMap := make(map[string]interface{})
29536	return json.Marshal(objectMap)
29537}
29538
29539// SyncFullSchemaPropertiesListResult a list of sync schema properties.
29540type SyncFullSchemaPropertiesListResult struct {
29541	autorest.Response `json:"-"`
29542	// Value - READ-ONLY; Array of results.
29543	Value *[]SyncFullSchemaProperties `json:"value,omitempty"`
29544	// NextLink - READ-ONLY; Link to retrieve next page of results.
29545	NextLink *string `json:"nextLink,omitempty"`
29546}
29547
29548// MarshalJSON is the custom marshaler for SyncFullSchemaPropertiesListResult.
29549func (sfsplr SyncFullSchemaPropertiesListResult) MarshalJSON() ([]byte, error) {
29550	objectMap := make(map[string]interface{})
29551	return json.Marshal(objectMap)
29552}
29553
29554// SyncFullSchemaPropertiesListResultIterator provides access to a complete listing of
29555// SyncFullSchemaProperties values.
29556type SyncFullSchemaPropertiesListResultIterator struct {
29557	i    int
29558	page SyncFullSchemaPropertiesListResultPage
29559}
29560
29561// NextWithContext advances to the next value.  If there was an error making
29562// the request the iterator does not advance and the error is returned.
29563func (iter *SyncFullSchemaPropertiesListResultIterator) NextWithContext(ctx context.Context) (err error) {
29564	if tracing.IsEnabled() {
29565		ctx = tracing.StartSpan(ctx, fqdn+"/SyncFullSchemaPropertiesListResultIterator.NextWithContext")
29566		defer func() {
29567			sc := -1
29568			if iter.Response().Response.Response != nil {
29569				sc = iter.Response().Response.Response.StatusCode
29570			}
29571			tracing.EndSpan(ctx, sc, err)
29572		}()
29573	}
29574	iter.i++
29575	if iter.i < len(iter.page.Values()) {
29576		return nil
29577	}
29578	err = iter.page.NextWithContext(ctx)
29579	if err != nil {
29580		iter.i--
29581		return err
29582	}
29583	iter.i = 0
29584	return nil
29585}
29586
29587// Next advances to the next value.  If there was an error making
29588// the request the iterator does not advance and the error is returned.
29589// Deprecated: Use NextWithContext() instead.
29590func (iter *SyncFullSchemaPropertiesListResultIterator) Next() error {
29591	return iter.NextWithContext(context.Background())
29592}
29593
29594// NotDone returns true if the enumeration should be started or is not yet complete.
29595func (iter SyncFullSchemaPropertiesListResultIterator) NotDone() bool {
29596	return iter.page.NotDone() && iter.i < len(iter.page.Values())
29597}
29598
29599// Response returns the raw server response from the last page request.
29600func (iter SyncFullSchemaPropertiesListResultIterator) Response() SyncFullSchemaPropertiesListResult {
29601	return iter.page.Response()
29602}
29603
29604// Value returns the current value or a zero-initialized value if the
29605// iterator has advanced beyond the end of the collection.
29606func (iter SyncFullSchemaPropertiesListResultIterator) Value() SyncFullSchemaProperties {
29607	if !iter.page.NotDone() {
29608		return SyncFullSchemaProperties{}
29609	}
29610	return iter.page.Values()[iter.i]
29611}
29612
29613// Creates a new instance of the SyncFullSchemaPropertiesListResultIterator type.
29614func NewSyncFullSchemaPropertiesListResultIterator(page SyncFullSchemaPropertiesListResultPage) SyncFullSchemaPropertiesListResultIterator {
29615	return SyncFullSchemaPropertiesListResultIterator{page: page}
29616}
29617
29618// IsEmpty returns true if the ListResult contains no values.
29619func (sfsplr SyncFullSchemaPropertiesListResult) IsEmpty() bool {
29620	return sfsplr.Value == nil || len(*sfsplr.Value) == 0
29621}
29622
29623// hasNextLink returns true if the NextLink is not empty.
29624func (sfsplr SyncFullSchemaPropertiesListResult) hasNextLink() bool {
29625	return sfsplr.NextLink != nil && len(*sfsplr.NextLink) != 0
29626}
29627
29628// syncFullSchemaPropertiesListResultPreparer prepares a request to retrieve the next set of results.
29629// It returns nil if no more results exist.
29630func (sfsplr SyncFullSchemaPropertiesListResult) syncFullSchemaPropertiesListResultPreparer(ctx context.Context) (*http.Request, error) {
29631	if !sfsplr.hasNextLink() {
29632		return nil, nil
29633	}
29634	return autorest.Prepare((&http.Request{}).WithContext(ctx),
29635		autorest.AsJSON(),
29636		autorest.AsGet(),
29637		autorest.WithBaseURL(to.String(sfsplr.NextLink)))
29638}
29639
29640// SyncFullSchemaPropertiesListResultPage contains a page of SyncFullSchemaProperties values.
29641type SyncFullSchemaPropertiesListResultPage struct {
29642	fn     func(context.Context, SyncFullSchemaPropertiesListResult) (SyncFullSchemaPropertiesListResult, error)
29643	sfsplr SyncFullSchemaPropertiesListResult
29644}
29645
29646// NextWithContext advances to the next page of values.  If there was an error making
29647// the request the page does not advance and the error is returned.
29648func (page *SyncFullSchemaPropertiesListResultPage) NextWithContext(ctx context.Context) (err error) {
29649	if tracing.IsEnabled() {
29650		ctx = tracing.StartSpan(ctx, fqdn+"/SyncFullSchemaPropertiesListResultPage.NextWithContext")
29651		defer func() {
29652			sc := -1
29653			if page.Response().Response.Response != nil {
29654				sc = page.Response().Response.Response.StatusCode
29655			}
29656			tracing.EndSpan(ctx, sc, err)
29657		}()
29658	}
29659	for {
29660		next, err := page.fn(ctx, page.sfsplr)
29661		if err != nil {
29662			return err
29663		}
29664		page.sfsplr = next
29665		if !next.hasNextLink() || !next.IsEmpty() {
29666			break
29667		}
29668	}
29669	return nil
29670}
29671
29672// Next advances to the next page of values.  If there was an error making
29673// the request the page does not advance and the error is returned.
29674// Deprecated: Use NextWithContext() instead.
29675func (page *SyncFullSchemaPropertiesListResultPage) Next() error {
29676	return page.NextWithContext(context.Background())
29677}
29678
29679// NotDone returns true if the page enumeration should be started or is not yet complete.
29680func (page SyncFullSchemaPropertiesListResultPage) NotDone() bool {
29681	return !page.sfsplr.IsEmpty()
29682}
29683
29684// Response returns the raw server response from the last page request.
29685func (page SyncFullSchemaPropertiesListResultPage) Response() SyncFullSchemaPropertiesListResult {
29686	return page.sfsplr
29687}
29688
29689// Values returns the slice of values for the current page or nil if there are no values.
29690func (page SyncFullSchemaPropertiesListResultPage) Values() []SyncFullSchemaProperties {
29691	if page.sfsplr.IsEmpty() {
29692		return nil
29693	}
29694	return *page.sfsplr.Value
29695}
29696
29697// Creates a new instance of the SyncFullSchemaPropertiesListResultPage type.
29698func NewSyncFullSchemaPropertiesListResultPage(cur SyncFullSchemaPropertiesListResult, getNextPage func(context.Context, SyncFullSchemaPropertiesListResult) (SyncFullSchemaPropertiesListResult, error)) SyncFullSchemaPropertiesListResultPage {
29699	return SyncFullSchemaPropertiesListResultPage{
29700		fn:     getNextPage,
29701		sfsplr: cur,
29702	}
29703}
29704
29705// SyncFullSchemaTable properties of the table in the database full schema.
29706type SyncFullSchemaTable struct {
29707	// Columns - READ-ONLY; List of columns in the table of database full schema.
29708	Columns *[]SyncFullSchemaTableColumn `json:"columns,omitempty"`
29709	// ErrorID - READ-ONLY; Error id of the table.
29710	ErrorID *string `json:"errorId,omitempty"`
29711	// HasError - READ-ONLY; If there is error in the table.
29712	HasError *bool `json:"hasError,omitempty"`
29713	// Name - READ-ONLY; Name of the table.
29714	Name *string `json:"name,omitempty"`
29715	// QuotedName - READ-ONLY; Quoted name of the table.
29716	QuotedName *string `json:"quotedName,omitempty"`
29717}
29718
29719// MarshalJSON is the custom marshaler for SyncFullSchemaTable.
29720func (sfst SyncFullSchemaTable) MarshalJSON() ([]byte, error) {
29721	objectMap := make(map[string]interface{})
29722	return json.Marshal(objectMap)
29723}
29724
29725// SyncFullSchemaTableColumn properties of the column in the table of database full schema.
29726type SyncFullSchemaTableColumn struct {
29727	// DataSize - READ-ONLY; Data size of the column.
29728	DataSize *string `json:"dataSize,omitempty"`
29729	// DataType - READ-ONLY; Data type of the column.
29730	DataType *string `json:"dataType,omitempty"`
29731	// ErrorID - READ-ONLY; Error id of the column.
29732	ErrorID *string `json:"errorId,omitempty"`
29733	// HasError - READ-ONLY; If there is error in the table.
29734	HasError *bool `json:"hasError,omitempty"`
29735	// IsPrimaryKey - READ-ONLY; If it is the primary key of the table.
29736	IsPrimaryKey *bool `json:"isPrimaryKey,omitempty"`
29737	// Name - READ-ONLY; Name of the column.
29738	Name *string `json:"name,omitempty"`
29739	// QuotedName - READ-ONLY; Quoted name of the column.
29740	QuotedName *string `json:"quotedName,omitempty"`
29741}
29742
29743// MarshalJSON is the custom marshaler for SyncFullSchemaTableColumn.
29744func (sfstc SyncFullSchemaTableColumn) MarshalJSON() ([]byte, error) {
29745	objectMap := make(map[string]interface{})
29746	return json.Marshal(objectMap)
29747}
29748
29749// SyncGroup an Azure SQL Database sync group.
29750type SyncGroup struct {
29751	autorest.Response `json:"-"`
29752	// Sku - The name and capacity of the SKU.
29753	Sku *Sku `json:"sku,omitempty"`
29754	// SyncGroupProperties - Resource properties.
29755	*SyncGroupProperties `json:"properties,omitempty"`
29756	// ID - READ-ONLY; Resource ID.
29757	ID *string `json:"id,omitempty"`
29758	// Name - READ-ONLY; Resource name.
29759	Name *string `json:"name,omitempty"`
29760	// Type - READ-ONLY; Resource type.
29761	Type *string `json:"type,omitempty"`
29762}
29763
29764// MarshalJSON is the custom marshaler for SyncGroup.
29765func (sg SyncGroup) MarshalJSON() ([]byte, error) {
29766	objectMap := make(map[string]interface{})
29767	if sg.Sku != nil {
29768		objectMap["sku"] = sg.Sku
29769	}
29770	if sg.SyncGroupProperties != nil {
29771		objectMap["properties"] = sg.SyncGroupProperties
29772	}
29773	return json.Marshal(objectMap)
29774}
29775
29776// UnmarshalJSON is the custom unmarshaler for SyncGroup struct.
29777func (sg *SyncGroup) UnmarshalJSON(body []byte) error {
29778	var m map[string]*json.RawMessage
29779	err := json.Unmarshal(body, &m)
29780	if err != nil {
29781		return err
29782	}
29783	for k, v := range m {
29784		switch k {
29785		case "sku":
29786			if v != nil {
29787				var sku Sku
29788				err = json.Unmarshal(*v, &sku)
29789				if err != nil {
29790					return err
29791				}
29792				sg.Sku = &sku
29793			}
29794		case "properties":
29795			if v != nil {
29796				var syncGroupProperties SyncGroupProperties
29797				err = json.Unmarshal(*v, &syncGroupProperties)
29798				if err != nil {
29799					return err
29800				}
29801				sg.SyncGroupProperties = &syncGroupProperties
29802			}
29803		case "id":
29804			if v != nil {
29805				var ID string
29806				err = json.Unmarshal(*v, &ID)
29807				if err != nil {
29808					return err
29809				}
29810				sg.ID = &ID
29811			}
29812		case "name":
29813			if v != nil {
29814				var name string
29815				err = json.Unmarshal(*v, &name)
29816				if err != nil {
29817					return err
29818				}
29819				sg.Name = &name
29820			}
29821		case "type":
29822			if v != nil {
29823				var typeVar string
29824				err = json.Unmarshal(*v, &typeVar)
29825				if err != nil {
29826					return err
29827				}
29828				sg.Type = &typeVar
29829			}
29830		}
29831	}
29832
29833	return nil
29834}
29835
29836// SyncGroupListResult a list of sync groups.
29837type SyncGroupListResult struct {
29838	autorest.Response `json:"-"`
29839	// Value - READ-ONLY; Array of results.
29840	Value *[]SyncGroup `json:"value,omitempty"`
29841	// NextLink - READ-ONLY; Link to retrieve next page of results.
29842	NextLink *string `json:"nextLink,omitempty"`
29843}
29844
29845// MarshalJSON is the custom marshaler for SyncGroupListResult.
29846func (sglr SyncGroupListResult) MarshalJSON() ([]byte, error) {
29847	objectMap := make(map[string]interface{})
29848	return json.Marshal(objectMap)
29849}
29850
29851// SyncGroupListResultIterator provides access to a complete listing of SyncGroup values.
29852type SyncGroupListResultIterator struct {
29853	i    int
29854	page SyncGroupListResultPage
29855}
29856
29857// NextWithContext advances to the next value.  If there was an error making
29858// the request the iterator does not advance and the error is returned.
29859func (iter *SyncGroupListResultIterator) NextWithContext(ctx context.Context) (err error) {
29860	if tracing.IsEnabled() {
29861		ctx = tracing.StartSpan(ctx, fqdn+"/SyncGroupListResultIterator.NextWithContext")
29862		defer func() {
29863			sc := -1
29864			if iter.Response().Response.Response != nil {
29865				sc = iter.Response().Response.Response.StatusCode
29866			}
29867			tracing.EndSpan(ctx, sc, err)
29868		}()
29869	}
29870	iter.i++
29871	if iter.i < len(iter.page.Values()) {
29872		return nil
29873	}
29874	err = iter.page.NextWithContext(ctx)
29875	if err != nil {
29876		iter.i--
29877		return err
29878	}
29879	iter.i = 0
29880	return nil
29881}
29882
29883// Next advances to the next value.  If there was an error making
29884// the request the iterator does not advance and the error is returned.
29885// Deprecated: Use NextWithContext() instead.
29886func (iter *SyncGroupListResultIterator) Next() error {
29887	return iter.NextWithContext(context.Background())
29888}
29889
29890// NotDone returns true if the enumeration should be started or is not yet complete.
29891func (iter SyncGroupListResultIterator) NotDone() bool {
29892	return iter.page.NotDone() && iter.i < len(iter.page.Values())
29893}
29894
29895// Response returns the raw server response from the last page request.
29896func (iter SyncGroupListResultIterator) Response() SyncGroupListResult {
29897	return iter.page.Response()
29898}
29899
29900// Value returns the current value or a zero-initialized value if the
29901// iterator has advanced beyond the end of the collection.
29902func (iter SyncGroupListResultIterator) Value() SyncGroup {
29903	if !iter.page.NotDone() {
29904		return SyncGroup{}
29905	}
29906	return iter.page.Values()[iter.i]
29907}
29908
29909// Creates a new instance of the SyncGroupListResultIterator type.
29910func NewSyncGroupListResultIterator(page SyncGroupListResultPage) SyncGroupListResultIterator {
29911	return SyncGroupListResultIterator{page: page}
29912}
29913
29914// IsEmpty returns true if the ListResult contains no values.
29915func (sglr SyncGroupListResult) IsEmpty() bool {
29916	return sglr.Value == nil || len(*sglr.Value) == 0
29917}
29918
29919// hasNextLink returns true if the NextLink is not empty.
29920func (sglr SyncGroupListResult) hasNextLink() bool {
29921	return sglr.NextLink != nil && len(*sglr.NextLink) != 0
29922}
29923
29924// syncGroupListResultPreparer prepares a request to retrieve the next set of results.
29925// It returns nil if no more results exist.
29926func (sglr SyncGroupListResult) syncGroupListResultPreparer(ctx context.Context) (*http.Request, error) {
29927	if !sglr.hasNextLink() {
29928		return nil, nil
29929	}
29930	return autorest.Prepare((&http.Request{}).WithContext(ctx),
29931		autorest.AsJSON(),
29932		autorest.AsGet(),
29933		autorest.WithBaseURL(to.String(sglr.NextLink)))
29934}
29935
29936// SyncGroupListResultPage contains a page of SyncGroup values.
29937type SyncGroupListResultPage struct {
29938	fn   func(context.Context, SyncGroupListResult) (SyncGroupListResult, error)
29939	sglr SyncGroupListResult
29940}
29941
29942// NextWithContext advances to the next page of values.  If there was an error making
29943// the request the page does not advance and the error is returned.
29944func (page *SyncGroupListResultPage) NextWithContext(ctx context.Context) (err error) {
29945	if tracing.IsEnabled() {
29946		ctx = tracing.StartSpan(ctx, fqdn+"/SyncGroupListResultPage.NextWithContext")
29947		defer func() {
29948			sc := -1
29949			if page.Response().Response.Response != nil {
29950				sc = page.Response().Response.Response.StatusCode
29951			}
29952			tracing.EndSpan(ctx, sc, err)
29953		}()
29954	}
29955	for {
29956		next, err := page.fn(ctx, page.sglr)
29957		if err != nil {
29958			return err
29959		}
29960		page.sglr = next
29961		if !next.hasNextLink() || !next.IsEmpty() {
29962			break
29963		}
29964	}
29965	return nil
29966}
29967
29968// Next advances to the next page of values.  If there was an error making
29969// the request the page does not advance and the error is returned.
29970// Deprecated: Use NextWithContext() instead.
29971func (page *SyncGroupListResultPage) Next() error {
29972	return page.NextWithContext(context.Background())
29973}
29974
29975// NotDone returns true if the page enumeration should be started or is not yet complete.
29976func (page SyncGroupListResultPage) NotDone() bool {
29977	return !page.sglr.IsEmpty()
29978}
29979
29980// Response returns the raw server response from the last page request.
29981func (page SyncGroupListResultPage) Response() SyncGroupListResult {
29982	return page.sglr
29983}
29984
29985// Values returns the slice of values for the current page or nil if there are no values.
29986func (page SyncGroupListResultPage) Values() []SyncGroup {
29987	if page.sglr.IsEmpty() {
29988		return nil
29989	}
29990	return *page.sglr.Value
29991}
29992
29993// Creates a new instance of the SyncGroupListResultPage type.
29994func NewSyncGroupListResultPage(cur SyncGroupListResult, getNextPage func(context.Context, SyncGroupListResult) (SyncGroupListResult, error)) SyncGroupListResultPage {
29995	return SyncGroupListResultPage{
29996		fn:   getNextPage,
29997		sglr: cur,
29998	}
29999}
30000
30001// SyncGroupLogListResult a list of sync group log properties.
30002type SyncGroupLogListResult struct {
30003	autorest.Response `json:"-"`
30004	// Value - READ-ONLY; Array of results.
30005	Value *[]SyncGroupLogProperties `json:"value,omitempty"`
30006	// NextLink - READ-ONLY; Link to retrieve next page of results.
30007	NextLink *string `json:"nextLink,omitempty"`
30008}
30009
30010// MarshalJSON is the custom marshaler for SyncGroupLogListResult.
30011func (sgllr SyncGroupLogListResult) MarshalJSON() ([]byte, error) {
30012	objectMap := make(map[string]interface{})
30013	return json.Marshal(objectMap)
30014}
30015
30016// SyncGroupLogListResultIterator provides access to a complete listing of SyncGroupLogProperties values.
30017type SyncGroupLogListResultIterator struct {
30018	i    int
30019	page SyncGroupLogListResultPage
30020}
30021
30022// NextWithContext advances to the next value.  If there was an error making
30023// the request the iterator does not advance and the error is returned.
30024func (iter *SyncGroupLogListResultIterator) NextWithContext(ctx context.Context) (err error) {
30025	if tracing.IsEnabled() {
30026		ctx = tracing.StartSpan(ctx, fqdn+"/SyncGroupLogListResultIterator.NextWithContext")
30027		defer func() {
30028			sc := -1
30029			if iter.Response().Response.Response != nil {
30030				sc = iter.Response().Response.Response.StatusCode
30031			}
30032			tracing.EndSpan(ctx, sc, err)
30033		}()
30034	}
30035	iter.i++
30036	if iter.i < len(iter.page.Values()) {
30037		return nil
30038	}
30039	err = iter.page.NextWithContext(ctx)
30040	if err != nil {
30041		iter.i--
30042		return err
30043	}
30044	iter.i = 0
30045	return nil
30046}
30047
30048// Next advances to the next value.  If there was an error making
30049// the request the iterator does not advance and the error is returned.
30050// Deprecated: Use NextWithContext() instead.
30051func (iter *SyncGroupLogListResultIterator) Next() error {
30052	return iter.NextWithContext(context.Background())
30053}
30054
30055// NotDone returns true if the enumeration should be started or is not yet complete.
30056func (iter SyncGroupLogListResultIterator) NotDone() bool {
30057	return iter.page.NotDone() && iter.i < len(iter.page.Values())
30058}
30059
30060// Response returns the raw server response from the last page request.
30061func (iter SyncGroupLogListResultIterator) Response() SyncGroupLogListResult {
30062	return iter.page.Response()
30063}
30064
30065// Value returns the current value or a zero-initialized value if the
30066// iterator has advanced beyond the end of the collection.
30067func (iter SyncGroupLogListResultIterator) Value() SyncGroupLogProperties {
30068	if !iter.page.NotDone() {
30069		return SyncGroupLogProperties{}
30070	}
30071	return iter.page.Values()[iter.i]
30072}
30073
30074// Creates a new instance of the SyncGroupLogListResultIterator type.
30075func NewSyncGroupLogListResultIterator(page SyncGroupLogListResultPage) SyncGroupLogListResultIterator {
30076	return SyncGroupLogListResultIterator{page: page}
30077}
30078
30079// IsEmpty returns true if the ListResult contains no values.
30080func (sgllr SyncGroupLogListResult) IsEmpty() bool {
30081	return sgllr.Value == nil || len(*sgllr.Value) == 0
30082}
30083
30084// hasNextLink returns true if the NextLink is not empty.
30085func (sgllr SyncGroupLogListResult) hasNextLink() bool {
30086	return sgllr.NextLink != nil && len(*sgllr.NextLink) != 0
30087}
30088
30089// syncGroupLogListResultPreparer prepares a request to retrieve the next set of results.
30090// It returns nil if no more results exist.
30091func (sgllr SyncGroupLogListResult) syncGroupLogListResultPreparer(ctx context.Context) (*http.Request, error) {
30092	if !sgllr.hasNextLink() {
30093		return nil, nil
30094	}
30095	return autorest.Prepare((&http.Request{}).WithContext(ctx),
30096		autorest.AsJSON(),
30097		autorest.AsGet(),
30098		autorest.WithBaseURL(to.String(sgllr.NextLink)))
30099}
30100
30101// SyncGroupLogListResultPage contains a page of SyncGroupLogProperties values.
30102type SyncGroupLogListResultPage struct {
30103	fn    func(context.Context, SyncGroupLogListResult) (SyncGroupLogListResult, error)
30104	sgllr SyncGroupLogListResult
30105}
30106
30107// NextWithContext advances to the next page of values.  If there was an error making
30108// the request the page does not advance and the error is returned.
30109func (page *SyncGroupLogListResultPage) NextWithContext(ctx context.Context) (err error) {
30110	if tracing.IsEnabled() {
30111		ctx = tracing.StartSpan(ctx, fqdn+"/SyncGroupLogListResultPage.NextWithContext")
30112		defer func() {
30113			sc := -1
30114			if page.Response().Response.Response != nil {
30115				sc = page.Response().Response.Response.StatusCode
30116			}
30117			tracing.EndSpan(ctx, sc, err)
30118		}()
30119	}
30120	for {
30121		next, err := page.fn(ctx, page.sgllr)
30122		if err != nil {
30123			return err
30124		}
30125		page.sgllr = next
30126		if !next.hasNextLink() || !next.IsEmpty() {
30127			break
30128		}
30129	}
30130	return nil
30131}
30132
30133// Next advances to the next page of values.  If there was an error making
30134// the request the page does not advance and the error is returned.
30135// Deprecated: Use NextWithContext() instead.
30136func (page *SyncGroupLogListResultPage) Next() error {
30137	return page.NextWithContext(context.Background())
30138}
30139
30140// NotDone returns true if the page enumeration should be started or is not yet complete.
30141func (page SyncGroupLogListResultPage) NotDone() bool {
30142	return !page.sgllr.IsEmpty()
30143}
30144
30145// Response returns the raw server response from the last page request.
30146func (page SyncGroupLogListResultPage) Response() SyncGroupLogListResult {
30147	return page.sgllr
30148}
30149
30150// Values returns the slice of values for the current page or nil if there are no values.
30151func (page SyncGroupLogListResultPage) Values() []SyncGroupLogProperties {
30152	if page.sgllr.IsEmpty() {
30153		return nil
30154	}
30155	return *page.sgllr.Value
30156}
30157
30158// Creates a new instance of the SyncGroupLogListResultPage type.
30159func NewSyncGroupLogListResultPage(cur SyncGroupLogListResult, getNextPage func(context.Context, SyncGroupLogListResult) (SyncGroupLogListResult, error)) SyncGroupLogListResultPage {
30160	return SyncGroupLogListResultPage{
30161		fn:    getNextPage,
30162		sgllr: cur,
30163	}
30164}
30165
30166// SyncGroupLogProperties properties of an Azure SQL Database sync group log.
30167type SyncGroupLogProperties struct {
30168	// Timestamp - READ-ONLY; Timestamp of the sync group log.
30169	Timestamp *date.Time `json:"timestamp,omitempty"`
30170	// Type - READ-ONLY; Type of the sync group log. Possible values include: 'SyncGroupLogTypeAll', 'SyncGroupLogTypeError', 'SyncGroupLogTypeWarning', 'SyncGroupLogTypeSuccess'
30171	Type SyncGroupLogType `json:"type,omitempty"`
30172	// Source - READ-ONLY; Source of the sync group log.
30173	Source *string `json:"source,omitempty"`
30174	// Details - READ-ONLY; Details of the sync group log.
30175	Details *string `json:"details,omitempty"`
30176	// TracingID - READ-ONLY; TracingId of the sync group log.
30177	TracingID *uuid.UUID `json:"tracingId,omitempty"`
30178	// OperationStatus - READ-ONLY; OperationStatus of the sync group log.
30179	OperationStatus *string `json:"operationStatus,omitempty"`
30180}
30181
30182// MarshalJSON is the custom marshaler for SyncGroupLogProperties.
30183func (sglp SyncGroupLogProperties) MarshalJSON() ([]byte, error) {
30184	objectMap := make(map[string]interface{})
30185	return json.Marshal(objectMap)
30186}
30187
30188// SyncGroupProperties properties of a sync group.
30189type SyncGroupProperties struct {
30190	// Interval - Sync interval of the sync group.
30191	Interval *int32 `json:"interval,omitempty"`
30192	// LastSyncTime - READ-ONLY; Last sync time of the sync group.
30193	LastSyncTime *date.Time `json:"lastSyncTime,omitempty"`
30194	// ConflictResolutionPolicy - Conflict resolution policy of the sync group. Possible values include: 'SyncConflictResolutionPolicyHubWin', 'SyncConflictResolutionPolicyMemberWin'
30195	ConflictResolutionPolicy SyncConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"`
30196	// SyncDatabaseID - ARM resource id of the sync database in the sync group.
30197	SyncDatabaseID *string `json:"syncDatabaseId,omitempty"`
30198	// HubDatabaseUserName - User name for the sync group hub database credential.
30199	HubDatabaseUserName *string `json:"hubDatabaseUserName,omitempty"`
30200	// HubDatabasePassword - Password for the sync group hub database credential.
30201	HubDatabasePassword *string `json:"hubDatabasePassword,omitempty"`
30202	// SyncState - READ-ONLY; Sync state of the sync group. Possible values include: 'SyncGroupStateNotReady', 'SyncGroupStateError', 'SyncGroupStateWarning', 'SyncGroupStateProgressing', 'SyncGroupStateGood'
30203	SyncState SyncGroupState `json:"syncState,omitempty"`
30204	// Schema - Sync schema of the sync group.
30205	Schema *SyncGroupSchema `json:"schema,omitempty"`
30206	// EnableConflictLogging - If conflict logging is enabled.
30207	EnableConflictLogging *bool `json:"enableConflictLogging,omitempty"`
30208	// ConflictLoggingRetentionInDays - Conflict logging retention period.
30209	ConflictLoggingRetentionInDays *int32 `json:"conflictLoggingRetentionInDays,omitempty"`
30210	// UsePrivateLinkConnection - If use private link connection is enabled.
30211	UsePrivateLinkConnection *bool `json:"usePrivateLinkConnection,omitempty"`
30212	// PrivateEndpointName - READ-ONLY; Private endpoint name of the sync group if use private link connection is enabled.
30213	PrivateEndpointName *string `json:"privateEndpointName,omitempty"`
30214}
30215
30216// MarshalJSON is the custom marshaler for SyncGroupProperties.
30217func (sgp SyncGroupProperties) MarshalJSON() ([]byte, error) {
30218	objectMap := make(map[string]interface{})
30219	if sgp.Interval != nil {
30220		objectMap["interval"] = sgp.Interval
30221	}
30222	if sgp.ConflictResolutionPolicy != "" {
30223		objectMap["conflictResolutionPolicy"] = sgp.ConflictResolutionPolicy
30224	}
30225	if sgp.SyncDatabaseID != nil {
30226		objectMap["syncDatabaseId"] = sgp.SyncDatabaseID
30227	}
30228	if sgp.HubDatabaseUserName != nil {
30229		objectMap["hubDatabaseUserName"] = sgp.HubDatabaseUserName
30230	}
30231	if sgp.HubDatabasePassword != nil {
30232		objectMap["hubDatabasePassword"] = sgp.HubDatabasePassword
30233	}
30234	if sgp.Schema != nil {
30235		objectMap["schema"] = sgp.Schema
30236	}
30237	if sgp.EnableConflictLogging != nil {
30238		objectMap["enableConflictLogging"] = sgp.EnableConflictLogging
30239	}
30240	if sgp.ConflictLoggingRetentionInDays != nil {
30241		objectMap["conflictLoggingRetentionInDays"] = sgp.ConflictLoggingRetentionInDays
30242	}
30243	if sgp.UsePrivateLinkConnection != nil {
30244		objectMap["usePrivateLinkConnection"] = sgp.UsePrivateLinkConnection
30245	}
30246	return json.Marshal(objectMap)
30247}
30248
30249// SyncGroupSchema properties of sync group schema.
30250type SyncGroupSchema struct {
30251	// Tables - List of tables in sync group schema.
30252	Tables *[]SyncGroupSchemaTable `json:"tables,omitempty"`
30253	// MasterSyncMemberName - Name of master sync member where the schema is from.
30254	MasterSyncMemberName *string `json:"masterSyncMemberName,omitempty"`
30255}
30256
30257// SyncGroupSchemaTable properties of table in sync group schema.
30258type SyncGroupSchemaTable struct {
30259	// Columns - List of columns in sync group schema.
30260	Columns *[]SyncGroupSchemaTableColumn `json:"columns,omitempty"`
30261	// QuotedName - Quoted name of sync group schema table.
30262	QuotedName *string `json:"quotedName,omitempty"`
30263}
30264
30265// SyncGroupSchemaTableColumn properties of column in sync group table.
30266type SyncGroupSchemaTableColumn struct {
30267	// QuotedName - Quoted name of sync group table column.
30268	QuotedName *string `json:"quotedName,omitempty"`
30269	// DataSize - Data size of the column.
30270	DataSize *string `json:"dataSize,omitempty"`
30271	// DataType - Data type of the column.
30272	DataType *string `json:"dataType,omitempty"`
30273}
30274
30275// SyncGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
30276// long-running operation.
30277type SyncGroupsCreateOrUpdateFuture struct {
30278	azure.FutureAPI
30279	// Result returns the result of the asynchronous operation.
30280	// If the operation has not completed it will return an error.
30281	Result func(SyncGroupsClient) (SyncGroup, error)
30282}
30283
30284// UnmarshalJSON is the custom unmarshaller for CreateFuture.
30285func (future *SyncGroupsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
30286	var azFuture azure.Future
30287	if err := json.Unmarshal(body, &azFuture); err != nil {
30288		return err
30289	}
30290	future.FutureAPI = &azFuture
30291	future.Result = future.result
30292	return nil
30293}
30294
30295// result is the default implementation for SyncGroupsCreateOrUpdateFuture.Result.
30296func (future *SyncGroupsCreateOrUpdateFuture) result(client SyncGroupsClient) (sg SyncGroup, err error) {
30297	var done bool
30298	done, err = future.DoneWithContext(context.Background(), client)
30299	if err != nil {
30300		err = autorest.NewErrorWithError(err, "sql.SyncGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
30301		return
30302	}
30303	if !done {
30304		sg.Response.Response = future.Response()
30305		err = azure.NewAsyncOpIncompleteError("sql.SyncGroupsCreateOrUpdateFuture")
30306		return
30307	}
30308	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
30309	if sg.Response.Response, err = future.GetResult(sender); err == nil && sg.Response.Response.StatusCode != http.StatusNoContent {
30310		sg, err = client.CreateOrUpdateResponder(sg.Response.Response)
30311		if err != nil {
30312			err = autorest.NewErrorWithError(err, "sql.SyncGroupsCreateOrUpdateFuture", "Result", sg.Response.Response, "Failure responding to request")
30313		}
30314	}
30315	return
30316}
30317
30318// SyncGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
30319// operation.
30320type SyncGroupsDeleteFuture struct {
30321	azure.FutureAPI
30322	// Result returns the result of the asynchronous operation.
30323	// If the operation has not completed it will return an error.
30324	Result func(SyncGroupsClient) (autorest.Response, error)
30325}
30326
30327// UnmarshalJSON is the custom unmarshaller for CreateFuture.
30328func (future *SyncGroupsDeleteFuture) UnmarshalJSON(body []byte) error {
30329	var azFuture azure.Future
30330	if err := json.Unmarshal(body, &azFuture); err != nil {
30331		return err
30332	}
30333	future.FutureAPI = &azFuture
30334	future.Result = future.result
30335	return nil
30336}
30337
30338// result is the default implementation for SyncGroupsDeleteFuture.Result.
30339func (future *SyncGroupsDeleteFuture) result(client SyncGroupsClient) (ar autorest.Response, err error) {
30340	var done bool
30341	done, err = future.DoneWithContext(context.Background(), client)
30342	if err != nil {
30343		err = autorest.NewErrorWithError(err, "sql.SyncGroupsDeleteFuture", "Result", future.Response(), "Polling failure")
30344		return
30345	}
30346	if !done {
30347		ar.Response = future.Response()
30348		err = azure.NewAsyncOpIncompleteError("sql.SyncGroupsDeleteFuture")
30349		return
30350	}
30351	ar.Response = future.Response()
30352	return
30353}
30354
30355// SyncGroupsRefreshHubSchemaFuture an abstraction for monitoring and retrieving the results of a
30356// long-running operation.
30357type SyncGroupsRefreshHubSchemaFuture struct {
30358	azure.FutureAPI
30359	// Result returns the result of the asynchronous operation.
30360	// If the operation has not completed it will return an error.
30361	Result func(SyncGroupsClient) (autorest.Response, error)
30362}
30363
30364// UnmarshalJSON is the custom unmarshaller for CreateFuture.
30365func (future *SyncGroupsRefreshHubSchemaFuture) UnmarshalJSON(body []byte) error {
30366	var azFuture azure.Future
30367	if err := json.Unmarshal(body, &azFuture); err != nil {
30368		return err
30369	}
30370	future.FutureAPI = &azFuture
30371	future.Result = future.result
30372	return nil
30373}
30374
30375// result is the default implementation for SyncGroupsRefreshHubSchemaFuture.Result.
30376func (future *SyncGroupsRefreshHubSchemaFuture) result(client SyncGroupsClient) (ar autorest.Response, err error) {
30377	var done bool
30378	done, err = future.DoneWithContext(context.Background(), client)
30379	if err != nil {
30380		err = autorest.NewErrorWithError(err, "sql.SyncGroupsRefreshHubSchemaFuture", "Result", future.Response(), "Polling failure")
30381		return
30382	}
30383	if !done {
30384		ar.Response = future.Response()
30385		err = azure.NewAsyncOpIncompleteError("sql.SyncGroupsRefreshHubSchemaFuture")
30386		return
30387	}
30388	ar.Response = future.Response()
30389	return
30390}
30391
30392// SyncGroupsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
30393// operation.
30394type SyncGroupsUpdateFuture struct {
30395	azure.FutureAPI
30396	// Result returns the result of the asynchronous operation.
30397	// If the operation has not completed it will return an error.
30398	Result func(SyncGroupsClient) (SyncGroup, error)
30399}
30400
30401// UnmarshalJSON is the custom unmarshaller for CreateFuture.
30402func (future *SyncGroupsUpdateFuture) UnmarshalJSON(body []byte) error {
30403	var azFuture azure.Future
30404	if err := json.Unmarshal(body, &azFuture); err != nil {
30405		return err
30406	}
30407	future.FutureAPI = &azFuture
30408	future.Result = future.result
30409	return nil
30410}
30411
30412// result is the default implementation for SyncGroupsUpdateFuture.Result.
30413func (future *SyncGroupsUpdateFuture) result(client SyncGroupsClient) (sg SyncGroup, err error) {
30414	var done bool
30415	done, err = future.DoneWithContext(context.Background(), client)
30416	if err != nil {
30417		err = autorest.NewErrorWithError(err, "sql.SyncGroupsUpdateFuture", "Result", future.Response(), "Polling failure")
30418		return
30419	}
30420	if !done {
30421		sg.Response.Response = future.Response()
30422		err = azure.NewAsyncOpIncompleteError("sql.SyncGroupsUpdateFuture")
30423		return
30424	}
30425	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
30426	if sg.Response.Response, err = future.GetResult(sender); err == nil && sg.Response.Response.StatusCode != http.StatusNoContent {
30427		sg, err = client.UpdateResponder(sg.Response.Response)
30428		if err != nil {
30429			err = autorest.NewErrorWithError(err, "sql.SyncGroupsUpdateFuture", "Result", sg.Response.Response, "Failure responding to request")
30430		}
30431	}
30432	return
30433}
30434
30435// SyncMember an Azure SQL Database sync member.
30436type SyncMember struct {
30437	autorest.Response `json:"-"`
30438	// SyncMemberProperties - Resource properties.
30439	*SyncMemberProperties `json:"properties,omitempty"`
30440	// ID - READ-ONLY; Resource ID.
30441	ID *string `json:"id,omitempty"`
30442	// Name - READ-ONLY; Resource name.
30443	Name *string `json:"name,omitempty"`
30444	// Type - READ-ONLY; Resource type.
30445	Type *string `json:"type,omitempty"`
30446}
30447
30448// MarshalJSON is the custom marshaler for SyncMember.
30449func (sm SyncMember) MarshalJSON() ([]byte, error) {
30450	objectMap := make(map[string]interface{})
30451	if sm.SyncMemberProperties != nil {
30452		objectMap["properties"] = sm.SyncMemberProperties
30453	}
30454	return json.Marshal(objectMap)
30455}
30456
30457// UnmarshalJSON is the custom unmarshaler for SyncMember struct.
30458func (sm *SyncMember) UnmarshalJSON(body []byte) error {
30459	var m map[string]*json.RawMessage
30460	err := json.Unmarshal(body, &m)
30461	if err != nil {
30462		return err
30463	}
30464	for k, v := range m {
30465		switch k {
30466		case "properties":
30467			if v != nil {
30468				var syncMemberProperties SyncMemberProperties
30469				err = json.Unmarshal(*v, &syncMemberProperties)
30470				if err != nil {
30471					return err
30472				}
30473				sm.SyncMemberProperties = &syncMemberProperties
30474			}
30475		case "id":
30476			if v != nil {
30477				var ID string
30478				err = json.Unmarshal(*v, &ID)
30479				if err != nil {
30480					return err
30481				}
30482				sm.ID = &ID
30483			}
30484		case "name":
30485			if v != nil {
30486				var name string
30487				err = json.Unmarshal(*v, &name)
30488				if err != nil {
30489					return err
30490				}
30491				sm.Name = &name
30492			}
30493		case "type":
30494			if v != nil {
30495				var typeVar string
30496				err = json.Unmarshal(*v, &typeVar)
30497				if err != nil {
30498					return err
30499				}
30500				sm.Type = &typeVar
30501			}
30502		}
30503	}
30504
30505	return nil
30506}
30507
30508// SyncMemberListResult a list of Azure SQL Database sync members.
30509type SyncMemberListResult struct {
30510	autorest.Response `json:"-"`
30511	// Value - READ-ONLY; Array of results.
30512	Value *[]SyncMember `json:"value,omitempty"`
30513	// NextLink - READ-ONLY; Link to retrieve next page of results.
30514	NextLink *string `json:"nextLink,omitempty"`
30515}
30516
30517// MarshalJSON is the custom marshaler for SyncMemberListResult.
30518func (smlr SyncMemberListResult) MarshalJSON() ([]byte, error) {
30519	objectMap := make(map[string]interface{})
30520	return json.Marshal(objectMap)
30521}
30522
30523// SyncMemberListResultIterator provides access to a complete listing of SyncMember values.
30524type SyncMemberListResultIterator struct {
30525	i    int
30526	page SyncMemberListResultPage
30527}
30528
30529// NextWithContext advances to the next value.  If there was an error making
30530// the request the iterator does not advance and the error is returned.
30531func (iter *SyncMemberListResultIterator) NextWithContext(ctx context.Context) (err error) {
30532	if tracing.IsEnabled() {
30533		ctx = tracing.StartSpan(ctx, fqdn+"/SyncMemberListResultIterator.NextWithContext")
30534		defer func() {
30535			sc := -1
30536			if iter.Response().Response.Response != nil {
30537				sc = iter.Response().Response.Response.StatusCode
30538			}
30539			tracing.EndSpan(ctx, sc, err)
30540		}()
30541	}
30542	iter.i++
30543	if iter.i < len(iter.page.Values()) {
30544		return nil
30545	}
30546	err = iter.page.NextWithContext(ctx)
30547	if err != nil {
30548		iter.i--
30549		return err
30550	}
30551	iter.i = 0
30552	return nil
30553}
30554
30555// Next advances to the next value.  If there was an error making
30556// the request the iterator does not advance and the error is returned.
30557// Deprecated: Use NextWithContext() instead.
30558func (iter *SyncMemberListResultIterator) Next() error {
30559	return iter.NextWithContext(context.Background())
30560}
30561
30562// NotDone returns true if the enumeration should be started or is not yet complete.
30563func (iter SyncMemberListResultIterator) NotDone() bool {
30564	return iter.page.NotDone() && iter.i < len(iter.page.Values())
30565}
30566
30567// Response returns the raw server response from the last page request.
30568func (iter SyncMemberListResultIterator) Response() SyncMemberListResult {
30569	return iter.page.Response()
30570}
30571
30572// Value returns the current value or a zero-initialized value if the
30573// iterator has advanced beyond the end of the collection.
30574func (iter SyncMemberListResultIterator) Value() SyncMember {
30575	if !iter.page.NotDone() {
30576		return SyncMember{}
30577	}
30578	return iter.page.Values()[iter.i]
30579}
30580
30581// Creates a new instance of the SyncMemberListResultIterator type.
30582func NewSyncMemberListResultIterator(page SyncMemberListResultPage) SyncMemberListResultIterator {
30583	return SyncMemberListResultIterator{page: page}
30584}
30585
30586// IsEmpty returns true if the ListResult contains no values.
30587func (smlr SyncMemberListResult) IsEmpty() bool {
30588	return smlr.Value == nil || len(*smlr.Value) == 0
30589}
30590
30591// hasNextLink returns true if the NextLink is not empty.
30592func (smlr SyncMemberListResult) hasNextLink() bool {
30593	return smlr.NextLink != nil && len(*smlr.NextLink) != 0
30594}
30595
30596// syncMemberListResultPreparer prepares a request to retrieve the next set of results.
30597// It returns nil if no more results exist.
30598func (smlr SyncMemberListResult) syncMemberListResultPreparer(ctx context.Context) (*http.Request, error) {
30599	if !smlr.hasNextLink() {
30600		return nil, nil
30601	}
30602	return autorest.Prepare((&http.Request{}).WithContext(ctx),
30603		autorest.AsJSON(),
30604		autorest.AsGet(),
30605		autorest.WithBaseURL(to.String(smlr.NextLink)))
30606}
30607
30608// SyncMemberListResultPage contains a page of SyncMember values.
30609type SyncMemberListResultPage struct {
30610	fn   func(context.Context, SyncMemberListResult) (SyncMemberListResult, error)
30611	smlr SyncMemberListResult
30612}
30613
30614// NextWithContext advances to the next page of values.  If there was an error making
30615// the request the page does not advance and the error is returned.
30616func (page *SyncMemberListResultPage) NextWithContext(ctx context.Context) (err error) {
30617	if tracing.IsEnabled() {
30618		ctx = tracing.StartSpan(ctx, fqdn+"/SyncMemberListResultPage.NextWithContext")
30619		defer func() {
30620			sc := -1
30621			if page.Response().Response.Response != nil {
30622				sc = page.Response().Response.Response.StatusCode
30623			}
30624			tracing.EndSpan(ctx, sc, err)
30625		}()
30626	}
30627	for {
30628		next, err := page.fn(ctx, page.smlr)
30629		if err != nil {
30630			return err
30631		}
30632		page.smlr = next
30633		if !next.hasNextLink() || !next.IsEmpty() {
30634			break
30635		}
30636	}
30637	return nil
30638}
30639
30640// Next advances to the next page of values.  If there was an error making
30641// the request the page does not advance and the error is returned.
30642// Deprecated: Use NextWithContext() instead.
30643func (page *SyncMemberListResultPage) Next() error {
30644	return page.NextWithContext(context.Background())
30645}
30646
30647// NotDone returns true if the page enumeration should be started or is not yet complete.
30648func (page SyncMemberListResultPage) NotDone() bool {
30649	return !page.smlr.IsEmpty()
30650}
30651
30652// Response returns the raw server response from the last page request.
30653func (page SyncMemberListResultPage) Response() SyncMemberListResult {
30654	return page.smlr
30655}
30656
30657// Values returns the slice of values for the current page or nil if there are no values.
30658func (page SyncMemberListResultPage) Values() []SyncMember {
30659	if page.smlr.IsEmpty() {
30660		return nil
30661	}
30662	return *page.smlr.Value
30663}
30664
30665// Creates a new instance of the SyncMemberListResultPage type.
30666func NewSyncMemberListResultPage(cur SyncMemberListResult, getNextPage func(context.Context, SyncMemberListResult) (SyncMemberListResult, error)) SyncMemberListResultPage {
30667	return SyncMemberListResultPage{
30668		fn:   getNextPage,
30669		smlr: cur,
30670	}
30671}
30672
30673// SyncMemberProperties properties of a sync member.
30674type SyncMemberProperties struct {
30675	// DatabaseType - Database type of the sync member. Possible values include: 'SyncMemberDbTypeAzureSQLDatabase', 'SyncMemberDbTypeSQLServerDatabase'
30676	DatabaseType SyncMemberDbType `json:"databaseType,omitempty"`
30677	// SyncAgentID - ARM resource id of the sync agent in the sync member.
30678	SyncAgentID *string `json:"syncAgentId,omitempty"`
30679	// SQLServerDatabaseID - SQL Server database id of the sync member.
30680	SQLServerDatabaseID *uuid.UUID `json:"sqlServerDatabaseId,omitempty"`
30681	// SyncMemberAzureDatabaseResourceID - ARM resource id of the sync member logical database, for sync members in Azure.
30682	SyncMemberAzureDatabaseResourceID *string `json:"syncMemberAzureDatabaseResourceId,omitempty"`
30683	// UsePrivateLinkConnection - Whether to use private link connection.
30684	UsePrivateLinkConnection *bool `json:"usePrivateLinkConnection,omitempty"`
30685	// PrivateEndpointName - READ-ONLY; Private endpoint name of the sync member if use private link connection is enabled, for sync members in Azure.
30686	PrivateEndpointName *string `json:"privateEndpointName,omitempty"`
30687	// ServerName - Server name of the member database in the sync member
30688	ServerName *string `json:"serverName,omitempty"`
30689	// DatabaseName - Database name of the member database in the sync member.
30690	DatabaseName *string `json:"databaseName,omitempty"`
30691	// UserName - User name of the member database in the sync member.
30692	UserName *string `json:"userName,omitempty"`
30693	// Password - Password of the member database in the sync member.
30694	Password *string `json:"password,omitempty"`
30695	// SyncDirection - Sync direction of the sync member. Possible values include: 'SyncDirectionBidirectional', 'SyncDirectionOneWayMemberToHub', 'SyncDirectionOneWayHubToMember'
30696	SyncDirection SyncDirection `json:"syncDirection,omitempty"`
30697	// SyncState - READ-ONLY; Sync state of the sync member. Possible values include: 'SyncMemberStateSyncInProgress', 'SyncMemberStateSyncSucceeded', 'SyncMemberStateSyncFailed', 'SyncMemberStateDisabledTombstoneCleanup', 'SyncMemberStateDisabledBackupRestore', 'SyncMemberStateSyncSucceededWithWarnings', 'SyncMemberStateSyncCancelling', 'SyncMemberStateSyncCancelled', 'SyncMemberStateUnProvisioned', 'SyncMemberStateProvisioning', 'SyncMemberStateProvisioned', 'SyncMemberStateProvisionFailed', 'SyncMemberStateDeProvisioning', 'SyncMemberStateDeProvisioned', 'SyncMemberStateDeProvisionFailed', 'SyncMemberStateReprovisioning', 'SyncMemberStateReprovisionFailed', 'SyncMemberStateUnReprovisioned'
30698	SyncState SyncMemberState `json:"syncState,omitempty"`
30699}
30700
30701// MarshalJSON is the custom marshaler for SyncMemberProperties.
30702func (smp SyncMemberProperties) MarshalJSON() ([]byte, error) {
30703	objectMap := make(map[string]interface{})
30704	if smp.DatabaseType != "" {
30705		objectMap["databaseType"] = smp.DatabaseType
30706	}
30707	if smp.SyncAgentID != nil {
30708		objectMap["syncAgentId"] = smp.SyncAgentID
30709	}
30710	if smp.SQLServerDatabaseID != nil {
30711		objectMap["sqlServerDatabaseId"] = smp.SQLServerDatabaseID
30712	}
30713	if smp.SyncMemberAzureDatabaseResourceID != nil {
30714		objectMap["syncMemberAzureDatabaseResourceId"] = smp.SyncMemberAzureDatabaseResourceID
30715	}
30716	if smp.UsePrivateLinkConnection != nil {
30717		objectMap["usePrivateLinkConnection"] = smp.UsePrivateLinkConnection
30718	}
30719	if smp.ServerName != nil {
30720		objectMap["serverName"] = smp.ServerName
30721	}
30722	if smp.DatabaseName != nil {
30723		objectMap["databaseName"] = smp.DatabaseName
30724	}
30725	if smp.UserName != nil {
30726		objectMap["userName"] = smp.UserName
30727	}
30728	if smp.Password != nil {
30729		objectMap["password"] = smp.Password
30730	}
30731	if smp.SyncDirection != "" {
30732		objectMap["syncDirection"] = smp.SyncDirection
30733	}
30734	return json.Marshal(objectMap)
30735}
30736
30737// SyncMembersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
30738// long-running operation.
30739type SyncMembersCreateOrUpdateFuture struct {
30740	azure.FutureAPI
30741	// Result returns the result of the asynchronous operation.
30742	// If the operation has not completed it will return an error.
30743	Result func(SyncMembersClient) (SyncMember, error)
30744}
30745
30746// UnmarshalJSON is the custom unmarshaller for CreateFuture.
30747func (future *SyncMembersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
30748	var azFuture azure.Future
30749	if err := json.Unmarshal(body, &azFuture); err != nil {
30750		return err
30751	}
30752	future.FutureAPI = &azFuture
30753	future.Result = future.result
30754	return nil
30755}
30756
30757// result is the default implementation for SyncMembersCreateOrUpdateFuture.Result.
30758func (future *SyncMembersCreateOrUpdateFuture) result(client SyncMembersClient) (sm SyncMember, err error) {
30759	var done bool
30760	done, err = future.DoneWithContext(context.Background(), client)
30761	if err != nil {
30762		err = autorest.NewErrorWithError(err, "sql.SyncMembersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
30763		return
30764	}
30765	if !done {
30766		sm.Response.Response = future.Response()
30767		err = azure.NewAsyncOpIncompleteError("sql.SyncMembersCreateOrUpdateFuture")
30768		return
30769	}
30770	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
30771	if sm.Response.Response, err = future.GetResult(sender); err == nil && sm.Response.Response.StatusCode != http.StatusNoContent {
30772		sm, err = client.CreateOrUpdateResponder(sm.Response.Response)
30773		if err != nil {
30774			err = autorest.NewErrorWithError(err, "sql.SyncMembersCreateOrUpdateFuture", "Result", sm.Response.Response, "Failure responding to request")
30775		}
30776	}
30777	return
30778}
30779
30780// SyncMembersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
30781// operation.
30782type SyncMembersDeleteFuture struct {
30783	azure.FutureAPI
30784	// Result returns the result of the asynchronous operation.
30785	// If the operation has not completed it will return an error.
30786	Result func(SyncMembersClient) (autorest.Response, error)
30787}
30788
30789// UnmarshalJSON is the custom unmarshaller for CreateFuture.
30790func (future *SyncMembersDeleteFuture) UnmarshalJSON(body []byte) error {
30791	var azFuture azure.Future
30792	if err := json.Unmarshal(body, &azFuture); err != nil {
30793		return err
30794	}
30795	future.FutureAPI = &azFuture
30796	future.Result = future.result
30797	return nil
30798}
30799
30800// result is the default implementation for SyncMembersDeleteFuture.Result.
30801func (future *SyncMembersDeleteFuture) result(client SyncMembersClient) (ar autorest.Response, err error) {
30802	var done bool
30803	done, err = future.DoneWithContext(context.Background(), client)
30804	if err != nil {
30805		err = autorest.NewErrorWithError(err, "sql.SyncMembersDeleteFuture", "Result", future.Response(), "Polling failure")
30806		return
30807	}
30808	if !done {
30809		ar.Response = future.Response()
30810		err = azure.NewAsyncOpIncompleteError("sql.SyncMembersDeleteFuture")
30811		return
30812	}
30813	ar.Response = future.Response()
30814	return
30815}
30816
30817// SyncMembersRefreshMemberSchemaFuture an abstraction for monitoring and retrieving the results of a
30818// long-running operation.
30819type SyncMembersRefreshMemberSchemaFuture struct {
30820	azure.FutureAPI
30821	// Result returns the result of the asynchronous operation.
30822	// If the operation has not completed it will return an error.
30823	Result func(SyncMembersClient) (autorest.Response, error)
30824}
30825
30826// UnmarshalJSON is the custom unmarshaller for CreateFuture.
30827func (future *SyncMembersRefreshMemberSchemaFuture) UnmarshalJSON(body []byte) error {
30828	var azFuture azure.Future
30829	if err := json.Unmarshal(body, &azFuture); err != nil {
30830		return err
30831	}
30832	future.FutureAPI = &azFuture
30833	future.Result = future.result
30834	return nil
30835}
30836
30837// result is the default implementation for SyncMembersRefreshMemberSchemaFuture.Result.
30838func (future *SyncMembersRefreshMemberSchemaFuture) result(client SyncMembersClient) (ar autorest.Response, err error) {
30839	var done bool
30840	done, err = future.DoneWithContext(context.Background(), client)
30841	if err != nil {
30842		err = autorest.NewErrorWithError(err, "sql.SyncMembersRefreshMemberSchemaFuture", "Result", future.Response(), "Polling failure")
30843		return
30844	}
30845	if !done {
30846		ar.Response = future.Response()
30847		err = azure.NewAsyncOpIncompleteError("sql.SyncMembersRefreshMemberSchemaFuture")
30848		return
30849	}
30850	ar.Response = future.Response()
30851	return
30852}
30853
30854// SyncMembersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
30855// operation.
30856type SyncMembersUpdateFuture struct {
30857	azure.FutureAPI
30858	// Result returns the result of the asynchronous operation.
30859	// If the operation has not completed it will return an error.
30860	Result func(SyncMembersClient) (SyncMember, error)
30861}
30862
30863// UnmarshalJSON is the custom unmarshaller for CreateFuture.
30864func (future *SyncMembersUpdateFuture) UnmarshalJSON(body []byte) error {
30865	var azFuture azure.Future
30866	if err := json.Unmarshal(body, &azFuture); err != nil {
30867		return err
30868	}
30869	future.FutureAPI = &azFuture
30870	future.Result = future.result
30871	return nil
30872}
30873
30874// result is the default implementation for SyncMembersUpdateFuture.Result.
30875func (future *SyncMembersUpdateFuture) result(client SyncMembersClient) (sm SyncMember, err error) {
30876	var done bool
30877	done, err = future.DoneWithContext(context.Background(), client)
30878	if err != nil {
30879		err = autorest.NewErrorWithError(err, "sql.SyncMembersUpdateFuture", "Result", future.Response(), "Polling failure")
30880		return
30881	}
30882	if !done {
30883		sm.Response.Response = future.Response()
30884		err = azure.NewAsyncOpIncompleteError("sql.SyncMembersUpdateFuture")
30885		return
30886	}
30887	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
30888	if sm.Response.Response, err = future.GetResult(sender); err == nil && sm.Response.Response.StatusCode != http.StatusNoContent {
30889		sm, err = client.UpdateResponder(sm.Response.Response)
30890		if err != nil {
30891			err = autorest.NewErrorWithError(err, "sql.SyncMembersUpdateFuture", "Result", sm.Response.Response, "Failure responding to request")
30892		}
30893	}
30894	return
30895}
30896
30897// SystemData metadata pertaining to creation and last modification of the resource.
30898type SystemData struct {
30899	// CreatedBy - The identity that created the resource.
30900	CreatedBy *string `json:"createdBy,omitempty"`
30901	// CreatedByType - The type of identity that created the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey'
30902	CreatedByType CreatedByType `json:"createdByType,omitempty"`
30903	// CreatedAt - The timestamp of resource creation (UTC).
30904	CreatedAt *date.Time `json:"createdAt,omitempty"`
30905	// LastModifiedBy - The identity that last modified the resource.
30906	LastModifiedBy *string `json:"lastModifiedBy,omitempty"`
30907	// LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey'
30908	LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"`
30909	// LastModifiedAt - The timestamp of resource last modification (UTC)
30910	LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"`
30911}
30912
30913// TdeCertificate a TDE certificate that can be uploaded into a server.
30914type TdeCertificate struct {
30915	// TdeCertificateProperties - Resource properties.
30916	*TdeCertificateProperties `json:"properties,omitempty"`
30917	// ID - READ-ONLY; Resource ID.
30918	ID *string `json:"id,omitempty"`
30919	// Name - READ-ONLY; Resource name.
30920	Name *string `json:"name,omitempty"`
30921	// Type - READ-ONLY; Resource type.
30922	Type *string `json:"type,omitempty"`
30923}
30924
30925// MarshalJSON is the custom marshaler for TdeCertificate.
30926func (tc TdeCertificate) MarshalJSON() ([]byte, error) {
30927	objectMap := make(map[string]interface{})
30928	if tc.TdeCertificateProperties != nil {
30929		objectMap["properties"] = tc.TdeCertificateProperties
30930	}
30931	return json.Marshal(objectMap)
30932}
30933
30934// UnmarshalJSON is the custom unmarshaler for TdeCertificate struct.
30935func (tc *TdeCertificate) UnmarshalJSON(body []byte) error {
30936	var m map[string]*json.RawMessage
30937	err := json.Unmarshal(body, &m)
30938	if err != nil {
30939		return err
30940	}
30941	for k, v := range m {
30942		switch k {
30943		case "properties":
30944			if v != nil {
30945				var tdeCertificateProperties TdeCertificateProperties
30946				err = json.Unmarshal(*v, &tdeCertificateProperties)
30947				if err != nil {
30948					return err
30949				}
30950				tc.TdeCertificateProperties = &tdeCertificateProperties
30951			}
30952		case "id":
30953			if v != nil {
30954				var ID string
30955				err = json.Unmarshal(*v, &ID)
30956				if err != nil {
30957					return err
30958				}
30959				tc.ID = &ID
30960			}
30961		case "name":
30962			if v != nil {
30963				var name string
30964				err = json.Unmarshal(*v, &name)
30965				if err != nil {
30966					return err
30967				}
30968				tc.Name = &name
30969			}
30970		case "type":
30971			if v != nil {
30972				var typeVar string
30973				err = json.Unmarshal(*v, &typeVar)
30974				if err != nil {
30975					return err
30976				}
30977				tc.Type = &typeVar
30978			}
30979		}
30980	}
30981
30982	return nil
30983}
30984
30985// TdeCertificateProperties properties of a TDE certificate.
30986type TdeCertificateProperties struct {
30987	// PrivateBlob - The base64 encoded certificate private blob.
30988	PrivateBlob *string `json:"privateBlob,omitempty"`
30989	// CertPassword - The certificate password.
30990	CertPassword *string `json:"certPassword,omitempty"`
30991}
30992
30993// TdeCertificatesCreateFuture an abstraction for monitoring and retrieving the results of a long-running
30994// operation.
30995type TdeCertificatesCreateFuture struct {
30996	azure.FutureAPI
30997	// Result returns the result of the asynchronous operation.
30998	// If the operation has not completed it will return an error.
30999	Result func(TdeCertificatesClient) (autorest.Response, error)
31000}
31001
31002// UnmarshalJSON is the custom unmarshaller for CreateFuture.
31003func (future *TdeCertificatesCreateFuture) UnmarshalJSON(body []byte) error {
31004	var azFuture azure.Future
31005	if err := json.Unmarshal(body, &azFuture); err != nil {
31006		return err
31007	}
31008	future.FutureAPI = &azFuture
31009	future.Result = future.result
31010	return nil
31011}
31012
31013// result is the default implementation for TdeCertificatesCreateFuture.Result.
31014func (future *TdeCertificatesCreateFuture) result(client TdeCertificatesClient) (ar autorest.Response, err error) {
31015	var done bool
31016	done, err = future.DoneWithContext(context.Background(), client)
31017	if err != nil {
31018		err = autorest.NewErrorWithError(err, "sql.TdeCertificatesCreateFuture", "Result", future.Response(), "Polling failure")
31019		return
31020	}
31021	if !done {
31022		ar.Response = future.Response()
31023		err = azure.NewAsyncOpIncompleteError("sql.TdeCertificatesCreateFuture")
31024		return
31025	}
31026	ar.Response = future.Response()
31027	return
31028}
31029
31030// TimeZone time Zone.
31031type TimeZone struct {
31032	autorest.Response `json:"-"`
31033	// TimeZoneProperties - Resource properties.
31034	*TimeZoneProperties `json:"properties,omitempty"`
31035	// ID - READ-ONLY; Resource ID.
31036	ID *string `json:"id,omitempty"`
31037	// Name - READ-ONLY; Resource name.
31038	Name *string `json:"name,omitempty"`
31039	// Type - READ-ONLY; Resource type.
31040	Type *string `json:"type,omitempty"`
31041}
31042
31043// MarshalJSON is the custom marshaler for TimeZone.
31044func (tz TimeZone) MarshalJSON() ([]byte, error) {
31045	objectMap := make(map[string]interface{})
31046	if tz.TimeZoneProperties != nil {
31047		objectMap["properties"] = tz.TimeZoneProperties
31048	}
31049	return json.Marshal(objectMap)
31050}
31051
31052// UnmarshalJSON is the custom unmarshaler for TimeZone struct.
31053func (tz *TimeZone) UnmarshalJSON(body []byte) error {
31054	var m map[string]*json.RawMessage
31055	err := json.Unmarshal(body, &m)
31056	if err != nil {
31057		return err
31058	}
31059	for k, v := range m {
31060		switch k {
31061		case "properties":
31062			if v != nil {
31063				var timeZoneProperties TimeZoneProperties
31064				err = json.Unmarshal(*v, &timeZoneProperties)
31065				if err != nil {
31066					return err
31067				}
31068				tz.TimeZoneProperties = &timeZoneProperties
31069			}
31070		case "id":
31071			if v != nil {
31072				var ID string
31073				err = json.Unmarshal(*v, &ID)
31074				if err != nil {
31075					return err
31076				}
31077				tz.ID = &ID
31078			}
31079		case "name":
31080			if v != nil {
31081				var name string
31082				err = json.Unmarshal(*v, &name)
31083				if err != nil {
31084					return err
31085				}
31086				tz.Name = &name
31087			}
31088		case "type":
31089			if v != nil {
31090				var typeVar string
31091				err = json.Unmarshal(*v, &typeVar)
31092				if err != nil {
31093					return err
31094				}
31095				tz.Type = &typeVar
31096			}
31097		}
31098	}
31099
31100	return nil
31101}
31102
31103// TimeZoneListResult a list of time zones.
31104type TimeZoneListResult struct {
31105	autorest.Response `json:"-"`
31106	// Value - READ-ONLY; Array of results.
31107	Value *[]TimeZone `json:"value,omitempty"`
31108	// NextLink - READ-ONLY; Link to retrieve next page of results.
31109	NextLink *string `json:"nextLink,omitempty"`
31110}
31111
31112// MarshalJSON is the custom marshaler for TimeZoneListResult.
31113func (tzlr TimeZoneListResult) MarshalJSON() ([]byte, error) {
31114	objectMap := make(map[string]interface{})
31115	return json.Marshal(objectMap)
31116}
31117
31118// TimeZoneListResultIterator provides access to a complete listing of TimeZone values.
31119type TimeZoneListResultIterator struct {
31120	i    int
31121	page TimeZoneListResultPage
31122}
31123
31124// NextWithContext advances to the next value.  If there was an error making
31125// the request the iterator does not advance and the error is returned.
31126func (iter *TimeZoneListResultIterator) NextWithContext(ctx context.Context) (err error) {
31127	if tracing.IsEnabled() {
31128		ctx = tracing.StartSpan(ctx, fqdn+"/TimeZoneListResultIterator.NextWithContext")
31129		defer func() {
31130			sc := -1
31131			if iter.Response().Response.Response != nil {
31132				sc = iter.Response().Response.Response.StatusCode
31133			}
31134			tracing.EndSpan(ctx, sc, err)
31135		}()
31136	}
31137	iter.i++
31138	if iter.i < len(iter.page.Values()) {
31139		return nil
31140	}
31141	err = iter.page.NextWithContext(ctx)
31142	if err != nil {
31143		iter.i--
31144		return err
31145	}
31146	iter.i = 0
31147	return nil
31148}
31149
31150// Next advances to the next value.  If there was an error making
31151// the request the iterator does not advance and the error is returned.
31152// Deprecated: Use NextWithContext() instead.
31153func (iter *TimeZoneListResultIterator) Next() error {
31154	return iter.NextWithContext(context.Background())
31155}
31156
31157// NotDone returns true if the enumeration should be started or is not yet complete.
31158func (iter TimeZoneListResultIterator) NotDone() bool {
31159	return iter.page.NotDone() && iter.i < len(iter.page.Values())
31160}
31161
31162// Response returns the raw server response from the last page request.
31163func (iter TimeZoneListResultIterator) Response() TimeZoneListResult {
31164	return iter.page.Response()
31165}
31166
31167// Value returns the current value or a zero-initialized value if the
31168// iterator has advanced beyond the end of the collection.
31169func (iter TimeZoneListResultIterator) Value() TimeZone {
31170	if !iter.page.NotDone() {
31171		return TimeZone{}
31172	}
31173	return iter.page.Values()[iter.i]
31174}
31175
31176// Creates a new instance of the TimeZoneListResultIterator type.
31177func NewTimeZoneListResultIterator(page TimeZoneListResultPage) TimeZoneListResultIterator {
31178	return TimeZoneListResultIterator{page: page}
31179}
31180
31181// IsEmpty returns true if the ListResult contains no values.
31182func (tzlr TimeZoneListResult) IsEmpty() bool {
31183	return tzlr.Value == nil || len(*tzlr.Value) == 0
31184}
31185
31186// hasNextLink returns true if the NextLink is not empty.
31187func (tzlr TimeZoneListResult) hasNextLink() bool {
31188	return tzlr.NextLink != nil && len(*tzlr.NextLink) != 0
31189}
31190
31191// timeZoneListResultPreparer prepares a request to retrieve the next set of results.
31192// It returns nil if no more results exist.
31193func (tzlr TimeZoneListResult) timeZoneListResultPreparer(ctx context.Context) (*http.Request, error) {
31194	if !tzlr.hasNextLink() {
31195		return nil, nil
31196	}
31197	return autorest.Prepare((&http.Request{}).WithContext(ctx),
31198		autorest.AsJSON(),
31199		autorest.AsGet(),
31200		autorest.WithBaseURL(to.String(tzlr.NextLink)))
31201}
31202
31203// TimeZoneListResultPage contains a page of TimeZone values.
31204type TimeZoneListResultPage struct {
31205	fn   func(context.Context, TimeZoneListResult) (TimeZoneListResult, error)
31206	tzlr TimeZoneListResult
31207}
31208
31209// NextWithContext advances to the next page of values.  If there was an error making
31210// the request the page does not advance and the error is returned.
31211func (page *TimeZoneListResultPage) NextWithContext(ctx context.Context) (err error) {
31212	if tracing.IsEnabled() {
31213		ctx = tracing.StartSpan(ctx, fqdn+"/TimeZoneListResultPage.NextWithContext")
31214		defer func() {
31215			sc := -1
31216			if page.Response().Response.Response != nil {
31217				sc = page.Response().Response.Response.StatusCode
31218			}
31219			tracing.EndSpan(ctx, sc, err)
31220		}()
31221	}
31222	for {
31223		next, err := page.fn(ctx, page.tzlr)
31224		if err != nil {
31225			return err
31226		}
31227		page.tzlr = next
31228		if !next.hasNextLink() || !next.IsEmpty() {
31229			break
31230		}
31231	}
31232	return nil
31233}
31234
31235// Next advances to the next page of values.  If there was an error making
31236// the request the page does not advance and the error is returned.
31237// Deprecated: Use NextWithContext() instead.
31238func (page *TimeZoneListResultPage) Next() error {
31239	return page.NextWithContext(context.Background())
31240}
31241
31242// NotDone returns true if the page enumeration should be started or is not yet complete.
31243func (page TimeZoneListResultPage) NotDone() bool {
31244	return !page.tzlr.IsEmpty()
31245}
31246
31247// Response returns the raw server response from the last page request.
31248func (page TimeZoneListResultPage) Response() TimeZoneListResult {
31249	return page.tzlr
31250}
31251
31252// Values returns the slice of values for the current page or nil if there are no values.
31253func (page TimeZoneListResultPage) Values() []TimeZone {
31254	if page.tzlr.IsEmpty() {
31255		return nil
31256	}
31257	return *page.tzlr.Value
31258}
31259
31260// Creates a new instance of the TimeZoneListResultPage type.
31261func NewTimeZoneListResultPage(cur TimeZoneListResult, getNextPage func(context.Context, TimeZoneListResult) (TimeZoneListResult, error)) TimeZoneListResultPage {
31262	return TimeZoneListResultPage{
31263		fn:   getNextPage,
31264		tzlr: cur,
31265	}
31266}
31267
31268// TimeZoneProperties the properties of a time zone.
31269type TimeZoneProperties struct {
31270	// TimeZoneID - READ-ONLY; The time zone id
31271	TimeZoneID *string `json:"timeZoneId,omitempty"`
31272	// DisplayName - READ-ONLY; The time zone display name
31273	DisplayName *string `json:"displayName,omitempty"`
31274}
31275
31276// MarshalJSON is the custom marshaler for TimeZoneProperties.
31277func (tzp TimeZoneProperties) MarshalJSON() ([]byte, error) {
31278	objectMap := make(map[string]interface{})
31279	return json.Marshal(objectMap)
31280}
31281
31282// TopQueries ...
31283type TopQueries struct {
31284	// NumberOfQueries - READ-ONLY; Requested number of top queries.
31285	NumberOfQueries *int32 `json:"numberOfQueries,omitempty"`
31286	// AggregationFunction - READ-ONLY; Aggregation function used to calculate query metrics.
31287	AggregationFunction *string `json:"aggregationFunction,omitempty"`
31288	// ObservationMetric - READ-ONLY; Metric used to rank queries.
31289	ObservationMetric *string `json:"observationMetric,omitempty"`
31290	// IntervalType - READ-ONLY; Interval type (length). Possible values include: 'QueryTimeGrainTypePT1H', 'QueryTimeGrainTypeP1D'
31291	IntervalType QueryTimeGrainType `json:"intervalType,omitempty"`
31292	// StartTime - READ-ONLY; The start time for the metric (ISO-8601 format).
31293	StartTime *string `json:"startTime,omitempty"`
31294	// EndTime - READ-ONLY; The end time for the metric (ISO-8601 format).
31295	EndTime *string `json:"endTime,omitempty"`
31296	// Queries - List of top resource consuming queries with appropriate metric data
31297	Queries *[]QueryStatisticsProperties `json:"queries,omitempty"`
31298}
31299
31300// MarshalJSON is the custom marshaler for TopQueries.
31301func (tq TopQueries) MarshalJSON() ([]byte, error) {
31302	objectMap := make(map[string]interface{})
31303	if tq.Queries != nil {
31304		objectMap["queries"] = tq.Queries
31305	}
31306	return json.Marshal(objectMap)
31307}
31308
31309// TopQueriesListResult a list of top resource consuming queries on managed instance
31310type TopQueriesListResult struct {
31311	autorest.Response `json:"-"`
31312	// Value - READ-ONLY; Array of results.
31313	Value *[]TopQueries `json:"value,omitempty"`
31314	// NextLink - READ-ONLY; Link to retrieve next page of results.
31315	NextLink *string `json:"nextLink,omitempty"`
31316}
31317
31318// MarshalJSON is the custom marshaler for TopQueriesListResult.
31319func (tqlr TopQueriesListResult) MarshalJSON() ([]byte, error) {
31320	objectMap := make(map[string]interface{})
31321	return json.Marshal(objectMap)
31322}
31323
31324// TopQueriesListResultIterator provides access to a complete listing of TopQueries values.
31325type TopQueriesListResultIterator struct {
31326	i    int
31327	page TopQueriesListResultPage
31328}
31329
31330// NextWithContext advances to the next value.  If there was an error making
31331// the request the iterator does not advance and the error is returned.
31332func (iter *TopQueriesListResultIterator) NextWithContext(ctx context.Context) (err error) {
31333	if tracing.IsEnabled() {
31334		ctx = tracing.StartSpan(ctx, fqdn+"/TopQueriesListResultIterator.NextWithContext")
31335		defer func() {
31336			sc := -1
31337			if iter.Response().Response.Response != nil {
31338				sc = iter.Response().Response.Response.StatusCode
31339			}
31340			tracing.EndSpan(ctx, sc, err)
31341		}()
31342	}
31343	iter.i++
31344	if iter.i < len(iter.page.Values()) {
31345		return nil
31346	}
31347	err = iter.page.NextWithContext(ctx)
31348	if err != nil {
31349		iter.i--
31350		return err
31351	}
31352	iter.i = 0
31353	return nil
31354}
31355
31356// Next advances to the next value.  If there was an error making
31357// the request the iterator does not advance and the error is returned.
31358// Deprecated: Use NextWithContext() instead.
31359func (iter *TopQueriesListResultIterator) Next() error {
31360	return iter.NextWithContext(context.Background())
31361}
31362
31363// NotDone returns true if the enumeration should be started or is not yet complete.
31364func (iter TopQueriesListResultIterator) NotDone() bool {
31365	return iter.page.NotDone() && iter.i < len(iter.page.Values())
31366}
31367
31368// Response returns the raw server response from the last page request.
31369func (iter TopQueriesListResultIterator) Response() TopQueriesListResult {
31370	return iter.page.Response()
31371}
31372
31373// Value returns the current value or a zero-initialized value if the
31374// iterator has advanced beyond the end of the collection.
31375func (iter TopQueriesListResultIterator) Value() TopQueries {
31376	if !iter.page.NotDone() {
31377		return TopQueries{}
31378	}
31379	return iter.page.Values()[iter.i]
31380}
31381
31382// Creates a new instance of the TopQueriesListResultIterator type.
31383func NewTopQueriesListResultIterator(page TopQueriesListResultPage) TopQueriesListResultIterator {
31384	return TopQueriesListResultIterator{page: page}
31385}
31386
31387// IsEmpty returns true if the ListResult contains no values.
31388func (tqlr TopQueriesListResult) IsEmpty() bool {
31389	return tqlr.Value == nil || len(*tqlr.Value) == 0
31390}
31391
31392// hasNextLink returns true if the NextLink is not empty.
31393func (tqlr TopQueriesListResult) hasNextLink() bool {
31394	return tqlr.NextLink != nil && len(*tqlr.NextLink) != 0
31395}
31396
31397// topQueriesListResultPreparer prepares a request to retrieve the next set of results.
31398// It returns nil if no more results exist.
31399func (tqlr TopQueriesListResult) topQueriesListResultPreparer(ctx context.Context) (*http.Request, error) {
31400	if !tqlr.hasNextLink() {
31401		return nil, nil
31402	}
31403	return autorest.Prepare((&http.Request{}).WithContext(ctx),
31404		autorest.AsJSON(),
31405		autorest.AsGet(),
31406		autorest.WithBaseURL(to.String(tqlr.NextLink)))
31407}
31408
31409// TopQueriesListResultPage contains a page of TopQueries values.
31410type TopQueriesListResultPage struct {
31411	fn   func(context.Context, TopQueriesListResult) (TopQueriesListResult, error)
31412	tqlr TopQueriesListResult
31413}
31414
31415// NextWithContext advances to the next page of values.  If there was an error making
31416// the request the page does not advance and the error is returned.
31417func (page *TopQueriesListResultPage) NextWithContext(ctx context.Context) (err error) {
31418	if tracing.IsEnabled() {
31419		ctx = tracing.StartSpan(ctx, fqdn+"/TopQueriesListResultPage.NextWithContext")
31420		defer func() {
31421			sc := -1
31422			if page.Response().Response.Response != nil {
31423				sc = page.Response().Response.Response.StatusCode
31424			}
31425			tracing.EndSpan(ctx, sc, err)
31426		}()
31427	}
31428	for {
31429		next, err := page.fn(ctx, page.tqlr)
31430		if err != nil {
31431			return err
31432		}
31433		page.tqlr = next
31434		if !next.hasNextLink() || !next.IsEmpty() {
31435			break
31436		}
31437	}
31438	return nil
31439}
31440
31441// Next advances to the next page of values.  If there was an error making
31442// the request the page does not advance and the error is returned.
31443// Deprecated: Use NextWithContext() instead.
31444func (page *TopQueriesListResultPage) Next() error {
31445	return page.NextWithContext(context.Background())
31446}
31447
31448// NotDone returns true if the page enumeration should be started or is not yet complete.
31449func (page TopQueriesListResultPage) NotDone() bool {
31450	return !page.tqlr.IsEmpty()
31451}
31452
31453// Response returns the raw server response from the last page request.
31454func (page TopQueriesListResultPage) Response() TopQueriesListResult {
31455	return page.tqlr
31456}
31457
31458// Values returns the slice of values for the current page or nil if there are no values.
31459func (page TopQueriesListResultPage) Values() []TopQueries {
31460	if page.tqlr.IsEmpty() {
31461		return nil
31462	}
31463	return *page.tqlr.Value
31464}
31465
31466// Creates a new instance of the TopQueriesListResultPage type.
31467func NewTopQueriesListResultPage(cur TopQueriesListResult, getNextPage func(context.Context, TopQueriesListResult) (TopQueriesListResult, error)) TopQueriesListResultPage {
31468	return TopQueriesListResultPage{
31469		fn:   getNextPage,
31470		tqlr: cur,
31471	}
31472}
31473
31474// TrackedResource ARM tracked top level resource.
31475type TrackedResource struct {
31476	// Location - Resource location.
31477	Location *string `json:"location,omitempty"`
31478	// Tags - Resource tags.
31479	Tags map[string]*string `json:"tags"`
31480	// ID - READ-ONLY; Resource ID.
31481	ID *string `json:"id,omitempty"`
31482	// Name - READ-ONLY; Resource name.
31483	Name *string `json:"name,omitempty"`
31484	// Type - READ-ONLY; Resource type.
31485	Type *string `json:"type,omitempty"`
31486}
31487
31488// MarshalJSON is the custom marshaler for TrackedResource.
31489func (tr TrackedResource) MarshalJSON() ([]byte, error) {
31490	objectMap := make(map[string]interface{})
31491	if tr.Location != nil {
31492		objectMap["location"] = tr.Location
31493	}
31494	if tr.Tags != nil {
31495		objectMap["tags"] = tr.Tags
31496	}
31497	return json.Marshal(objectMap)
31498}
31499
31500// TransparentDataEncryption represents a database transparent data encryption configuration.
31501type TransparentDataEncryption struct {
31502	autorest.Response `json:"-"`
31503	// Location - READ-ONLY; Resource location.
31504	Location *string `json:"location,omitempty"`
31505	// TransparentDataEncryptionProperties - Represents the properties of the resource.
31506	*TransparentDataEncryptionProperties `json:"properties,omitempty"`
31507	// ID - READ-ONLY; Resource ID.
31508	ID *string `json:"id,omitempty"`
31509	// Name - READ-ONLY; Resource name.
31510	Name *string `json:"name,omitempty"`
31511	// Type - READ-ONLY; Resource type.
31512	Type *string `json:"type,omitempty"`
31513}
31514
31515// MarshalJSON is the custom marshaler for TransparentDataEncryption.
31516func (tde TransparentDataEncryption) MarshalJSON() ([]byte, error) {
31517	objectMap := make(map[string]interface{})
31518	if tde.TransparentDataEncryptionProperties != nil {
31519		objectMap["properties"] = tde.TransparentDataEncryptionProperties
31520	}
31521	return json.Marshal(objectMap)
31522}
31523
31524// UnmarshalJSON is the custom unmarshaler for TransparentDataEncryption struct.
31525func (tde *TransparentDataEncryption) UnmarshalJSON(body []byte) error {
31526	var m map[string]*json.RawMessage
31527	err := json.Unmarshal(body, &m)
31528	if err != nil {
31529		return err
31530	}
31531	for k, v := range m {
31532		switch k {
31533		case "location":
31534			if v != nil {
31535				var location string
31536				err = json.Unmarshal(*v, &location)
31537				if err != nil {
31538					return err
31539				}
31540				tde.Location = &location
31541			}
31542		case "properties":
31543			if v != nil {
31544				var transparentDataEncryptionProperties TransparentDataEncryptionProperties
31545				err = json.Unmarshal(*v, &transparentDataEncryptionProperties)
31546				if err != nil {
31547					return err
31548				}
31549				tde.TransparentDataEncryptionProperties = &transparentDataEncryptionProperties
31550			}
31551		case "id":
31552			if v != nil {
31553				var ID string
31554				err = json.Unmarshal(*v, &ID)
31555				if err != nil {
31556					return err
31557				}
31558				tde.ID = &ID
31559			}
31560		case "name":
31561			if v != nil {
31562				var name string
31563				err = json.Unmarshal(*v, &name)
31564				if err != nil {
31565					return err
31566				}
31567				tde.Name = &name
31568			}
31569		case "type":
31570			if v != nil {
31571				var typeVar string
31572				err = json.Unmarshal(*v, &typeVar)
31573				if err != nil {
31574					return err
31575				}
31576				tde.Type = &typeVar
31577			}
31578		}
31579	}
31580
31581	return nil
31582}
31583
31584// TransparentDataEncryptionActivity represents a database transparent data encryption Scan.
31585type TransparentDataEncryptionActivity struct {
31586	// Location - READ-ONLY; Resource location.
31587	Location *string `json:"location,omitempty"`
31588	// TransparentDataEncryptionActivityProperties - Represents the properties of the resource.
31589	*TransparentDataEncryptionActivityProperties `json:"properties,omitempty"`
31590	// ID - READ-ONLY; Resource ID.
31591	ID *string `json:"id,omitempty"`
31592	// Name - READ-ONLY; Resource name.
31593	Name *string `json:"name,omitempty"`
31594	// Type - READ-ONLY; Resource type.
31595	Type *string `json:"type,omitempty"`
31596}
31597
31598// MarshalJSON is the custom marshaler for TransparentDataEncryptionActivity.
31599func (tdea TransparentDataEncryptionActivity) MarshalJSON() ([]byte, error) {
31600	objectMap := make(map[string]interface{})
31601	if tdea.TransparentDataEncryptionActivityProperties != nil {
31602		objectMap["properties"] = tdea.TransparentDataEncryptionActivityProperties
31603	}
31604	return json.Marshal(objectMap)
31605}
31606
31607// UnmarshalJSON is the custom unmarshaler for TransparentDataEncryptionActivity struct.
31608func (tdea *TransparentDataEncryptionActivity) UnmarshalJSON(body []byte) error {
31609	var m map[string]*json.RawMessage
31610	err := json.Unmarshal(body, &m)
31611	if err != nil {
31612		return err
31613	}
31614	for k, v := range m {
31615		switch k {
31616		case "location":
31617			if v != nil {
31618				var location string
31619				err = json.Unmarshal(*v, &location)
31620				if err != nil {
31621					return err
31622				}
31623				tdea.Location = &location
31624			}
31625		case "properties":
31626			if v != nil {
31627				var transparentDataEncryptionActivityProperties TransparentDataEncryptionActivityProperties
31628				err = json.Unmarshal(*v, &transparentDataEncryptionActivityProperties)
31629				if err != nil {
31630					return err
31631				}
31632				tdea.TransparentDataEncryptionActivityProperties = &transparentDataEncryptionActivityProperties
31633			}
31634		case "id":
31635			if v != nil {
31636				var ID string
31637				err = json.Unmarshal(*v, &ID)
31638				if err != nil {
31639					return err
31640				}
31641				tdea.ID = &ID
31642			}
31643		case "name":
31644			if v != nil {
31645				var name string
31646				err = json.Unmarshal(*v, &name)
31647				if err != nil {
31648					return err
31649				}
31650				tdea.Name = &name
31651			}
31652		case "type":
31653			if v != nil {
31654				var typeVar string
31655				err = json.Unmarshal(*v, &typeVar)
31656				if err != nil {
31657					return err
31658				}
31659				tdea.Type = &typeVar
31660			}
31661		}
31662	}
31663
31664	return nil
31665}
31666
31667// TransparentDataEncryptionActivityListResult represents the response to a list database transparent data
31668// encryption activity request.
31669type TransparentDataEncryptionActivityListResult struct {
31670	autorest.Response `json:"-"`
31671	// Value - The list of database transparent data encryption activities.
31672	Value *[]TransparentDataEncryptionActivity `json:"value,omitempty"`
31673}
31674
31675// TransparentDataEncryptionActivityProperties represents the properties of a database transparent data
31676// encryption Scan.
31677type TransparentDataEncryptionActivityProperties struct {
31678	// Status - READ-ONLY; The status of the database. Possible values include: 'TransparentDataEncryptionActivityStatusEncrypting', 'TransparentDataEncryptionActivityStatusDecrypting'
31679	Status TransparentDataEncryptionActivityStatus `json:"status,omitempty"`
31680	// PercentComplete - READ-ONLY; The percent complete of the transparent data encryption scan for a database.
31681	PercentComplete *float64 `json:"percentComplete,omitempty"`
31682}
31683
31684// MarshalJSON is the custom marshaler for TransparentDataEncryptionActivityProperties.
31685func (tdeap TransparentDataEncryptionActivityProperties) MarshalJSON() ([]byte, error) {
31686	objectMap := make(map[string]interface{})
31687	return json.Marshal(objectMap)
31688}
31689
31690// TransparentDataEncryptionProperties represents the properties of a database transparent data encryption.
31691type TransparentDataEncryptionProperties struct {
31692	// Status - The status of the database transparent data encryption. Possible values include: 'TransparentDataEncryptionStatusEnabled', 'TransparentDataEncryptionStatusDisabled'
31693	Status TransparentDataEncryptionStatus `json:"status,omitempty"`
31694}
31695
31696// UnlinkParameters represents the parameters for Unlink Replication Link request.
31697type UnlinkParameters struct {
31698	// ForcedTermination - Determines whether link will be terminated in a forced or a friendly way.
31699	ForcedTermination *bool `json:"forcedTermination,omitempty"`
31700}
31701
31702// UpdateLongTermRetentionBackupParameters contains the information necessary to perform long term
31703// retention backup update operation.
31704type UpdateLongTermRetentionBackupParameters struct {
31705	// UpdateLongTermRetentionBackupParametersProperties - Resource properties.
31706	*UpdateLongTermRetentionBackupParametersProperties `json:"properties,omitempty"`
31707}
31708
31709// MarshalJSON is the custom marshaler for UpdateLongTermRetentionBackupParameters.
31710func (ultrbp UpdateLongTermRetentionBackupParameters) MarshalJSON() ([]byte, error) {
31711	objectMap := make(map[string]interface{})
31712	if ultrbp.UpdateLongTermRetentionBackupParametersProperties != nil {
31713		objectMap["properties"] = ultrbp.UpdateLongTermRetentionBackupParametersProperties
31714	}
31715	return json.Marshal(objectMap)
31716}
31717
31718// UnmarshalJSON is the custom unmarshaler for UpdateLongTermRetentionBackupParameters struct.
31719func (ultrbp *UpdateLongTermRetentionBackupParameters) UnmarshalJSON(body []byte) error {
31720	var m map[string]*json.RawMessage
31721	err := json.Unmarshal(body, &m)
31722	if err != nil {
31723		return err
31724	}
31725	for k, v := range m {
31726		switch k {
31727		case "properties":
31728			if v != nil {
31729				var updateLongTermRetentionBackupParametersProperties UpdateLongTermRetentionBackupParametersProperties
31730				err = json.Unmarshal(*v, &updateLongTermRetentionBackupParametersProperties)
31731				if err != nil {
31732					return err
31733				}
31734				ultrbp.UpdateLongTermRetentionBackupParametersProperties = &updateLongTermRetentionBackupParametersProperties
31735			}
31736		}
31737	}
31738
31739	return nil
31740}
31741
31742// UpdateLongTermRetentionBackupParametersProperties contains the properties to perform long term retention
31743// backup copy operation.
31744type UpdateLongTermRetentionBackupParametersProperties struct {
31745	// RequestedBackupStorageRedundancy - The storage redundancy type of the copied backup. Possible values include: 'RequestedBackupStorageRedundancyGeo', 'RequestedBackupStorageRedundancyLocal', 'RequestedBackupStorageRedundancyZone'
31746	RequestedBackupStorageRedundancy RequestedBackupStorageRedundancy `json:"requestedBackupStorageRedundancy,omitempty"`
31747}
31748
31749// UpdateManagedInstanceDNSServersOperation a recoverable managed database resource.
31750type UpdateManagedInstanceDNSServersOperation struct {
31751	autorest.Response `json:"-"`
31752	// DNSRefreshConfigurationProperties - Resource properties.
31753	*DNSRefreshConfigurationProperties `json:"properties,omitempty"`
31754	// ID - READ-ONLY; Resource ID.
31755	ID *string `json:"id,omitempty"`
31756	// Name - READ-ONLY; Resource name.
31757	Name *string `json:"name,omitempty"`
31758	// Type - READ-ONLY; Resource type.
31759	Type *string `json:"type,omitempty"`
31760}
31761
31762// MarshalJSON is the custom marshaler for UpdateManagedInstanceDNSServersOperation.
31763func (umidso UpdateManagedInstanceDNSServersOperation) MarshalJSON() ([]byte, error) {
31764	objectMap := make(map[string]interface{})
31765	if umidso.DNSRefreshConfigurationProperties != nil {
31766		objectMap["properties"] = umidso.DNSRefreshConfigurationProperties
31767	}
31768	return json.Marshal(objectMap)
31769}
31770
31771// UnmarshalJSON is the custom unmarshaler for UpdateManagedInstanceDNSServersOperation struct.
31772func (umidso *UpdateManagedInstanceDNSServersOperation) UnmarshalJSON(body []byte) error {
31773	var m map[string]*json.RawMessage
31774	err := json.Unmarshal(body, &m)
31775	if err != nil {
31776		return err
31777	}
31778	for k, v := range m {
31779		switch k {
31780		case "properties":
31781			if v != nil {
31782				var DNSRefreshConfigurationProperties DNSRefreshConfigurationProperties
31783				err = json.Unmarshal(*v, &DNSRefreshConfigurationProperties)
31784				if err != nil {
31785					return err
31786				}
31787				umidso.DNSRefreshConfigurationProperties = &DNSRefreshConfigurationProperties
31788			}
31789		case "id":
31790			if v != nil {
31791				var ID string
31792				err = json.Unmarshal(*v, &ID)
31793				if err != nil {
31794					return err
31795				}
31796				umidso.ID = &ID
31797			}
31798		case "name":
31799			if v != nil {
31800				var name string
31801				err = json.Unmarshal(*v, &name)
31802				if err != nil {
31803					return err
31804				}
31805				umidso.Name = &name
31806			}
31807		case "type":
31808			if v != nil {
31809				var typeVar string
31810				err = json.Unmarshal(*v, &typeVar)
31811				if err != nil {
31812					return err
31813				}
31814				umidso.Type = &typeVar
31815			}
31816		}
31817	}
31818
31819	return nil
31820}
31821
31822// UpsertManagedServerOperationParameters ...
31823type UpsertManagedServerOperationParameters struct {
31824	Family          *string `json:"family,omitempty"`
31825	Tier            *string `json:"tier,omitempty"`
31826	VCores          *int32  `json:"vCores,omitempty"`
31827	StorageSizeInGB *int32  `json:"storageSizeInGB,omitempty"`
31828}
31829
31830// UpsertManagedServerOperationStep ...
31831type UpsertManagedServerOperationStep struct {
31832	Order *int32  `json:"order,omitempty"`
31833	Name  *string `json:"name,omitempty"`
31834	// Status - Possible values include: 'StatusNotStarted', 'StatusInProgress', 'StatusSlowedDown', 'StatusCompleted', 'StatusFailed', 'StatusCanceled'
31835	Status Status `json:"status,omitempty"`
31836}
31837
31838// Usage ARM usage.
31839type Usage struct {
31840	// ID - READ-ONLY; Resource ID.
31841	ID *string `json:"id,omitempty"`
31842	// Name - READ-ONLY; Resource name.
31843	Name *Name `json:"name,omitempty"`
31844	// Type - READ-ONLY; Resource type.
31845	Type *string `json:"type,omitempty"`
31846	// Unit - READ-ONLY; Usage unit.
31847	Unit *string `json:"unit,omitempty"`
31848	// CurrentValue - READ-ONLY; Usage current value.
31849	CurrentValue *int32 `json:"currentValue,omitempty"`
31850	// Limit - READ-ONLY; Usage limit.
31851	Limit *int32 `json:"limit,omitempty"`
31852	// RequestedLimit - READ-ONLY; Usage requested limit.
31853	RequestedLimit *int32 `json:"requestedLimit,omitempty"`
31854}
31855
31856// MarshalJSON is the custom marshaler for Usage.
31857func (u Usage) MarshalJSON() ([]byte, error) {
31858	objectMap := make(map[string]interface{})
31859	return json.Marshal(objectMap)
31860}
31861
31862// UsageListResult a list of usages.
31863type UsageListResult struct {
31864	autorest.Response `json:"-"`
31865	// Value - READ-ONLY; Array of results.
31866	Value *[]Usage `json:"value,omitempty"`
31867	// NextLink - READ-ONLY; Link to retrieve next page of results.
31868	NextLink *string `json:"nextLink,omitempty"`
31869}
31870
31871// MarshalJSON is the custom marshaler for UsageListResult.
31872func (ulr UsageListResult) MarshalJSON() ([]byte, error) {
31873	objectMap := make(map[string]interface{})
31874	return json.Marshal(objectMap)
31875}
31876
31877// UsageListResultIterator provides access to a complete listing of Usage values.
31878type UsageListResultIterator struct {
31879	i    int
31880	page UsageListResultPage
31881}
31882
31883// NextWithContext advances to the next value.  If there was an error making
31884// the request the iterator does not advance and the error is returned.
31885func (iter *UsageListResultIterator) NextWithContext(ctx context.Context) (err error) {
31886	if tracing.IsEnabled() {
31887		ctx = tracing.StartSpan(ctx, fqdn+"/UsageListResultIterator.NextWithContext")
31888		defer func() {
31889			sc := -1
31890			if iter.Response().Response.Response != nil {
31891				sc = iter.Response().Response.Response.StatusCode
31892			}
31893			tracing.EndSpan(ctx, sc, err)
31894		}()
31895	}
31896	iter.i++
31897	if iter.i < len(iter.page.Values()) {
31898		return nil
31899	}
31900	err = iter.page.NextWithContext(ctx)
31901	if err != nil {
31902		iter.i--
31903		return err
31904	}
31905	iter.i = 0
31906	return nil
31907}
31908
31909// Next advances to the next value.  If there was an error making
31910// the request the iterator does not advance and the error is returned.
31911// Deprecated: Use NextWithContext() instead.
31912func (iter *UsageListResultIterator) Next() error {
31913	return iter.NextWithContext(context.Background())
31914}
31915
31916// NotDone returns true if the enumeration should be started or is not yet complete.
31917func (iter UsageListResultIterator) NotDone() bool {
31918	return iter.page.NotDone() && iter.i < len(iter.page.Values())
31919}
31920
31921// Response returns the raw server response from the last page request.
31922func (iter UsageListResultIterator) Response() UsageListResult {
31923	return iter.page.Response()
31924}
31925
31926// Value returns the current value or a zero-initialized value if the
31927// iterator has advanced beyond the end of the collection.
31928func (iter UsageListResultIterator) Value() Usage {
31929	if !iter.page.NotDone() {
31930		return Usage{}
31931	}
31932	return iter.page.Values()[iter.i]
31933}
31934
31935// Creates a new instance of the UsageListResultIterator type.
31936func NewUsageListResultIterator(page UsageListResultPage) UsageListResultIterator {
31937	return UsageListResultIterator{page: page}
31938}
31939
31940// IsEmpty returns true if the ListResult contains no values.
31941func (ulr UsageListResult) IsEmpty() bool {
31942	return ulr.Value == nil || len(*ulr.Value) == 0
31943}
31944
31945// hasNextLink returns true if the NextLink is not empty.
31946func (ulr UsageListResult) hasNextLink() bool {
31947	return ulr.NextLink != nil && len(*ulr.NextLink) != 0
31948}
31949
31950// usageListResultPreparer prepares a request to retrieve the next set of results.
31951// It returns nil if no more results exist.
31952func (ulr UsageListResult) usageListResultPreparer(ctx context.Context) (*http.Request, error) {
31953	if !ulr.hasNextLink() {
31954		return nil, nil
31955	}
31956	return autorest.Prepare((&http.Request{}).WithContext(ctx),
31957		autorest.AsJSON(),
31958		autorest.AsGet(),
31959		autorest.WithBaseURL(to.String(ulr.NextLink)))
31960}
31961
31962// UsageListResultPage contains a page of Usage values.
31963type UsageListResultPage struct {
31964	fn  func(context.Context, UsageListResult) (UsageListResult, error)
31965	ulr UsageListResult
31966}
31967
31968// NextWithContext advances to the next page of values.  If there was an error making
31969// the request the page does not advance and the error is returned.
31970func (page *UsageListResultPage) NextWithContext(ctx context.Context) (err error) {
31971	if tracing.IsEnabled() {
31972		ctx = tracing.StartSpan(ctx, fqdn+"/UsageListResultPage.NextWithContext")
31973		defer func() {
31974			sc := -1
31975			if page.Response().Response.Response != nil {
31976				sc = page.Response().Response.Response.StatusCode
31977			}
31978			tracing.EndSpan(ctx, sc, err)
31979		}()
31980	}
31981	for {
31982		next, err := page.fn(ctx, page.ulr)
31983		if err != nil {
31984			return err
31985		}
31986		page.ulr = next
31987		if !next.hasNextLink() || !next.IsEmpty() {
31988			break
31989		}
31990	}
31991	return nil
31992}
31993
31994// Next advances to the next page of values.  If there was an error making
31995// the request the page does not advance and the error is returned.
31996// Deprecated: Use NextWithContext() instead.
31997func (page *UsageListResultPage) Next() error {
31998	return page.NextWithContext(context.Background())
31999}
32000
32001// NotDone returns true if the page enumeration should be started or is not yet complete.
32002func (page UsageListResultPage) NotDone() bool {
32003	return !page.ulr.IsEmpty()
32004}
32005
32006// Response returns the raw server response from the last page request.
32007func (page UsageListResultPage) Response() UsageListResult {
32008	return page.ulr
32009}
32010
32011// Values returns the slice of values for the current page or nil if there are no values.
32012func (page UsageListResultPage) Values() []Usage {
32013	if page.ulr.IsEmpty() {
32014		return nil
32015	}
32016	return *page.ulr.Value
32017}
32018
32019// Creates a new instance of the UsageListResultPage type.
32020func NewUsageListResultPage(cur UsageListResult, getNextPage func(context.Context, UsageListResult) (UsageListResult, error)) UsageListResultPage {
32021	return UsageListResultPage{
32022		fn:  getNextPage,
32023		ulr: cur,
32024	}
32025}
32026
32027// UserIdentity azure Active Directory identity configuration for a resource.
32028type UserIdentity struct {
32029	// PrincipalID - READ-ONLY; The Azure Active Directory principal id.
32030	PrincipalID *uuid.UUID `json:"principalId,omitempty"`
32031	// ClientID - READ-ONLY; The Azure Active Directory client id.
32032	ClientID *uuid.UUID `json:"clientId,omitempty"`
32033}
32034
32035// MarshalJSON is the custom marshaler for UserIdentity.
32036func (UI UserIdentity) MarshalJSON() ([]byte, error) {
32037	objectMap := make(map[string]interface{})
32038	return json.Marshal(objectMap)
32039}
32040
32041// VirtualCluster an Azure SQL virtual cluster.
32042type VirtualCluster struct {
32043	autorest.Response `json:"-"`
32044	// VirtualClusterProperties - Resource properties.
32045	*VirtualClusterProperties `json:"properties,omitempty"`
32046	// Location - Resource location.
32047	Location *string `json:"location,omitempty"`
32048	// Tags - Resource tags.
32049	Tags map[string]*string `json:"tags"`
32050	// ID - READ-ONLY; Resource ID.
32051	ID *string `json:"id,omitempty"`
32052	// Name - READ-ONLY; Resource name.
32053	Name *string `json:"name,omitempty"`
32054	// Type - READ-ONLY; Resource type.
32055	Type *string `json:"type,omitempty"`
32056}
32057
32058// MarshalJSON is the custom marshaler for VirtualCluster.
32059func (vc VirtualCluster) MarshalJSON() ([]byte, error) {
32060	objectMap := make(map[string]interface{})
32061	if vc.VirtualClusterProperties != nil {
32062		objectMap["properties"] = vc.VirtualClusterProperties
32063	}
32064	if vc.Location != nil {
32065		objectMap["location"] = vc.Location
32066	}
32067	if vc.Tags != nil {
32068		objectMap["tags"] = vc.Tags
32069	}
32070	return json.Marshal(objectMap)
32071}
32072
32073// UnmarshalJSON is the custom unmarshaler for VirtualCluster struct.
32074func (vc *VirtualCluster) UnmarshalJSON(body []byte) error {
32075	var m map[string]*json.RawMessage
32076	err := json.Unmarshal(body, &m)
32077	if err != nil {
32078		return err
32079	}
32080	for k, v := range m {
32081		switch k {
32082		case "properties":
32083			if v != nil {
32084				var virtualClusterProperties VirtualClusterProperties
32085				err = json.Unmarshal(*v, &virtualClusterProperties)
32086				if err != nil {
32087					return err
32088				}
32089				vc.VirtualClusterProperties = &virtualClusterProperties
32090			}
32091		case "location":
32092			if v != nil {
32093				var location string
32094				err = json.Unmarshal(*v, &location)
32095				if err != nil {
32096					return err
32097				}
32098				vc.Location = &location
32099			}
32100		case "tags":
32101			if v != nil {
32102				var tags map[string]*string
32103				err = json.Unmarshal(*v, &tags)
32104				if err != nil {
32105					return err
32106				}
32107				vc.Tags = tags
32108			}
32109		case "id":
32110			if v != nil {
32111				var ID string
32112				err = json.Unmarshal(*v, &ID)
32113				if err != nil {
32114					return err
32115				}
32116				vc.ID = &ID
32117			}
32118		case "name":
32119			if v != nil {
32120				var name string
32121				err = json.Unmarshal(*v, &name)
32122				if err != nil {
32123					return err
32124				}
32125				vc.Name = &name
32126			}
32127		case "type":
32128			if v != nil {
32129				var typeVar string
32130				err = json.Unmarshal(*v, &typeVar)
32131				if err != nil {
32132					return err
32133				}
32134				vc.Type = &typeVar
32135			}
32136		}
32137	}
32138
32139	return nil
32140}
32141
32142// VirtualClusterListResult a list of virtual clusters.
32143type VirtualClusterListResult struct {
32144	autorest.Response `json:"-"`
32145	// Value - READ-ONLY; Array of results.
32146	Value *[]VirtualCluster `json:"value,omitempty"`
32147	// NextLink - READ-ONLY; Link to retrieve next page of results.
32148	NextLink *string `json:"nextLink,omitempty"`
32149}
32150
32151// MarshalJSON is the custom marshaler for VirtualClusterListResult.
32152func (vclr VirtualClusterListResult) MarshalJSON() ([]byte, error) {
32153	objectMap := make(map[string]interface{})
32154	return json.Marshal(objectMap)
32155}
32156
32157// VirtualClusterListResultIterator provides access to a complete listing of VirtualCluster values.
32158type VirtualClusterListResultIterator struct {
32159	i    int
32160	page VirtualClusterListResultPage
32161}
32162
32163// NextWithContext advances to the next value.  If there was an error making
32164// the request the iterator does not advance and the error is returned.
32165func (iter *VirtualClusterListResultIterator) NextWithContext(ctx context.Context) (err error) {
32166	if tracing.IsEnabled() {
32167		ctx = tracing.StartSpan(ctx, fqdn+"/VirtualClusterListResultIterator.NextWithContext")
32168		defer func() {
32169			sc := -1
32170			if iter.Response().Response.Response != nil {
32171				sc = iter.Response().Response.Response.StatusCode
32172			}
32173			tracing.EndSpan(ctx, sc, err)
32174		}()
32175	}
32176	iter.i++
32177	if iter.i < len(iter.page.Values()) {
32178		return nil
32179	}
32180	err = iter.page.NextWithContext(ctx)
32181	if err != nil {
32182		iter.i--
32183		return err
32184	}
32185	iter.i = 0
32186	return nil
32187}
32188
32189// Next advances to the next value.  If there was an error making
32190// the request the iterator does not advance and the error is returned.
32191// Deprecated: Use NextWithContext() instead.
32192func (iter *VirtualClusterListResultIterator) Next() error {
32193	return iter.NextWithContext(context.Background())
32194}
32195
32196// NotDone returns true if the enumeration should be started or is not yet complete.
32197func (iter VirtualClusterListResultIterator) NotDone() bool {
32198	return iter.page.NotDone() && iter.i < len(iter.page.Values())
32199}
32200
32201// Response returns the raw server response from the last page request.
32202func (iter VirtualClusterListResultIterator) Response() VirtualClusterListResult {
32203	return iter.page.Response()
32204}
32205
32206// Value returns the current value or a zero-initialized value if the
32207// iterator has advanced beyond the end of the collection.
32208func (iter VirtualClusterListResultIterator) Value() VirtualCluster {
32209	if !iter.page.NotDone() {
32210		return VirtualCluster{}
32211	}
32212	return iter.page.Values()[iter.i]
32213}
32214
32215// Creates a new instance of the VirtualClusterListResultIterator type.
32216func NewVirtualClusterListResultIterator(page VirtualClusterListResultPage) VirtualClusterListResultIterator {
32217	return VirtualClusterListResultIterator{page: page}
32218}
32219
32220// IsEmpty returns true if the ListResult contains no values.
32221func (vclr VirtualClusterListResult) IsEmpty() bool {
32222	return vclr.Value == nil || len(*vclr.Value) == 0
32223}
32224
32225// hasNextLink returns true if the NextLink is not empty.
32226func (vclr VirtualClusterListResult) hasNextLink() bool {
32227	return vclr.NextLink != nil && len(*vclr.NextLink) != 0
32228}
32229
32230// virtualClusterListResultPreparer prepares a request to retrieve the next set of results.
32231// It returns nil if no more results exist.
32232func (vclr VirtualClusterListResult) virtualClusterListResultPreparer(ctx context.Context) (*http.Request, error) {
32233	if !vclr.hasNextLink() {
32234		return nil, nil
32235	}
32236	return autorest.Prepare((&http.Request{}).WithContext(ctx),
32237		autorest.AsJSON(),
32238		autorest.AsGet(),
32239		autorest.WithBaseURL(to.String(vclr.NextLink)))
32240}
32241
32242// VirtualClusterListResultPage contains a page of VirtualCluster values.
32243type VirtualClusterListResultPage struct {
32244	fn   func(context.Context, VirtualClusterListResult) (VirtualClusterListResult, error)
32245	vclr VirtualClusterListResult
32246}
32247
32248// NextWithContext advances to the next page of values.  If there was an error making
32249// the request the page does not advance and the error is returned.
32250func (page *VirtualClusterListResultPage) NextWithContext(ctx context.Context) (err error) {
32251	if tracing.IsEnabled() {
32252		ctx = tracing.StartSpan(ctx, fqdn+"/VirtualClusterListResultPage.NextWithContext")
32253		defer func() {
32254			sc := -1
32255			if page.Response().Response.Response != nil {
32256				sc = page.Response().Response.Response.StatusCode
32257			}
32258			tracing.EndSpan(ctx, sc, err)
32259		}()
32260	}
32261	for {
32262		next, err := page.fn(ctx, page.vclr)
32263		if err != nil {
32264			return err
32265		}
32266		page.vclr = next
32267		if !next.hasNextLink() || !next.IsEmpty() {
32268			break
32269		}
32270	}
32271	return nil
32272}
32273
32274// Next advances to the next page of values.  If there was an error making
32275// the request the page does not advance and the error is returned.
32276// Deprecated: Use NextWithContext() instead.
32277func (page *VirtualClusterListResultPage) Next() error {
32278	return page.NextWithContext(context.Background())
32279}
32280
32281// NotDone returns true if the page enumeration should be started or is not yet complete.
32282func (page VirtualClusterListResultPage) NotDone() bool {
32283	return !page.vclr.IsEmpty()
32284}
32285
32286// Response returns the raw server response from the last page request.
32287func (page VirtualClusterListResultPage) Response() VirtualClusterListResult {
32288	return page.vclr
32289}
32290
32291// Values returns the slice of values for the current page or nil if there are no values.
32292func (page VirtualClusterListResultPage) Values() []VirtualCluster {
32293	if page.vclr.IsEmpty() {
32294		return nil
32295	}
32296	return *page.vclr.Value
32297}
32298
32299// Creates a new instance of the VirtualClusterListResultPage type.
32300func NewVirtualClusterListResultPage(cur VirtualClusterListResult, getNextPage func(context.Context, VirtualClusterListResult) (VirtualClusterListResult, error)) VirtualClusterListResultPage {
32301	return VirtualClusterListResultPage{
32302		fn:   getNextPage,
32303		vclr: cur,
32304	}
32305}
32306
32307// VirtualClusterProperties the properties of a virtual cluster.
32308type VirtualClusterProperties struct {
32309	// SubnetID - READ-ONLY; Subnet resource ID for the virtual cluster.
32310	SubnetID *string `json:"subnetId,omitempty"`
32311	// Family - If the service has different generations of hardware, for the same SKU, then that can be captured here.
32312	Family *string `json:"family,omitempty"`
32313	// ChildResources - READ-ONLY; List of resources in this virtual cluster.
32314	ChildResources *[]string `json:"childResources,omitempty"`
32315	// MaintenanceConfigurationID - Specifies maintenance configuration id to apply to this virtual cluster.
32316	MaintenanceConfigurationID *string `json:"maintenanceConfigurationId,omitempty"`
32317}
32318
32319// MarshalJSON is the custom marshaler for VirtualClusterProperties.
32320func (vcp VirtualClusterProperties) MarshalJSON() ([]byte, error) {
32321	objectMap := make(map[string]interface{})
32322	if vcp.Family != nil {
32323		objectMap["family"] = vcp.Family
32324	}
32325	if vcp.MaintenanceConfigurationID != nil {
32326		objectMap["maintenanceConfigurationId"] = vcp.MaintenanceConfigurationID
32327	}
32328	return json.Marshal(objectMap)
32329}
32330
32331// VirtualClustersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
32332// operation.
32333type VirtualClustersDeleteFuture struct {
32334	azure.FutureAPI
32335	// Result returns the result of the asynchronous operation.
32336	// If the operation has not completed it will return an error.
32337	Result func(VirtualClustersClient) (autorest.Response, error)
32338}
32339
32340// UnmarshalJSON is the custom unmarshaller for CreateFuture.
32341func (future *VirtualClustersDeleteFuture) UnmarshalJSON(body []byte) error {
32342	var azFuture azure.Future
32343	if err := json.Unmarshal(body, &azFuture); err != nil {
32344		return err
32345	}
32346	future.FutureAPI = &azFuture
32347	future.Result = future.result
32348	return nil
32349}
32350
32351// result is the default implementation for VirtualClustersDeleteFuture.Result.
32352func (future *VirtualClustersDeleteFuture) result(client VirtualClustersClient) (ar autorest.Response, err error) {
32353	var done bool
32354	done, err = future.DoneWithContext(context.Background(), client)
32355	if err != nil {
32356		err = autorest.NewErrorWithError(err, "sql.VirtualClustersDeleteFuture", "Result", future.Response(), "Polling failure")
32357		return
32358	}
32359	if !done {
32360		ar.Response = future.Response()
32361		err = azure.NewAsyncOpIncompleteError("sql.VirtualClustersDeleteFuture")
32362		return
32363	}
32364	ar.Response = future.Response()
32365	return
32366}
32367
32368// VirtualClustersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
32369// operation.
32370type VirtualClustersUpdateFuture struct {
32371	azure.FutureAPI
32372	// Result returns the result of the asynchronous operation.
32373	// If the operation has not completed it will return an error.
32374	Result func(VirtualClustersClient) (VirtualCluster, error)
32375}
32376
32377// UnmarshalJSON is the custom unmarshaller for CreateFuture.
32378func (future *VirtualClustersUpdateFuture) UnmarshalJSON(body []byte) error {
32379	var azFuture azure.Future
32380	if err := json.Unmarshal(body, &azFuture); err != nil {
32381		return err
32382	}
32383	future.FutureAPI = &azFuture
32384	future.Result = future.result
32385	return nil
32386}
32387
32388// result is the default implementation for VirtualClustersUpdateFuture.Result.
32389func (future *VirtualClustersUpdateFuture) result(client VirtualClustersClient) (vc VirtualCluster, err error) {
32390	var done bool
32391	done, err = future.DoneWithContext(context.Background(), client)
32392	if err != nil {
32393		err = autorest.NewErrorWithError(err, "sql.VirtualClustersUpdateFuture", "Result", future.Response(), "Polling failure")
32394		return
32395	}
32396	if !done {
32397		vc.Response.Response = future.Response()
32398		err = azure.NewAsyncOpIncompleteError("sql.VirtualClustersUpdateFuture")
32399		return
32400	}
32401	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
32402	if vc.Response.Response, err = future.GetResult(sender); err == nil && vc.Response.Response.StatusCode != http.StatusNoContent {
32403		vc, err = client.UpdateResponder(vc.Response.Response)
32404		if err != nil {
32405			err = autorest.NewErrorWithError(err, "sql.VirtualClustersUpdateFuture", "Result", vc.Response.Response, "Failure responding to request")
32406		}
32407	}
32408	return
32409}
32410
32411// VirtualClusterUpdate an update request for an Azure SQL Database virtual cluster.
32412type VirtualClusterUpdate struct {
32413	// VirtualClusterProperties - Resource properties.
32414	*VirtualClusterProperties `json:"properties,omitempty"`
32415	// Tags - Resource tags.
32416	Tags map[string]*string `json:"tags"`
32417}
32418
32419// MarshalJSON is the custom marshaler for VirtualClusterUpdate.
32420func (vcu VirtualClusterUpdate) MarshalJSON() ([]byte, error) {
32421	objectMap := make(map[string]interface{})
32422	if vcu.VirtualClusterProperties != nil {
32423		objectMap["properties"] = vcu.VirtualClusterProperties
32424	}
32425	if vcu.Tags != nil {
32426		objectMap["tags"] = vcu.Tags
32427	}
32428	return json.Marshal(objectMap)
32429}
32430
32431// UnmarshalJSON is the custom unmarshaler for VirtualClusterUpdate struct.
32432func (vcu *VirtualClusterUpdate) UnmarshalJSON(body []byte) error {
32433	var m map[string]*json.RawMessage
32434	err := json.Unmarshal(body, &m)
32435	if err != nil {
32436		return err
32437	}
32438	for k, v := range m {
32439		switch k {
32440		case "properties":
32441			if v != nil {
32442				var virtualClusterProperties VirtualClusterProperties
32443				err = json.Unmarshal(*v, &virtualClusterProperties)
32444				if err != nil {
32445					return err
32446				}
32447				vcu.VirtualClusterProperties = &virtualClusterProperties
32448			}
32449		case "tags":
32450			if v != nil {
32451				var tags map[string]*string
32452				err = json.Unmarshal(*v, &tags)
32453				if err != nil {
32454					return err
32455				}
32456				vcu.Tags = tags
32457			}
32458		}
32459	}
32460
32461	return nil
32462}
32463
32464// VirtualNetworkRule a virtual network rule.
32465type VirtualNetworkRule struct {
32466	autorest.Response `json:"-"`
32467	// VirtualNetworkRuleProperties - Resource properties.
32468	*VirtualNetworkRuleProperties `json:"properties,omitempty"`
32469	// ID - READ-ONLY; Resource ID.
32470	ID *string `json:"id,omitempty"`
32471	// Name - READ-ONLY; Resource name.
32472	Name *string `json:"name,omitempty"`
32473	// Type - READ-ONLY; Resource type.
32474	Type *string `json:"type,omitempty"`
32475}
32476
32477// MarshalJSON is the custom marshaler for VirtualNetworkRule.
32478func (vnr VirtualNetworkRule) MarshalJSON() ([]byte, error) {
32479	objectMap := make(map[string]interface{})
32480	if vnr.VirtualNetworkRuleProperties != nil {
32481		objectMap["properties"] = vnr.VirtualNetworkRuleProperties
32482	}
32483	return json.Marshal(objectMap)
32484}
32485
32486// UnmarshalJSON is the custom unmarshaler for VirtualNetworkRule struct.
32487func (vnr *VirtualNetworkRule) UnmarshalJSON(body []byte) error {
32488	var m map[string]*json.RawMessage
32489	err := json.Unmarshal(body, &m)
32490	if err != nil {
32491		return err
32492	}
32493	for k, v := range m {
32494		switch k {
32495		case "properties":
32496			if v != nil {
32497				var virtualNetworkRuleProperties VirtualNetworkRuleProperties
32498				err = json.Unmarshal(*v, &virtualNetworkRuleProperties)
32499				if err != nil {
32500					return err
32501				}
32502				vnr.VirtualNetworkRuleProperties = &virtualNetworkRuleProperties
32503			}
32504		case "id":
32505			if v != nil {
32506				var ID string
32507				err = json.Unmarshal(*v, &ID)
32508				if err != nil {
32509					return err
32510				}
32511				vnr.ID = &ID
32512			}
32513		case "name":
32514			if v != nil {
32515				var name string
32516				err = json.Unmarshal(*v, &name)
32517				if err != nil {
32518					return err
32519				}
32520				vnr.Name = &name
32521			}
32522		case "type":
32523			if v != nil {
32524				var typeVar string
32525				err = json.Unmarshal(*v, &typeVar)
32526				if err != nil {
32527					return err
32528				}
32529				vnr.Type = &typeVar
32530			}
32531		}
32532	}
32533
32534	return nil
32535}
32536
32537// VirtualNetworkRuleListResult a list of virtual network rules.
32538type VirtualNetworkRuleListResult struct {
32539	autorest.Response `json:"-"`
32540	// Value - READ-ONLY; Array of results.
32541	Value *[]VirtualNetworkRule `json:"value,omitempty"`
32542	// NextLink - READ-ONLY; Link to retrieve next page of results.
32543	NextLink *string `json:"nextLink,omitempty"`
32544}
32545
32546// MarshalJSON is the custom marshaler for VirtualNetworkRuleListResult.
32547func (vnrlr VirtualNetworkRuleListResult) MarshalJSON() ([]byte, error) {
32548	objectMap := make(map[string]interface{})
32549	return json.Marshal(objectMap)
32550}
32551
32552// VirtualNetworkRuleListResultIterator provides access to a complete listing of VirtualNetworkRule values.
32553type VirtualNetworkRuleListResultIterator struct {
32554	i    int
32555	page VirtualNetworkRuleListResultPage
32556}
32557
32558// NextWithContext advances to the next value.  If there was an error making
32559// the request the iterator does not advance and the error is returned.
32560func (iter *VirtualNetworkRuleListResultIterator) NextWithContext(ctx context.Context) (err error) {
32561	if tracing.IsEnabled() {
32562		ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkRuleListResultIterator.NextWithContext")
32563		defer func() {
32564			sc := -1
32565			if iter.Response().Response.Response != nil {
32566				sc = iter.Response().Response.Response.StatusCode
32567			}
32568			tracing.EndSpan(ctx, sc, err)
32569		}()
32570	}
32571	iter.i++
32572	if iter.i < len(iter.page.Values()) {
32573		return nil
32574	}
32575	err = iter.page.NextWithContext(ctx)
32576	if err != nil {
32577		iter.i--
32578		return err
32579	}
32580	iter.i = 0
32581	return nil
32582}
32583
32584// Next advances to the next value.  If there was an error making
32585// the request the iterator does not advance and the error is returned.
32586// Deprecated: Use NextWithContext() instead.
32587func (iter *VirtualNetworkRuleListResultIterator) Next() error {
32588	return iter.NextWithContext(context.Background())
32589}
32590
32591// NotDone returns true if the enumeration should be started or is not yet complete.
32592func (iter VirtualNetworkRuleListResultIterator) NotDone() bool {
32593	return iter.page.NotDone() && iter.i < len(iter.page.Values())
32594}
32595
32596// Response returns the raw server response from the last page request.
32597func (iter VirtualNetworkRuleListResultIterator) Response() VirtualNetworkRuleListResult {
32598	return iter.page.Response()
32599}
32600
32601// Value returns the current value or a zero-initialized value if the
32602// iterator has advanced beyond the end of the collection.
32603func (iter VirtualNetworkRuleListResultIterator) Value() VirtualNetworkRule {
32604	if !iter.page.NotDone() {
32605		return VirtualNetworkRule{}
32606	}
32607	return iter.page.Values()[iter.i]
32608}
32609
32610// Creates a new instance of the VirtualNetworkRuleListResultIterator type.
32611func NewVirtualNetworkRuleListResultIterator(page VirtualNetworkRuleListResultPage) VirtualNetworkRuleListResultIterator {
32612	return VirtualNetworkRuleListResultIterator{page: page}
32613}
32614
32615// IsEmpty returns true if the ListResult contains no values.
32616func (vnrlr VirtualNetworkRuleListResult) IsEmpty() bool {
32617	return vnrlr.Value == nil || len(*vnrlr.Value) == 0
32618}
32619
32620// hasNextLink returns true if the NextLink is not empty.
32621func (vnrlr VirtualNetworkRuleListResult) hasNextLink() bool {
32622	return vnrlr.NextLink != nil && len(*vnrlr.NextLink) != 0
32623}
32624
32625// virtualNetworkRuleListResultPreparer prepares a request to retrieve the next set of results.
32626// It returns nil if no more results exist.
32627func (vnrlr VirtualNetworkRuleListResult) virtualNetworkRuleListResultPreparer(ctx context.Context) (*http.Request, error) {
32628	if !vnrlr.hasNextLink() {
32629		return nil, nil
32630	}
32631	return autorest.Prepare((&http.Request{}).WithContext(ctx),
32632		autorest.AsJSON(),
32633		autorest.AsGet(),
32634		autorest.WithBaseURL(to.String(vnrlr.NextLink)))
32635}
32636
32637// VirtualNetworkRuleListResultPage contains a page of VirtualNetworkRule values.
32638type VirtualNetworkRuleListResultPage struct {
32639	fn    func(context.Context, VirtualNetworkRuleListResult) (VirtualNetworkRuleListResult, error)
32640	vnrlr VirtualNetworkRuleListResult
32641}
32642
32643// NextWithContext advances to the next page of values.  If there was an error making
32644// the request the page does not advance and the error is returned.
32645func (page *VirtualNetworkRuleListResultPage) NextWithContext(ctx context.Context) (err error) {
32646	if tracing.IsEnabled() {
32647		ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkRuleListResultPage.NextWithContext")
32648		defer func() {
32649			sc := -1
32650			if page.Response().Response.Response != nil {
32651				sc = page.Response().Response.Response.StatusCode
32652			}
32653			tracing.EndSpan(ctx, sc, err)
32654		}()
32655	}
32656	for {
32657		next, err := page.fn(ctx, page.vnrlr)
32658		if err != nil {
32659			return err
32660		}
32661		page.vnrlr = next
32662		if !next.hasNextLink() || !next.IsEmpty() {
32663			break
32664		}
32665	}
32666	return nil
32667}
32668
32669// Next advances to the next page of values.  If there was an error making
32670// the request the page does not advance and the error is returned.
32671// Deprecated: Use NextWithContext() instead.
32672func (page *VirtualNetworkRuleListResultPage) Next() error {
32673	return page.NextWithContext(context.Background())
32674}
32675
32676// NotDone returns true if the page enumeration should be started or is not yet complete.
32677func (page VirtualNetworkRuleListResultPage) NotDone() bool {
32678	return !page.vnrlr.IsEmpty()
32679}
32680
32681// Response returns the raw server response from the last page request.
32682func (page VirtualNetworkRuleListResultPage) Response() VirtualNetworkRuleListResult {
32683	return page.vnrlr
32684}
32685
32686// Values returns the slice of values for the current page or nil if there are no values.
32687func (page VirtualNetworkRuleListResultPage) Values() []VirtualNetworkRule {
32688	if page.vnrlr.IsEmpty() {
32689		return nil
32690	}
32691	return *page.vnrlr.Value
32692}
32693
32694// Creates a new instance of the VirtualNetworkRuleListResultPage type.
32695func NewVirtualNetworkRuleListResultPage(cur VirtualNetworkRuleListResult, getNextPage func(context.Context, VirtualNetworkRuleListResult) (VirtualNetworkRuleListResult, error)) VirtualNetworkRuleListResultPage {
32696	return VirtualNetworkRuleListResultPage{
32697		fn:    getNextPage,
32698		vnrlr: cur,
32699	}
32700}
32701
32702// VirtualNetworkRuleProperties properties of a virtual network rule.
32703type VirtualNetworkRuleProperties struct {
32704	// VirtualNetworkSubnetID - The ARM resource id of the virtual network subnet.
32705	VirtualNetworkSubnetID *string `json:"virtualNetworkSubnetId,omitempty"`
32706	// IgnoreMissingVnetServiceEndpoint - Create firewall rule before the virtual network has vnet service endpoint enabled.
32707	IgnoreMissingVnetServiceEndpoint *bool `json:"ignoreMissingVnetServiceEndpoint,omitempty"`
32708	// State - READ-ONLY; Virtual Network Rule State. Possible values include: 'VirtualNetworkRuleStateInitializing', 'VirtualNetworkRuleStateInProgress', 'VirtualNetworkRuleStateReady', 'VirtualNetworkRuleStateFailed', 'VirtualNetworkRuleStateDeleting', 'VirtualNetworkRuleStateUnknown'
32709	State VirtualNetworkRuleState `json:"state,omitempty"`
32710}
32711
32712// MarshalJSON is the custom marshaler for VirtualNetworkRuleProperties.
32713func (vnrp VirtualNetworkRuleProperties) MarshalJSON() ([]byte, error) {
32714	objectMap := make(map[string]interface{})
32715	if vnrp.VirtualNetworkSubnetID != nil {
32716		objectMap["virtualNetworkSubnetId"] = vnrp.VirtualNetworkSubnetID
32717	}
32718	if vnrp.IgnoreMissingVnetServiceEndpoint != nil {
32719		objectMap["ignoreMissingVnetServiceEndpoint"] = vnrp.IgnoreMissingVnetServiceEndpoint
32720	}
32721	return json.Marshal(objectMap)
32722}
32723
32724// VirtualNetworkRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
32725// long-running operation.
32726type VirtualNetworkRulesCreateOrUpdateFuture struct {
32727	azure.FutureAPI
32728	// Result returns the result of the asynchronous operation.
32729	// If the operation has not completed it will return an error.
32730	Result func(VirtualNetworkRulesClient) (VirtualNetworkRule, error)
32731}
32732
32733// UnmarshalJSON is the custom unmarshaller for CreateFuture.
32734func (future *VirtualNetworkRulesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
32735	var azFuture azure.Future
32736	if err := json.Unmarshal(body, &azFuture); err != nil {
32737		return err
32738	}
32739	future.FutureAPI = &azFuture
32740	future.Result = future.result
32741	return nil
32742}
32743
32744// result is the default implementation for VirtualNetworkRulesCreateOrUpdateFuture.Result.
32745func (future *VirtualNetworkRulesCreateOrUpdateFuture) result(client VirtualNetworkRulesClient) (vnr VirtualNetworkRule, err error) {
32746	var done bool
32747	done, err = future.DoneWithContext(context.Background(), client)
32748	if err != nil {
32749		err = autorest.NewErrorWithError(err, "sql.VirtualNetworkRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
32750		return
32751	}
32752	if !done {
32753		vnr.Response.Response = future.Response()
32754		err = azure.NewAsyncOpIncompleteError("sql.VirtualNetworkRulesCreateOrUpdateFuture")
32755		return
32756	}
32757	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
32758	if vnr.Response.Response, err = future.GetResult(sender); err == nil && vnr.Response.Response.StatusCode != http.StatusNoContent {
32759		vnr, err = client.CreateOrUpdateResponder(vnr.Response.Response)
32760		if err != nil {
32761			err = autorest.NewErrorWithError(err, "sql.VirtualNetworkRulesCreateOrUpdateFuture", "Result", vnr.Response.Response, "Failure responding to request")
32762		}
32763	}
32764	return
32765}
32766
32767// VirtualNetworkRulesDeleteFuture an abstraction for monitoring and retrieving the results of a
32768// long-running operation.
32769type VirtualNetworkRulesDeleteFuture struct {
32770	azure.FutureAPI
32771	// Result returns the result of the asynchronous operation.
32772	// If the operation has not completed it will return an error.
32773	Result func(VirtualNetworkRulesClient) (autorest.Response, error)
32774}
32775
32776// UnmarshalJSON is the custom unmarshaller for CreateFuture.
32777func (future *VirtualNetworkRulesDeleteFuture) UnmarshalJSON(body []byte) error {
32778	var azFuture azure.Future
32779	if err := json.Unmarshal(body, &azFuture); err != nil {
32780		return err
32781	}
32782	future.FutureAPI = &azFuture
32783	future.Result = future.result
32784	return nil
32785}
32786
32787// result is the default implementation for VirtualNetworkRulesDeleteFuture.Result.
32788func (future *VirtualNetworkRulesDeleteFuture) result(client VirtualNetworkRulesClient) (ar autorest.Response, err error) {
32789	var done bool
32790	done, err = future.DoneWithContext(context.Background(), client)
32791	if err != nil {
32792		err = autorest.NewErrorWithError(err, "sql.VirtualNetworkRulesDeleteFuture", "Result", future.Response(), "Polling failure")
32793		return
32794	}
32795	if !done {
32796		ar.Response = future.Response()
32797		err = azure.NewAsyncOpIncompleteError("sql.VirtualNetworkRulesDeleteFuture")
32798		return
32799	}
32800	ar.Response = future.Response()
32801	return
32802}
32803
32804// VulnerabilityAssessmentRecurringScansProperties properties of a Vulnerability Assessment recurring
32805// scans.
32806type VulnerabilityAssessmentRecurringScansProperties struct {
32807	// IsEnabled - Recurring scans state.
32808	IsEnabled *bool `json:"isEnabled,omitempty"`
32809	// EmailSubscriptionAdmins - Specifies that the schedule scan notification will be is sent to the subscription administrators.
32810	EmailSubscriptionAdmins *bool `json:"emailSubscriptionAdmins,omitempty"`
32811	// Emails - Specifies an array of e-mail addresses to which the scan notification is sent.
32812	Emails *[]string `json:"emails,omitempty"`
32813}
32814
32815// VulnerabilityAssessmentScanError properties of a vulnerability assessment scan error.
32816type VulnerabilityAssessmentScanError struct {
32817	// Code - READ-ONLY; The error code.
32818	Code *string `json:"code,omitempty"`
32819	// Message - READ-ONLY; The error message.
32820	Message *string `json:"message,omitempty"`
32821}
32822
32823// MarshalJSON is the custom marshaler for VulnerabilityAssessmentScanError.
32824func (vase VulnerabilityAssessmentScanError) MarshalJSON() ([]byte, error) {
32825	objectMap := make(map[string]interface{})
32826	return json.Marshal(objectMap)
32827}
32828
32829// VulnerabilityAssessmentScanRecord a vulnerability assessment scan record.
32830type VulnerabilityAssessmentScanRecord struct {
32831	autorest.Response `json:"-"`
32832	// VulnerabilityAssessmentScanRecordProperties - Resource properties.
32833	*VulnerabilityAssessmentScanRecordProperties `json:"properties,omitempty"`
32834	// ID - READ-ONLY; Resource ID.
32835	ID *string `json:"id,omitempty"`
32836	// Name - READ-ONLY; Resource name.
32837	Name *string `json:"name,omitempty"`
32838	// Type - READ-ONLY; Resource type.
32839	Type *string `json:"type,omitempty"`
32840}
32841
32842// MarshalJSON is the custom marshaler for VulnerabilityAssessmentScanRecord.
32843func (vasr VulnerabilityAssessmentScanRecord) MarshalJSON() ([]byte, error) {
32844	objectMap := make(map[string]interface{})
32845	if vasr.VulnerabilityAssessmentScanRecordProperties != nil {
32846		objectMap["properties"] = vasr.VulnerabilityAssessmentScanRecordProperties
32847	}
32848	return json.Marshal(objectMap)
32849}
32850
32851// UnmarshalJSON is the custom unmarshaler for VulnerabilityAssessmentScanRecord struct.
32852func (vasr *VulnerabilityAssessmentScanRecord) UnmarshalJSON(body []byte) error {
32853	var m map[string]*json.RawMessage
32854	err := json.Unmarshal(body, &m)
32855	if err != nil {
32856		return err
32857	}
32858	for k, v := range m {
32859		switch k {
32860		case "properties":
32861			if v != nil {
32862				var vulnerabilityAssessmentScanRecordProperties VulnerabilityAssessmentScanRecordProperties
32863				err = json.Unmarshal(*v, &vulnerabilityAssessmentScanRecordProperties)
32864				if err != nil {
32865					return err
32866				}
32867				vasr.VulnerabilityAssessmentScanRecordProperties = &vulnerabilityAssessmentScanRecordProperties
32868			}
32869		case "id":
32870			if v != nil {
32871				var ID string
32872				err = json.Unmarshal(*v, &ID)
32873				if err != nil {
32874					return err
32875				}
32876				vasr.ID = &ID
32877			}
32878		case "name":
32879			if v != nil {
32880				var name string
32881				err = json.Unmarshal(*v, &name)
32882				if err != nil {
32883					return err
32884				}
32885				vasr.Name = &name
32886			}
32887		case "type":
32888			if v != nil {
32889				var typeVar string
32890				err = json.Unmarshal(*v, &typeVar)
32891				if err != nil {
32892					return err
32893				}
32894				vasr.Type = &typeVar
32895			}
32896		}
32897	}
32898
32899	return nil
32900}
32901
32902// VulnerabilityAssessmentScanRecordListResult a list of vulnerability assessment scan records.
32903type VulnerabilityAssessmentScanRecordListResult struct {
32904	autorest.Response `json:"-"`
32905	// Value - READ-ONLY; Array of results.
32906	Value *[]VulnerabilityAssessmentScanRecord `json:"value,omitempty"`
32907	// NextLink - READ-ONLY; Link to retrieve next page of results.
32908	NextLink *string `json:"nextLink,omitempty"`
32909}
32910
32911// MarshalJSON is the custom marshaler for VulnerabilityAssessmentScanRecordListResult.
32912func (vasrlr VulnerabilityAssessmentScanRecordListResult) MarshalJSON() ([]byte, error) {
32913	objectMap := make(map[string]interface{})
32914	return json.Marshal(objectMap)
32915}
32916
32917// VulnerabilityAssessmentScanRecordListResultIterator provides access to a complete listing of
32918// VulnerabilityAssessmentScanRecord values.
32919type VulnerabilityAssessmentScanRecordListResultIterator struct {
32920	i    int
32921	page VulnerabilityAssessmentScanRecordListResultPage
32922}
32923
32924// NextWithContext advances to the next value.  If there was an error making
32925// the request the iterator does not advance and the error is returned.
32926func (iter *VulnerabilityAssessmentScanRecordListResultIterator) NextWithContext(ctx context.Context) (err error) {
32927	if tracing.IsEnabled() {
32928		ctx = tracing.StartSpan(ctx, fqdn+"/VulnerabilityAssessmentScanRecordListResultIterator.NextWithContext")
32929		defer func() {
32930			sc := -1
32931			if iter.Response().Response.Response != nil {
32932				sc = iter.Response().Response.Response.StatusCode
32933			}
32934			tracing.EndSpan(ctx, sc, err)
32935		}()
32936	}
32937	iter.i++
32938	if iter.i < len(iter.page.Values()) {
32939		return nil
32940	}
32941	err = iter.page.NextWithContext(ctx)
32942	if err != nil {
32943		iter.i--
32944		return err
32945	}
32946	iter.i = 0
32947	return nil
32948}
32949
32950// Next advances to the next value.  If there was an error making
32951// the request the iterator does not advance and the error is returned.
32952// Deprecated: Use NextWithContext() instead.
32953func (iter *VulnerabilityAssessmentScanRecordListResultIterator) Next() error {
32954	return iter.NextWithContext(context.Background())
32955}
32956
32957// NotDone returns true if the enumeration should be started or is not yet complete.
32958func (iter VulnerabilityAssessmentScanRecordListResultIterator) NotDone() bool {
32959	return iter.page.NotDone() && iter.i < len(iter.page.Values())
32960}
32961
32962// Response returns the raw server response from the last page request.
32963func (iter VulnerabilityAssessmentScanRecordListResultIterator) Response() VulnerabilityAssessmentScanRecordListResult {
32964	return iter.page.Response()
32965}
32966
32967// Value returns the current value or a zero-initialized value if the
32968// iterator has advanced beyond the end of the collection.
32969func (iter VulnerabilityAssessmentScanRecordListResultIterator) Value() VulnerabilityAssessmentScanRecord {
32970	if !iter.page.NotDone() {
32971		return VulnerabilityAssessmentScanRecord{}
32972	}
32973	return iter.page.Values()[iter.i]
32974}
32975
32976// Creates a new instance of the VulnerabilityAssessmentScanRecordListResultIterator type.
32977func NewVulnerabilityAssessmentScanRecordListResultIterator(page VulnerabilityAssessmentScanRecordListResultPage) VulnerabilityAssessmentScanRecordListResultIterator {
32978	return VulnerabilityAssessmentScanRecordListResultIterator{page: page}
32979}
32980
32981// IsEmpty returns true if the ListResult contains no values.
32982func (vasrlr VulnerabilityAssessmentScanRecordListResult) IsEmpty() bool {
32983	return vasrlr.Value == nil || len(*vasrlr.Value) == 0
32984}
32985
32986// hasNextLink returns true if the NextLink is not empty.
32987func (vasrlr VulnerabilityAssessmentScanRecordListResult) hasNextLink() bool {
32988	return vasrlr.NextLink != nil && len(*vasrlr.NextLink) != 0
32989}
32990
32991// vulnerabilityAssessmentScanRecordListResultPreparer prepares a request to retrieve the next set of results.
32992// It returns nil if no more results exist.
32993func (vasrlr VulnerabilityAssessmentScanRecordListResult) vulnerabilityAssessmentScanRecordListResultPreparer(ctx context.Context) (*http.Request, error) {
32994	if !vasrlr.hasNextLink() {
32995		return nil, nil
32996	}
32997	return autorest.Prepare((&http.Request{}).WithContext(ctx),
32998		autorest.AsJSON(),
32999		autorest.AsGet(),
33000		autorest.WithBaseURL(to.String(vasrlr.NextLink)))
33001}
33002
33003// VulnerabilityAssessmentScanRecordListResultPage contains a page of VulnerabilityAssessmentScanRecord
33004// values.
33005type VulnerabilityAssessmentScanRecordListResultPage struct {
33006	fn     func(context.Context, VulnerabilityAssessmentScanRecordListResult) (VulnerabilityAssessmentScanRecordListResult, error)
33007	vasrlr VulnerabilityAssessmentScanRecordListResult
33008}
33009
33010// NextWithContext advances to the next page of values.  If there was an error making
33011// the request the page does not advance and the error is returned.
33012func (page *VulnerabilityAssessmentScanRecordListResultPage) NextWithContext(ctx context.Context) (err error) {
33013	if tracing.IsEnabled() {
33014		ctx = tracing.StartSpan(ctx, fqdn+"/VulnerabilityAssessmentScanRecordListResultPage.NextWithContext")
33015		defer func() {
33016			sc := -1
33017			if page.Response().Response.Response != nil {
33018				sc = page.Response().Response.Response.StatusCode
33019			}
33020			tracing.EndSpan(ctx, sc, err)
33021		}()
33022	}
33023	for {
33024		next, err := page.fn(ctx, page.vasrlr)
33025		if err != nil {
33026			return err
33027		}
33028		page.vasrlr = next
33029		if !next.hasNextLink() || !next.IsEmpty() {
33030			break
33031		}
33032	}
33033	return nil
33034}
33035
33036// Next advances to the next page of values.  If there was an error making
33037// the request the page does not advance and the error is returned.
33038// Deprecated: Use NextWithContext() instead.
33039func (page *VulnerabilityAssessmentScanRecordListResultPage) Next() error {
33040	return page.NextWithContext(context.Background())
33041}
33042
33043// NotDone returns true if the page enumeration should be started or is not yet complete.
33044func (page VulnerabilityAssessmentScanRecordListResultPage) NotDone() bool {
33045	return !page.vasrlr.IsEmpty()
33046}
33047
33048// Response returns the raw server response from the last page request.
33049func (page VulnerabilityAssessmentScanRecordListResultPage) Response() VulnerabilityAssessmentScanRecordListResult {
33050	return page.vasrlr
33051}
33052
33053// Values returns the slice of values for the current page or nil if there are no values.
33054func (page VulnerabilityAssessmentScanRecordListResultPage) Values() []VulnerabilityAssessmentScanRecord {
33055	if page.vasrlr.IsEmpty() {
33056		return nil
33057	}
33058	return *page.vasrlr.Value
33059}
33060
33061// Creates a new instance of the VulnerabilityAssessmentScanRecordListResultPage type.
33062func NewVulnerabilityAssessmentScanRecordListResultPage(cur VulnerabilityAssessmentScanRecordListResult, getNextPage func(context.Context, VulnerabilityAssessmentScanRecordListResult) (VulnerabilityAssessmentScanRecordListResult, error)) VulnerabilityAssessmentScanRecordListResultPage {
33063	return VulnerabilityAssessmentScanRecordListResultPage{
33064		fn:     getNextPage,
33065		vasrlr: cur,
33066	}
33067}
33068
33069// VulnerabilityAssessmentScanRecordProperties properties of a vulnerability assessment scan record.
33070type VulnerabilityAssessmentScanRecordProperties struct {
33071	// ScanID - READ-ONLY; The scan ID.
33072	ScanID *string `json:"scanId,omitempty"`
33073	// TriggerType - READ-ONLY; The scan trigger type. Possible values include: 'VulnerabilityAssessmentScanTriggerTypeOnDemand', 'VulnerabilityAssessmentScanTriggerTypeRecurring'
33074	TriggerType VulnerabilityAssessmentScanTriggerType `json:"triggerType,omitempty"`
33075	// State - READ-ONLY; The scan status. Possible values include: 'VulnerabilityAssessmentScanStatePassed', 'VulnerabilityAssessmentScanStateFailed', 'VulnerabilityAssessmentScanStateFailedToRun', 'VulnerabilityAssessmentScanStateInProgress'
33076	State VulnerabilityAssessmentScanState `json:"state,omitempty"`
33077	// StartTime - READ-ONLY; The scan start time (UTC).
33078	StartTime *date.Time `json:"startTime,omitempty"`
33079	// EndTime - READ-ONLY; The scan end time (UTC).
33080	EndTime *date.Time `json:"endTime,omitempty"`
33081	// Errors - READ-ONLY; The scan errors.
33082	Errors *[]VulnerabilityAssessmentScanError `json:"errors,omitempty"`
33083	// StorageContainerPath - READ-ONLY; The scan results storage container path.
33084	StorageContainerPath *string `json:"storageContainerPath,omitempty"`
33085	// NumberOfFailedSecurityChecks - READ-ONLY; The number of failed security checks.
33086	NumberOfFailedSecurityChecks *int32 `json:"numberOfFailedSecurityChecks,omitempty"`
33087}
33088
33089// MarshalJSON is the custom marshaler for VulnerabilityAssessmentScanRecordProperties.
33090func (vasrp VulnerabilityAssessmentScanRecordProperties) MarshalJSON() ([]byte, error) {
33091	objectMap := make(map[string]interface{})
33092	return json.Marshal(objectMap)
33093}
33094
33095// WorkloadClassifier workload classifier operations for a data warehouse
33096type WorkloadClassifier struct {
33097	autorest.Response `json:"-"`
33098	// WorkloadClassifierProperties - Resource properties.
33099	*WorkloadClassifierProperties `json:"properties,omitempty"`
33100	// ID - READ-ONLY; Resource ID.
33101	ID *string `json:"id,omitempty"`
33102	// Name - READ-ONLY; Resource name.
33103	Name *string `json:"name,omitempty"`
33104	// Type - READ-ONLY; Resource type.
33105	Type *string `json:"type,omitempty"`
33106}
33107
33108// MarshalJSON is the custom marshaler for WorkloadClassifier.
33109func (wc WorkloadClassifier) MarshalJSON() ([]byte, error) {
33110	objectMap := make(map[string]interface{})
33111	if wc.WorkloadClassifierProperties != nil {
33112		objectMap["properties"] = wc.WorkloadClassifierProperties
33113	}
33114	return json.Marshal(objectMap)
33115}
33116
33117// UnmarshalJSON is the custom unmarshaler for WorkloadClassifier struct.
33118func (wc *WorkloadClassifier) UnmarshalJSON(body []byte) error {
33119	var m map[string]*json.RawMessage
33120	err := json.Unmarshal(body, &m)
33121	if err != nil {
33122		return err
33123	}
33124	for k, v := range m {
33125		switch k {
33126		case "properties":
33127			if v != nil {
33128				var workloadClassifierProperties WorkloadClassifierProperties
33129				err = json.Unmarshal(*v, &workloadClassifierProperties)
33130				if err != nil {
33131					return err
33132				}
33133				wc.WorkloadClassifierProperties = &workloadClassifierProperties
33134			}
33135		case "id":
33136			if v != nil {
33137				var ID string
33138				err = json.Unmarshal(*v, &ID)
33139				if err != nil {
33140					return err
33141				}
33142				wc.ID = &ID
33143			}
33144		case "name":
33145			if v != nil {
33146				var name string
33147				err = json.Unmarshal(*v, &name)
33148				if err != nil {
33149					return err
33150				}
33151				wc.Name = &name
33152			}
33153		case "type":
33154			if v != nil {
33155				var typeVar string
33156				err = json.Unmarshal(*v, &typeVar)
33157				if err != nil {
33158					return err
33159				}
33160				wc.Type = &typeVar
33161			}
33162		}
33163	}
33164
33165	return nil
33166}
33167
33168// WorkloadClassifierListResult a list of workload classifiers for a workload group.
33169type WorkloadClassifierListResult struct {
33170	autorest.Response `json:"-"`
33171	// Value - READ-ONLY; Array of results.
33172	Value *[]WorkloadClassifier `json:"value,omitempty"`
33173	// NextLink - READ-ONLY; Link to retrieve next page of results.
33174	NextLink *string `json:"nextLink,omitempty"`
33175}
33176
33177// MarshalJSON is the custom marshaler for WorkloadClassifierListResult.
33178func (wclr WorkloadClassifierListResult) MarshalJSON() ([]byte, error) {
33179	objectMap := make(map[string]interface{})
33180	return json.Marshal(objectMap)
33181}
33182
33183// WorkloadClassifierListResultIterator provides access to a complete listing of WorkloadClassifier values.
33184type WorkloadClassifierListResultIterator struct {
33185	i    int
33186	page WorkloadClassifierListResultPage
33187}
33188
33189// NextWithContext advances to the next value.  If there was an error making
33190// the request the iterator does not advance and the error is returned.
33191func (iter *WorkloadClassifierListResultIterator) NextWithContext(ctx context.Context) (err error) {
33192	if tracing.IsEnabled() {
33193		ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadClassifierListResultIterator.NextWithContext")
33194		defer func() {
33195			sc := -1
33196			if iter.Response().Response.Response != nil {
33197				sc = iter.Response().Response.Response.StatusCode
33198			}
33199			tracing.EndSpan(ctx, sc, err)
33200		}()
33201	}
33202	iter.i++
33203	if iter.i < len(iter.page.Values()) {
33204		return nil
33205	}
33206	err = iter.page.NextWithContext(ctx)
33207	if err != nil {
33208		iter.i--
33209		return err
33210	}
33211	iter.i = 0
33212	return nil
33213}
33214
33215// Next advances to the next value.  If there was an error making
33216// the request the iterator does not advance and the error is returned.
33217// Deprecated: Use NextWithContext() instead.
33218func (iter *WorkloadClassifierListResultIterator) Next() error {
33219	return iter.NextWithContext(context.Background())
33220}
33221
33222// NotDone returns true if the enumeration should be started or is not yet complete.
33223func (iter WorkloadClassifierListResultIterator) NotDone() bool {
33224	return iter.page.NotDone() && iter.i < len(iter.page.Values())
33225}
33226
33227// Response returns the raw server response from the last page request.
33228func (iter WorkloadClassifierListResultIterator) Response() WorkloadClassifierListResult {
33229	return iter.page.Response()
33230}
33231
33232// Value returns the current value or a zero-initialized value if the
33233// iterator has advanced beyond the end of the collection.
33234func (iter WorkloadClassifierListResultIterator) Value() WorkloadClassifier {
33235	if !iter.page.NotDone() {
33236		return WorkloadClassifier{}
33237	}
33238	return iter.page.Values()[iter.i]
33239}
33240
33241// Creates a new instance of the WorkloadClassifierListResultIterator type.
33242func NewWorkloadClassifierListResultIterator(page WorkloadClassifierListResultPage) WorkloadClassifierListResultIterator {
33243	return WorkloadClassifierListResultIterator{page: page}
33244}
33245
33246// IsEmpty returns true if the ListResult contains no values.
33247func (wclr WorkloadClassifierListResult) IsEmpty() bool {
33248	return wclr.Value == nil || len(*wclr.Value) == 0
33249}
33250
33251// hasNextLink returns true if the NextLink is not empty.
33252func (wclr WorkloadClassifierListResult) hasNextLink() bool {
33253	return wclr.NextLink != nil && len(*wclr.NextLink) != 0
33254}
33255
33256// workloadClassifierListResultPreparer prepares a request to retrieve the next set of results.
33257// It returns nil if no more results exist.
33258func (wclr WorkloadClassifierListResult) workloadClassifierListResultPreparer(ctx context.Context) (*http.Request, error) {
33259	if !wclr.hasNextLink() {
33260		return nil, nil
33261	}
33262	return autorest.Prepare((&http.Request{}).WithContext(ctx),
33263		autorest.AsJSON(),
33264		autorest.AsGet(),
33265		autorest.WithBaseURL(to.String(wclr.NextLink)))
33266}
33267
33268// WorkloadClassifierListResultPage contains a page of WorkloadClassifier values.
33269type WorkloadClassifierListResultPage struct {
33270	fn   func(context.Context, WorkloadClassifierListResult) (WorkloadClassifierListResult, error)
33271	wclr WorkloadClassifierListResult
33272}
33273
33274// NextWithContext advances to the next page of values.  If there was an error making
33275// the request the page does not advance and the error is returned.
33276func (page *WorkloadClassifierListResultPage) NextWithContext(ctx context.Context) (err error) {
33277	if tracing.IsEnabled() {
33278		ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadClassifierListResultPage.NextWithContext")
33279		defer func() {
33280			sc := -1
33281			if page.Response().Response.Response != nil {
33282				sc = page.Response().Response.Response.StatusCode
33283			}
33284			tracing.EndSpan(ctx, sc, err)
33285		}()
33286	}
33287	for {
33288		next, err := page.fn(ctx, page.wclr)
33289		if err != nil {
33290			return err
33291		}
33292		page.wclr = next
33293		if !next.hasNextLink() || !next.IsEmpty() {
33294			break
33295		}
33296	}
33297	return nil
33298}
33299
33300// Next advances to the next page of values.  If there was an error making
33301// the request the page does not advance and the error is returned.
33302// Deprecated: Use NextWithContext() instead.
33303func (page *WorkloadClassifierListResultPage) Next() error {
33304	return page.NextWithContext(context.Background())
33305}
33306
33307// NotDone returns true if the page enumeration should be started or is not yet complete.
33308func (page WorkloadClassifierListResultPage) NotDone() bool {
33309	return !page.wclr.IsEmpty()
33310}
33311
33312// Response returns the raw server response from the last page request.
33313func (page WorkloadClassifierListResultPage) Response() WorkloadClassifierListResult {
33314	return page.wclr
33315}
33316
33317// Values returns the slice of values for the current page or nil if there are no values.
33318func (page WorkloadClassifierListResultPage) Values() []WorkloadClassifier {
33319	if page.wclr.IsEmpty() {
33320		return nil
33321	}
33322	return *page.wclr.Value
33323}
33324
33325// Creates a new instance of the WorkloadClassifierListResultPage type.
33326func NewWorkloadClassifierListResultPage(cur WorkloadClassifierListResult, getNextPage func(context.Context, WorkloadClassifierListResult) (WorkloadClassifierListResult, error)) WorkloadClassifierListResultPage {
33327	return WorkloadClassifierListResultPage{
33328		fn:   getNextPage,
33329		wclr: cur,
33330	}
33331}
33332
33333// WorkloadClassifierProperties workload classifier definition. For more information look at
33334// sys.workload_management_workload_classifiers (DMV).
33335type WorkloadClassifierProperties struct {
33336	// MemberName - The workload classifier member name.
33337	MemberName *string `json:"memberName,omitempty"`
33338	// Label - The workload classifier label.
33339	Label *string `json:"label,omitempty"`
33340	// Context - The workload classifier context.
33341	Context *string `json:"context,omitempty"`
33342	// StartTime - The workload classifier start time for classification.
33343	StartTime *string `json:"startTime,omitempty"`
33344	// EndTime - The workload classifier end time for classification.
33345	EndTime *string `json:"endTime,omitempty"`
33346	// Importance - The workload classifier importance.
33347	Importance *string `json:"importance,omitempty"`
33348}
33349
33350// WorkloadClassifiersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
33351// long-running operation.
33352type WorkloadClassifiersCreateOrUpdateFuture struct {
33353	azure.FutureAPI
33354	// Result returns the result of the asynchronous operation.
33355	// If the operation has not completed it will return an error.
33356	Result func(WorkloadClassifiersClient) (WorkloadClassifier, error)
33357}
33358
33359// UnmarshalJSON is the custom unmarshaller for CreateFuture.
33360func (future *WorkloadClassifiersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
33361	var azFuture azure.Future
33362	if err := json.Unmarshal(body, &azFuture); err != nil {
33363		return err
33364	}
33365	future.FutureAPI = &azFuture
33366	future.Result = future.result
33367	return nil
33368}
33369
33370// result is the default implementation for WorkloadClassifiersCreateOrUpdateFuture.Result.
33371func (future *WorkloadClassifiersCreateOrUpdateFuture) result(client WorkloadClassifiersClient) (wc WorkloadClassifier, err error) {
33372	var done bool
33373	done, err = future.DoneWithContext(context.Background(), client)
33374	if err != nil {
33375		err = autorest.NewErrorWithError(err, "sql.WorkloadClassifiersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
33376		return
33377	}
33378	if !done {
33379		wc.Response.Response = future.Response()
33380		err = azure.NewAsyncOpIncompleteError("sql.WorkloadClassifiersCreateOrUpdateFuture")
33381		return
33382	}
33383	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
33384	if wc.Response.Response, err = future.GetResult(sender); err == nil && wc.Response.Response.StatusCode != http.StatusNoContent {
33385		wc, err = client.CreateOrUpdateResponder(wc.Response.Response)
33386		if err != nil {
33387			err = autorest.NewErrorWithError(err, "sql.WorkloadClassifiersCreateOrUpdateFuture", "Result", wc.Response.Response, "Failure responding to request")
33388		}
33389	}
33390	return
33391}
33392
33393// WorkloadClassifiersDeleteFuture an abstraction for monitoring and retrieving the results of a
33394// long-running operation.
33395type WorkloadClassifiersDeleteFuture struct {
33396	azure.FutureAPI
33397	// Result returns the result of the asynchronous operation.
33398	// If the operation has not completed it will return an error.
33399	Result func(WorkloadClassifiersClient) (autorest.Response, error)
33400}
33401
33402// UnmarshalJSON is the custom unmarshaller for CreateFuture.
33403func (future *WorkloadClassifiersDeleteFuture) UnmarshalJSON(body []byte) error {
33404	var azFuture azure.Future
33405	if err := json.Unmarshal(body, &azFuture); err != nil {
33406		return err
33407	}
33408	future.FutureAPI = &azFuture
33409	future.Result = future.result
33410	return nil
33411}
33412
33413// result is the default implementation for WorkloadClassifiersDeleteFuture.Result.
33414func (future *WorkloadClassifiersDeleteFuture) result(client WorkloadClassifiersClient) (ar autorest.Response, err error) {
33415	var done bool
33416	done, err = future.DoneWithContext(context.Background(), client)
33417	if err != nil {
33418		err = autorest.NewErrorWithError(err, "sql.WorkloadClassifiersDeleteFuture", "Result", future.Response(), "Polling failure")
33419		return
33420	}
33421	if !done {
33422		ar.Response = future.Response()
33423		err = azure.NewAsyncOpIncompleteError("sql.WorkloadClassifiersDeleteFuture")
33424		return
33425	}
33426	ar.Response = future.Response()
33427	return
33428}
33429
33430// WorkloadGroup workload group operations for a data warehouse
33431type WorkloadGroup struct {
33432	autorest.Response `json:"-"`
33433	// WorkloadGroupProperties - Resource properties.
33434	*WorkloadGroupProperties `json:"properties,omitempty"`
33435	// ID - READ-ONLY; Resource ID.
33436	ID *string `json:"id,omitempty"`
33437	// Name - READ-ONLY; Resource name.
33438	Name *string `json:"name,omitempty"`
33439	// Type - READ-ONLY; Resource type.
33440	Type *string `json:"type,omitempty"`
33441}
33442
33443// MarshalJSON is the custom marshaler for WorkloadGroup.
33444func (wg WorkloadGroup) MarshalJSON() ([]byte, error) {
33445	objectMap := make(map[string]interface{})
33446	if wg.WorkloadGroupProperties != nil {
33447		objectMap["properties"] = wg.WorkloadGroupProperties
33448	}
33449	return json.Marshal(objectMap)
33450}
33451
33452// UnmarshalJSON is the custom unmarshaler for WorkloadGroup struct.
33453func (wg *WorkloadGroup) UnmarshalJSON(body []byte) error {
33454	var m map[string]*json.RawMessage
33455	err := json.Unmarshal(body, &m)
33456	if err != nil {
33457		return err
33458	}
33459	for k, v := range m {
33460		switch k {
33461		case "properties":
33462			if v != nil {
33463				var workloadGroupProperties WorkloadGroupProperties
33464				err = json.Unmarshal(*v, &workloadGroupProperties)
33465				if err != nil {
33466					return err
33467				}
33468				wg.WorkloadGroupProperties = &workloadGroupProperties
33469			}
33470		case "id":
33471			if v != nil {
33472				var ID string
33473				err = json.Unmarshal(*v, &ID)
33474				if err != nil {
33475					return err
33476				}
33477				wg.ID = &ID
33478			}
33479		case "name":
33480			if v != nil {
33481				var name string
33482				err = json.Unmarshal(*v, &name)
33483				if err != nil {
33484					return err
33485				}
33486				wg.Name = &name
33487			}
33488		case "type":
33489			if v != nil {
33490				var typeVar string
33491				err = json.Unmarshal(*v, &typeVar)
33492				if err != nil {
33493					return err
33494				}
33495				wg.Type = &typeVar
33496			}
33497		}
33498	}
33499
33500	return nil
33501}
33502
33503// WorkloadGroupListResult a list of workload groups.
33504type WorkloadGroupListResult struct {
33505	autorest.Response `json:"-"`
33506	// Value - READ-ONLY; Array of results.
33507	Value *[]WorkloadGroup `json:"value,omitempty"`
33508	// NextLink - READ-ONLY; Link to retrieve next page of results.
33509	NextLink *string `json:"nextLink,omitempty"`
33510}
33511
33512// MarshalJSON is the custom marshaler for WorkloadGroupListResult.
33513func (wglr WorkloadGroupListResult) MarshalJSON() ([]byte, error) {
33514	objectMap := make(map[string]interface{})
33515	return json.Marshal(objectMap)
33516}
33517
33518// WorkloadGroupListResultIterator provides access to a complete listing of WorkloadGroup values.
33519type WorkloadGroupListResultIterator struct {
33520	i    int
33521	page WorkloadGroupListResultPage
33522}
33523
33524// NextWithContext advances to the next value.  If there was an error making
33525// the request the iterator does not advance and the error is returned.
33526func (iter *WorkloadGroupListResultIterator) NextWithContext(ctx context.Context) (err error) {
33527	if tracing.IsEnabled() {
33528		ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadGroupListResultIterator.NextWithContext")
33529		defer func() {
33530			sc := -1
33531			if iter.Response().Response.Response != nil {
33532				sc = iter.Response().Response.Response.StatusCode
33533			}
33534			tracing.EndSpan(ctx, sc, err)
33535		}()
33536	}
33537	iter.i++
33538	if iter.i < len(iter.page.Values()) {
33539		return nil
33540	}
33541	err = iter.page.NextWithContext(ctx)
33542	if err != nil {
33543		iter.i--
33544		return err
33545	}
33546	iter.i = 0
33547	return nil
33548}
33549
33550// Next advances to the next value.  If there was an error making
33551// the request the iterator does not advance and the error is returned.
33552// Deprecated: Use NextWithContext() instead.
33553func (iter *WorkloadGroupListResultIterator) Next() error {
33554	return iter.NextWithContext(context.Background())
33555}
33556
33557// NotDone returns true if the enumeration should be started or is not yet complete.
33558func (iter WorkloadGroupListResultIterator) NotDone() bool {
33559	return iter.page.NotDone() && iter.i < len(iter.page.Values())
33560}
33561
33562// Response returns the raw server response from the last page request.
33563func (iter WorkloadGroupListResultIterator) Response() WorkloadGroupListResult {
33564	return iter.page.Response()
33565}
33566
33567// Value returns the current value or a zero-initialized value if the
33568// iterator has advanced beyond the end of the collection.
33569func (iter WorkloadGroupListResultIterator) Value() WorkloadGroup {
33570	if !iter.page.NotDone() {
33571		return WorkloadGroup{}
33572	}
33573	return iter.page.Values()[iter.i]
33574}
33575
33576// Creates a new instance of the WorkloadGroupListResultIterator type.
33577func NewWorkloadGroupListResultIterator(page WorkloadGroupListResultPage) WorkloadGroupListResultIterator {
33578	return WorkloadGroupListResultIterator{page: page}
33579}
33580
33581// IsEmpty returns true if the ListResult contains no values.
33582func (wglr WorkloadGroupListResult) IsEmpty() bool {
33583	return wglr.Value == nil || len(*wglr.Value) == 0
33584}
33585
33586// hasNextLink returns true if the NextLink is not empty.
33587func (wglr WorkloadGroupListResult) hasNextLink() bool {
33588	return wglr.NextLink != nil && len(*wglr.NextLink) != 0
33589}
33590
33591// workloadGroupListResultPreparer prepares a request to retrieve the next set of results.
33592// It returns nil if no more results exist.
33593func (wglr WorkloadGroupListResult) workloadGroupListResultPreparer(ctx context.Context) (*http.Request, error) {
33594	if !wglr.hasNextLink() {
33595		return nil, nil
33596	}
33597	return autorest.Prepare((&http.Request{}).WithContext(ctx),
33598		autorest.AsJSON(),
33599		autorest.AsGet(),
33600		autorest.WithBaseURL(to.String(wglr.NextLink)))
33601}
33602
33603// WorkloadGroupListResultPage contains a page of WorkloadGroup values.
33604type WorkloadGroupListResultPage struct {
33605	fn   func(context.Context, WorkloadGroupListResult) (WorkloadGroupListResult, error)
33606	wglr WorkloadGroupListResult
33607}
33608
33609// NextWithContext advances to the next page of values.  If there was an error making
33610// the request the page does not advance and the error is returned.
33611func (page *WorkloadGroupListResultPage) NextWithContext(ctx context.Context) (err error) {
33612	if tracing.IsEnabled() {
33613		ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadGroupListResultPage.NextWithContext")
33614		defer func() {
33615			sc := -1
33616			if page.Response().Response.Response != nil {
33617				sc = page.Response().Response.Response.StatusCode
33618			}
33619			tracing.EndSpan(ctx, sc, err)
33620		}()
33621	}
33622	for {
33623		next, err := page.fn(ctx, page.wglr)
33624		if err != nil {
33625			return err
33626		}
33627		page.wglr = next
33628		if !next.hasNextLink() || !next.IsEmpty() {
33629			break
33630		}
33631	}
33632	return nil
33633}
33634
33635// Next advances to the next page of values.  If there was an error making
33636// the request the page does not advance and the error is returned.
33637// Deprecated: Use NextWithContext() instead.
33638func (page *WorkloadGroupListResultPage) Next() error {
33639	return page.NextWithContext(context.Background())
33640}
33641
33642// NotDone returns true if the page enumeration should be started or is not yet complete.
33643func (page WorkloadGroupListResultPage) NotDone() bool {
33644	return !page.wglr.IsEmpty()
33645}
33646
33647// Response returns the raw server response from the last page request.
33648func (page WorkloadGroupListResultPage) Response() WorkloadGroupListResult {
33649	return page.wglr
33650}
33651
33652// Values returns the slice of values for the current page or nil if there are no values.
33653func (page WorkloadGroupListResultPage) Values() []WorkloadGroup {
33654	if page.wglr.IsEmpty() {
33655		return nil
33656	}
33657	return *page.wglr.Value
33658}
33659
33660// Creates a new instance of the WorkloadGroupListResultPage type.
33661func NewWorkloadGroupListResultPage(cur WorkloadGroupListResult, getNextPage func(context.Context, WorkloadGroupListResult) (WorkloadGroupListResult, error)) WorkloadGroupListResultPage {
33662	return WorkloadGroupListResultPage{
33663		fn:   getNextPage,
33664		wglr: cur,
33665	}
33666}
33667
33668// WorkloadGroupProperties workload group definition. For more information look at
33669// sys.workload_management_workload_groups (DMV).
33670type WorkloadGroupProperties struct {
33671	// MinResourcePercent - The workload group minimum percentage resource.
33672	MinResourcePercent *int32 `json:"minResourcePercent,omitempty"`
33673	// MaxResourcePercent - The workload group cap percentage resource.
33674	MaxResourcePercent *int32 `json:"maxResourcePercent,omitempty"`
33675	// MinResourcePercentPerRequest - The workload group request minimum grant percentage.
33676	MinResourcePercentPerRequest *float64 `json:"minResourcePercentPerRequest,omitempty"`
33677	// MaxResourcePercentPerRequest - The workload group request maximum grant percentage.
33678	MaxResourcePercentPerRequest *float64 `json:"maxResourcePercentPerRequest,omitempty"`
33679	// Importance - The workload group importance level.
33680	Importance *string `json:"importance,omitempty"`
33681	// QueryExecutionTimeout - The workload group query execution timeout.
33682	QueryExecutionTimeout *int32 `json:"queryExecutionTimeout,omitempty"`
33683}
33684
33685// WorkloadGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
33686// long-running operation.
33687type WorkloadGroupsCreateOrUpdateFuture struct {
33688	azure.FutureAPI
33689	// Result returns the result of the asynchronous operation.
33690	// If the operation has not completed it will return an error.
33691	Result func(WorkloadGroupsClient) (WorkloadGroup, error)
33692}
33693
33694// UnmarshalJSON is the custom unmarshaller for CreateFuture.
33695func (future *WorkloadGroupsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
33696	var azFuture azure.Future
33697	if err := json.Unmarshal(body, &azFuture); err != nil {
33698		return err
33699	}
33700	future.FutureAPI = &azFuture
33701	future.Result = future.result
33702	return nil
33703}
33704
33705// result is the default implementation for WorkloadGroupsCreateOrUpdateFuture.Result.
33706func (future *WorkloadGroupsCreateOrUpdateFuture) result(client WorkloadGroupsClient) (wg WorkloadGroup, err error) {
33707	var done bool
33708	done, err = future.DoneWithContext(context.Background(), client)
33709	if err != nil {
33710		err = autorest.NewErrorWithError(err, "sql.WorkloadGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
33711		return
33712	}
33713	if !done {
33714		wg.Response.Response = future.Response()
33715		err = azure.NewAsyncOpIncompleteError("sql.WorkloadGroupsCreateOrUpdateFuture")
33716		return
33717	}
33718	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
33719	if wg.Response.Response, err = future.GetResult(sender); err == nil && wg.Response.Response.StatusCode != http.StatusNoContent {
33720		wg, err = client.CreateOrUpdateResponder(wg.Response.Response)
33721		if err != nil {
33722			err = autorest.NewErrorWithError(err, "sql.WorkloadGroupsCreateOrUpdateFuture", "Result", wg.Response.Response, "Failure responding to request")
33723		}
33724	}
33725	return
33726}
33727
33728// WorkloadGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
33729// operation.
33730type WorkloadGroupsDeleteFuture struct {
33731	azure.FutureAPI
33732	// Result returns the result of the asynchronous operation.
33733	// If the operation has not completed it will return an error.
33734	Result func(WorkloadGroupsClient) (autorest.Response, error)
33735}
33736
33737// UnmarshalJSON is the custom unmarshaller for CreateFuture.
33738func (future *WorkloadGroupsDeleteFuture) UnmarshalJSON(body []byte) error {
33739	var azFuture azure.Future
33740	if err := json.Unmarshal(body, &azFuture); err != nil {
33741		return err
33742	}
33743	future.FutureAPI = &azFuture
33744	future.Result = future.result
33745	return nil
33746}
33747
33748// result is the default implementation for WorkloadGroupsDeleteFuture.Result.
33749func (future *WorkloadGroupsDeleteFuture) result(client WorkloadGroupsClient) (ar autorest.Response, err error) {
33750	var done bool
33751	done, err = future.DoneWithContext(context.Background(), client)
33752	if err != nil {
33753		err = autorest.NewErrorWithError(err, "sql.WorkloadGroupsDeleteFuture", "Result", future.Response(), "Polling failure")
33754		return
33755	}
33756	if !done {
33757		ar.Response = future.Response()
33758		err = azure.NewAsyncOpIncompleteError("sql.WorkloadGroupsDeleteFuture")
33759		return
33760	}
33761	ar.Response = future.Response()
33762	return
33763}
33764