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/v3.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// AutomaticTuningOptions automatic tuning properties for individual advisors.
223type AutomaticTuningOptions struct {
224	// DesiredState - Automatic tuning option desired state. Possible values include: 'AutomaticTuningOptionModeDesiredOff', 'AutomaticTuningOptionModeDesiredOn', 'AutomaticTuningOptionModeDesiredDefault'
225	DesiredState AutomaticTuningOptionModeDesired `json:"desiredState,omitempty"`
226	// ActualState - READ-ONLY; Automatic tuning option actual state. Possible values include: 'Off', 'On'
227	ActualState AutomaticTuningOptionModeActual `json:"actualState,omitempty"`
228	// ReasonCode - READ-ONLY; Reason code if desired and actual state are different.
229	ReasonCode *int32 `json:"reasonCode,omitempty"`
230	// ReasonDesc - READ-ONLY; Reason description if desired and actual state are different. Possible values include: 'Default', 'Disabled', 'AutoConfigured', 'InheritedFromServer', 'QueryStoreOff', 'QueryStoreReadOnly', 'NotSupported'
231	ReasonDesc AutomaticTuningDisabledReason `json:"reasonDesc,omitempty"`
232}
233
234// MarshalJSON is the custom marshaler for AutomaticTuningOptions.
235func (ato AutomaticTuningOptions) MarshalJSON() ([]byte, error) {
236	objectMap := make(map[string]interface{})
237	if ato.DesiredState != "" {
238		objectMap["desiredState"] = ato.DesiredState
239	}
240	return json.Marshal(objectMap)
241}
242
243// AutomaticTuningServerOptions automatic tuning properties for individual advisors.
244type AutomaticTuningServerOptions struct {
245	// DesiredState - Automatic tuning option desired state. Possible values include: 'AutomaticTuningOptionModeDesiredOff', 'AutomaticTuningOptionModeDesiredOn', 'AutomaticTuningOptionModeDesiredDefault'
246	DesiredState AutomaticTuningOptionModeDesired `json:"desiredState,omitempty"`
247	// ActualState - READ-ONLY; Automatic tuning option actual state. Possible values include: 'Off', 'On'
248	ActualState AutomaticTuningOptionModeActual `json:"actualState,omitempty"`
249	// ReasonCode - READ-ONLY; Reason code if desired and actual state are different.
250	ReasonCode *int32 `json:"reasonCode,omitempty"`
251	// ReasonDesc - READ-ONLY; Reason description if desired and actual state are different. Possible values include: 'AutomaticTuningServerReasonDefault', 'AutomaticTuningServerReasonDisabled', 'AutomaticTuningServerReasonAutoConfigured'
252	ReasonDesc AutomaticTuningServerReason `json:"reasonDesc,omitempty"`
253}
254
255// MarshalJSON is the custom marshaler for AutomaticTuningServerOptions.
256func (atso AutomaticTuningServerOptions) MarshalJSON() ([]byte, error) {
257	objectMap := make(map[string]interface{})
258	if atso.DesiredState != "" {
259		objectMap["desiredState"] = atso.DesiredState
260	}
261	return json.Marshal(objectMap)
262}
263
264// AutomaticTuningServerProperties server-level Automatic Tuning properties.
265type AutomaticTuningServerProperties struct {
266	// DesiredState - Automatic tuning desired state. Possible values include: 'AutomaticTuningServerModeCustom', 'AutomaticTuningServerModeAuto', 'AutomaticTuningServerModeUnspecified'
267	DesiredState AutomaticTuningServerMode `json:"desiredState,omitempty"`
268	// ActualState - READ-ONLY; Automatic tuning actual state. Possible values include: 'AutomaticTuningServerModeCustom', 'AutomaticTuningServerModeAuto', 'AutomaticTuningServerModeUnspecified'
269	ActualState AutomaticTuningServerMode `json:"actualState,omitempty"`
270	// Options - Automatic tuning options definition.
271	Options map[string]*AutomaticTuningServerOptions `json:"options"`
272}
273
274// MarshalJSON is the custom marshaler for AutomaticTuningServerProperties.
275func (atsp AutomaticTuningServerProperties) MarshalJSON() ([]byte, error) {
276	objectMap := make(map[string]interface{})
277	if atsp.DesiredState != "" {
278		objectMap["desiredState"] = atsp.DesiredState
279	}
280	if atsp.Options != nil {
281		objectMap["options"] = atsp.Options
282	}
283	return json.Marshal(objectMap)
284}
285
286// AutoPauseDelayTimeRange supported auto pause delay time range
287type AutoPauseDelayTimeRange struct {
288	// MinValue - READ-ONLY; Minimum value
289	MinValue *int32 `json:"minValue,omitempty"`
290	// MaxValue - READ-ONLY; Maximum value
291	MaxValue *int32 `json:"maxValue,omitempty"`
292	// StepSize - READ-ONLY; Step value for discrete values between the minimum value and the maximum value.
293	StepSize *int32 `json:"stepSize,omitempty"`
294	// Default - READ-ONLY; Default value is no value is provided
295	Default *int32 `json:"default,omitempty"`
296	// Unit - READ-ONLY; Unit of time that delay is expressed in. Possible values include: 'Minutes'
297	Unit PauseDelayTimeUnit `json:"unit,omitempty"`
298	// DoNotPauseValue - READ-ONLY; Value that is used to not pause (infinite delay before pause)
299	DoNotPauseValue *int32 `json:"doNotPauseValue,omitempty"`
300}
301
302// MarshalJSON is the custom marshaler for AutoPauseDelayTimeRange.
303func (apdtr AutoPauseDelayTimeRange) MarshalJSON() ([]byte, error) {
304	objectMap := make(map[string]interface{})
305	return json.Marshal(objectMap)
306}
307
308// AzureADOnlyAuthListResult a list of active directory only authentications.
309type AzureADOnlyAuthListResult struct {
310	autorest.Response `json:"-"`
311	// Value - READ-ONLY; Array of results.
312	Value *[]ServerAzureADOnlyAuthentication `json:"value,omitempty"`
313	// NextLink - READ-ONLY; Link to retrieve next page of results.
314	NextLink *string `json:"nextLink,omitempty"`
315}
316
317// MarshalJSON is the custom marshaler for AzureADOnlyAuthListResult.
318func (aaoalr AzureADOnlyAuthListResult) MarshalJSON() ([]byte, error) {
319	objectMap := make(map[string]interface{})
320	return json.Marshal(objectMap)
321}
322
323// AzureADOnlyAuthListResultIterator provides access to a complete listing of
324// ServerAzureADOnlyAuthentication values.
325type AzureADOnlyAuthListResultIterator struct {
326	i    int
327	page AzureADOnlyAuthListResultPage
328}
329
330// NextWithContext advances to the next value.  If there was an error making
331// the request the iterator does not advance and the error is returned.
332func (iter *AzureADOnlyAuthListResultIterator) NextWithContext(ctx context.Context) (err error) {
333	if tracing.IsEnabled() {
334		ctx = tracing.StartSpan(ctx, fqdn+"/AzureADOnlyAuthListResultIterator.NextWithContext")
335		defer func() {
336			sc := -1
337			if iter.Response().Response.Response != nil {
338				sc = iter.Response().Response.Response.StatusCode
339			}
340			tracing.EndSpan(ctx, sc, err)
341		}()
342	}
343	iter.i++
344	if iter.i < len(iter.page.Values()) {
345		return nil
346	}
347	err = iter.page.NextWithContext(ctx)
348	if err != nil {
349		iter.i--
350		return err
351	}
352	iter.i = 0
353	return nil
354}
355
356// Next advances to the next value.  If there was an error making
357// the request the iterator does not advance and the error is returned.
358// Deprecated: Use NextWithContext() instead.
359func (iter *AzureADOnlyAuthListResultIterator) Next() error {
360	return iter.NextWithContext(context.Background())
361}
362
363// NotDone returns true if the enumeration should be started or is not yet complete.
364func (iter AzureADOnlyAuthListResultIterator) NotDone() bool {
365	return iter.page.NotDone() && iter.i < len(iter.page.Values())
366}
367
368// Response returns the raw server response from the last page request.
369func (iter AzureADOnlyAuthListResultIterator) Response() AzureADOnlyAuthListResult {
370	return iter.page.Response()
371}
372
373// Value returns the current value or a zero-initialized value if the
374// iterator has advanced beyond the end of the collection.
375func (iter AzureADOnlyAuthListResultIterator) Value() ServerAzureADOnlyAuthentication {
376	if !iter.page.NotDone() {
377		return ServerAzureADOnlyAuthentication{}
378	}
379	return iter.page.Values()[iter.i]
380}
381
382// Creates a new instance of the AzureADOnlyAuthListResultIterator type.
383func NewAzureADOnlyAuthListResultIterator(page AzureADOnlyAuthListResultPage) AzureADOnlyAuthListResultIterator {
384	return AzureADOnlyAuthListResultIterator{page: page}
385}
386
387// IsEmpty returns true if the ListResult contains no values.
388func (aaoalr AzureADOnlyAuthListResult) IsEmpty() bool {
389	return aaoalr.Value == nil || len(*aaoalr.Value) == 0
390}
391
392// hasNextLink returns true if the NextLink is not empty.
393func (aaoalr AzureADOnlyAuthListResult) hasNextLink() bool {
394	return aaoalr.NextLink != nil && len(*aaoalr.NextLink) != 0
395}
396
397// azureADOnlyAuthListResultPreparer prepares a request to retrieve the next set of results.
398// It returns nil if no more results exist.
399func (aaoalr AzureADOnlyAuthListResult) azureADOnlyAuthListResultPreparer(ctx context.Context) (*http.Request, error) {
400	if !aaoalr.hasNextLink() {
401		return nil, nil
402	}
403	return autorest.Prepare((&http.Request{}).WithContext(ctx),
404		autorest.AsJSON(),
405		autorest.AsGet(),
406		autorest.WithBaseURL(to.String(aaoalr.NextLink)))
407}
408
409// AzureADOnlyAuthListResultPage contains a page of ServerAzureADOnlyAuthentication values.
410type AzureADOnlyAuthListResultPage struct {
411	fn     func(context.Context, AzureADOnlyAuthListResult) (AzureADOnlyAuthListResult, error)
412	aaoalr AzureADOnlyAuthListResult
413}
414
415// NextWithContext advances to the next page of values.  If there was an error making
416// the request the page does not advance and the error is returned.
417func (page *AzureADOnlyAuthListResultPage) NextWithContext(ctx context.Context) (err error) {
418	if tracing.IsEnabled() {
419		ctx = tracing.StartSpan(ctx, fqdn+"/AzureADOnlyAuthListResultPage.NextWithContext")
420		defer func() {
421			sc := -1
422			if page.Response().Response.Response != nil {
423				sc = page.Response().Response.Response.StatusCode
424			}
425			tracing.EndSpan(ctx, sc, err)
426		}()
427	}
428	for {
429		next, err := page.fn(ctx, page.aaoalr)
430		if err != nil {
431			return err
432		}
433		page.aaoalr = next
434		if !next.hasNextLink() || !next.IsEmpty() {
435			break
436		}
437	}
438	return nil
439}
440
441// Next advances to the next page of values.  If there was an error making
442// the request the page does not advance and the error is returned.
443// Deprecated: Use NextWithContext() instead.
444func (page *AzureADOnlyAuthListResultPage) Next() error {
445	return page.NextWithContext(context.Background())
446}
447
448// NotDone returns true if the page enumeration should be started or is not yet complete.
449func (page AzureADOnlyAuthListResultPage) NotDone() bool {
450	return !page.aaoalr.IsEmpty()
451}
452
453// Response returns the raw server response from the last page request.
454func (page AzureADOnlyAuthListResultPage) Response() AzureADOnlyAuthListResult {
455	return page.aaoalr
456}
457
458// Values returns the slice of values for the current page or nil if there are no values.
459func (page AzureADOnlyAuthListResultPage) Values() []ServerAzureADOnlyAuthentication {
460	if page.aaoalr.IsEmpty() {
461		return nil
462	}
463	return *page.aaoalr.Value
464}
465
466// Creates a new instance of the AzureADOnlyAuthListResultPage type.
467func NewAzureADOnlyAuthListResultPage(cur AzureADOnlyAuthListResult, getNextPage func(context.Context, AzureADOnlyAuthListResult) (AzureADOnlyAuthListResult, error)) AzureADOnlyAuthListResultPage {
468	return AzureADOnlyAuthListResultPage{
469		fn:     getNextPage,
470		aaoalr: cur,
471	}
472}
473
474// AzureADOnlyAuthProperties properties of a active directory only authentication.
475type AzureADOnlyAuthProperties struct {
476	// AzureADOnlyAuthentication - Azure Active Directory only Authentication enabled.
477	AzureADOnlyAuthentication *bool `json:"azureADOnlyAuthentication,omitempty"`
478}
479
480// BackupLongTermRetentionPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the
481// results of a long-running operation.
482type BackupLongTermRetentionPoliciesCreateOrUpdateFuture struct {
483	azure.FutureAPI
484	// Result returns the result of the asynchronous operation.
485	// If the operation has not completed it will return an error.
486	Result func(BackupLongTermRetentionPoliciesClient) (BackupLongTermRetentionPolicy, error)
487}
488
489// UnmarshalJSON is the custom unmarshaller for CreateFuture.
490func (future *BackupLongTermRetentionPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
491	var azFuture azure.Future
492	if err := json.Unmarshal(body, &azFuture); err != nil {
493		return err
494	}
495	future.FutureAPI = &azFuture
496	future.Result = future.result
497	return nil
498}
499
500// result is the default implementation for BackupLongTermRetentionPoliciesCreateOrUpdateFuture.Result.
501func (future *BackupLongTermRetentionPoliciesCreateOrUpdateFuture) result(client BackupLongTermRetentionPoliciesClient) (bltrp BackupLongTermRetentionPolicy, err error) {
502	var done bool
503	done, err = future.DoneWithContext(context.Background(), client)
504	if err != nil {
505		err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
506		return
507	}
508	if !done {
509		bltrp.Response.Response = future.Response()
510		err = azure.NewAsyncOpIncompleteError("sql.BackupLongTermRetentionPoliciesCreateOrUpdateFuture")
511		return
512	}
513	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
514	if bltrp.Response.Response, err = future.GetResult(sender); err == nil && bltrp.Response.Response.StatusCode != http.StatusNoContent {
515		bltrp, err = client.CreateOrUpdateResponder(bltrp.Response.Response)
516		if err != nil {
517			err = autorest.NewErrorWithError(err, "sql.BackupLongTermRetentionPoliciesCreateOrUpdateFuture", "Result", bltrp.Response.Response, "Failure responding to request")
518		}
519	}
520	return
521}
522
523// BackupLongTermRetentionPolicy a long term retention policy.
524type BackupLongTermRetentionPolicy struct {
525	autorest.Response `json:"-"`
526	// LongTermRetentionPolicyProperties - Resource properties.
527	*LongTermRetentionPolicyProperties `json:"properties,omitempty"`
528	// ID - READ-ONLY; Resource ID.
529	ID *string `json:"id,omitempty"`
530	// Name - READ-ONLY; Resource name.
531	Name *string `json:"name,omitempty"`
532	// Type - READ-ONLY; Resource type.
533	Type *string `json:"type,omitempty"`
534}
535
536// MarshalJSON is the custom marshaler for BackupLongTermRetentionPolicy.
537func (bltrp BackupLongTermRetentionPolicy) MarshalJSON() ([]byte, error) {
538	objectMap := make(map[string]interface{})
539	if bltrp.LongTermRetentionPolicyProperties != nil {
540		objectMap["properties"] = bltrp.LongTermRetentionPolicyProperties
541	}
542	return json.Marshal(objectMap)
543}
544
545// UnmarshalJSON is the custom unmarshaler for BackupLongTermRetentionPolicy struct.
546func (bltrp *BackupLongTermRetentionPolicy) UnmarshalJSON(body []byte) error {
547	var m map[string]*json.RawMessage
548	err := json.Unmarshal(body, &m)
549	if err != nil {
550		return err
551	}
552	for k, v := range m {
553		switch k {
554		case "properties":
555			if v != nil {
556				var longTermRetentionPolicyProperties LongTermRetentionPolicyProperties
557				err = json.Unmarshal(*v, &longTermRetentionPolicyProperties)
558				if err != nil {
559					return err
560				}
561				bltrp.LongTermRetentionPolicyProperties = &longTermRetentionPolicyProperties
562			}
563		case "id":
564			if v != nil {
565				var ID string
566				err = json.Unmarshal(*v, &ID)
567				if err != nil {
568					return err
569				}
570				bltrp.ID = &ID
571			}
572		case "name":
573			if v != nil {
574				var name string
575				err = json.Unmarshal(*v, &name)
576				if err != nil {
577					return err
578				}
579				bltrp.Name = &name
580			}
581		case "type":
582			if v != nil {
583				var typeVar string
584				err = json.Unmarshal(*v, &typeVar)
585				if err != nil {
586					return err
587				}
588				bltrp.Type = &typeVar
589			}
590		}
591	}
592
593	return nil
594}
595
596// BackupShortTermRetentionPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the
597// results of a long-running operation.
598type BackupShortTermRetentionPoliciesCreateOrUpdateFuture struct {
599	azure.FutureAPI
600	// Result returns the result of the asynchronous operation.
601	// If the operation has not completed it will return an error.
602	Result func(BackupShortTermRetentionPoliciesClient) (BackupShortTermRetentionPolicy, error)
603}
604
605// UnmarshalJSON is the custom unmarshaller for CreateFuture.
606func (future *BackupShortTermRetentionPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
607	var azFuture azure.Future
608	if err := json.Unmarshal(body, &azFuture); err != nil {
609		return err
610	}
611	future.FutureAPI = &azFuture
612	future.Result = future.result
613	return nil
614}
615
616// result is the default implementation for BackupShortTermRetentionPoliciesCreateOrUpdateFuture.Result.
617func (future *BackupShortTermRetentionPoliciesCreateOrUpdateFuture) result(client BackupShortTermRetentionPoliciesClient) (bstrp BackupShortTermRetentionPolicy, err error) {
618	var done bool
619	done, err = future.DoneWithContext(context.Background(), client)
620	if err != nil {
621		err = autorest.NewErrorWithError(err, "sql.BackupShortTermRetentionPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
622		return
623	}
624	if !done {
625		bstrp.Response.Response = future.Response()
626		err = azure.NewAsyncOpIncompleteError("sql.BackupShortTermRetentionPoliciesCreateOrUpdateFuture")
627		return
628	}
629	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
630	if bstrp.Response.Response, err = future.GetResult(sender); err == nil && bstrp.Response.Response.StatusCode != http.StatusNoContent {
631		bstrp, err = client.CreateOrUpdateResponder(bstrp.Response.Response)
632		if err != nil {
633			err = autorest.NewErrorWithError(err, "sql.BackupShortTermRetentionPoliciesCreateOrUpdateFuture", "Result", bstrp.Response.Response, "Failure responding to request")
634		}
635	}
636	return
637}
638
639// BackupShortTermRetentionPoliciesUpdateFuture an abstraction for monitoring and retrieving the results of
640// a long-running operation.
641type BackupShortTermRetentionPoliciesUpdateFuture struct {
642	azure.FutureAPI
643	// Result returns the result of the asynchronous operation.
644	// If the operation has not completed it will return an error.
645	Result func(BackupShortTermRetentionPoliciesClient) (BackupShortTermRetentionPolicy, error)
646}
647
648// UnmarshalJSON is the custom unmarshaller for CreateFuture.
649func (future *BackupShortTermRetentionPoliciesUpdateFuture) UnmarshalJSON(body []byte) error {
650	var azFuture azure.Future
651	if err := json.Unmarshal(body, &azFuture); err != nil {
652		return err
653	}
654	future.FutureAPI = &azFuture
655	future.Result = future.result
656	return nil
657}
658
659// result is the default implementation for BackupShortTermRetentionPoliciesUpdateFuture.Result.
660func (future *BackupShortTermRetentionPoliciesUpdateFuture) result(client BackupShortTermRetentionPoliciesClient) (bstrp BackupShortTermRetentionPolicy, err error) {
661	var done bool
662	done, err = future.DoneWithContext(context.Background(), client)
663	if err != nil {
664		err = autorest.NewErrorWithError(err, "sql.BackupShortTermRetentionPoliciesUpdateFuture", "Result", future.Response(), "Polling failure")
665		return
666	}
667	if !done {
668		bstrp.Response.Response = future.Response()
669		err = azure.NewAsyncOpIncompleteError("sql.BackupShortTermRetentionPoliciesUpdateFuture")
670		return
671	}
672	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
673	if bstrp.Response.Response, err = future.GetResult(sender); err == nil && bstrp.Response.Response.StatusCode != http.StatusNoContent {
674		bstrp, err = client.UpdateResponder(bstrp.Response.Response)
675		if err != nil {
676			err = autorest.NewErrorWithError(err, "sql.BackupShortTermRetentionPoliciesUpdateFuture", "Result", bstrp.Response.Response, "Failure responding to request")
677		}
678	}
679	return
680}
681
682// BackupShortTermRetentionPolicy a short term retention policy.
683type BackupShortTermRetentionPolicy struct {
684	autorest.Response `json:"-"`
685	// BackupShortTermRetentionPolicyProperties - Resource properties.
686	*BackupShortTermRetentionPolicyProperties `json:"properties,omitempty"`
687	// ID - READ-ONLY; Resource ID.
688	ID *string `json:"id,omitempty"`
689	// Name - READ-ONLY; Resource name.
690	Name *string `json:"name,omitempty"`
691	// Type - READ-ONLY; Resource type.
692	Type *string `json:"type,omitempty"`
693}
694
695// MarshalJSON is the custom marshaler for BackupShortTermRetentionPolicy.
696func (bstrp BackupShortTermRetentionPolicy) MarshalJSON() ([]byte, error) {
697	objectMap := make(map[string]interface{})
698	if bstrp.BackupShortTermRetentionPolicyProperties != nil {
699		objectMap["properties"] = bstrp.BackupShortTermRetentionPolicyProperties
700	}
701	return json.Marshal(objectMap)
702}
703
704// UnmarshalJSON is the custom unmarshaler for BackupShortTermRetentionPolicy struct.
705func (bstrp *BackupShortTermRetentionPolicy) UnmarshalJSON(body []byte) error {
706	var m map[string]*json.RawMessage
707	err := json.Unmarshal(body, &m)
708	if err != nil {
709		return err
710	}
711	for k, v := range m {
712		switch k {
713		case "properties":
714			if v != nil {
715				var backupShortTermRetentionPolicyProperties BackupShortTermRetentionPolicyProperties
716				err = json.Unmarshal(*v, &backupShortTermRetentionPolicyProperties)
717				if err != nil {
718					return err
719				}
720				bstrp.BackupShortTermRetentionPolicyProperties = &backupShortTermRetentionPolicyProperties
721			}
722		case "id":
723			if v != nil {
724				var ID string
725				err = json.Unmarshal(*v, &ID)
726				if err != nil {
727					return err
728				}
729				bstrp.ID = &ID
730			}
731		case "name":
732			if v != nil {
733				var name string
734				err = json.Unmarshal(*v, &name)
735				if err != nil {
736					return err
737				}
738				bstrp.Name = &name
739			}
740		case "type":
741			if v != nil {
742				var typeVar string
743				err = json.Unmarshal(*v, &typeVar)
744				if err != nil {
745					return err
746				}
747				bstrp.Type = &typeVar
748			}
749		}
750	}
751
752	return nil
753}
754
755// BackupShortTermRetentionPolicyListResult a list of short term retention policies.
756type BackupShortTermRetentionPolicyListResult struct {
757	autorest.Response `json:"-"`
758	// Value - READ-ONLY; Array of results.
759	Value *[]BackupShortTermRetentionPolicy `json:"value,omitempty"`
760	// NextLink - READ-ONLY; Link to retrieve next page of results.
761	NextLink *string `json:"nextLink,omitempty"`
762}
763
764// MarshalJSON is the custom marshaler for BackupShortTermRetentionPolicyListResult.
765func (bstrplr BackupShortTermRetentionPolicyListResult) MarshalJSON() ([]byte, error) {
766	objectMap := make(map[string]interface{})
767	return json.Marshal(objectMap)
768}
769
770// BackupShortTermRetentionPolicyListResultIterator provides access to a complete listing of
771// BackupShortTermRetentionPolicy values.
772type BackupShortTermRetentionPolicyListResultIterator struct {
773	i    int
774	page BackupShortTermRetentionPolicyListResultPage
775}
776
777// NextWithContext advances to the next value.  If there was an error making
778// the request the iterator does not advance and the error is returned.
779func (iter *BackupShortTermRetentionPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
780	if tracing.IsEnabled() {
781		ctx = tracing.StartSpan(ctx, fqdn+"/BackupShortTermRetentionPolicyListResultIterator.NextWithContext")
782		defer func() {
783			sc := -1
784			if iter.Response().Response.Response != nil {
785				sc = iter.Response().Response.Response.StatusCode
786			}
787			tracing.EndSpan(ctx, sc, err)
788		}()
789	}
790	iter.i++
791	if iter.i < len(iter.page.Values()) {
792		return nil
793	}
794	err = iter.page.NextWithContext(ctx)
795	if err != nil {
796		iter.i--
797		return err
798	}
799	iter.i = 0
800	return nil
801}
802
803// Next advances to the next value.  If there was an error making
804// the request the iterator does not advance and the error is returned.
805// Deprecated: Use NextWithContext() instead.
806func (iter *BackupShortTermRetentionPolicyListResultIterator) Next() error {
807	return iter.NextWithContext(context.Background())
808}
809
810// NotDone returns true if the enumeration should be started or is not yet complete.
811func (iter BackupShortTermRetentionPolicyListResultIterator) NotDone() bool {
812	return iter.page.NotDone() && iter.i < len(iter.page.Values())
813}
814
815// Response returns the raw server response from the last page request.
816func (iter BackupShortTermRetentionPolicyListResultIterator) Response() BackupShortTermRetentionPolicyListResult {
817	return iter.page.Response()
818}
819
820// Value returns the current value or a zero-initialized value if the
821// iterator has advanced beyond the end of the collection.
822func (iter BackupShortTermRetentionPolicyListResultIterator) Value() BackupShortTermRetentionPolicy {
823	if !iter.page.NotDone() {
824		return BackupShortTermRetentionPolicy{}
825	}
826	return iter.page.Values()[iter.i]
827}
828
829// Creates a new instance of the BackupShortTermRetentionPolicyListResultIterator type.
830func NewBackupShortTermRetentionPolicyListResultIterator(page BackupShortTermRetentionPolicyListResultPage) BackupShortTermRetentionPolicyListResultIterator {
831	return BackupShortTermRetentionPolicyListResultIterator{page: page}
832}
833
834// IsEmpty returns true if the ListResult contains no values.
835func (bstrplr BackupShortTermRetentionPolicyListResult) IsEmpty() bool {
836	return bstrplr.Value == nil || len(*bstrplr.Value) == 0
837}
838
839// hasNextLink returns true if the NextLink is not empty.
840func (bstrplr BackupShortTermRetentionPolicyListResult) hasNextLink() bool {
841	return bstrplr.NextLink != nil && len(*bstrplr.NextLink) != 0
842}
843
844// backupShortTermRetentionPolicyListResultPreparer prepares a request to retrieve the next set of results.
845// It returns nil if no more results exist.
846func (bstrplr BackupShortTermRetentionPolicyListResult) backupShortTermRetentionPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
847	if !bstrplr.hasNextLink() {
848		return nil, nil
849	}
850	return autorest.Prepare((&http.Request{}).WithContext(ctx),
851		autorest.AsJSON(),
852		autorest.AsGet(),
853		autorest.WithBaseURL(to.String(bstrplr.NextLink)))
854}
855
856// BackupShortTermRetentionPolicyListResultPage contains a page of BackupShortTermRetentionPolicy values.
857type BackupShortTermRetentionPolicyListResultPage struct {
858	fn      func(context.Context, BackupShortTermRetentionPolicyListResult) (BackupShortTermRetentionPolicyListResult, error)
859	bstrplr BackupShortTermRetentionPolicyListResult
860}
861
862// NextWithContext advances to the next page of values.  If there was an error making
863// the request the page does not advance and the error is returned.
864func (page *BackupShortTermRetentionPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
865	if tracing.IsEnabled() {
866		ctx = tracing.StartSpan(ctx, fqdn+"/BackupShortTermRetentionPolicyListResultPage.NextWithContext")
867		defer func() {
868			sc := -1
869			if page.Response().Response.Response != nil {
870				sc = page.Response().Response.Response.StatusCode
871			}
872			tracing.EndSpan(ctx, sc, err)
873		}()
874	}
875	for {
876		next, err := page.fn(ctx, page.bstrplr)
877		if err != nil {
878			return err
879		}
880		page.bstrplr = next
881		if !next.hasNextLink() || !next.IsEmpty() {
882			break
883		}
884	}
885	return nil
886}
887
888// Next advances to the next page of values.  If there was an error making
889// the request the page does not advance and the error is returned.
890// Deprecated: Use NextWithContext() instead.
891func (page *BackupShortTermRetentionPolicyListResultPage) Next() error {
892	return page.NextWithContext(context.Background())
893}
894
895// NotDone returns true if the page enumeration should be started or is not yet complete.
896func (page BackupShortTermRetentionPolicyListResultPage) NotDone() bool {
897	return !page.bstrplr.IsEmpty()
898}
899
900// Response returns the raw server response from the last page request.
901func (page BackupShortTermRetentionPolicyListResultPage) Response() BackupShortTermRetentionPolicyListResult {
902	return page.bstrplr
903}
904
905// Values returns the slice of values for the current page or nil if there are no values.
906func (page BackupShortTermRetentionPolicyListResultPage) Values() []BackupShortTermRetentionPolicy {
907	if page.bstrplr.IsEmpty() {
908		return nil
909	}
910	return *page.bstrplr.Value
911}
912
913// Creates a new instance of the BackupShortTermRetentionPolicyListResultPage type.
914func NewBackupShortTermRetentionPolicyListResultPage(cur BackupShortTermRetentionPolicyListResult, getNextPage func(context.Context, BackupShortTermRetentionPolicyListResult) (BackupShortTermRetentionPolicyListResult, error)) BackupShortTermRetentionPolicyListResultPage {
915	return BackupShortTermRetentionPolicyListResultPage{
916		fn:      getNextPage,
917		bstrplr: cur,
918	}
919}
920
921// BackupShortTermRetentionPolicyProperties properties of a short term retention policy
922type BackupShortTermRetentionPolicyProperties struct {
923	// RetentionDays - The backup retention period in days. This is how many days Point-in-Time Restore will be supported.
924	RetentionDays *int32 `json:"retentionDays,omitempty"`
925}
926
927// BaseLongTermRetentionPolicyProperties properties of a long term retention policy
928type BaseLongTermRetentionPolicyProperties struct {
929	// WeeklyRetention - The weekly retention policy for an LTR backup in an ISO 8601 format.
930	WeeklyRetention *string `json:"weeklyRetention,omitempty"`
931	// MonthlyRetention - The monthly retention policy for an LTR backup in an ISO 8601 format.
932	MonthlyRetention *string `json:"monthlyRetention,omitempty"`
933	// YearlyRetention - The yearly retention policy for an LTR backup in an ISO 8601 format.
934	YearlyRetention *string `json:"yearlyRetention,omitempty"`
935	// WeekOfYear - The week of year to take the yearly backup in an ISO 8601 format.
936	WeekOfYear *int32 `json:"weekOfYear,omitempty"`
937}
938
939// CheckNameAvailabilityRequest a request to check whether the specified name for a resource is available.
940type CheckNameAvailabilityRequest struct {
941	Name *string `json:"name,omitempty"`
942	Type *string `json:"type,omitempty"`
943}
944
945// CheckNameAvailabilityResponse the result of a name availability check.
946type CheckNameAvailabilityResponse struct {
947	autorest.Response `json:"-"`
948	// Name - READ-ONLY; The name whose availability was checked.
949	Name *string `json:"name,omitempty"`
950	// Available - READ-ONLY; True if the name is available, otherwise false.
951	Available *bool `json:"available,omitempty"`
952	// Reason - READ-ONLY; The reason code explaining why the name is unavailable. Will be undefined if the name is available. Possible values include: 'Invalid', 'AlreadyExists'
953	Reason CheckNameAvailabilityReason `json:"reason,omitempty"`
954	// Message - READ-ONLY; A message explaining why the name is unavailable. Will be undefined if the name is available.
955	Message *string `json:"message,omitempty"`
956}
957
958// MarshalJSON is the custom marshaler for CheckNameAvailabilityResponse.
959func (cnar CheckNameAvailabilityResponse) MarshalJSON() ([]byte, error) {
960	objectMap := make(map[string]interface{})
961	return json.Marshal(objectMap)
962}
963
964// CompleteDatabaseRestoreDefinition contains the information necessary to perform a complete database
965// restore operation.
966type CompleteDatabaseRestoreDefinition struct {
967	// LastBackupName - The last backup name to apply
968	LastBackupName *string `json:"lastBackupName,omitempty"`
969}
970
971// CreateDatabaseRestorePointDefinition contains the information necessary to perform a create database
972// restore point operation.
973type CreateDatabaseRestorePointDefinition struct {
974	// RestorePointLabel - The restore point label to apply
975	RestorePointLabel *string `json:"restorePointLabel,omitempty"`
976}
977
978// Database a database resource.
979type Database struct {
980	autorest.Response `json:"-"`
981	// Sku - The database SKU.
982	//
983	// 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:
984	//
985	// ```azurecli
986	// az sql db list-editions -l <location> -o table
987	// ````
988	//
989	// ```powershell
990	// Get-AzSqlServerServiceObjective -Location <location>
991	// ````
992	Sku *Sku `json:"sku,omitempty"`
993	// Kind - READ-ONLY; Kind of database. This is metadata used for the Azure portal experience.
994	Kind *string `json:"kind,omitempty"`
995	// ManagedBy - READ-ONLY; Resource that manages the database.
996	ManagedBy *string `json:"managedBy,omitempty"`
997	// DatabaseProperties - Resource properties.
998	*DatabaseProperties `json:"properties,omitempty"`
999	// Location - Resource location.
1000	Location *string `json:"location,omitempty"`
1001	// Tags - Resource tags.
1002	Tags map[string]*string `json:"tags"`
1003	// ID - READ-ONLY; Resource ID.
1004	ID *string `json:"id,omitempty"`
1005	// Name - READ-ONLY; Resource name.
1006	Name *string `json:"name,omitempty"`
1007	// Type - READ-ONLY; Resource type.
1008	Type *string `json:"type,omitempty"`
1009}
1010
1011// MarshalJSON is the custom marshaler for Database.
1012func (d Database) MarshalJSON() ([]byte, error) {
1013	objectMap := make(map[string]interface{})
1014	if d.Sku != nil {
1015		objectMap["sku"] = d.Sku
1016	}
1017	if d.DatabaseProperties != nil {
1018		objectMap["properties"] = d.DatabaseProperties
1019	}
1020	if d.Location != nil {
1021		objectMap["location"] = d.Location
1022	}
1023	if d.Tags != nil {
1024		objectMap["tags"] = d.Tags
1025	}
1026	return json.Marshal(objectMap)
1027}
1028
1029// UnmarshalJSON is the custom unmarshaler for Database struct.
1030func (d *Database) UnmarshalJSON(body []byte) error {
1031	var m map[string]*json.RawMessage
1032	err := json.Unmarshal(body, &m)
1033	if err != nil {
1034		return err
1035	}
1036	for k, v := range m {
1037		switch k {
1038		case "sku":
1039			if v != nil {
1040				var sku Sku
1041				err = json.Unmarshal(*v, &sku)
1042				if err != nil {
1043					return err
1044				}
1045				d.Sku = &sku
1046			}
1047		case "kind":
1048			if v != nil {
1049				var kind string
1050				err = json.Unmarshal(*v, &kind)
1051				if err != nil {
1052					return err
1053				}
1054				d.Kind = &kind
1055			}
1056		case "managedBy":
1057			if v != nil {
1058				var managedBy string
1059				err = json.Unmarshal(*v, &managedBy)
1060				if err != nil {
1061					return err
1062				}
1063				d.ManagedBy = &managedBy
1064			}
1065		case "properties":
1066			if v != nil {
1067				var databaseProperties DatabaseProperties
1068				err = json.Unmarshal(*v, &databaseProperties)
1069				if err != nil {
1070					return err
1071				}
1072				d.DatabaseProperties = &databaseProperties
1073			}
1074		case "location":
1075			if v != nil {
1076				var location string
1077				err = json.Unmarshal(*v, &location)
1078				if err != nil {
1079					return err
1080				}
1081				d.Location = &location
1082			}
1083		case "tags":
1084			if v != nil {
1085				var tags map[string]*string
1086				err = json.Unmarshal(*v, &tags)
1087				if err != nil {
1088					return err
1089				}
1090				d.Tags = tags
1091			}
1092		case "id":
1093			if v != nil {
1094				var ID string
1095				err = json.Unmarshal(*v, &ID)
1096				if err != nil {
1097					return err
1098				}
1099				d.ID = &ID
1100			}
1101		case "name":
1102			if v != nil {
1103				var name string
1104				err = json.Unmarshal(*v, &name)
1105				if err != nil {
1106					return err
1107				}
1108				d.Name = &name
1109			}
1110		case "type":
1111			if v != nil {
1112				var typeVar string
1113				err = json.Unmarshal(*v, &typeVar)
1114				if err != nil {
1115					return err
1116				}
1117				d.Type = &typeVar
1118			}
1119		}
1120	}
1121
1122	return nil
1123}
1124
1125// DatabaseAutomaticTuning database-level Automatic Tuning.
1126type DatabaseAutomaticTuning struct {
1127	autorest.Response `json:"-"`
1128	// DatabaseAutomaticTuningProperties - Resource properties.
1129	*DatabaseAutomaticTuningProperties `json:"properties,omitempty"`
1130	// ID - READ-ONLY; Resource ID.
1131	ID *string `json:"id,omitempty"`
1132	// Name - READ-ONLY; Resource name.
1133	Name *string `json:"name,omitempty"`
1134	// Type - READ-ONLY; Resource type.
1135	Type *string `json:"type,omitempty"`
1136}
1137
1138// MarshalJSON is the custom marshaler for DatabaseAutomaticTuning.
1139func (dat DatabaseAutomaticTuning) MarshalJSON() ([]byte, error) {
1140	objectMap := make(map[string]interface{})
1141	if dat.DatabaseAutomaticTuningProperties != nil {
1142		objectMap["properties"] = dat.DatabaseAutomaticTuningProperties
1143	}
1144	return json.Marshal(objectMap)
1145}
1146
1147// UnmarshalJSON is the custom unmarshaler for DatabaseAutomaticTuning struct.
1148func (dat *DatabaseAutomaticTuning) UnmarshalJSON(body []byte) error {
1149	var m map[string]*json.RawMessage
1150	err := json.Unmarshal(body, &m)
1151	if err != nil {
1152		return err
1153	}
1154	for k, v := range m {
1155		switch k {
1156		case "properties":
1157			if v != nil {
1158				var databaseAutomaticTuningProperties DatabaseAutomaticTuningProperties
1159				err = json.Unmarshal(*v, &databaseAutomaticTuningProperties)
1160				if err != nil {
1161					return err
1162				}
1163				dat.DatabaseAutomaticTuningProperties = &databaseAutomaticTuningProperties
1164			}
1165		case "id":
1166			if v != nil {
1167				var ID string
1168				err = json.Unmarshal(*v, &ID)
1169				if err != nil {
1170					return err
1171				}
1172				dat.ID = &ID
1173			}
1174		case "name":
1175			if v != nil {
1176				var name string
1177				err = json.Unmarshal(*v, &name)
1178				if err != nil {
1179					return err
1180				}
1181				dat.Name = &name
1182			}
1183		case "type":
1184			if v != nil {
1185				var typeVar string
1186				err = json.Unmarshal(*v, &typeVar)
1187				if err != nil {
1188					return err
1189				}
1190				dat.Type = &typeVar
1191			}
1192		}
1193	}
1194
1195	return nil
1196}
1197
1198// DatabaseAutomaticTuningProperties database-level Automatic Tuning properties.
1199type DatabaseAutomaticTuningProperties struct {
1200	// DesiredState - Automatic tuning desired state. Possible values include: 'Inherit', 'Custom', 'Auto', 'Unspecified'
1201	DesiredState AutomaticTuningMode `json:"desiredState,omitempty"`
1202	// ActualState - READ-ONLY; Automatic tuning actual state. Possible values include: 'Inherit', 'Custom', 'Auto', 'Unspecified'
1203	ActualState AutomaticTuningMode `json:"actualState,omitempty"`
1204	// Options - Automatic tuning options definition.
1205	Options map[string]*AutomaticTuningOptions `json:"options"`
1206}
1207
1208// MarshalJSON is the custom marshaler for DatabaseAutomaticTuningProperties.
1209func (datp DatabaseAutomaticTuningProperties) MarshalJSON() ([]byte, error) {
1210	objectMap := make(map[string]interface{})
1211	if datp.DesiredState != "" {
1212		objectMap["desiredState"] = datp.DesiredState
1213	}
1214	if datp.Options != nil {
1215		objectMap["options"] = datp.Options
1216	}
1217	return json.Marshal(objectMap)
1218}
1219
1220// DatabaseBlobAuditingPolicy a database blob auditing policy.
1221type DatabaseBlobAuditingPolicy struct {
1222	autorest.Response `json:"-"`
1223	// Kind - READ-ONLY; Resource kind.
1224	Kind *string `json:"kind,omitempty"`
1225	// DatabaseBlobAuditingPolicyProperties - Resource properties.
1226	*DatabaseBlobAuditingPolicyProperties `json:"properties,omitempty"`
1227	// ID - READ-ONLY; Resource ID.
1228	ID *string `json:"id,omitempty"`
1229	// Name - READ-ONLY; Resource name.
1230	Name *string `json:"name,omitempty"`
1231	// Type - READ-ONLY; Resource type.
1232	Type *string `json:"type,omitempty"`
1233}
1234
1235// MarshalJSON is the custom marshaler for DatabaseBlobAuditingPolicy.
1236func (dbap DatabaseBlobAuditingPolicy) MarshalJSON() ([]byte, error) {
1237	objectMap := make(map[string]interface{})
1238	if dbap.DatabaseBlobAuditingPolicyProperties != nil {
1239		objectMap["properties"] = dbap.DatabaseBlobAuditingPolicyProperties
1240	}
1241	return json.Marshal(objectMap)
1242}
1243
1244// UnmarshalJSON is the custom unmarshaler for DatabaseBlobAuditingPolicy struct.
1245func (dbap *DatabaseBlobAuditingPolicy) UnmarshalJSON(body []byte) error {
1246	var m map[string]*json.RawMessage
1247	err := json.Unmarshal(body, &m)
1248	if err != nil {
1249		return err
1250	}
1251	for k, v := range m {
1252		switch k {
1253		case "kind":
1254			if v != nil {
1255				var kind string
1256				err = json.Unmarshal(*v, &kind)
1257				if err != nil {
1258					return err
1259				}
1260				dbap.Kind = &kind
1261			}
1262		case "properties":
1263			if v != nil {
1264				var databaseBlobAuditingPolicyProperties DatabaseBlobAuditingPolicyProperties
1265				err = json.Unmarshal(*v, &databaseBlobAuditingPolicyProperties)
1266				if err != nil {
1267					return err
1268				}
1269				dbap.DatabaseBlobAuditingPolicyProperties = &databaseBlobAuditingPolicyProperties
1270			}
1271		case "id":
1272			if v != nil {
1273				var ID string
1274				err = json.Unmarshal(*v, &ID)
1275				if err != nil {
1276					return err
1277				}
1278				dbap.ID = &ID
1279			}
1280		case "name":
1281			if v != nil {
1282				var name string
1283				err = json.Unmarshal(*v, &name)
1284				if err != nil {
1285					return err
1286				}
1287				dbap.Name = &name
1288			}
1289		case "type":
1290			if v != nil {
1291				var typeVar string
1292				err = json.Unmarshal(*v, &typeVar)
1293				if err != nil {
1294					return err
1295				}
1296				dbap.Type = &typeVar
1297			}
1298		}
1299	}
1300
1301	return nil
1302}
1303
1304// DatabaseBlobAuditingPolicyListResult a list of database auditing settings.
1305type DatabaseBlobAuditingPolicyListResult struct {
1306	autorest.Response `json:"-"`
1307	// Value - READ-ONLY; Array of results.
1308	Value *[]DatabaseBlobAuditingPolicy `json:"value,omitempty"`
1309	// NextLink - READ-ONLY; Link to retrieve next page of results.
1310	NextLink *string `json:"nextLink,omitempty"`
1311}
1312
1313// MarshalJSON is the custom marshaler for DatabaseBlobAuditingPolicyListResult.
1314func (dbaplr DatabaseBlobAuditingPolicyListResult) MarshalJSON() ([]byte, error) {
1315	objectMap := make(map[string]interface{})
1316	return json.Marshal(objectMap)
1317}
1318
1319// DatabaseBlobAuditingPolicyListResultIterator provides access to a complete listing of
1320// DatabaseBlobAuditingPolicy values.
1321type DatabaseBlobAuditingPolicyListResultIterator struct {
1322	i    int
1323	page DatabaseBlobAuditingPolicyListResultPage
1324}
1325
1326// NextWithContext advances to the next value.  If there was an error making
1327// the request the iterator does not advance and the error is returned.
1328func (iter *DatabaseBlobAuditingPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
1329	if tracing.IsEnabled() {
1330		ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseBlobAuditingPolicyListResultIterator.NextWithContext")
1331		defer func() {
1332			sc := -1
1333			if iter.Response().Response.Response != nil {
1334				sc = iter.Response().Response.Response.StatusCode
1335			}
1336			tracing.EndSpan(ctx, sc, err)
1337		}()
1338	}
1339	iter.i++
1340	if iter.i < len(iter.page.Values()) {
1341		return nil
1342	}
1343	err = iter.page.NextWithContext(ctx)
1344	if err != nil {
1345		iter.i--
1346		return err
1347	}
1348	iter.i = 0
1349	return nil
1350}
1351
1352// Next advances to the next value.  If there was an error making
1353// the request the iterator does not advance and the error is returned.
1354// Deprecated: Use NextWithContext() instead.
1355func (iter *DatabaseBlobAuditingPolicyListResultIterator) Next() error {
1356	return iter.NextWithContext(context.Background())
1357}
1358
1359// NotDone returns true if the enumeration should be started or is not yet complete.
1360func (iter DatabaseBlobAuditingPolicyListResultIterator) NotDone() bool {
1361	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1362}
1363
1364// Response returns the raw server response from the last page request.
1365func (iter DatabaseBlobAuditingPolicyListResultIterator) Response() DatabaseBlobAuditingPolicyListResult {
1366	return iter.page.Response()
1367}
1368
1369// Value returns the current value or a zero-initialized value if the
1370// iterator has advanced beyond the end of the collection.
1371func (iter DatabaseBlobAuditingPolicyListResultIterator) Value() DatabaseBlobAuditingPolicy {
1372	if !iter.page.NotDone() {
1373		return DatabaseBlobAuditingPolicy{}
1374	}
1375	return iter.page.Values()[iter.i]
1376}
1377
1378// Creates a new instance of the DatabaseBlobAuditingPolicyListResultIterator type.
1379func NewDatabaseBlobAuditingPolicyListResultIterator(page DatabaseBlobAuditingPolicyListResultPage) DatabaseBlobAuditingPolicyListResultIterator {
1380	return DatabaseBlobAuditingPolicyListResultIterator{page: page}
1381}
1382
1383// IsEmpty returns true if the ListResult contains no values.
1384func (dbaplr DatabaseBlobAuditingPolicyListResult) IsEmpty() bool {
1385	return dbaplr.Value == nil || len(*dbaplr.Value) == 0
1386}
1387
1388// hasNextLink returns true if the NextLink is not empty.
1389func (dbaplr DatabaseBlobAuditingPolicyListResult) hasNextLink() bool {
1390	return dbaplr.NextLink != nil && len(*dbaplr.NextLink) != 0
1391}
1392
1393// databaseBlobAuditingPolicyListResultPreparer prepares a request to retrieve the next set of results.
1394// It returns nil if no more results exist.
1395func (dbaplr DatabaseBlobAuditingPolicyListResult) databaseBlobAuditingPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
1396	if !dbaplr.hasNextLink() {
1397		return nil, nil
1398	}
1399	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1400		autorest.AsJSON(),
1401		autorest.AsGet(),
1402		autorest.WithBaseURL(to.String(dbaplr.NextLink)))
1403}
1404
1405// DatabaseBlobAuditingPolicyListResultPage contains a page of DatabaseBlobAuditingPolicy values.
1406type DatabaseBlobAuditingPolicyListResultPage struct {
1407	fn     func(context.Context, DatabaseBlobAuditingPolicyListResult) (DatabaseBlobAuditingPolicyListResult, error)
1408	dbaplr DatabaseBlobAuditingPolicyListResult
1409}
1410
1411// NextWithContext advances to the next page of values.  If there was an error making
1412// the request the page does not advance and the error is returned.
1413func (page *DatabaseBlobAuditingPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
1414	if tracing.IsEnabled() {
1415		ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseBlobAuditingPolicyListResultPage.NextWithContext")
1416		defer func() {
1417			sc := -1
1418			if page.Response().Response.Response != nil {
1419				sc = page.Response().Response.Response.StatusCode
1420			}
1421			tracing.EndSpan(ctx, sc, err)
1422		}()
1423	}
1424	for {
1425		next, err := page.fn(ctx, page.dbaplr)
1426		if err != nil {
1427			return err
1428		}
1429		page.dbaplr = next
1430		if !next.hasNextLink() || !next.IsEmpty() {
1431			break
1432		}
1433	}
1434	return nil
1435}
1436
1437// Next advances to the next page of values.  If there was an error making
1438// the request the page does not advance and the error is returned.
1439// Deprecated: Use NextWithContext() instead.
1440func (page *DatabaseBlobAuditingPolicyListResultPage) Next() error {
1441	return page.NextWithContext(context.Background())
1442}
1443
1444// NotDone returns true if the page enumeration should be started or is not yet complete.
1445func (page DatabaseBlobAuditingPolicyListResultPage) NotDone() bool {
1446	return !page.dbaplr.IsEmpty()
1447}
1448
1449// Response returns the raw server response from the last page request.
1450func (page DatabaseBlobAuditingPolicyListResultPage) Response() DatabaseBlobAuditingPolicyListResult {
1451	return page.dbaplr
1452}
1453
1454// Values returns the slice of values for the current page or nil if there are no values.
1455func (page DatabaseBlobAuditingPolicyListResultPage) Values() []DatabaseBlobAuditingPolicy {
1456	if page.dbaplr.IsEmpty() {
1457		return nil
1458	}
1459	return *page.dbaplr.Value
1460}
1461
1462// Creates a new instance of the DatabaseBlobAuditingPolicyListResultPage type.
1463func NewDatabaseBlobAuditingPolicyListResultPage(cur DatabaseBlobAuditingPolicyListResult, getNextPage func(context.Context, DatabaseBlobAuditingPolicyListResult) (DatabaseBlobAuditingPolicyListResult, error)) DatabaseBlobAuditingPolicyListResultPage {
1464	return DatabaseBlobAuditingPolicyListResultPage{
1465		fn:     getNextPage,
1466		dbaplr: cur,
1467	}
1468}
1469
1470// DatabaseBlobAuditingPolicyProperties properties of a database blob auditing policy.
1471type DatabaseBlobAuditingPolicyProperties struct {
1472	// State - Specifies the state of the policy. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. Possible values include: 'BlobAuditingPolicyStateEnabled', 'BlobAuditingPolicyStateDisabled'
1473	State BlobAuditingPolicyState `json:"state,omitempty"`
1474	// StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required.
1475	StorageEndpoint *string `json:"storageEndpoint,omitempty"`
1476	// StorageAccountAccessKey - Specifies the identifier key of the auditing storage account.
1477	// If state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage.
1478	// Prerequisites for using managed identity authentication:
1479	// 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD).
1480	// 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity.
1481	// For more information, see [Auditing to storage using Managed Identity authentication](https://go.microsoft.com/fwlink/?linkid=2114355)
1482	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
1483	// RetentionDays - Specifies the number of days to keep in the audit logs in the storage account.
1484	RetentionDays *int32 `json:"retentionDays,omitempty"`
1485	// AuditActionsAndGroups - Specifies the Actions-Groups and Actions to audit.
1486	//
1487	// 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:
1488	//
1489	// BATCH_COMPLETED_GROUP,
1490	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP,
1491	// FAILED_DATABASE_AUTHENTICATION_GROUP.
1492	//
1493	// This above combination is also the set that is configured by default when enabling auditing from the Azure portal.
1494	//
1495	// 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):
1496	//
1497	// APPLICATION_ROLE_CHANGE_PASSWORD_GROUP
1498	// BACKUP_RESTORE_GROUP
1499	// DATABASE_LOGOUT_GROUP
1500	// DATABASE_OBJECT_CHANGE_GROUP
1501	// DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP
1502	// DATABASE_OBJECT_PERMISSION_CHANGE_GROUP
1503	// DATABASE_OPERATION_GROUP
1504	// DATABASE_PERMISSION_CHANGE_GROUP
1505	// DATABASE_PRINCIPAL_CHANGE_GROUP
1506	// DATABASE_PRINCIPAL_IMPERSONATION_GROUP
1507	// DATABASE_ROLE_MEMBER_CHANGE_GROUP
1508	// FAILED_DATABASE_AUTHENTICATION_GROUP
1509	// SCHEMA_OBJECT_ACCESS_GROUP
1510	// SCHEMA_OBJECT_CHANGE_GROUP
1511	// SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP
1512	// SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP
1513	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP
1514	// USER_CHANGE_PASSWORD_GROUP
1515	// BATCH_STARTED_GROUP
1516	// BATCH_COMPLETED_GROUP
1517	//
1518	// 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.
1519	//
1520	// 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).
1521	//
1522	// 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:
1523	// SELECT
1524	// UPDATE
1525	// INSERT
1526	// DELETE
1527	// EXECUTE
1528	// RECEIVE
1529	// REFERENCES
1530	//
1531	// The general form for defining an action to be audited is:
1532	// {action} ON {object} BY {principal}
1533	//
1534	// 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.
1535	//
1536	// For example:
1537	// SELECT on dbo.myTable by public
1538	// SELECT on DATABASE::myDatabase by public
1539	// SELECT on SCHEMA::mySchema by public
1540	//
1541	// 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)
1542	AuditActionsAndGroups *[]string `json:"auditActionsAndGroups,omitempty"`
1543	// StorageAccountSubscriptionID - Specifies the blob storage subscription Id.
1544	StorageAccountSubscriptionID *uuid.UUID `json:"storageAccountSubscriptionId,omitempty"`
1545	// IsStorageSecondaryKeyInUse - Specifies whether storageAccountAccessKey value is the storage's secondary key.
1546	IsStorageSecondaryKeyInUse *bool `json:"isStorageSecondaryKeyInUse,omitempty"`
1547	// IsAzureMonitorTargetEnabled - Specifies whether audit events are sent to Azure Monitor.
1548	// In order to send the events to Azure Monitor, specify 'state' as 'Enabled' and 'isAzureMonitorTargetEnabled' as true.
1549	//
1550	// When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created.
1551	// Note that for server level audit you should use the 'master' database as {databaseName}.
1552	//
1553	// Diagnostic Settings URI format:
1554	// 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
1555	//
1556	// For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207)
1557	// or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)
1558	IsAzureMonitorTargetEnabled *bool `json:"isAzureMonitorTargetEnabled,omitempty"`
1559	// QueueDelayMs - Specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed.
1560	// The default minimum value is 1000 (1 second). The maximum is 2,147,483,647.
1561	QueueDelayMs *int32 `json:"queueDelayMs,omitempty"`
1562}
1563
1564// DatabaseListResult a list of databases.
1565type DatabaseListResult struct {
1566	autorest.Response `json:"-"`
1567	// Value - READ-ONLY; Array of results.
1568	Value *[]Database `json:"value,omitempty"`
1569	// NextLink - READ-ONLY; Link to retrieve next page of results.
1570	NextLink *string `json:"nextLink,omitempty"`
1571}
1572
1573// MarshalJSON is the custom marshaler for DatabaseListResult.
1574func (dlr DatabaseListResult) MarshalJSON() ([]byte, error) {
1575	objectMap := make(map[string]interface{})
1576	return json.Marshal(objectMap)
1577}
1578
1579// DatabaseListResultIterator provides access to a complete listing of Database values.
1580type DatabaseListResultIterator struct {
1581	i    int
1582	page DatabaseListResultPage
1583}
1584
1585// NextWithContext advances to the next value.  If there was an error making
1586// the request the iterator does not advance and the error is returned.
1587func (iter *DatabaseListResultIterator) NextWithContext(ctx context.Context) (err error) {
1588	if tracing.IsEnabled() {
1589		ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseListResultIterator.NextWithContext")
1590		defer func() {
1591			sc := -1
1592			if iter.Response().Response.Response != nil {
1593				sc = iter.Response().Response.Response.StatusCode
1594			}
1595			tracing.EndSpan(ctx, sc, err)
1596		}()
1597	}
1598	iter.i++
1599	if iter.i < len(iter.page.Values()) {
1600		return nil
1601	}
1602	err = iter.page.NextWithContext(ctx)
1603	if err != nil {
1604		iter.i--
1605		return err
1606	}
1607	iter.i = 0
1608	return nil
1609}
1610
1611// Next advances to the next value.  If there was an error making
1612// the request the iterator does not advance and the error is returned.
1613// Deprecated: Use NextWithContext() instead.
1614func (iter *DatabaseListResultIterator) Next() error {
1615	return iter.NextWithContext(context.Background())
1616}
1617
1618// NotDone returns true if the enumeration should be started or is not yet complete.
1619func (iter DatabaseListResultIterator) NotDone() bool {
1620	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1621}
1622
1623// Response returns the raw server response from the last page request.
1624func (iter DatabaseListResultIterator) Response() DatabaseListResult {
1625	return iter.page.Response()
1626}
1627
1628// Value returns the current value or a zero-initialized value if the
1629// iterator has advanced beyond the end of the collection.
1630func (iter DatabaseListResultIterator) Value() Database {
1631	if !iter.page.NotDone() {
1632		return Database{}
1633	}
1634	return iter.page.Values()[iter.i]
1635}
1636
1637// Creates a new instance of the DatabaseListResultIterator type.
1638func NewDatabaseListResultIterator(page DatabaseListResultPage) DatabaseListResultIterator {
1639	return DatabaseListResultIterator{page: page}
1640}
1641
1642// IsEmpty returns true if the ListResult contains no values.
1643func (dlr DatabaseListResult) IsEmpty() bool {
1644	return dlr.Value == nil || len(*dlr.Value) == 0
1645}
1646
1647// hasNextLink returns true if the NextLink is not empty.
1648func (dlr DatabaseListResult) hasNextLink() bool {
1649	return dlr.NextLink != nil && len(*dlr.NextLink) != 0
1650}
1651
1652// databaseListResultPreparer prepares a request to retrieve the next set of results.
1653// It returns nil if no more results exist.
1654func (dlr DatabaseListResult) databaseListResultPreparer(ctx context.Context) (*http.Request, error) {
1655	if !dlr.hasNextLink() {
1656		return nil, nil
1657	}
1658	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1659		autorest.AsJSON(),
1660		autorest.AsGet(),
1661		autorest.WithBaseURL(to.String(dlr.NextLink)))
1662}
1663
1664// DatabaseListResultPage contains a page of Database values.
1665type DatabaseListResultPage struct {
1666	fn  func(context.Context, DatabaseListResult) (DatabaseListResult, error)
1667	dlr DatabaseListResult
1668}
1669
1670// NextWithContext advances to the next page of values.  If there was an error making
1671// the request the page does not advance and the error is returned.
1672func (page *DatabaseListResultPage) NextWithContext(ctx context.Context) (err error) {
1673	if tracing.IsEnabled() {
1674		ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseListResultPage.NextWithContext")
1675		defer func() {
1676			sc := -1
1677			if page.Response().Response.Response != nil {
1678				sc = page.Response().Response.Response.StatusCode
1679			}
1680			tracing.EndSpan(ctx, sc, err)
1681		}()
1682	}
1683	for {
1684		next, err := page.fn(ctx, page.dlr)
1685		if err != nil {
1686			return err
1687		}
1688		page.dlr = next
1689		if !next.hasNextLink() || !next.IsEmpty() {
1690			break
1691		}
1692	}
1693	return nil
1694}
1695
1696// Next advances to the next page of values.  If there was an error making
1697// the request the page does not advance and the error is returned.
1698// Deprecated: Use NextWithContext() instead.
1699func (page *DatabaseListResultPage) Next() error {
1700	return page.NextWithContext(context.Background())
1701}
1702
1703// NotDone returns true if the page enumeration should be started or is not yet complete.
1704func (page DatabaseListResultPage) NotDone() bool {
1705	return !page.dlr.IsEmpty()
1706}
1707
1708// Response returns the raw server response from the last page request.
1709func (page DatabaseListResultPage) Response() DatabaseListResult {
1710	return page.dlr
1711}
1712
1713// Values returns the slice of values for the current page or nil if there are no values.
1714func (page DatabaseListResultPage) Values() []Database {
1715	if page.dlr.IsEmpty() {
1716		return nil
1717	}
1718	return *page.dlr.Value
1719}
1720
1721// Creates a new instance of the DatabaseListResultPage type.
1722func NewDatabaseListResultPage(cur DatabaseListResult, getNextPage func(context.Context, DatabaseListResult) (DatabaseListResult, error)) DatabaseListResultPage {
1723	return DatabaseListResultPage{
1724		fn:  getNextPage,
1725		dlr: cur,
1726	}
1727}
1728
1729// DatabaseOperation a database operation.
1730type DatabaseOperation struct {
1731	// DatabaseOperationProperties - Resource properties.
1732	*DatabaseOperationProperties `json:"properties,omitempty"`
1733	// ID - READ-ONLY; Resource ID.
1734	ID *string `json:"id,omitempty"`
1735	// Name - READ-ONLY; Resource name.
1736	Name *string `json:"name,omitempty"`
1737	// Type - READ-ONLY; Resource type.
1738	Type *string `json:"type,omitempty"`
1739}
1740
1741// MarshalJSON is the custom marshaler for DatabaseOperation.
1742func (do DatabaseOperation) MarshalJSON() ([]byte, error) {
1743	objectMap := make(map[string]interface{})
1744	if do.DatabaseOperationProperties != nil {
1745		objectMap["properties"] = do.DatabaseOperationProperties
1746	}
1747	return json.Marshal(objectMap)
1748}
1749
1750// UnmarshalJSON is the custom unmarshaler for DatabaseOperation struct.
1751func (do *DatabaseOperation) UnmarshalJSON(body []byte) error {
1752	var m map[string]*json.RawMessage
1753	err := json.Unmarshal(body, &m)
1754	if err != nil {
1755		return err
1756	}
1757	for k, v := range m {
1758		switch k {
1759		case "properties":
1760			if v != nil {
1761				var databaseOperationProperties DatabaseOperationProperties
1762				err = json.Unmarshal(*v, &databaseOperationProperties)
1763				if err != nil {
1764					return err
1765				}
1766				do.DatabaseOperationProperties = &databaseOperationProperties
1767			}
1768		case "id":
1769			if v != nil {
1770				var ID string
1771				err = json.Unmarshal(*v, &ID)
1772				if err != nil {
1773					return err
1774				}
1775				do.ID = &ID
1776			}
1777		case "name":
1778			if v != nil {
1779				var name string
1780				err = json.Unmarshal(*v, &name)
1781				if err != nil {
1782					return err
1783				}
1784				do.Name = &name
1785			}
1786		case "type":
1787			if v != nil {
1788				var typeVar string
1789				err = json.Unmarshal(*v, &typeVar)
1790				if err != nil {
1791					return err
1792				}
1793				do.Type = &typeVar
1794			}
1795		}
1796	}
1797
1798	return nil
1799}
1800
1801// DatabaseOperationListResult the response to a list database operations request
1802type DatabaseOperationListResult struct {
1803	autorest.Response `json:"-"`
1804	// Value - READ-ONLY; Array of results.
1805	Value *[]DatabaseOperation `json:"value,omitempty"`
1806	// NextLink - READ-ONLY; Link to retrieve next page of results.
1807	NextLink *string `json:"nextLink,omitempty"`
1808}
1809
1810// MarshalJSON is the custom marshaler for DatabaseOperationListResult.
1811func (dolr DatabaseOperationListResult) MarshalJSON() ([]byte, error) {
1812	objectMap := make(map[string]interface{})
1813	return json.Marshal(objectMap)
1814}
1815
1816// DatabaseOperationListResultIterator provides access to a complete listing of DatabaseOperation values.
1817type DatabaseOperationListResultIterator struct {
1818	i    int
1819	page DatabaseOperationListResultPage
1820}
1821
1822// NextWithContext advances to the next value.  If there was an error making
1823// the request the iterator does not advance and the error is returned.
1824func (iter *DatabaseOperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
1825	if tracing.IsEnabled() {
1826		ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseOperationListResultIterator.NextWithContext")
1827		defer func() {
1828			sc := -1
1829			if iter.Response().Response.Response != nil {
1830				sc = iter.Response().Response.Response.StatusCode
1831			}
1832			tracing.EndSpan(ctx, sc, err)
1833		}()
1834	}
1835	iter.i++
1836	if iter.i < len(iter.page.Values()) {
1837		return nil
1838	}
1839	err = iter.page.NextWithContext(ctx)
1840	if err != nil {
1841		iter.i--
1842		return err
1843	}
1844	iter.i = 0
1845	return nil
1846}
1847
1848// Next advances to the next value.  If there was an error making
1849// the request the iterator does not advance and the error is returned.
1850// Deprecated: Use NextWithContext() instead.
1851func (iter *DatabaseOperationListResultIterator) Next() error {
1852	return iter.NextWithContext(context.Background())
1853}
1854
1855// NotDone returns true if the enumeration should be started or is not yet complete.
1856func (iter DatabaseOperationListResultIterator) NotDone() bool {
1857	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1858}
1859
1860// Response returns the raw server response from the last page request.
1861func (iter DatabaseOperationListResultIterator) Response() DatabaseOperationListResult {
1862	return iter.page.Response()
1863}
1864
1865// Value returns the current value or a zero-initialized value if the
1866// iterator has advanced beyond the end of the collection.
1867func (iter DatabaseOperationListResultIterator) Value() DatabaseOperation {
1868	if !iter.page.NotDone() {
1869		return DatabaseOperation{}
1870	}
1871	return iter.page.Values()[iter.i]
1872}
1873
1874// Creates a new instance of the DatabaseOperationListResultIterator type.
1875func NewDatabaseOperationListResultIterator(page DatabaseOperationListResultPage) DatabaseOperationListResultIterator {
1876	return DatabaseOperationListResultIterator{page: page}
1877}
1878
1879// IsEmpty returns true if the ListResult contains no values.
1880func (dolr DatabaseOperationListResult) IsEmpty() bool {
1881	return dolr.Value == nil || len(*dolr.Value) == 0
1882}
1883
1884// hasNextLink returns true if the NextLink is not empty.
1885func (dolr DatabaseOperationListResult) hasNextLink() bool {
1886	return dolr.NextLink != nil && len(*dolr.NextLink) != 0
1887}
1888
1889// databaseOperationListResultPreparer prepares a request to retrieve the next set of results.
1890// It returns nil if no more results exist.
1891func (dolr DatabaseOperationListResult) databaseOperationListResultPreparer(ctx context.Context) (*http.Request, error) {
1892	if !dolr.hasNextLink() {
1893		return nil, nil
1894	}
1895	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1896		autorest.AsJSON(),
1897		autorest.AsGet(),
1898		autorest.WithBaseURL(to.String(dolr.NextLink)))
1899}
1900
1901// DatabaseOperationListResultPage contains a page of DatabaseOperation values.
1902type DatabaseOperationListResultPage struct {
1903	fn   func(context.Context, DatabaseOperationListResult) (DatabaseOperationListResult, error)
1904	dolr DatabaseOperationListResult
1905}
1906
1907// NextWithContext advances to the next page of values.  If there was an error making
1908// the request the page does not advance and the error is returned.
1909func (page *DatabaseOperationListResultPage) NextWithContext(ctx context.Context) (err error) {
1910	if tracing.IsEnabled() {
1911		ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseOperationListResultPage.NextWithContext")
1912		defer func() {
1913			sc := -1
1914			if page.Response().Response.Response != nil {
1915				sc = page.Response().Response.Response.StatusCode
1916			}
1917			tracing.EndSpan(ctx, sc, err)
1918		}()
1919	}
1920	for {
1921		next, err := page.fn(ctx, page.dolr)
1922		if err != nil {
1923			return err
1924		}
1925		page.dolr = next
1926		if !next.hasNextLink() || !next.IsEmpty() {
1927			break
1928		}
1929	}
1930	return nil
1931}
1932
1933// Next advances to the next page of values.  If there was an error making
1934// the request the page does not advance and the error is returned.
1935// Deprecated: Use NextWithContext() instead.
1936func (page *DatabaseOperationListResultPage) Next() error {
1937	return page.NextWithContext(context.Background())
1938}
1939
1940// NotDone returns true if the page enumeration should be started or is not yet complete.
1941func (page DatabaseOperationListResultPage) NotDone() bool {
1942	return !page.dolr.IsEmpty()
1943}
1944
1945// Response returns the raw server response from the last page request.
1946func (page DatabaseOperationListResultPage) Response() DatabaseOperationListResult {
1947	return page.dolr
1948}
1949
1950// Values returns the slice of values for the current page or nil if there are no values.
1951func (page DatabaseOperationListResultPage) Values() []DatabaseOperation {
1952	if page.dolr.IsEmpty() {
1953		return nil
1954	}
1955	return *page.dolr.Value
1956}
1957
1958// Creates a new instance of the DatabaseOperationListResultPage type.
1959func NewDatabaseOperationListResultPage(cur DatabaseOperationListResult, getNextPage func(context.Context, DatabaseOperationListResult) (DatabaseOperationListResult, error)) DatabaseOperationListResultPage {
1960	return DatabaseOperationListResultPage{
1961		fn:   getNextPage,
1962		dolr: cur,
1963	}
1964}
1965
1966// DatabaseOperationProperties the properties of a database operation.
1967type DatabaseOperationProperties struct {
1968	// DatabaseName - READ-ONLY; The name of the database the operation is being performed on.
1969	DatabaseName *string `json:"databaseName,omitempty"`
1970	// Operation - READ-ONLY; The name of operation.
1971	Operation *string `json:"operation,omitempty"`
1972	// OperationFriendlyName - READ-ONLY; The friendly name of operation.
1973	OperationFriendlyName *string `json:"operationFriendlyName,omitempty"`
1974	// PercentComplete - READ-ONLY; The percentage of the operation completed.
1975	PercentComplete *int32 `json:"percentComplete,omitempty"`
1976	// ServerName - READ-ONLY; The name of the server.
1977	ServerName *string `json:"serverName,omitempty"`
1978	// StartTime - READ-ONLY; The operation start time.
1979	StartTime *date.Time `json:"startTime,omitempty"`
1980	// State - READ-ONLY; The operation state. Possible values include: 'ManagementOperationStatePending', 'ManagementOperationStateInProgress', 'ManagementOperationStateSucceeded', 'ManagementOperationStateFailed', 'ManagementOperationStateCancelInProgress', 'ManagementOperationStateCancelled'
1981	State ManagementOperationState `json:"state,omitempty"`
1982	// ErrorCode - READ-ONLY; The operation error code.
1983	ErrorCode *int32 `json:"errorCode,omitempty"`
1984	// ErrorDescription - READ-ONLY; The operation error description.
1985	ErrorDescription *string `json:"errorDescription,omitempty"`
1986	// ErrorSeverity - READ-ONLY; The operation error severity.
1987	ErrorSeverity *int32 `json:"errorSeverity,omitempty"`
1988	// IsUserError - READ-ONLY; Whether or not the error is a user error.
1989	IsUserError *bool `json:"isUserError,omitempty"`
1990	// EstimatedCompletionTime - READ-ONLY; The estimated completion time of the operation.
1991	EstimatedCompletionTime *date.Time `json:"estimatedCompletionTime,omitempty"`
1992	// Description - READ-ONLY; The operation description.
1993	Description *string `json:"description,omitempty"`
1994	// IsCancellable - READ-ONLY; Whether the operation can be cancelled.
1995	IsCancellable *bool `json:"isCancellable,omitempty"`
1996}
1997
1998// MarshalJSON is the custom marshaler for DatabaseOperationProperties.
1999func (dop DatabaseOperationProperties) MarshalJSON() ([]byte, error) {
2000	objectMap := make(map[string]interface{})
2001	return json.Marshal(objectMap)
2002}
2003
2004// DatabaseProperties the database's properties.
2005type DatabaseProperties struct {
2006	// CreateMode - Specifies the mode of database creation.
2007	//
2008	// Default: regular database creation.
2009	//
2010	// Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified as the resource ID of the source database.
2011	//
2012	// 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.
2013	//
2014	// 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.
2015	//
2016	// Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be specified as the recoverable database resource ID to restore.
2017	//
2018	// 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.
2019	//
2020	// RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention vault. recoveryServicesRecoveryPointResourceId must be specified as the recovery point resource ID.
2021	//
2022	// Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. Possible values include: 'CreateModeDefault', 'CreateModeCopy', 'CreateModeSecondary', 'CreateModePointInTimeRestore', 'CreateModeRestore', 'CreateModeRecovery', 'CreateModeRestoreExternalBackup', 'CreateModeRestoreExternalBackupSecondary', 'CreateModeRestoreLongTermRetentionBackup', 'CreateModeOnlineSecondary'
2023	CreateMode CreateMode `json:"createMode,omitempty"`
2024	// Collation - The collation of the database.
2025	Collation *string `json:"collation,omitempty"`
2026	// MaxSizeBytes - The max size of the database expressed in bytes.
2027	MaxSizeBytes *int64 `json:"maxSizeBytes,omitempty"`
2028	// SampleName - The name of the sample schema to apply when creating this database. Possible values include: 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull'
2029	SampleName SampleName `json:"sampleName,omitempty"`
2030	// ElasticPoolID - The resource identifier of the elastic pool containing this database.
2031	ElasticPoolID *string `json:"elasticPoolId,omitempty"`
2032	// SourceDatabaseID - The resource identifier of the source database associated with create operation of this database.
2033	SourceDatabaseID *string `json:"sourceDatabaseId,omitempty"`
2034	// 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'
2035	Status DatabaseStatus `json:"status,omitempty"`
2036	// DatabaseID - READ-ONLY; The ID of the database.
2037	DatabaseID *uuid.UUID `json:"databaseId,omitempty"`
2038	// CreationDate - READ-ONLY; The creation date of the database (ISO8601 format).
2039	CreationDate *date.Time `json:"creationDate,omitempty"`
2040	// CurrentServiceObjectiveName - READ-ONLY; The current service level objective name of the database.
2041	CurrentServiceObjectiveName *string `json:"currentServiceObjectiveName,omitempty"`
2042	// RequestedServiceObjectiveName - READ-ONLY; The requested service level objective name of the database.
2043	RequestedServiceObjectiveName *string `json:"requestedServiceObjectiveName,omitempty"`
2044	// DefaultSecondaryLocation - READ-ONLY; The default secondary region for this database.
2045	DefaultSecondaryLocation *string `json:"defaultSecondaryLocation,omitempty"`
2046	// FailoverGroupID - READ-ONLY; Failover Group resource identifier that this database belongs to.
2047	FailoverGroupID *string `json:"failoverGroupId,omitempty"`
2048	// RestorePointInTime - Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database.
2049	RestorePointInTime *date.Time `json:"restorePointInTime,omitempty"`
2050	// SourceDatabaseDeletionDate - Specifies the time that the database was deleted.
2051	SourceDatabaseDeletionDate *date.Time `json:"sourceDatabaseDeletionDate,omitempty"`
2052	// RecoveryServicesRecoveryPointID - The resource identifier of the recovery point associated with create operation of this database.
2053	RecoveryServicesRecoveryPointID *string `json:"recoveryServicesRecoveryPointId,omitempty"`
2054	// LongTermRetentionBackupResourceID - The resource identifier of the long term retention backup associated with create operation of this database.
2055	LongTermRetentionBackupResourceID *string `json:"longTermRetentionBackupResourceId,omitempty"`
2056	// RecoverableDatabaseID - The resource identifier of the recoverable database associated with create operation of this database.
2057	RecoverableDatabaseID *string `json:"recoverableDatabaseId,omitempty"`
2058	// RestorableDroppedDatabaseID - The resource identifier of the restorable dropped database associated with create operation of this database.
2059	RestorableDroppedDatabaseID *string `json:"restorableDroppedDatabaseId,omitempty"`
2060	// CatalogCollation - Collation of the metadata catalog. Possible values include: 'DATABASEDEFAULT', 'SQLLatin1GeneralCP1CIAS'
2061	CatalogCollation CatalogCollationType `json:"catalogCollation,omitempty"`
2062	// ZoneRedundant - Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones.
2063	ZoneRedundant *bool `json:"zoneRedundant,omitempty"`
2064	// 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: 'LicenseIncluded', 'BasePrice'
2065	LicenseType DatabaseLicenseType `json:"licenseType,omitempty"`
2066	// MaxLogSizeBytes - READ-ONLY; The max log size for this database.
2067	MaxLogSizeBytes *int64 `json:"maxLogSizeBytes,omitempty"`
2068	// EarliestRestoreDate - READ-ONLY; This records the earliest start date and time that restore is available for this database (ISO8601 format).
2069	EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"`
2070	// 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'
2071	ReadScale DatabaseReadScale `json:"readScale,omitempty"`
2072	// ReadReplicaCount - The number of readonly secondary replicas associated with the database.
2073	ReadReplicaCount *int32 `json:"readReplicaCount,omitempty"`
2074	// CurrentSku - READ-ONLY; The name and tier of the SKU.
2075	CurrentSku *Sku `json:"currentSku,omitempty"`
2076	// AutoPauseDelay - Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled
2077	AutoPauseDelay *int32 `json:"autoPauseDelay,omitempty"`
2078	// StorageAccountType - The storage account type used to store backups for this database. Possible values include: 'GRS', 'LRS', 'ZRS'
2079	StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"`
2080	// MinCapacity - Minimal capacity that database will always have allocated, if not paused
2081	MinCapacity *float64 `json:"minCapacity,omitempty"`
2082	// PausedDate - READ-ONLY; The date when database was paused by user configuration or action(ISO8601 format). Null if the database is ready.
2083	PausedDate *date.Time `json:"pausedDate,omitempty"`
2084	// ResumedDate - READ-ONLY; The date when database was resumed by user action or database login (ISO8601 format). Null if the database is paused.
2085	ResumedDate *date.Time `json:"resumedDate,omitempty"`
2086}
2087
2088// MarshalJSON is the custom marshaler for DatabaseProperties.
2089func (dp DatabaseProperties) MarshalJSON() ([]byte, error) {
2090	objectMap := make(map[string]interface{})
2091	if dp.CreateMode != "" {
2092		objectMap["createMode"] = dp.CreateMode
2093	}
2094	if dp.Collation != nil {
2095		objectMap["collation"] = dp.Collation
2096	}
2097	if dp.MaxSizeBytes != nil {
2098		objectMap["maxSizeBytes"] = dp.MaxSizeBytes
2099	}
2100	if dp.SampleName != "" {
2101		objectMap["sampleName"] = dp.SampleName
2102	}
2103	if dp.ElasticPoolID != nil {
2104		objectMap["elasticPoolId"] = dp.ElasticPoolID
2105	}
2106	if dp.SourceDatabaseID != nil {
2107		objectMap["sourceDatabaseId"] = dp.SourceDatabaseID
2108	}
2109	if dp.RestorePointInTime != nil {
2110		objectMap["restorePointInTime"] = dp.RestorePointInTime
2111	}
2112	if dp.SourceDatabaseDeletionDate != nil {
2113		objectMap["sourceDatabaseDeletionDate"] = dp.SourceDatabaseDeletionDate
2114	}
2115	if dp.RecoveryServicesRecoveryPointID != nil {
2116		objectMap["recoveryServicesRecoveryPointId"] = dp.RecoveryServicesRecoveryPointID
2117	}
2118	if dp.LongTermRetentionBackupResourceID != nil {
2119		objectMap["longTermRetentionBackupResourceId"] = dp.LongTermRetentionBackupResourceID
2120	}
2121	if dp.RecoverableDatabaseID != nil {
2122		objectMap["recoverableDatabaseId"] = dp.RecoverableDatabaseID
2123	}
2124	if dp.RestorableDroppedDatabaseID != nil {
2125		objectMap["restorableDroppedDatabaseId"] = dp.RestorableDroppedDatabaseID
2126	}
2127	if dp.CatalogCollation != "" {
2128		objectMap["catalogCollation"] = dp.CatalogCollation
2129	}
2130	if dp.ZoneRedundant != nil {
2131		objectMap["zoneRedundant"] = dp.ZoneRedundant
2132	}
2133	if dp.LicenseType != "" {
2134		objectMap["licenseType"] = dp.LicenseType
2135	}
2136	if dp.ReadScale != "" {
2137		objectMap["readScale"] = dp.ReadScale
2138	}
2139	if dp.ReadReplicaCount != nil {
2140		objectMap["readReplicaCount"] = dp.ReadReplicaCount
2141	}
2142	if dp.AutoPauseDelay != nil {
2143		objectMap["autoPauseDelay"] = dp.AutoPauseDelay
2144	}
2145	if dp.StorageAccountType != "" {
2146		objectMap["storageAccountType"] = dp.StorageAccountType
2147	}
2148	if dp.MinCapacity != nil {
2149		objectMap["minCapacity"] = dp.MinCapacity
2150	}
2151	return json.Marshal(objectMap)
2152}
2153
2154// DatabasesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
2155// operation.
2156type DatabasesCreateOrUpdateFuture struct {
2157	azure.FutureAPI
2158	// Result returns the result of the asynchronous operation.
2159	// If the operation has not completed it will return an error.
2160	Result func(DatabasesClient) (Database, error)
2161}
2162
2163// UnmarshalJSON is the custom unmarshaller for CreateFuture.
2164func (future *DatabasesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
2165	var azFuture azure.Future
2166	if err := json.Unmarshal(body, &azFuture); err != nil {
2167		return err
2168	}
2169	future.FutureAPI = &azFuture
2170	future.Result = future.result
2171	return nil
2172}
2173
2174// result is the default implementation for DatabasesCreateOrUpdateFuture.Result.
2175func (future *DatabasesCreateOrUpdateFuture) result(client DatabasesClient) (d Database, err error) {
2176	var done bool
2177	done, err = future.DoneWithContext(context.Background(), client)
2178	if err != nil {
2179		err = autorest.NewErrorWithError(err, "sql.DatabasesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
2180		return
2181	}
2182	if !done {
2183		d.Response.Response = future.Response()
2184		err = azure.NewAsyncOpIncompleteError("sql.DatabasesCreateOrUpdateFuture")
2185		return
2186	}
2187	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2188	if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent {
2189		d, err = client.CreateOrUpdateResponder(d.Response.Response)
2190		if err != nil {
2191			err = autorest.NewErrorWithError(err, "sql.DatabasesCreateOrUpdateFuture", "Result", d.Response.Response, "Failure responding to request")
2192		}
2193	}
2194	return
2195}
2196
2197// DatabasesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
2198// operation.
2199type DatabasesDeleteFuture struct {
2200	azure.FutureAPI
2201	// Result returns the result of the asynchronous operation.
2202	// If the operation has not completed it will return an error.
2203	Result func(DatabasesClient) (autorest.Response, error)
2204}
2205
2206// UnmarshalJSON is the custom unmarshaller for CreateFuture.
2207func (future *DatabasesDeleteFuture) UnmarshalJSON(body []byte) error {
2208	var azFuture azure.Future
2209	if err := json.Unmarshal(body, &azFuture); err != nil {
2210		return err
2211	}
2212	future.FutureAPI = &azFuture
2213	future.Result = future.result
2214	return nil
2215}
2216
2217// result is the default implementation for DatabasesDeleteFuture.Result.
2218func (future *DatabasesDeleteFuture) result(client DatabasesClient) (ar autorest.Response, err error) {
2219	var done bool
2220	done, err = future.DoneWithContext(context.Background(), client)
2221	if err != nil {
2222		err = autorest.NewErrorWithError(err, "sql.DatabasesDeleteFuture", "Result", future.Response(), "Polling failure")
2223		return
2224	}
2225	if !done {
2226		ar.Response = future.Response()
2227		err = azure.NewAsyncOpIncompleteError("sql.DatabasesDeleteFuture")
2228		return
2229	}
2230	ar.Response = future.Response()
2231	return
2232}
2233
2234// DatabaseSecurityAlertPolicy contains information about a database Threat Detection policy.
2235type DatabaseSecurityAlertPolicy struct {
2236	autorest.Response `json:"-"`
2237	// Location - The geo-location where the resource lives
2238	Location *string `json:"location,omitempty"`
2239	// Kind - READ-ONLY; Resource kind.
2240	Kind *string `json:"kind,omitempty"`
2241	// DatabaseSecurityAlertPolicyProperties - Properties of the security alert policy.
2242	*DatabaseSecurityAlertPolicyProperties `json:"properties,omitempty"`
2243	// ID - READ-ONLY; Resource ID.
2244	ID *string `json:"id,omitempty"`
2245	// Name - READ-ONLY; Resource name.
2246	Name *string `json:"name,omitempty"`
2247	// Type - READ-ONLY; Resource type.
2248	Type *string `json:"type,omitempty"`
2249}
2250
2251// MarshalJSON is the custom marshaler for DatabaseSecurityAlertPolicy.
2252func (dsap DatabaseSecurityAlertPolicy) MarshalJSON() ([]byte, error) {
2253	objectMap := make(map[string]interface{})
2254	if dsap.Location != nil {
2255		objectMap["location"] = dsap.Location
2256	}
2257	if dsap.DatabaseSecurityAlertPolicyProperties != nil {
2258		objectMap["properties"] = dsap.DatabaseSecurityAlertPolicyProperties
2259	}
2260	return json.Marshal(objectMap)
2261}
2262
2263// UnmarshalJSON is the custom unmarshaler for DatabaseSecurityAlertPolicy struct.
2264func (dsap *DatabaseSecurityAlertPolicy) UnmarshalJSON(body []byte) error {
2265	var m map[string]*json.RawMessage
2266	err := json.Unmarshal(body, &m)
2267	if err != nil {
2268		return err
2269	}
2270	for k, v := range m {
2271		switch k {
2272		case "location":
2273			if v != nil {
2274				var location string
2275				err = json.Unmarshal(*v, &location)
2276				if err != nil {
2277					return err
2278				}
2279				dsap.Location = &location
2280			}
2281		case "kind":
2282			if v != nil {
2283				var kind string
2284				err = json.Unmarshal(*v, &kind)
2285				if err != nil {
2286					return err
2287				}
2288				dsap.Kind = &kind
2289			}
2290		case "properties":
2291			if v != nil {
2292				var databaseSecurityAlertPolicyProperties DatabaseSecurityAlertPolicyProperties
2293				err = json.Unmarshal(*v, &databaseSecurityAlertPolicyProperties)
2294				if err != nil {
2295					return err
2296				}
2297				dsap.DatabaseSecurityAlertPolicyProperties = &databaseSecurityAlertPolicyProperties
2298			}
2299		case "id":
2300			if v != nil {
2301				var ID string
2302				err = json.Unmarshal(*v, &ID)
2303				if err != nil {
2304					return err
2305				}
2306				dsap.ID = &ID
2307			}
2308		case "name":
2309			if v != nil {
2310				var name string
2311				err = json.Unmarshal(*v, &name)
2312				if err != nil {
2313					return err
2314				}
2315				dsap.Name = &name
2316			}
2317		case "type":
2318			if v != nil {
2319				var typeVar string
2320				err = json.Unmarshal(*v, &typeVar)
2321				if err != nil {
2322					return err
2323				}
2324				dsap.Type = &typeVar
2325			}
2326		}
2327	}
2328
2329	return nil
2330}
2331
2332// DatabaseSecurityAlertPolicyProperties properties for a database Threat Detection policy.
2333type DatabaseSecurityAlertPolicyProperties struct {
2334	// State - Specifies the state of the policy. If state is Enabled, storageEndpoint and storageAccountAccessKey are required. Possible values include: 'SecurityAlertPolicyStateNew', 'SecurityAlertPolicyStateEnabled', 'SecurityAlertPolicyStateDisabled'
2335	State SecurityAlertPolicyState `json:"state,omitempty"`
2336	// DisabledAlerts - Specifies the semicolon-separated list of alerts that are disabled, or empty string to disable no alerts. Possible values: Sql_Injection; Sql_Injection_Vulnerability; Access_Anomaly; Data_Exfiltration; Unsafe_Action.
2337	DisabledAlerts *string `json:"disabledAlerts,omitempty"`
2338	// EmailAddresses - Specifies the semicolon-separated list of e-mail addresses to which the alert is sent.
2339	EmailAddresses *string `json:"emailAddresses,omitempty"`
2340	// EmailAccountAdmins - Specifies that the alert is sent to the account administrators. Possible values include: 'SecurityAlertPolicyEmailAccountAdminsEnabled', 'SecurityAlertPolicyEmailAccountAdminsDisabled'
2341	EmailAccountAdmins SecurityAlertPolicyEmailAccountAdmins `json:"emailAccountAdmins,omitempty"`
2342	// StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs. If state is Enabled, storageEndpoint is required.
2343	StorageEndpoint *string `json:"storageEndpoint,omitempty"`
2344	// StorageAccountAccessKey - Specifies the identifier key of the Threat Detection audit storage account. If state is Enabled, storageAccountAccessKey is required.
2345	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
2346	// RetentionDays - Specifies the number of days to keep in the Threat Detection audit logs.
2347	RetentionDays *int32 `json:"retentionDays,omitempty"`
2348	// UseServerDefault - Specifies whether to use the default server policy. Possible values include: 'SecurityAlertPolicyUseServerDefaultEnabled', 'SecurityAlertPolicyUseServerDefaultDisabled'
2349	UseServerDefault SecurityAlertPolicyUseServerDefault `json:"useServerDefault,omitempty"`
2350}
2351
2352// DatabasesExportFuture an abstraction for monitoring and retrieving the results of a long-running
2353// operation.
2354type DatabasesExportFuture struct {
2355	azure.FutureAPI
2356	// Result returns the result of the asynchronous operation.
2357	// If the operation has not completed it will return an error.
2358	Result func(DatabasesClient) (ImportExportOperationResult, error)
2359}
2360
2361// UnmarshalJSON is the custom unmarshaller for CreateFuture.
2362func (future *DatabasesExportFuture) UnmarshalJSON(body []byte) error {
2363	var azFuture azure.Future
2364	if err := json.Unmarshal(body, &azFuture); err != nil {
2365		return err
2366	}
2367	future.FutureAPI = &azFuture
2368	future.Result = future.result
2369	return nil
2370}
2371
2372// result is the default implementation for DatabasesExportFuture.Result.
2373func (future *DatabasesExportFuture) result(client DatabasesClient) (ieor ImportExportOperationResult, err error) {
2374	var done bool
2375	done, err = future.DoneWithContext(context.Background(), client)
2376	if err != nil {
2377		err = autorest.NewErrorWithError(err, "sql.DatabasesExportFuture", "Result", future.Response(), "Polling failure")
2378		return
2379	}
2380	if !done {
2381		ieor.Response.Response = future.Response()
2382		err = azure.NewAsyncOpIncompleteError("sql.DatabasesExportFuture")
2383		return
2384	}
2385	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2386	if ieor.Response.Response, err = future.GetResult(sender); err == nil && ieor.Response.Response.StatusCode != http.StatusNoContent {
2387		ieor, err = client.ExportResponder(ieor.Response.Response)
2388		if err != nil {
2389			err = autorest.NewErrorWithError(err, "sql.DatabasesExportFuture", "Result", ieor.Response.Response, "Failure responding to request")
2390		}
2391	}
2392	return
2393}
2394
2395// DatabasesFailoverFuture an abstraction for monitoring and retrieving the results of a long-running
2396// operation.
2397type DatabasesFailoverFuture struct {
2398	azure.FutureAPI
2399	// Result returns the result of the asynchronous operation.
2400	// If the operation has not completed it will return an error.
2401	Result func(DatabasesClient) (autorest.Response, error)
2402}
2403
2404// UnmarshalJSON is the custom unmarshaller for CreateFuture.
2405func (future *DatabasesFailoverFuture) UnmarshalJSON(body []byte) error {
2406	var azFuture azure.Future
2407	if err := json.Unmarshal(body, &azFuture); err != nil {
2408		return err
2409	}
2410	future.FutureAPI = &azFuture
2411	future.Result = future.result
2412	return nil
2413}
2414
2415// result is the default implementation for DatabasesFailoverFuture.Result.
2416func (future *DatabasesFailoverFuture) result(client DatabasesClient) (ar autorest.Response, err error) {
2417	var done bool
2418	done, err = future.DoneWithContext(context.Background(), client)
2419	if err != nil {
2420		err = autorest.NewErrorWithError(err, "sql.DatabasesFailoverFuture", "Result", future.Response(), "Polling failure")
2421		return
2422	}
2423	if !done {
2424		ar.Response = future.Response()
2425		err = azure.NewAsyncOpIncompleteError("sql.DatabasesFailoverFuture")
2426		return
2427	}
2428	ar.Response = future.Response()
2429	return
2430}
2431
2432// DatabasesPauseFuture an abstraction for monitoring and retrieving the results of a long-running
2433// operation.
2434type DatabasesPauseFuture struct {
2435	azure.FutureAPI
2436	// Result returns the result of the asynchronous operation.
2437	// If the operation has not completed it will return an error.
2438	Result func(DatabasesClient) (Database, error)
2439}
2440
2441// UnmarshalJSON is the custom unmarshaller for CreateFuture.
2442func (future *DatabasesPauseFuture) UnmarshalJSON(body []byte) error {
2443	var azFuture azure.Future
2444	if err := json.Unmarshal(body, &azFuture); err != nil {
2445		return err
2446	}
2447	future.FutureAPI = &azFuture
2448	future.Result = future.result
2449	return nil
2450}
2451
2452// result is the default implementation for DatabasesPauseFuture.Result.
2453func (future *DatabasesPauseFuture) result(client DatabasesClient) (d Database, err error) {
2454	var done bool
2455	done, err = future.DoneWithContext(context.Background(), client)
2456	if err != nil {
2457		err = autorest.NewErrorWithError(err, "sql.DatabasesPauseFuture", "Result", future.Response(), "Polling failure")
2458		return
2459	}
2460	if !done {
2461		d.Response.Response = future.Response()
2462		err = azure.NewAsyncOpIncompleteError("sql.DatabasesPauseFuture")
2463		return
2464	}
2465	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2466	if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent {
2467		d, err = client.PauseResponder(d.Response.Response)
2468		if err != nil {
2469			err = autorest.NewErrorWithError(err, "sql.DatabasesPauseFuture", "Result", d.Response.Response, "Failure responding to request")
2470		}
2471	}
2472	return
2473}
2474
2475// DatabasesResumeFuture an abstraction for monitoring and retrieving the results of a long-running
2476// operation.
2477type DatabasesResumeFuture struct {
2478	azure.FutureAPI
2479	// Result returns the result of the asynchronous operation.
2480	// If the operation has not completed it will return an error.
2481	Result func(DatabasesClient) (Database, error)
2482}
2483
2484// UnmarshalJSON is the custom unmarshaller for CreateFuture.
2485func (future *DatabasesResumeFuture) UnmarshalJSON(body []byte) error {
2486	var azFuture azure.Future
2487	if err := json.Unmarshal(body, &azFuture); err != nil {
2488		return err
2489	}
2490	future.FutureAPI = &azFuture
2491	future.Result = future.result
2492	return nil
2493}
2494
2495// result is the default implementation for DatabasesResumeFuture.Result.
2496func (future *DatabasesResumeFuture) result(client DatabasesClient) (d Database, err error) {
2497	var done bool
2498	done, err = future.DoneWithContext(context.Background(), client)
2499	if err != nil {
2500		err = autorest.NewErrorWithError(err, "sql.DatabasesResumeFuture", "Result", future.Response(), "Polling failure")
2501		return
2502	}
2503	if !done {
2504		d.Response.Response = future.Response()
2505		err = azure.NewAsyncOpIncompleteError("sql.DatabasesResumeFuture")
2506		return
2507	}
2508	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2509	if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent {
2510		d, err = client.ResumeResponder(d.Response.Response)
2511		if err != nil {
2512			err = autorest.NewErrorWithError(err, "sql.DatabasesResumeFuture", "Result", d.Response.Response, "Failure responding to request")
2513		}
2514	}
2515	return
2516}
2517
2518// DatabasesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
2519// operation.
2520type DatabasesUpdateFuture struct {
2521	azure.FutureAPI
2522	// Result returns the result of the asynchronous operation.
2523	// If the operation has not completed it will return an error.
2524	Result func(DatabasesClient) (Database, error)
2525}
2526
2527// UnmarshalJSON is the custom unmarshaller for CreateFuture.
2528func (future *DatabasesUpdateFuture) UnmarshalJSON(body []byte) error {
2529	var azFuture azure.Future
2530	if err := json.Unmarshal(body, &azFuture); err != nil {
2531		return err
2532	}
2533	future.FutureAPI = &azFuture
2534	future.Result = future.result
2535	return nil
2536}
2537
2538// result is the default implementation for DatabasesUpdateFuture.Result.
2539func (future *DatabasesUpdateFuture) result(client DatabasesClient) (d Database, err error) {
2540	var done bool
2541	done, err = future.DoneWithContext(context.Background(), client)
2542	if err != nil {
2543		err = autorest.NewErrorWithError(err, "sql.DatabasesUpdateFuture", "Result", future.Response(), "Polling failure")
2544		return
2545	}
2546	if !done {
2547		d.Response.Response = future.Response()
2548		err = azure.NewAsyncOpIncompleteError("sql.DatabasesUpdateFuture")
2549		return
2550	}
2551	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2552	if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent {
2553		d, err = client.UpdateResponder(d.Response.Response)
2554		if err != nil {
2555			err = autorest.NewErrorWithError(err, "sql.DatabasesUpdateFuture", "Result", d.Response.Response, "Failure responding to request")
2556		}
2557	}
2558	return
2559}
2560
2561// DatabasesUpgradeDataWarehouseFuture an abstraction for monitoring and retrieving the results of a
2562// long-running operation.
2563type DatabasesUpgradeDataWarehouseFuture struct {
2564	azure.FutureAPI
2565	// Result returns the result of the asynchronous operation.
2566	// If the operation has not completed it will return an error.
2567	Result func(DatabasesClient) (autorest.Response, error)
2568}
2569
2570// UnmarshalJSON is the custom unmarshaller for CreateFuture.
2571func (future *DatabasesUpgradeDataWarehouseFuture) UnmarshalJSON(body []byte) error {
2572	var azFuture azure.Future
2573	if err := json.Unmarshal(body, &azFuture); err != nil {
2574		return err
2575	}
2576	future.FutureAPI = &azFuture
2577	future.Result = future.result
2578	return nil
2579}
2580
2581// result is the default implementation for DatabasesUpgradeDataWarehouseFuture.Result.
2582func (future *DatabasesUpgradeDataWarehouseFuture) result(client DatabasesClient) (ar autorest.Response, err error) {
2583	var done bool
2584	done, err = future.DoneWithContext(context.Background(), client)
2585	if err != nil {
2586		err = autorest.NewErrorWithError(err, "sql.DatabasesUpgradeDataWarehouseFuture", "Result", future.Response(), "Polling failure")
2587		return
2588	}
2589	if !done {
2590		ar.Response = future.Response()
2591		err = azure.NewAsyncOpIncompleteError("sql.DatabasesUpgradeDataWarehouseFuture")
2592		return
2593	}
2594	ar.Response = future.Response()
2595	return
2596}
2597
2598// DatabaseUpdate a database resource.
2599type DatabaseUpdate struct {
2600	// Sku - The name and tier of the SKU.
2601	Sku *Sku `json:"sku,omitempty"`
2602	// DatabaseProperties - Resource properties.
2603	*DatabaseProperties `json:"properties,omitempty"`
2604	// Tags - Resource tags.
2605	Tags map[string]*string `json:"tags"`
2606}
2607
2608// MarshalJSON is the custom marshaler for DatabaseUpdate.
2609func (du DatabaseUpdate) MarshalJSON() ([]byte, error) {
2610	objectMap := make(map[string]interface{})
2611	if du.Sku != nil {
2612		objectMap["sku"] = du.Sku
2613	}
2614	if du.DatabaseProperties != nil {
2615		objectMap["properties"] = du.DatabaseProperties
2616	}
2617	if du.Tags != nil {
2618		objectMap["tags"] = du.Tags
2619	}
2620	return json.Marshal(objectMap)
2621}
2622
2623// UnmarshalJSON is the custom unmarshaler for DatabaseUpdate struct.
2624func (du *DatabaseUpdate) UnmarshalJSON(body []byte) error {
2625	var m map[string]*json.RawMessage
2626	err := json.Unmarshal(body, &m)
2627	if err != nil {
2628		return err
2629	}
2630	for k, v := range m {
2631		switch k {
2632		case "sku":
2633			if v != nil {
2634				var sku Sku
2635				err = json.Unmarshal(*v, &sku)
2636				if err != nil {
2637					return err
2638				}
2639				du.Sku = &sku
2640			}
2641		case "properties":
2642			if v != nil {
2643				var databaseProperties DatabaseProperties
2644				err = json.Unmarshal(*v, &databaseProperties)
2645				if err != nil {
2646					return err
2647				}
2648				du.DatabaseProperties = &databaseProperties
2649			}
2650		case "tags":
2651			if v != nil {
2652				var tags map[string]*string
2653				err = json.Unmarshal(*v, &tags)
2654				if err != nil {
2655					return err
2656				}
2657				du.Tags = tags
2658			}
2659		}
2660	}
2661
2662	return nil
2663}
2664
2665// DatabaseUsage the database usages.
2666type DatabaseUsage struct {
2667	// Name - READ-ONLY; The name of the usage metric.
2668	Name *string `json:"name,omitempty"`
2669	// ResourceName - READ-ONLY; The name of the resource.
2670	ResourceName *string `json:"resourceName,omitempty"`
2671	// DisplayName - READ-ONLY; The usage metric display name.
2672	DisplayName *string `json:"displayName,omitempty"`
2673	// CurrentValue - READ-ONLY; The current value of the usage metric.
2674	CurrentValue *float64 `json:"currentValue,omitempty"`
2675	// Limit - READ-ONLY; The current limit of the usage metric.
2676	Limit *float64 `json:"limit,omitempty"`
2677	// Unit - READ-ONLY; The units of the usage metric.
2678	Unit *string `json:"unit,omitempty"`
2679	// NextResetTime - READ-ONLY; The next reset time for the usage metric (ISO8601 format).
2680	NextResetTime *date.Time `json:"nextResetTime,omitempty"`
2681}
2682
2683// MarshalJSON is the custom marshaler for DatabaseUsage.
2684func (du DatabaseUsage) MarshalJSON() ([]byte, error) {
2685	objectMap := make(map[string]interface{})
2686	return json.Marshal(objectMap)
2687}
2688
2689// DatabaseUsageListResult the response to a list database metrics request.
2690type DatabaseUsageListResult struct {
2691	autorest.Response `json:"-"`
2692	// Value - The list of database usages for the database.
2693	Value *[]DatabaseUsage `json:"value,omitempty"`
2694}
2695
2696// DatabaseVulnerabilityAssessment a database vulnerability assessment.
2697type DatabaseVulnerabilityAssessment struct {
2698	autorest.Response `json:"-"`
2699	// DatabaseVulnerabilityAssessmentProperties - Resource properties.
2700	*DatabaseVulnerabilityAssessmentProperties `json:"properties,omitempty"`
2701	// ID - READ-ONLY; Resource ID.
2702	ID *string `json:"id,omitempty"`
2703	// Name - READ-ONLY; Resource name.
2704	Name *string `json:"name,omitempty"`
2705	// Type - READ-ONLY; Resource type.
2706	Type *string `json:"type,omitempty"`
2707}
2708
2709// MarshalJSON is the custom marshaler for DatabaseVulnerabilityAssessment.
2710func (dva DatabaseVulnerabilityAssessment) MarshalJSON() ([]byte, error) {
2711	objectMap := make(map[string]interface{})
2712	if dva.DatabaseVulnerabilityAssessmentProperties != nil {
2713		objectMap["properties"] = dva.DatabaseVulnerabilityAssessmentProperties
2714	}
2715	return json.Marshal(objectMap)
2716}
2717
2718// UnmarshalJSON is the custom unmarshaler for DatabaseVulnerabilityAssessment struct.
2719func (dva *DatabaseVulnerabilityAssessment) UnmarshalJSON(body []byte) error {
2720	var m map[string]*json.RawMessage
2721	err := json.Unmarshal(body, &m)
2722	if err != nil {
2723		return err
2724	}
2725	for k, v := range m {
2726		switch k {
2727		case "properties":
2728			if v != nil {
2729				var databaseVulnerabilityAssessmentProperties DatabaseVulnerabilityAssessmentProperties
2730				err = json.Unmarshal(*v, &databaseVulnerabilityAssessmentProperties)
2731				if err != nil {
2732					return err
2733				}
2734				dva.DatabaseVulnerabilityAssessmentProperties = &databaseVulnerabilityAssessmentProperties
2735			}
2736		case "id":
2737			if v != nil {
2738				var ID string
2739				err = json.Unmarshal(*v, &ID)
2740				if err != nil {
2741					return err
2742				}
2743				dva.ID = &ID
2744			}
2745		case "name":
2746			if v != nil {
2747				var name string
2748				err = json.Unmarshal(*v, &name)
2749				if err != nil {
2750					return err
2751				}
2752				dva.Name = &name
2753			}
2754		case "type":
2755			if v != nil {
2756				var typeVar string
2757				err = json.Unmarshal(*v, &typeVar)
2758				if err != nil {
2759					return err
2760				}
2761				dva.Type = &typeVar
2762			}
2763		}
2764	}
2765
2766	return nil
2767}
2768
2769// DatabaseVulnerabilityAssessmentListResult a list of the database's vulnerability assessments.
2770type DatabaseVulnerabilityAssessmentListResult struct {
2771	autorest.Response `json:"-"`
2772	// Value - READ-ONLY; Array of results.
2773	Value *[]DatabaseVulnerabilityAssessment `json:"value,omitempty"`
2774	// NextLink - READ-ONLY; Link to retrieve next page of results.
2775	NextLink *string `json:"nextLink,omitempty"`
2776}
2777
2778// MarshalJSON is the custom marshaler for DatabaseVulnerabilityAssessmentListResult.
2779func (dvalr DatabaseVulnerabilityAssessmentListResult) MarshalJSON() ([]byte, error) {
2780	objectMap := make(map[string]interface{})
2781	return json.Marshal(objectMap)
2782}
2783
2784// DatabaseVulnerabilityAssessmentListResultIterator provides access to a complete listing of
2785// DatabaseVulnerabilityAssessment values.
2786type DatabaseVulnerabilityAssessmentListResultIterator struct {
2787	i    int
2788	page DatabaseVulnerabilityAssessmentListResultPage
2789}
2790
2791// NextWithContext advances to the next value.  If there was an error making
2792// the request the iterator does not advance and the error is returned.
2793func (iter *DatabaseVulnerabilityAssessmentListResultIterator) NextWithContext(ctx context.Context) (err error) {
2794	if tracing.IsEnabled() {
2795		ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseVulnerabilityAssessmentListResultIterator.NextWithContext")
2796		defer func() {
2797			sc := -1
2798			if iter.Response().Response.Response != nil {
2799				sc = iter.Response().Response.Response.StatusCode
2800			}
2801			tracing.EndSpan(ctx, sc, err)
2802		}()
2803	}
2804	iter.i++
2805	if iter.i < len(iter.page.Values()) {
2806		return nil
2807	}
2808	err = iter.page.NextWithContext(ctx)
2809	if err != nil {
2810		iter.i--
2811		return err
2812	}
2813	iter.i = 0
2814	return nil
2815}
2816
2817// Next advances to the next value.  If there was an error making
2818// the request the iterator does not advance and the error is returned.
2819// Deprecated: Use NextWithContext() instead.
2820func (iter *DatabaseVulnerabilityAssessmentListResultIterator) Next() error {
2821	return iter.NextWithContext(context.Background())
2822}
2823
2824// NotDone returns true if the enumeration should be started or is not yet complete.
2825func (iter DatabaseVulnerabilityAssessmentListResultIterator) NotDone() bool {
2826	return iter.page.NotDone() && iter.i < len(iter.page.Values())
2827}
2828
2829// Response returns the raw server response from the last page request.
2830func (iter DatabaseVulnerabilityAssessmentListResultIterator) Response() DatabaseVulnerabilityAssessmentListResult {
2831	return iter.page.Response()
2832}
2833
2834// Value returns the current value or a zero-initialized value if the
2835// iterator has advanced beyond the end of the collection.
2836func (iter DatabaseVulnerabilityAssessmentListResultIterator) Value() DatabaseVulnerabilityAssessment {
2837	if !iter.page.NotDone() {
2838		return DatabaseVulnerabilityAssessment{}
2839	}
2840	return iter.page.Values()[iter.i]
2841}
2842
2843// Creates a new instance of the DatabaseVulnerabilityAssessmentListResultIterator type.
2844func NewDatabaseVulnerabilityAssessmentListResultIterator(page DatabaseVulnerabilityAssessmentListResultPage) DatabaseVulnerabilityAssessmentListResultIterator {
2845	return DatabaseVulnerabilityAssessmentListResultIterator{page: page}
2846}
2847
2848// IsEmpty returns true if the ListResult contains no values.
2849func (dvalr DatabaseVulnerabilityAssessmentListResult) IsEmpty() bool {
2850	return dvalr.Value == nil || len(*dvalr.Value) == 0
2851}
2852
2853// hasNextLink returns true if the NextLink is not empty.
2854func (dvalr DatabaseVulnerabilityAssessmentListResult) hasNextLink() bool {
2855	return dvalr.NextLink != nil && len(*dvalr.NextLink) != 0
2856}
2857
2858// databaseVulnerabilityAssessmentListResultPreparer prepares a request to retrieve the next set of results.
2859// It returns nil if no more results exist.
2860func (dvalr DatabaseVulnerabilityAssessmentListResult) databaseVulnerabilityAssessmentListResultPreparer(ctx context.Context) (*http.Request, error) {
2861	if !dvalr.hasNextLink() {
2862		return nil, nil
2863	}
2864	return autorest.Prepare((&http.Request{}).WithContext(ctx),
2865		autorest.AsJSON(),
2866		autorest.AsGet(),
2867		autorest.WithBaseURL(to.String(dvalr.NextLink)))
2868}
2869
2870// DatabaseVulnerabilityAssessmentListResultPage contains a page of DatabaseVulnerabilityAssessment values.
2871type DatabaseVulnerabilityAssessmentListResultPage struct {
2872	fn    func(context.Context, DatabaseVulnerabilityAssessmentListResult) (DatabaseVulnerabilityAssessmentListResult, error)
2873	dvalr DatabaseVulnerabilityAssessmentListResult
2874}
2875
2876// NextWithContext advances to the next page of values.  If there was an error making
2877// the request the page does not advance and the error is returned.
2878func (page *DatabaseVulnerabilityAssessmentListResultPage) NextWithContext(ctx context.Context) (err error) {
2879	if tracing.IsEnabled() {
2880		ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseVulnerabilityAssessmentListResultPage.NextWithContext")
2881		defer func() {
2882			sc := -1
2883			if page.Response().Response.Response != nil {
2884				sc = page.Response().Response.Response.StatusCode
2885			}
2886			tracing.EndSpan(ctx, sc, err)
2887		}()
2888	}
2889	for {
2890		next, err := page.fn(ctx, page.dvalr)
2891		if err != nil {
2892			return err
2893		}
2894		page.dvalr = next
2895		if !next.hasNextLink() || !next.IsEmpty() {
2896			break
2897		}
2898	}
2899	return nil
2900}
2901
2902// Next advances to the next page of values.  If there was an error making
2903// the request the page does not advance and the error is returned.
2904// Deprecated: Use NextWithContext() instead.
2905func (page *DatabaseVulnerabilityAssessmentListResultPage) Next() error {
2906	return page.NextWithContext(context.Background())
2907}
2908
2909// NotDone returns true if the page enumeration should be started or is not yet complete.
2910func (page DatabaseVulnerabilityAssessmentListResultPage) NotDone() bool {
2911	return !page.dvalr.IsEmpty()
2912}
2913
2914// Response returns the raw server response from the last page request.
2915func (page DatabaseVulnerabilityAssessmentListResultPage) Response() DatabaseVulnerabilityAssessmentListResult {
2916	return page.dvalr
2917}
2918
2919// Values returns the slice of values for the current page or nil if there are no values.
2920func (page DatabaseVulnerabilityAssessmentListResultPage) Values() []DatabaseVulnerabilityAssessment {
2921	if page.dvalr.IsEmpty() {
2922		return nil
2923	}
2924	return *page.dvalr.Value
2925}
2926
2927// Creates a new instance of the DatabaseVulnerabilityAssessmentListResultPage type.
2928func NewDatabaseVulnerabilityAssessmentListResultPage(cur DatabaseVulnerabilityAssessmentListResult, getNextPage func(context.Context, DatabaseVulnerabilityAssessmentListResult) (DatabaseVulnerabilityAssessmentListResult, error)) DatabaseVulnerabilityAssessmentListResultPage {
2929	return DatabaseVulnerabilityAssessmentListResultPage{
2930		fn:    getNextPage,
2931		dvalr: cur,
2932	}
2933}
2934
2935// DatabaseVulnerabilityAssessmentProperties properties of a database Vulnerability Assessment.
2936type DatabaseVulnerabilityAssessmentProperties struct {
2937	// 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
2938	StorageContainerPath *string `json:"storageContainerPath,omitempty"`
2939	// StorageContainerSasKey - A shared access signature (SAS Key) that has read and write access to the blob container specified in 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't specified, StorageContainerSasKey is required.
2940	StorageContainerSasKey *string `json:"storageContainerSasKey,omitempty"`
2941	// StorageAccountAccessKey - Specifies the identifier key of the storage account for vulnerability assessment scan results. If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is required.
2942	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
2943	// RecurringScans - The recurring scans settings
2944	RecurringScans *VulnerabilityAssessmentRecurringScansProperties `json:"recurringScans,omitempty"`
2945}
2946
2947// DatabaseVulnerabilityAssessmentRuleBaseline a database vulnerability assessment rule baseline.
2948type DatabaseVulnerabilityAssessmentRuleBaseline struct {
2949	autorest.Response `json:"-"`
2950	// DatabaseVulnerabilityAssessmentRuleBaselineProperties - Resource properties.
2951	*DatabaseVulnerabilityAssessmentRuleBaselineProperties `json:"properties,omitempty"`
2952	// ID - READ-ONLY; Resource ID.
2953	ID *string `json:"id,omitempty"`
2954	// Name - READ-ONLY; Resource name.
2955	Name *string `json:"name,omitempty"`
2956	// Type - READ-ONLY; Resource type.
2957	Type *string `json:"type,omitempty"`
2958}
2959
2960// MarshalJSON is the custom marshaler for DatabaseVulnerabilityAssessmentRuleBaseline.
2961func (dvarb DatabaseVulnerabilityAssessmentRuleBaseline) MarshalJSON() ([]byte, error) {
2962	objectMap := make(map[string]interface{})
2963	if dvarb.DatabaseVulnerabilityAssessmentRuleBaselineProperties != nil {
2964		objectMap["properties"] = dvarb.DatabaseVulnerabilityAssessmentRuleBaselineProperties
2965	}
2966	return json.Marshal(objectMap)
2967}
2968
2969// UnmarshalJSON is the custom unmarshaler for DatabaseVulnerabilityAssessmentRuleBaseline struct.
2970func (dvarb *DatabaseVulnerabilityAssessmentRuleBaseline) UnmarshalJSON(body []byte) error {
2971	var m map[string]*json.RawMessage
2972	err := json.Unmarshal(body, &m)
2973	if err != nil {
2974		return err
2975	}
2976	for k, v := range m {
2977		switch k {
2978		case "properties":
2979			if v != nil {
2980				var databaseVulnerabilityAssessmentRuleBaselineProperties DatabaseVulnerabilityAssessmentRuleBaselineProperties
2981				err = json.Unmarshal(*v, &databaseVulnerabilityAssessmentRuleBaselineProperties)
2982				if err != nil {
2983					return err
2984				}
2985				dvarb.DatabaseVulnerabilityAssessmentRuleBaselineProperties = &databaseVulnerabilityAssessmentRuleBaselineProperties
2986			}
2987		case "id":
2988			if v != nil {
2989				var ID string
2990				err = json.Unmarshal(*v, &ID)
2991				if err != nil {
2992					return err
2993				}
2994				dvarb.ID = &ID
2995			}
2996		case "name":
2997			if v != nil {
2998				var name string
2999				err = json.Unmarshal(*v, &name)
3000				if err != nil {
3001					return err
3002				}
3003				dvarb.Name = &name
3004			}
3005		case "type":
3006			if v != nil {
3007				var typeVar string
3008				err = json.Unmarshal(*v, &typeVar)
3009				if err != nil {
3010					return err
3011				}
3012				dvarb.Type = &typeVar
3013			}
3014		}
3015	}
3016
3017	return nil
3018}
3019
3020// DatabaseVulnerabilityAssessmentRuleBaselineItem properties for an Azure SQL Database Vulnerability
3021// Assessment rule baseline's result.
3022type DatabaseVulnerabilityAssessmentRuleBaselineItem struct {
3023	// Result - The rule baseline result
3024	Result *[]string `json:"result,omitempty"`
3025}
3026
3027// DatabaseVulnerabilityAssessmentRuleBaselineProperties properties of a database Vulnerability Assessment
3028// rule baseline.
3029type DatabaseVulnerabilityAssessmentRuleBaselineProperties struct {
3030	// BaselineResults - The rule baseline result
3031	BaselineResults *[]DatabaseVulnerabilityAssessmentRuleBaselineItem `json:"baselineResults,omitempty"`
3032}
3033
3034// DatabaseVulnerabilityAssessmentScanExportProperties properties of the export operation's result.
3035type DatabaseVulnerabilityAssessmentScanExportProperties struct {
3036	// ExportedReportLocation - READ-ONLY; Location of the exported report (e.g. https://myStorage.blob.core.windows.net/VaScans/scans/serverName/databaseName/scan_scanId.xlsx).
3037	ExportedReportLocation *string `json:"exportedReportLocation,omitempty"`
3038}
3039
3040// MarshalJSON is the custom marshaler for DatabaseVulnerabilityAssessmentScanExportProperties.
3041func (dvasep DatabaseVulnerabilityAssessmentScanExportProperties) MarshalJSON() ([]byte, error) {
3042	objectMap := make(map[string]interface{})
3043	return json.Marshal(objectMap)
3044}
3045
3046// DatabaseVulnerabilityAssessmentScansExport a database Vulnerability Assessment scan export resource.
3047type DatabaseVulnerabilityAssessmentScansExport struct {
3048	autorest.Response `json:"-"`
3049	// DatabaseVulnerabilityAssessmentScanExportProperties - Resource properties.
3050	*DatabaseVulnerabilityAssessmentScanExportProperties `json:"properties,omitempty"`
3051	// ID - READ-ONLY; Resource ID.
3052	ID *string `json:"id,omitempty"`
3053	// Name - READ-ONLY; Resource name.
3054	Name *string `json:"name,omitempty"`
3055	// Type - READ-ONLY; Resource type.
3056	Type *string `json:"type,omitempty"`
3057}
3058
3059// MarshalJSON is the custom marshaler for DatabaseVulnerabilityAssessmentScansExport.
3060func (dvase DatabaseVulnerabilityAssessmentScansExport) MarshalJSON() ([]byte, error) {
3061	objectMap := make(map[string]interface{})
3062	if dvase.DatabaseVulnerabilityAssessmentScanExportProperties != nil {
3063		objectMap["properties"] = dvase.DatabaseVulnerabilityAssessmentScanExportProperties
3064	}
3065	return json.Marshal(objectMap)
3066}
3067
3068// UnmarshalJSON is the custom unmarshaler for DatabaseVulnerabilityAssessmentScansExport struct.
3069func (dvase *DatabaseVulnerabilityAssessmentScansExport) UnmarshalJSON(body []byte) error {
3070	var m map[string]*json.RawMessage
3071	err := json.Unmarshal(body, &m)
3072	if err != nil {
3073		return err
3074	}
3075	for k, v := range m {
3076		switch k {
3077		case "properties":
3078			if v != nil {
3079				var databaseVulnerabilityAssessmentScanExportProperties DatabaseVulnerabilityAssessmentScanExportProperties
3080				err = json.Unmarshal(*v, &databaseVulnerabilityAssessmentScanExportProperties)
3081				if err != nil {
3082					return err
3083				}
3084				dvase.DatabaseVulnerabilityAssessmentScanExportProperties = &databaseVulnerabilityAssessmentScanExportProperties
3085			}
3086		case "id":
3087			if v != nil {
3088				var ID string
3089				err = json.Unmarshal(*v, &ID)
3090				if err != nil {
3091					return err
3092				}
3093				dvase.ID = &ID
3094			}
3095		case "name":
3096			if v != nil {
3097				var name string
3098				err = json.Unmarshal(*v, &name)
3099				if err != nil {
3100					return err
3101				}
3102				dvase.Name = &name
3103			}
3104		case "type":
3105			if v != nil {
3106				var typeVar string
3107				err = json.Unmarshal(*v, &typeVar)
3108				if err != nil {
3109					return err
3110				}
3111				dvase.Type = &typeVar
3112			}
3113		}
3114	}
3115
3116	return nil
3117}
3118
3119// DatabaseVulnerabilityAssessmentScansInitiateScanFuture an abstraction for monitoring and retrieving the
3120// results of a long-running operation.
3121type DatabaseVulnerabilityAssessmentScansInitiateScanFuture struct {
3122	azure.FutureAPI
3123	// Result returns the result of the asynchronous operation.
3124	// If the operation has not completed it will return an error.
3125	Result func(DatabaseVulnerabilityAssessmentScansClient) (autorest.Response, error)
3126}
3127
3128// UnmarshalJSON is the custom unmarshaller for CreateFuture.
3129func (future *DatabaseVulnerabilityAssessmentScansInitiateScanFuture) UnmarshalJSON(body []byte) error {
3130	var azFuture azure.Future
3131	if err := json.Unmarshal(body, &azFuture); err != nil {
3132		return err
3133	}
3134	future.FutureAPI = &azFuture
3135	future.Result = future.result
3136	return nil
3137}
3138
3139// result is the default implementation for DatabaseVulnerabilityAssessmentScansInitiateScanFuture.Result.
3140func (future *DatabaseVulnerabilityAssessmentScansInitiateScanFuture) result(client DatabaseVulnerabilityAssessmentScansClient) (ar autorest.Response, err error) {
3141	var done bool
3142	done, err = future.DoneWithContext(context.Background(), client)
3143	if err != nil {
3144		err = autorest.NewErrorWithError(err, "sql.DatabaseVulnerabilityAssessmentScansInitiateScanFuture", "Result", future.Response(), "Polling failure")
3145		return
3146	}
3147	if !done {
3148		ar.Response = future.Response()
3149		err = azure.NewAsyncOpIncompleteError("sql.DatabaseVulnerabilityAssessmentScansInitiateScanFuture")
3150		return
3151	}
3152	ar.Response = future.Response()
3153	return
3154}
3155
3156// DataMaskingPolicy represents a database data masking policy.
3157type DataMaskingPolicy struct {
3158	autorest.Response `json:"-"`
3159	// DataMaskingPolicyProperties - The properties of the data masking policy.
3160	*DataMaskingPolicyProperties `json:"properties,omitempty"`
3161	// Location - READ-ONLY; The location of the data masking policy.
3162	Location *string `json:"location,omitempty"`
3163	// Kind - READ-ONLY; The kind of data masking policy. Metadata, used for Azure portal.
3164	Kind *string `json:"kind,omitempty"`
3165	// ID - READ-ONLY; Resource ID.
3166	ID *string `json:"id,omitempty"`
3167	// Name - READ-ONLY; Resource name.
3168	Name *string `json:"name,omitempty"`
3169	// Type - READ-ONLY; Resource type.
3170	Type *string `json:"type,omitempty"`
3171}
3172
3173// MarshalJSON is the custom marshaler for DataMaskingPolicy.
3174func (dmp DataMaskingPolicy) MarshalJSON() ([]byte, error) {
3175	objectMap := make(map[string]interface{})
3176	if dmp.DataMaskingPolicyProperties != nil {
3177		objectMap["properties"] = dmp.DataMaskingPolicyProperties
3178	}
3179	return json.Marshal(objectMap)
3180}
3181
3182// UnmarshalJSON is the custom unmarshaler for DataMaskingPolicy struct.
3183func (dmp *DataMaskingPolicy) UnmarshalJSON(body []byte) error {
3184	var m map[string]*json.RawMessage
3185	err := json.Unmarshal(body, &m)
3186	if err != nil {
3187		return err
3188	}
3189	for k, v := range m {
3190		switch k {
3191		case "properties":
3192			if v != nil {
3193				var dataMaskingPolicyProperties DataMaskingPolicyProperties
3194				err = json.Unmarshal(*v, &dataMaskingPolicyProperties)
3195				if err != nil {
3196					return err
3197				}
3198				dmp.DataMaskingPolicyProperties = &dataMaskingPolicyProperties
3199			}
3200		case "location":
3201			if v != nil {
3202				var location string
3203				err = json.Unmarshal(*v, &location)
3204				if err != nil {
3205					return err
3206				}
3207				dmp.Location = &location
3208			}
3209		case "kind":
3210			if v != nil {
3211				var kind string
3212				err = json.Unmarshal(*v, &kind)
3213				if err != nil {
3214					return err
3215				}
3216				dmp.Kind = &kind
3217			}
3218		case "id":
3219			if v != nil {
3220				var ID string
3221				err = json.Unmarshal(*v, &ID)
3222				if err != nil {
3223					return err
3224				}
3225				dmp.ID = &ID
3226			}
3227		case "name":
3228			if v != nil {
3229				var name string
3230				err = json.Unmarshal(*v, &name)
3231				if err != nil {
3232					return err
3233				}
3234				dmp.Name = &name
3235			}
3236		case "type":
3237			if v != nil {
3238				var typeVar string
3239				err = json.Unmarshal(*v, &typeVar)
3240				if err != nil {
3241					return err
3242				}
3243				dmp.Type = &typeVar
3244			}
3245		}
3246	}
3247
3248	return nil
3249}
3250
3251// DataMaskingPolicyProperties the properties of a database data masking policy.
3252type DataMaskingPolicyProperties struct {
3253	// DataMaskingState - The state of the data masking policy. Possible values include: 'DataMaskingStateDisabled', 'DataMaskingStateEnabled'
3254	DataMaskingState DataMaskingState `json:"dataMaskingState,omitempty"`
3255	// 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.
3256	ExemptPrincipals *string `json:"exemptPrincipals,omitempty"`
3257	// ApplicationPrincipals - READ-ONLY; The list of the application principals. This is a legacy parameter and is no longer used.
3258	ApplicationPrincipals *string `json:"applicationPrincipals,omitempty"`
3259	// MaskingLevel - READ-ONLY; The masking level. This is a legacy parameter and is no longer used.
3260	MaskingLevel *string `json:"maskingLevel,omitempty"`
3261}
3262
3263// MarshalJSON is the custom marshaler for DataMaskingPolicyProperties.
3264func (dmpp DataMaskingPolicyProperties) MarshalJSON() ([]byte, error) {
3265	objectMap := make(map[string]interface{})
3266	if dmpp.DataMaskingState != "" {
3267		objectMap["dataMaskingState"] = dmpp.DataMaskingState
3268	}
3269	if dmpp.ExemptPrincipals != nil {
3270		objectMap["exemptPrincipals"] = dmpp.ExemptPrincipals
3271	}
3272	return json.Marshal(objectMap)
3273}
3274
3275// DataMaskingRule represents a database data masking rule.
3276type DataMaskingRule struct {
3277	autorest.Response `json:"-"`
3278	// DataMaskingRuleProperties - The properties of the resource.
3279	*DataMaskingRuleProperties `json:"properties,omitempty"`
3280	// Location - READ-ONLY; The location of the data masking rule.
3281	Location *string `json:"location,omitempty"`
3282	// Kind - READ-ONLY; The kind of Data Masking Rule. Metadata, used for Azure portal.
3283	Kind *string `json:"kind,omitempty"`
3284	// ID - READ-ONLY; Resource ID.
3285	ID *string `json:"id,omitempty"`
3286	// Name - READ-ONLY; Resource name.
3287	Name *string `json:"name,omitempty"`
3288	// Type - READ-ONLY; Resource type.
3289	Type *string `json:"type,omitempty"`
3290}
3291
3292// MarshalJSON is the custom marshaler for DataMaskingRule.
3293func (dmr DataMaskingRule) MarshalJSON() ([]byte, error) {
3294	objectMap := make(map[string]interface{})
3295	if dmr.DataMaskingRuleProperties != nil {
3296		objectMap["properties"] = dmr.DataMaskingRuleProperties
3297	}
3298	return json.Marshal(objectMap)
3299}
3300
3301// UnmarshalJSON is the custom unmarshaler for DataMaskingRule struct.
3302func (dmr *DataMaskingRule) UnmarshalJSON(body []byte) error {
3303	var m map[string]*json.RawMessage
3304	err := json.Unmarshal(body, &m)
3305	if err != nil {
3306		return err
3307	}
3308	for k, v := range m {
3309		switch k {
3310		case "properties":
3311			if v != nil {
3312				var dataMaskingRuleProperties DataMaskingRuleProperties
3313				err = json.Unmarshal(*v, &dataMaskingRuleProperties)
3314				if err != nil {
3315					return err
3316				}
3317				dmr.DataMaskingRuleProperties = &dataMaskingRuleProperties
3318			}
3319		case "location":
3320			if v != nil {
3321				var location string
3322				err = json.Unmarshal(*v, &location)
3323				if err != nil {
3324					return err
3325				}
3326				dmr.Location = &location
3327			}
3328		case "kind":
3329			if v != nil {
3330				var kind string
3331				err = json.Unmarshal(*v, &kind)
3332				if err != nil {
3333					return err
3334				}
3335				dmr.Kind = &kind
3336			}
3337		case "id":
3338			if v != nil {
3339				var ID string
3340				err = json.Unmarshal(*v, &ID)
3341				if err != nil {
3342					return err
3343				}
3344				dmr.ID = &ID
3345			}
3346		case "name":
3347			if v != nil {
3348				var name string
3349				err = json.Unmarshal(*v, &name)
3350				if err != nil {
3351					return err
3352				}
3353				dmr.Name = &name
3354			}
3355		case "type":
3356			if v != nil {
3357				var typeVar string
3358				err = json.Unmarshal(*v, &typeVar)
3359				if err != nil {
3360					return err
3361				}
3362				dmr.Type = &typeVar
3363			}
3364		}
3365	}
3366
3367	return nil
3368}
3369
3370// DataMaskingRuleListResult the response to a list data masking rules request.
3371type DataMaskingRuleListResult struct {
3372	autorest.Response `json:"-"`
3373	// Value - The list of database data masking rules.
3374	Value *[]DataMaskingRule `json:"value,omitempty"`
3375}
3376
3377// DataMaskingRuleProperties the properties of a database data masking rule.
3378type DataMaskingRuleProperties struct {
3379	// ID - READ-ONLY; The rule Id.
3380	ID *string `json:"id,omitempty"`
3381	// AliasName - The alias name. This is a legacy parameter and is no longer used.
3382	AliasName *string `json:"aliasName,omitempty"`
3383	// 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'
3384	RuleState DataMaskingRuleState `json:"ruleState,omitempty"`
3385	// SchemaName - The schema name on which the data masking rule is applied.
3386	SchemaName *string `json:"schemaName,omitempty"`
3387	// TableName - The table name on which the data masking rule is applied.
3388	TableName *string `json:"tableName,omitempty"`
3389	// ColumnName - The column name on which the data masking rule is applied.
3390	ColumnName *string `json:"columnName,omitempty"`
3391	// MaskingFunction - The masking function that is used for the data masking rule. Possible values include: 'DataMaskingFunctionDefault', 'DataMaskingFunctionCCN', 'DataMaskingFunctionEmail', 'DataMaskingFunctionNumber', 'DataMaskingFunctionSSN', 'DataMaskingFunctionText'
3392	MaskingFunction DataMaskingFunction `json:"maskingFunction,omitempty"`
3393	// NumberFrom - The numberFrom property of the masking rule. Required if maskingFunction is set to Number, otherwise this parameter will be ignored.
3394	NumberFrom *string `json:"numberFrom,omitempty"`
3395	// NumberTo - The numberTo property of the data masking rule. Required if maskingFunction is set to Number, otherwise this parameter will be ignored.
3396	NumberTo *string `json:"numberTo,omitempty"`
3397	// 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.
3398	PrefixSize *string `json:"prefixSize,omitempty"`
3399	// 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.
3400	SuffixSize *string `json:"suffixSize,omitempty"`
3401	// 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.
3402	ReplacementString *string `json:"replacementString,omitempty"`
3403}
3404
3405// MarshalJSON is the custom marshaler for DataMaskingRuleProperties.
3406func (dmrp DataMaskingRuleProperties) MarshalJSON() ([]byte, error) {
3407	objectMap := make(map[string]interface{})
3408	if dmrp.AliasName != nil {
3409		objectMap["aliasName"] = dmrp.AliasName
3410	}
3411	if dmrp.RuleState != "" {
3412		objectMap["ruleState"] = dmrp.RuleState
3413	}
3414	if dmrp.SchemaName != nil {
3415		objectMap["schemaName"] = dmrp.SchemaName
3416	}
3417	if dmrp.TableName != nil {
3418		objectMap["tableName"] = dmrp.TableName
3419	}
3420	if dmrp.ColumnName != nil {
3421		objectMap["columnName"] = dmrp.ColumnName
3422	}
3423	if dmrp.MaskingFunction != "" {
3424		objectMap["maskingFunction"] = dmrp.MaskingFunction
3425	}
3426	if dmrp.NumberFrom != nil {
3427		objectMap["numberFrom"] = dmrp.NumberFrom
3428	}
3429	if dmrp.NumberTo != nil {
3430		objectMap["numberTo"] = dmrp.NumberTo
3431	}
3432	if dmrp.PrefixSize != nil {
3433		objectMap["prefixSize"] = dmrp.PrefixSize
3434	}
3435	if dmrp.SuffixSize != nil {
3436		objectMap["suffixSize"] = dmrp.SuffixSize
3437	}
3438	if dmrp.ReplacementString != nil {
3439		objectMap["replacementString"] = dmrp.ReplacementString
3440	}
3441	return json.Marshal(objectMap)
3442}
3443
3444// EditionCapability the edition capability.
3445type EditionCapability struct {
3446	// Name - READ-ONLY; The database edition name.
3447	Name *string `json:"name,omitempty"`
3448	// SupportedServiceLevelObjectives - READ-ONLY; The list of supported service objectives for the edition.
3449	SupportedServiceLevelObjectives *[]ServiceObjectiveCapability `json:"supportedServiceLevelObjectives,omitempty"`
3450	// ZoneRedundant - READ-ONLY; Whether or not zone redundancy is supported for the edition.
3451	ZoneRedundant *bool `json:"zoneRedundant,omitempty"`
3452	// ReadScale - READ-ONLY; The read scale capability for the edition.
3453	ReadScale *ReadScaleCapability `json:"readScale,omitempty"`
3454	// SupportedStorageCapabilities - READ-ONLY; The list of supported storage capabilities for this edition
3455	SupportedStorageCapabilities *[]StorageCapability `json:"supportedStorageCapabilities,omitempty"`
3456	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
3457	Status CapabilityStatus `json:"status,omitempty"`
3458	// Reason - The reason for the capability not being available.
3459	Reason *string `json:"reason,omitempty"`
3460}
3461
3462// MarshalJSON is the custom marshaler for EditionCapability.
3463func (ec EditionCapability) MarshalJSON() ([]byte, error) {
3464	objectMap := make(map[string]interface{})
3465	if ec.Reason != nil {
3466		objectMap["reason"] = ec.Reason
3467	}
3468	return json.Marshal(objectMap)
3469}
3470
3471// ElasticPool an elastic pool.
3472type ElasticPool struct {
3473	autorest.Response `json:"-"`
3474	// Sku - The elastic pool SKU.
3475	//
3476	// 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:
3477	//
3478	// ```azurecli
3479	// az sql elastic-pool list-editions -l <location> -o table
3480	// ````
3481	Sku *Sku `json:"sku,omitempty"`
3482	// Kind - READ-ONLY; Kind of elastic pool. This is metadata used for the Azure portal experience.
3483	Kind *string `json:"kind,omitempty"`
3484	// ElasticPoolProperties - Resource properties.
3485	*ElasticPoolProperties `json:"properties,omitempty"`
3486	// Location - Resource location.
3487	Location *string `json:"location,omitempty"`
3488	// Tags - Resource tags.
3489	Tags map[string]*string `json:"tags"`
3490	// ID - READ-ONLY; Resource ID.
3491	ID *string `json:"id,omitempty"`
3492	// Name - READ-ONLY; Resource name.
3493	Name *string `json:"name,omitempty"`
3494	// Type - READ-ONLY; Resource type.
3495	Type *string `json:"type,omitempty"`
3496}
3497
3498// MarshalJSON is the custom marshaler for ElasticPool.
3499func (ep ElasticPool) MarshalJSON() ([]byte, error) {
3500	objectMap := make(map[string]interface{})
3501	if ep.Sku != nil {
3502		objectMap["sku"] = ep.Sku
3503	}
3504	if ep.ElasticPoolProperties != nil {
3505		objectMap["properties"] = ep.ElasticPoolProperties
3506	}
3507	if ep.Location != nil {
3508		objectMap["location"] = ep.Location
3509	}
3510	if ep.Tags != nil {
3511		objectMap["tags"] = ep.Tags
3512	}
3513	return json.Marshal(objectMap)
3514}
3515
3516// UnmarshalJSON is the custom unmarshaler for ElasticPool struct.
3517func (ep *ElasticPool) UnmarshalJSON(body []byte) error {
3518	var m map[string]*json.RawMessage
3519	err := json.Unmarshal(body, &m)
3520	if err != nil {
3521		return err
3522	}
3523	for k, v := range m {
3524		switch k {
3525		case "sku":
3526			if v != nil {
3527				var sku Sku
3528				err = json.Unmarshal(*v, &sku)
3529				if err != nil {
3530					return err
3531				}
3532				ep.Sku = &sku
3533			}
3534		case "kind":
3535			if v != nil {
3536				var kind string
3537				err = json.Unmarshal(*v, &kind)
3538				if err != nil {
3539					return err
3540				}
3541				ep.Kind = &kind
3542			}
3543		case "properties":
3544			if v != nil {
3545				var elasticPoolProperties ElasticPoolProperties
3546				err = json.Unmarshal(*v, &elasticPoolProperties)
3547				if err != nil {
3548					return err
3549				}
3550				ep.ElasticPoolProperties = &elasticPoolProperties
3551			}
3552		case "location":
3553			if v != nil {
3554				var location string
3555				err = json.Unmarshal(*v, &location)
3556				if err != nil {
3557					return err
3558				}
3559				ep.Location = &location
3560			}
3561		case "tags":
3562			if v != nil {
3563				var tags map[string]*string
3564				err = json.Unmarshal(*v, &tags)
3565				if err != nil {
3566					return err
3567				}
3568				ep.Tags = tags
3569			}
3570		case "id":
3571			if v != nil {
3572				var ID string
3573				err = json.Unmarshal(*v, &ID)
3574				if err != nil {
3575					return err
3576				}
3577				ep.ID = &ID
3578			}
3579		case "name":
3580			if v != nil {
3581				var name string
3582				err = json.Unmarshal(*v, &name)
3583				if err != nil {
3584					return err
3585				}
3586				ep.Name = &name
3587			}
3588		case "type":
3589			if v != nil {
3590				var typeVar string
3591				err = json.Unmarshal(*v, &typeVar)
3592				if err != nil {
3593					return err
3594				}
3595				ep.Type = &typeVar
3596			}
3597		}
3598	}
3599
3600	return nil
3601}
3602
3603// ElasticPoolActivity represents the activity on an elastic pool.
3604type ElasticPoolActivity struct {
3605	// Location - The geo-location where the resource lives
3606	Location *string `json:"location,omitempty"`
3607	// ElasticPoolActivityProperties - The properties representing the resource.
3608	*ElasticPoolActivityProperties `json:"properties,omitempty"`
3609	// ID - READ-ONLY; Resource ID.
3610	ID *string `json:"id,omitempty"`
3611	// Name - READ-ONLY; Resource name.
3612	Name *string `json:"name,omitempty"`
3613	// Type - READ-ONLY; Resource type.
3614	Type *string `json:"type,omitempty"`
3615}
3616
3617// MarshalJSON is the custom marshaler for ElasticPoolActivity.
3618func (epa ElasticPoolActivity) MarshalJSON() ([]byte, error) {
3619	objectMap := make(map[string]interface{})
3620	if epa.Location != nil {
3621		objectMap["location"] = epa.Location
3622	}
3623	if epa.ElasticPoolActivityProperties != nil {
3624		objectMap["properties"] = epa.ElasticPoolActivityProperties
3625	}
3626	return json.Marshal(objectMap)
3627}
3628
3629// UnmarshalJSON is the custom unmarshaler for ElasticPoolActivity struct.
3630func (epa *ElasticPoolActivity) UnmarshalJSON(body []byte) error {
3631	var m map[string]*json.RawMessage
3632	err := json.Unmarshal(body, &m)
3633	if err != nil {
3634		return err
3635	}
3636	for k, v := range m {
3637		switch k {
3638		case "location":
3639			if v != nil {
3640				var location string
3641				err = json.Unmarshal(*v, &location)
3642				if err != nil {
3643					return err
3644				}
3645				epa.Location = &location
3646			}
3647		case "properties":
3648			if v != nil {
3649				var elasticPoolActivityProperties ElasticPoolActivityProperties
3650				err = json.Unmarshal(*v, &elasticPoolActivityProperties)
3651				if err != nil {
3652					return err
3653				}
3654				epa.ElasticPoolActivityProperties = &elasticPoolActivityProperties
3655			}
3656		case "id":
3657			if v != nil {
3658				var ID string
3659				err = json.Unmarshal(*v, &ID)
3660				if err != nil {
3661					return err
3662				}
3663				epa.ID = &ID
3664			}
3665		case "name":
3666			if v != nil {
3667				var name string
3668				err = json.Unmarshal(*v, &name)
3669				if err != nil {
3670					return err
3671				}
3672				epa.Name = &name
3673			}
3674		case "type":
3675			if v != nil {
3676				var typeVar string
3677				err = json.Unmarshal(*v, &typeVar)
3678				if err != nil {
3679					return err
3680				}
3681				epa.Type = &typeVar
3682			}
3683		}
3684	}
3685
3686	return nil
3687}
3688
3689// ElasticPoolActivityListResult represents the response to a list elastic pool activity request.
3690type ElasticPoolActivityListResult struct {
3691	autorest.Response `json:"-"`
3692	// Value - The list of elastic pool activities.
3693	Value *[]ElasticPoolActivity `json:"value,omitempty"`
3694}
3695
3696// ElasticPoolActivityProperties represents the properties of an elastic pool.
3697type ElasticPoolActivityProperties struct {
3698	// EndTime - READ-ONLY; The time the operation finished (ISO8601 format).
3699	EndTime *date.Time `json:"endTime,omitempty"`
3700	// ErrorCode - READ-ONLY; The error code if available.
3701	ErrorCode *int32 `json:"errorCode,omitempty"`
3702	// ErrorMessage - READ-ONLY; The error message if available.
3703	ErrorMessage *string `json:"errorMessage,omitempty"`
3704	// ErrorSeverity - READ-ONLY; The error severity if available.
3705	ErrorSeverity *int32 `json:"errorSeverity,omitempty"`
3706	// Operation - READ-ONLY; The operation name.
3707	Operation *string `json:"operation,omitempty"`
3708	// OperationID - READ-ONLY; The unique operation ID.
3709	OperationID *uuid.UUID `json:"operationId,omitempty"`
3710	// PercentComplete - READ-ONLY; The percentage complete if available.
3711	PercentComplete *int32 `json:"percentComplete,omitempty"`
3712	// RequestedDatabaseDtuMax - READ-ONLY; The requested max DTU per database if available.
3713	RequestedDatabaseDtuMax *int32 `json:"requestedDatabaseDtuMax,omitempty"`
3714	// RequestedDatabaseDtuMin - READ-ONLY; The requested min DTU per database if available.
3715	RequestedDatabaseDtuMin *int32 `json:"requestedDatabaseDtuMin,omitempty"`
3716	// RequestedDtu - READ-ONLY; The requested DTU for the pool if available.
3717	RequestedDtu *int32 `json:"requestedDtu,omitempty"`
3718	// RequestedElasticPoolName - READ-ONLY; The requested name for the elastic pool if available.
3719	RequestedElasticPoolName *string `json:"requestedElasticPoolName,omitempty"`
3720	// RequestedStorageLimitInGB - READ-ONLY; The requested storage limit for the pool in GB if available.
3721	RequestedStorageLimitInGB *int64 `json:"requestedStorageLimitInGB,omitempty"`
3722	// ElasticPoolName - READ-ONLY; The name of the elastic pool.
3723	ElasticPoolName *string `json:"elasticPoolName,omitempty"`
3724	// ServerName - READ-ONLY; The name of the server the elastic pool is in.
3725	ServerName *string `json:"serverName,omitempty"`
3726	// StartTime - READ-ONLY; The time the operation started (ISO8601 format).
3727	StartTime *date.Time `json:"startTime,omitempty"`
3728	// State - READ-ONLY; The current state of the operation.
3729	State *string `json:"state,omitempty"`
3730	// RequestedStorageLimitInMB - READ-ONLY; The requested storage limit in MB.
3731	RequestedStorageLimitInMB *int32 `json:"requestedStorageLimitInMB,omitempty"`
3732	// RequestedDatabaseDtuGuarantee - READ-ONLY; The requested per database DTU guarantee.
3733	RequestedDatabaseDtuGuarantee *int32 `json:"requestedDatabaseDtuGuarantee,omitempty"`
3734	// RequestedDatabaseDtuCap - READ-ONLY; The requested per database DTU cap.
3735	RequestedDatabaseDtuCap *int32 `json:"requestedDatabaseDtuCap,omitempty"`
3736	// RequestedDtuGuarantee - READ-ONLY; The requested DTU guarantee.
3737	RequestedDtuGuarantee *int32 `json:"requestedDtuGuarantee,omitempty"`
3738}
3739
3740// MarshalJSON is the custom marshaler for ElasticPoolActivityProperties.
3741func (epap ElasticPoolActivityProperties) MarshalJSON() ([]byte, error) {
3742	objectMap := make(map[string]interface{})
3743	return json.Marshal(objectMap)
3744}
3745
3746// ElasticPoolDatabaseActivity represents the activity on an elastic pool.
3747type ElasticPoolDatabaseActivity struct {
3748	// Location - The geo-location where the resource lives
3749	Location *string `json:"location,omitempty"`
3750	// ElasticPoolDatabaseActivityProperties - The properties representing the resource.
3751	*ElasticPoolDatabaseActivityProperties `json:"properties,omitempty"`
3752	// ID - READ-ONLY; Resource ID.
3753	ID *string `json:"id,omitempty"`
3754	// Name - READ-ONLY; Resource name.
3755	Name *string `json:"name,omitempty"`
3756	// Type - READ-ONLY; Resource type.
3757	Type *string `json:"type,omitempty"`
3758}
3759
3760// MarshalJSON is the custom marshaler for ElasticPoolDatabaseActivity.
3761func (epda ElasticPoolDatabaseActivity) MarshalJSON() ([]byte, error) {
3762	objectMap := make(map[string]interface{})
3763	if epda.Location != nil {
3764		objectMap["location"] = epda.Location
3765	}
3766	if epda.ElasticPoolDatabaseActivityProperties != nil {
3767		objectMap["properties"] = epda.ElasticPoolDatabaseActivityProperties
3768	}
3769	return json.Marshal(objectMap)
3770}
3771
3772// UnmarshalJSON is the custom unmarshaler for ElasticPoolDatabaseActivity struct.
3773func (epda *ElasticPoolDatabaseActivity) UnmarshalJSON(body []byte) error {
3774	var m map[string]*json.RawMessage
3775	err := json.Unmarshal(body, &m)
3776	if err != nil {
3777		return err
3778	}
3779	for k, v := range m {
3780		switch k {
3781		case "location":
3782			if v != nil {
3783				var location string
3784				err = json.Unmarshal(*v, &location)
3785				if err != nil {
3786					return err
3787				}
3788				epda.Location = &location
3789			}
3790		case "properties":
3791			if v != nil {
3792				var elasticPoolDatabaseActivityProperties ElasticPoolDatabaseActivityProperties
3793				err = json.Unmarshal(*v, &elasticPoolDatabaseActivityProperties)
3794				if err != nil {
3795					return err
3796				}
3797				epda.ElasticPoolDatabaseActivityProperties = &elasticPoolDatabaseActivityProperties
3798			}
3799		case "id":
3800			if v != nil {
3801				var ID string
3802				err = json.Unmarshal(*v, &ID)
3803				if err != nil {
3804					return err
3805				}
3806				epda.ID = &ID
3807			}
3808		case "name":
3809			if v != nil {
3810				var name string
3811				err = json.Unmarshal(*v, &name)
3812				if err != nil {
3813					return err
3814				}
3815				epda.Name = &name
3816			}
3817		case "type":
3818			if v != nil {
3819				var typeVar string
3820				err = json.Unmarshal(*v, &typeVar)
3821				if err != nil {
3822					return err
3823				}
3824				epda.Type = &typeVar
3825			}
3826		}
3827	}
3828
3829	return nil
3830}
3831
3832// ElasticPoolDatabaseActivityListResult represents the response to a list elastic pool database activity
3833// request.
3834type ElasticPoolDatabaseActivityListResult struct {
3835	autorest.Response `json:"-"`
3836	// Value - The list of elastic pool database activities.
3837	Value *[]ElasticPoolDatabaseActivity `json:"value,omitempty"`
3838}
3839
3840// ElasticPoolDatabaseActivityProperties represents the properties of an elastic pool database activity.
3841type ElasticPoolDatabaseActivityProperties struct {
3842	// DatabaseName - READ-ONLY; The database name.
3843	DatabaseName *string `json:"databaseName,omitempty"`
3844	// EndTime - READ-ONLY; The time the operation finished (ISO8601 format).
3845	EndTime *date.Time `json:"endTime,omitempty"`
3846	// ErrorCode - READ-ONLY; The error code if available.
3847	ErrorCode *int32 `json:"errorCode,omitempty"`
3848	// ErrorMessage - READ-ONLY; The error message if available.
3849	ErrorMessage *string `json:"errorMessage,omitempty"`
3850	// ErrorSeverity - READ-ONLY; The error severity if available.
3851	ErrorSeverity *int32 `json:"errorSeverity,omitempty"`
3852	// Operation - READ-ONLY; The operation name.
3853	Operation *string `json:"operation,omitempty"`
3854	// OperationID - READ-ONLY; The unique operation ID.
3855	OperationID *uuid.UUID `json:"operationId,omitempty"`
3856	// PercentComplete - READ-ONLY; The percentage complete if available.
3857	PercentComplete *int32 `json:"percentComplete,omitempty"`
3858	// RequestedElasticPoolName - READ-ONLY; The name for the elastic pool the database is moving into if available.
3859	RequestedElasticPoolName *string `json:"requestedElasticPoolName,omitempty"`
3860	// CurrentElasticPoolName - READ-ONLY; The name of the current elastic pool the database is in if available.
3861	CurrentElasticPoolName *string `json:"currentElasticPoolName,omitempty"`
3862	// CurrentServiceObjective - READ-ONLY; The name of the current service objective if available.
3863	CurrentServiceObjective *string `json:"currentServiceObjective,omitempty"`
3864	// RequestedServiceObjective - READ-ONLY; The name of the requested service objective if available.
3865	RequestedServiceObjective *string `json:"requestedServiceObjective,omitempty"`
3866	// ServerName - READ-ONLY; The name of the server the elastic pool is in.
3867	ServerName *string `json:"serverName,omitempty"`
3868	// StartTime - READ-ONLY; The time the operation started (ISO8601 format).
3869	StartTime *date.Time `json:"startTime,omitempty"`
3870	// State - READ-ONLY; The current state of the operation.
3871	State *string `json:"state,omitempty"`
3872}
3873
3874// MarshalJSON is the custom marshaler for ElasticPoolDatabaseActivityProperties.
3875func (epdap ElasticPoolDatabaseActivityProperties) MarshalJSON() ([]byte, error) {
3876	objectMap := make(map[string]interface{})
3877	return json.Marshal(objectMap)
3878}
3879
3880// ElasticPoolEditionCapability the elastic pool edition capability.
3881type ElasticPoolEditionCapability struct {
3882	// Name - READ-ONLY; The elastic pool edition name.
3883	Name *string `json:"name,omitempty"`
3884	// SupportedElasticPoolPerformanceLevels - READ-ONLY; The list of supported elastic pool DTU levels for the edition.
3885	SupportedElasticPoolPerformanceLevels *[]ElasticPoolPerformanceLevelCapability `json:"supportedElasticPoolPerformanceLevels,omitempty"`
3886	// ZoneRedundant - READ-ONLY; Whether or not zone redundancy is supported for the edition.
3887	ZoneRedundant *bool `json:"zoneRedundant,omitempty"`
3888	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
3889	Status CapabilityStatus `json:"status,omitempty"`
3890	// Reason - The reason for the capability not being available.
3891	Reason *string `json:"reason,omitempty"`
3892}
3893
3894// MarshalJSON is the custom marshaler for ElasticPoolEditionCapability.
3895func (epec ElasticPoolEditionCapability) MarshalJSON() ([]byte, error) {
3896	objectMap := make(map[string]interface{})
3897	if epec.Reason != nil {
3898		objectMap["reason"] = epec.Reason
3899	}
3900	return json.Marshal(objectMap)
3901}
3902
3903// ElasticPoolListResult the result of an elastic pool list request.
3904type ElasticPoolListResult struct {
3905	autorest.Response `json:"-"`
3906	// Value - READ-ONLY; Array of results.
3907	Value *[]ElasticPool `json:"value,omitempty"`
3908	// NextLink - READ-ONLY; Link to retrieve next page of results.
3909	NextLink *string `json:"nextLink,omitempty"`
3910}
3911
3912// MarshalJSON is the custom marshaler for ElasticPoolListResult.
3913func (eplr ElasticPoolListResult) MarshalJSON() ([]byte, error) {
3914	objectMap := make(map[string]interface{})
3915	return json.Marshal(objectMap)
3916}
3917
3918// ElasticPoolListResultIterator provides access to a complete listing of ElasticPool values.
3919type ElasticPoolListResultIterator struct {
3920	i    int
3921	page ElasticPoolListResultPage
3922}
3923
3924// NextWithContext advances to the next value.  If there was an error making
3925// the request the iterator does not advance and the error is returned.
3926func (iter *ElasticPoolListResultIterator) NextWithContext(ctx context.Context) (err error) {
3927	if tracing.IsEnabled() {
3928		ctx = tracing.StartSpan(ctx, fqdn+"/ElasticPoolListResultIterator.NextWithContext")
3929		defer func() {
3930			sc := -1
3931			if iter.Response().Response.Response != nil {
3932				sc = iter.Response().Response.Response.StatusCode
3933			}
3934			tracing.EndSpan(ctx, sc, err)
3935		}()
3936	}
3937	iter.i++
3938	if iter.i < len(iter.page.Values()) {
3939		return nil
3940	}
3941	err = iter.page.NextWithContext(ctx)
3942	if err != nil {
3943		iter.i--
3944		return err
3945	}
3946	iter.i = 0
3947	return nil
3948}
3949
3950// Next advances to the next value.  If there was an error making
3951// the request the iterator does not advance and the error is returned.
3952// Deprecated: Use NextWithContext() instead.
3953func (iter *ElasticPoolListResultIterator) Next() error {
3954	return iter.NextWithContext(context.Background())
3955}
3956
3957// NotDone returns true if the enumeration should be started or is not yet complete.
3958func (iter ElasticPoolListResultIterator) NotDone() bool {
3959	return iter.page.NotDone() && iter.i < len(iter.page.Values())
3960}
3961
3962// Response returns the raw server response from the last page request.
3963func (iter ElasticPoolListResultIterator) Response() ElasticPoolListResult {
3964	return iter.page.Response()
3965}
3966
3967// Value returns the current value or a zero-initialized value if the
3968// iterator has advanced beyond the end of the collection.
3969func (iter ElasticPoolListResultIterator) Value() ElasticPool {
3970	if !iter.page.NotDone() {
3971		return ElasticPool{}
3972	}
3973	return iter.page.Values()[iter.i]
3974}
3975
3976// Creates a new instance of the ElasticPoolListResultIterator type.
3977func NewElasticPoolListResultIterator(page ElasticPoolListResultPage) ElasticPoolListResultIterator {
3978	return ElasticPoolListResultIterator{page: page}
3979}
3980
3981// IsEmpty returns true if the ListResult contains no values.
3982func (eplr ElasticPoolListResult) IsEmpty() bool {
3983	return eplr.Value == nil || len(*eplr.Value) == 0
3984}
3985
3986// hasNextLink returns true if the NextLink is not empty.
3987func (eplr ElasticPoolListResult) hasNextLink() bool {
3988	return eplr.NextLink != nil && len(*eplr.NextLink) != 0
3989}
3990
3991// elasticPoolListResultPreparer prepares a request to retrieve the next set of results.
3992// It returns nil if no more results exist.
3993func (eplr ElasticPoolListResult) elasticPoolListResultPreparer(ctx context.Context) (*http.Request, error) {
3994	if !eplr.hasNextLink() {
3995		return nil, nil
3996	}
3997	return autorest.Prepare((&http.Request{}).WithContext(ctx),
3998		autorest.AsJSON(),
3999		autorest.AsGet(),
4000		autorest.WithBaseURL(to.String(eplr.NextLink)))
4001}
4002
4003// ElasticPoolListResultPage contains a page of ElasticPool values.
4004type ElasticPoolListResultPage struct {
4005	fn   func(context.Context, ElasticPoolListResult) (ElasticPoolListResult, error)
4006	eplr ElasticPoolListResult
4007}
4008
4009// NextWithContext advances to the next page of values.  If there was an error making
4010// the request the page does not advance and the error is returned.
4011func (page *ElasticPoolListResultPage) NextWithContext(ctx context.Context) (err error) {
4012	if tracing.IsEnabled() {
4013		ctx = tracing.StartSpan(ctx, fqdn+"/ElasticPoolListResultPage.NextWithContext")
4014		defer func() {
4015			sc := -1
4016			if page.Response().Response.Response != nil {
4017				sc = page.Response().Response.Response.StatusCode
4018			}
4019			tracing.EndSpan(ctx, sc, err)
4020		}()
4021	}
4022	for {
4023		next, err := page.fn(ctx, page.eplr)
4024		if err != nil {
4025			return err
4026		}
4027		page.eplr = next
4028		if !next.hasNextLink() || !next.IsEmpty() {
4029			break
4030		}
4031	}
4032	return nil
4033}
4034
4035// Next advances to the next page of values.  If there was an error making
4036// the request the page does not advance and the error is returned.
4037// Deprecated: Use NextWithContext() instead.
4038func (page *ElasticPoolListResultPage) Next() error {
4039	return page.NextWithContext(context.Background())
4040}
4041
4042// NotDone returns true if the page enumeration should be started or is not yet complete.
4043func (page ElasticPoolListResultPage) NotDone() bool {
4044	return !page.eplr.IsEmpty()
4045}
4046
4047// Response returns the raw server response from the last page request.
4048func (page ElasticPoolListResultPage) Response() ElasticPoolListResult {
4049	return page.eplr
4050}
4051
4052// Values returns the slice of values for the current page or nil if there are no values.
4053func (page ElasticPoolListResultPage) Values() []ElasticPool {
4054	if page.eplr.IsEmpty() {
4055		return nil
4056	}
4057	return *page.eplr.Value
4058}
4059
4060// Creates a new instance of the ElasticPoolListResultPage type.
4061func NewElasticPoolListResultPage(cur ElasticPoolListResult, getNextPage func(context.Context, ElasticPoolListResult) (ElasticPoolListResult, error)) ElasticPoolListResultPage {
4062	return ElasticPoolListResultPage{
4063		fn:   getNextPage,
4064		eplr: cur,
4065	}
4066}
4067
4068// ElasticPoolOperation a elastic pool operation.
4069type ElasticPoolOperation struct {
4070	// ElasticPoolOperationProperties - Resource properties.
4071	*ElasticPoolOperationProperties `json:"properties,omitempty"`
4072	// ID - READ-ONLY; Resource ID.
4073	ID *string `json:"id,omitempty"`
4074	// Name - READ-ONLY; Resource name.
4075	Name *string `json:"name,omitempty"`
4076	// Type - READ-ONLY; Resource type.
4077	Type *string `json:"type,omitempty"`
4078}
4079
4080// MarshalJSON is the custom marshaler for ElasticPoolOperation.
4081func (epo ElasticPoolOperation) MarshalJSON() ([]byte, error) {
4082	objectMap := make(map[string]interface{})
4083	if epo.ElasticPoolOperationProperties != nil {
4084		objectMap["properties"] = epo.ElasticPoolOperationProperties
4085	}
4086	return json.Marshal(objectMap)
4087}
4088
4089// UnmarshalJSON is the custom unmarshaler for ElasticPoolOperation struct.
4090func (epo *ElasticPoolOperation) UnmarshalJSON(body []byte) error {
4091	var m map[string]*json.RawMessage
4092	err := json.Unmarshal(body, &m)
4093	if err != nil {
4094		return err
4095	}
4096	for k, v := range m {
4097		switch k {
4098		case "properties":
4099			if v != nil {
4100				var elasticPoolOperationProperties ElasticPoolOperationProperties
4101				err = json.Unmarshal(*v, &elasticPoolOperationProperties)
4102				if err != nil {
4103					return err
4104				}
4105				epo.ElasticPoolOperationProperties = &elasticPoolOperationProperties
4106			}
4107		case "id":
4108			if v != nil {
4109				var ID string
4110				err = json.Unmarshal(*v, &ID)
4111				if err != nil {
4112					return err
4113				}
4114				epo.ID = &ID
4115			}
4116		case "name":
4117			if v != nil {
4118				var name string
4119				err = json.Unmarshal(*v, &name)
4120				if err != nil {
4121					return err
4122				}
4123				epo.Name = &name
4124			}
4125		case "type":
4126			if v != nil {
4127				var typeVar string
4128				err = json.Unmarshal(*v, &typeVar)
4129				if err != nil {
4130					return err
4131				}
4132				epo.Type = &typeVar
4133			}
4134		}
4135	}
4136
4137	return nil
4138}
4139
4140// ElasticPoolOperationListResult the response to a list elastic pool operations request
4141type ElasticPoolOperationListResult struct {
4142	autorest.Response `json:"-"`
4143	// Value - READ-ONLY; Array of results.
4144	Value *[]ElasticPoolOperation `json:"value,omitempty"`
4145	// NextLink - READ-ONLY; Link to retrieve next page of results.
4146	NextLink *string `json:"nextLink,omitempty"`
4147}
4148
4149// MarshalJSON is the custom marshaler for ElasticPoolOperationListResult.
4150func (epolr ElasticPoolOperationListResult) MarshalJSON() ([]byte, error) {
4151	objectMap := make(map[string]interface{})
4152	return json.Marshal(objectMap)
4153}
4154
4155// ElasticPoolOperationListResultIterator provides access to a complete listing of ElasticPoolOperation
4156// values.
4157type ElasticPoolOperationListResultIterator struct {
4158	i    int
4159	page ElasticPoolOperationListResultPage
4160}
4161
4162// NextWithContext advances to the next value.  If there was an error making
4163// the request the iterator does not advance and the error is returned.
4164func (iter *ElasticPoolOperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
4165	if tracing.IsEnabled() {
4166		ctx = tracing.StartSpan(ctx, fqdn+"/ElasticPoolOperationListResultIterator.NextWithContext")
4167		defer func() {
4168			sc := -1
4169			if iter.Response().Response.Response != nil {
4170				sc = iter.Response().Response.Response.StatusCode
4171			}
4172			tracing.EndSpan(ctx, sc, err)
4173		}()
4174	}
4175	iter.i++
4176	if iter.i < len(iter.page.Values()) {
4177		return nil
4178	}
4179	err = iter.page.NextWithContext(ctx)
4180	if err != nil {
4181		iter.i--
4182		return err
4183	}
4184	iter.i = 0
4185	return nil
4186}
4187
4188// Next advances to the next value.  If there was an error making
4189// the request the iterator does not advance and the error is returned.
4190// Deprecated: Use NextWithContext() instead.
4191func (iter *ElasticPoolOperationListResultIterator) Next() error {
4192	return iter.NextWithContext(context.Background())
4193}
4194
4195// NotDone returns true if the enumeration should be started or is not yet complete.
4196func (iter ElasticPoolOperationListResultIterator) NotDone() bool {
4197	return iter.page.NotDone() && iter.i < len(iter.page.Values())
4198}
4199
4200// Response returns the raw server response from the last page request.
4201func (iter ElasticPoolOperationListResultIterator) Response() ElasticPoolOperationListResult {
4202	return iter.page.Response()
4203}
4204
4205// Value returns the current value or a zero-initialized value if the
4206// iterator has advanced beyond the end of the collection.
4207func (iter ElasticPoolOperationListResultIterator) Value() ElasticPoolOperation {
4208	if !iter.page.NotDone() {
4209		return ElasticPoolOperation{}
4210	}
4211	return iter.page.Values()[iter.i]
4212}
4213
4214// Creates a new instance of the ElasticPoolOperationListResultIterator type.
4215func NewElasticPoolOperationListResultIterator(page ElasticPoolOperationListResultPage) ElasticPoolOperationListResultIterator {
4216	return ElasticPoolOperationListResultIterator{page: page}
4217}
4218
4219// IsEmpty returns true if the ListResult contains no values.
4220func (epolr ElasticPoolOperationListResult) IsEmpty() bool {
4221	return epolr.Value == nil || len(*epolr.Value) == 0
4222}
4223
4224// hasNextLink returns true if the NextLink is not empty.
4225func (epolr ElasticPoolOperationListResult) hasNextLink() bool {
4226	return epolr.NextLink != nil && len(*epolr.NextLink) != 0
4227}
4228
4229// elasticPoolOperationListResultPreparer prepares a request to retrieve the next set of results.
4230// It returns nil if no more results exist.
4231func (epolr ElasticPoolOperationListResult) elasticPoolOperationListResultPreparer(ctx context.Context) (*http.Request, error) {
4232	if !epolr.hasNextLink() {
4233		return nil, nil
4234	}
4235	return autorest.Prepare((&http.Request{}).WithContext(ctx),
4236		autorest.AsJSON(),
4237		autorest.AsGet(),
4238		autorest.WithBaseURL(to.String(epolr.NextLink)))
4239}
4240
4241// ElasticPoolOperationListResultPage contains a page of ElasticPoolOperation values.
4242type ElasticPoolOperationListResultPage struct {
4243	fn    func(context.Context, ElasticPoolOperationListResult) (ElasticPoolOperationListResult, error)
4244	epolr ElasticPoolOperationListResult
4245}
4246
4247// NextWithContext advances to the next page of values.  If there was an error making
4248// the request the page does not advance and the error is returned.
4249func (page *ElasticPoolOperationListResultPage) NextWithContext(ctx context.Context) (err error) {
4250	if tracing.IsEnabled() {
4251		ctx = tracing.StartSpan(ctx, fqdn+"/ElasticPoolOperationListResultPage.NextWithContext")
4252		defer func() {
4253			sc := -1
4254			if page.Response().Response.Response != nil {
4255				sc = page.Response().Response.Response.StatusCode
4256			}
4257			tracing.EndSpan(ctx, sc, err)
4258		}()
4259	}
4260	for {
4261		next, err := page.fn(ctx, page.epolr)
4262		if err != nil {
4263			return err
4264		}
4265		page.epolr = next
4266		if !next.hasNextLink() || !next.IsEmpty() {
4267			break
4268		}
4269	}
4270	return nil
4271}
4272
4273// Next advances to the next page of values.  If there was an error making
4274// the request the page does not advance and the error is returned.
4275// Deprecated: Use NextWithContext() instead.
4276func (page *ElasticPoolOperationListResultPage) Next() error {
4277	return page.NextWithContext(context.Background())
4278}
4279
4280// NotDone returns true if the page enumeration should be started or is not yet complete.
4281func (page ElasticPoolOperationListResultPage) NotDone() bool {
4282	return !page.epolr.IsEmpty()
4283}
4284
4285// Response returns the raw server response from the last page request.
4286func (page ElasticPoolOperationListResultPage) Response() ElasticPoolOperationListResult {
4287	return page.epolr
4288}
4289
4290// Values returns the slice of values for the current page or nil if there are no values.
4291func (page ElasticPoolOperationListResultPage) Values() []ElasticPoolOperation {
4292	if page.epolr.IsEmpty() {
4293		return nil
4294	}
4295	return *page.epolr.Value
4296}
4297
4298// Creates a new instance of the ElasticPoolOperationListResultPage type.
4299func NewElasticPoolOperationListResultPage(cur ElasticPoolOperationListResult, getNextPage func(context.Context, ElasticPoolOperationListResult) (ElasticPoolOperationListResult, error)) ElasticPoolOperationListResultPage {
4300	return ElasticPoolOperationListResultPage{
4301		fn:    getNextPage,
4302		epolr: cur,
4303	}
4304}
4305
4306// ElasticPoolOperationProperties the properties of a elastic pool operation.
4307type ElasticPoolOperationProperties struct {
4308	// ElasticPoolName - READ-ONLY; The name of the elastic pool the operation is being performed on.
4309	ElasticPoolName *string `json:"elasticPoolName,omitempty"`
4310	// Operation - READ-ONLY; The name of operation.
4311	Operation *string `json:"operation,omitempty"`
4312	// OperationFriendlyName - READ-ONLY; The friendly name of operation.
4313	OperationFriendlyName *string `json:"operationFriendlyName,omitempty"`
4314	// PercentComplete - READ-ONLY; The percentage of the operation completed.
4315	PercentComplete *int32 `json:"percentComplete,omitempty"`
4316	// ServerName - READ-ONLY; The name of the server.
4317	ServerName *string `json:"serverName,omitempty"`
4318	// StartTime - READ-ONLY; The operation start time.
4319	StartTime *date.Time `json:"startTime,omitempty"`
4320	// State - READ-ONLY; The operation state.
4321	State *string `json:"state,omitempty"`
4322	// ErrorCode - READ-ONLY; The operation error code.
4323	ErrorCode *int32 `json:"errorCode,omitempty"`
4324	// ErrorDescription - READ-ONLY; The operation error description.
4325	ErrorDescription *string `json:"errorDescription,omitempty"`
4326	// ErrorSeverity - READ-ONLY; The operation error severity.
4327	ErrorSeverity *int32 `json:"errorSeverity,omitempty"`
4328	// IsUserError - READ-ONLY; Whether or not the error is a user error.
4329	IsUserError *bool `json:"isUserError,omitempty"`
4330	// EstimatedCompletionTime - READ-ONLY; The estimated completion time of the operation.
4331	EstimatedCompletionTime *date.Time `json:"estimatedCompletionTime,omitempty"`
4332	// Description - READ-ONLY; The operation description.
4333	Description *string `json:"description,omitempty"`
4334	// IsCancellable - READ-ONLY; Whether the operation can be cancelled.
4335	IsCancellable *bool `json:"isCancellable,omitempty"`
4336}
4337
4338// MarshalJSON is the custom marshaler for ElasticPoolOperationProperties.
4339func (epop ElasticPoolOperationProperties) MarshalJSON() ([]byte, error) {
4340	objectMap := make(map[string]interface{})
4341	return json.Marshal(objectMap)
4342}
4343
4344// ElasticPoolPerDatabaseMaxPerformanceLevelCapability the max per-database performance level capability.
4345type ElasticPoolPerDatabaseMaxPerformanceLevelCapability struct {
4346	// Limit - READ-ONLY; The maximum performance level per database.
4347	Limit *float64 `json:"limit,omitempty"`
4348	// Unit - READ-ONLY; Unit type used to measure performance level. Possible values include: 'DTU', 'VCores'
4349	Unit PerformanceLevelUnit `json:"unit,omitempty"`
4350	// SupportedPerDatabaseMinPerformanceLevels - READ-ONLY; The list of supported min database performance levels.
4351	SupportedPerDatabaseMinPerformanceLevels *[]ElasticPoolPerDatabaseMinPerformanceLevelCapability `json:"supportedPerDatabaseMinPerformanceLevels,omitempty"`
4352	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
4353	Status CapabilityStatus `json:"status,omitempty"`
4354	// Reason - The reason for the capability not being available.
4355	Reason *string `json:"reason,omitempty"`
4356}
4357
4358// MarshalJSON is the custom marshaler for ElasticPoolPerDatabaseMaxPerformanceLevelCapability.
4359func (eppdmplc ElasticPoolPerDatabaseMaxPerformanceLevelCapability) MarshalJSON() ([]byte, error) {
4360	objectMap := make(map[string]interface{})
4361	if eppdmplc.Reason != nil {
4362		objectMap["reason"] = eppdmplc.Reason
4363	}
4364	return json.Marshal(objectMap)
4365}
4366
4367// ElasticPoolPerDatabaseMinPerformanceLevelCapability the minimum per-database performance level
4368// capability.
4369type ElasticPoolPerDatabaseMinPerformanceLevelCapability struct {
4370	// Limit - READ-ONLY; The minimum performance level per database.
4371	Limit *float64 `json:"limit,omitempty"`
4372	// Unit - READ-ONLY; Unit type used to measure performance level. Possible values include: 'DTU', 'VCores'
4373	Unit PerformanceLevelUnit `json:"unit,omitempty"`
4374	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
4375	Status CapabilityStatus `json:"status,omitempty"`
4376	// Reason - The reason for the capability not being available.
4377	Reason *string `json:"reason,omitempty"`
4378}
4379
4380// MarshalJSON is the custom marshaler for ElasticPoolPerDatabaseMinPerformanceLevelCapability.
4381func (eppdmplc ElasticPoolPerDatabaseMinPerformanceLevelCapability) MarshalJSON() ([]byte, error) {
4382	objectMap := make(map[string]interface{})
4383	if eppdmplc.Reason != nil {
4384		objectMap["reason"] = eppdmplc.Reason
4385	}
4386	return json.Marshal(objectMap)
4387}
4388
4389// ElasticPoolPerDatabaseSettings per database settings of an elastic pool.
4390type ElasticPoolPerDatabaseSettings struct {
4391	// MinCapacity - The minimum capacity all databases are guaranteed.
4392	MinCapacity *float64 `json:"minCapacity,omitempty"`
4393	// MaxCapacity - The maximum capacity any one database can consume.
4394	MaxCapacity *float64 `json:"maxCapacity,omitempty"`
4395}
4396
4397// ElasticPoolPerformanceLevelCapability the Elastic Pool performance level capability.
4398type ElasticPoolPerformanceLevelCapability struct {
4399	// PerformanceLevel - READ-ONLY; The performance level for the pool.
4400	PerformanceLevel *PerformanceLevelCapability `json:"performanceLevel,omitempty"`
4401	// Sku - READ-ONLY; The sku.
4402	Sku *Sku `json:"sku,omitempty"`
4403	// SupportedLicenseTypes - READ-ONLY; List of supported license types.
4404	SupportedLicenseTypes *[]LicenseTypeCapability `json:"supportedLicenseTypes,omitempty"`
4405	// MaxDatabaseCount - READ-ONLY; The maximum number of databases supported.
4406	MaxDatabaseCount *int32 `json:"maxDatabaseCount,omitempty"`
4407	// IncludedMaxSize - READ-ONLY; The included (free) max size for this performance level.
4408	IncludedMaxSize *MaxSizeCapability `json:"includedMaxSize,omitempty"`
4409	// SupportedMaxSizes - READ-ONLY; The list of supported max sizes.
4410	SupportedMaxSizes *[]MaxSizeRangeCapability `json:"supportedMaxSizes,omitempty"`
4411	// SupportedPerDatabaseMaxSizes - READ-ONLY; The list of supported per database max sizes.
4412	SupportedPerDatabaseMaxSizes *[]MaxSizeRangeCapability `json:"supportedPerDatabaseMaxSizes,omitempty"`
4413	// SupportedPerDatabaseMaxPerformanceLevels - READ-ONLY; The list of supported per database max performance levels.
4414	SupportedPerDatabaseMaxPerformanceLevels *[]ElasticPoolPerDatabaseMaxPerformanceLevelCapability `json:"supportedPerDatabaseMaxPerformanceLevels,omitempty"`
4415	// ZoneRedundant - READ-ONLY; Whether or not zone redundancy is supported for the performance level.
4416	ZoneRedundant *bool `json:"zoneRedundant,omitempty"`
4417	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
4418	Status CapabilityStatus `json:"status,omitempty"`
4419	// Reason - The reason for the capability not being available.
4420	Reason *string `json:"reason,omitempty"`
4421}
4422
4423// MarshalJSON is the custom marshaler for ElasticPoolPerformanceLevelCapability.
4424func (epplc ElasticPoolPerformanceLevelCapability) MarshalJSON() ([]byte, error) {
4425	objectMap := make(map[string]interface{})
4426	if epplc.Reason != nil {
4427		objectMap["reason"] = epplc.Reason
4428	}
4429	return json.Marshal(objectMap)
4430}
4431
4432// ElasticPoolProperties properties of an elastic pool
4433type ElasticPoolProperties struct {
4434	// State - READ-ONLY; The state of the elastic pool. Possible values include: 'ElasticPoolStateCreating', 'ElasticPoolStateReady', 'ElasticPoolStateDisabled'
4435	State ElasticPoolState `json:"state,omitempty"`
4436	// CreationDate - READ-ONLY; The creation date of the elastic pool (ISO8601 format).
4437	CreationDate *date.Time `json:"creationDate,omitempty"`
4438	// MaxSizeBytes - The storage limit for the database elastic pool in bytes.
4439	MaxSizeBytes *int64 `json:"maxSizeBytes,omitempty"`
4440	// PerDatabaseSettings - The per database settings for the elastic pool.
4441	PerDatabaseSettings *ElasticPoolPerDatabaseSettings `json:"perDatabaseSettings,omitempty"`
4442	// 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.
4443	ZoneRedundant *bool `json:"zoneRedundant,omitempty"`
4444	// LicenseType - The license type to apply for this elastic pool. Possible values include: 'ElasticPoolLicenseTypeLicenseIncluded', 'ElasticPoolLicenseTypeBasePrice'
4445	LicenseType ElasticPoolLicenseType `json:"licenseType,omitempty"`
4446}
4447
4448// MarshalJSON is the custom marshaler for ElasticPoolProperties.
4449func (epp ElasticPoolProperties) MarshalJSON() ([]byte, error) {
4450	objectMap := make(map[string]interface{})
4451	if epp.MaxSizeBytes != nil {
4452		objectMap["maxSizeBytes"] = epp.MaxSizeBytes
4453	}
4454	if epp.PerDatabaseSettings != nil {
4455		objectMap["perDatabaseSettings"] = epp.PerDatabaseSettings
4456	}
4457	if epp.ZoneRedundant != nil {
4458		objectMap["zoneRedundant"] = epp.ZoneRedundant
4459	}
4460	if epp.LicenseType != "" {
4461		objectMap["licenseType"] = epp.LicenseType
4462	}
4463	return json.Marshal(objectMap)
4464}
4465
4466// ElasticPoolsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
4467// long-running operation.
4468type ElasticPoolsCreateOrUpdateFuture struct {
4469	azure.FutureAPI
4470	// Result returns the result of the asynchronous operation.
4471	// If the operation has not completed it will return an error.
4472	Result func(ElasticPoolsClient) (ElasticPool, error)
4473}
4474
4475// UnmarshalJSON is the custom unmarshaller for CreateFuture.
4476func (future *ElasticPoolsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
4477	var azFuture azure.Future
4478	if err := json.Unmarshal(body, &azFuture); err != nil {
4479		return err
4480	}
4481	future.FutureAPI = &azFuture
4482	future.Result = future.result
4483	return nil
4484}
4485
4486// result is the default implementation for ElasticPoolsCreateOrUpdateFuture.Result.
4487func (future *ElasticPoolsCreateOrUpdateFuture) result(client ElasticPoolsClient) (ep ElasticPool, err error) {
4488	var done bool
4489	done, err = future.DoneWithContext(context.Background(), client)
4490	if err != nil {
4491		err = autorest.NewErrorWithError(err, "sql.ElasticPoolsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
4492		return
4493	}
4494	if !done {
4495		ep.Response.Response = future.Response()
4496		err = azure.NewAsyncOpIncompleteError("sql.ElasticPoolsCreateOrUpdateFuture")
4497		return
4498	}
4499	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4500	if ep.Response.Response, err = future.GetResult(sender); err == nil && ep.Response.Response.StatusCode != http.StatusNoContent {
4501		ep, err = client.CreateOrUpdateResponder(ep.Response.Response)
4502		if err != nil {
4503			err = autorest.NewErrorWithError(err, "sql.ElasticPoolsCreateOrUpdateFuture", "Result", ep.Response.Response, "Failure responding to request")
4504		}
4505	}
4506	return
4507}
4508
4509// ElasticPoolsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
4510// operation.
4511type ElasticPoolsDeleteFuture struct {
4512	azure.FutureAPI
4513	// Result returns the result of the asynchronous operation.
4514	// If the operation has not completed it will return an error.
4515	Result func(ElasticPoolsClient) (autorest.Response, error)
4516}
4517
4518// UnmarshalJSON is the custom unmarshaller for CreateFuture.
4519func (future *ElasticPoolsDeleteFuture) UnmarshalJSON(body []byte) error {
4520	var azFuture azure.Future
4521	if err := json.Unmarshal(body, &azFuture); err != nil {
4522		return err
4523	}
4524	future.FutureAPI = &azFuture
4525	future.Result = future.result
4526	return nil
4527}
4528
4529// result is the default implementation for ElasticPoolsDeleteFuture.Result.
4530func (future *ElasticPoolsDeleteFuture) result(client ElasticPoolsClient) (ar autorest.Response, err error) {
4531	var done bool
4532	done, err = future.DoneWithContext(context.Background(), client)
4533	if err != nil {
4534		err = autorest.NewErrorWithError(err, "sql.ElasticPoolsDeleteFuture", "Result", future.Response(), "Polling failure")
4535		return
4536	}
4537	if !done {
4538		ar.Response = future.Response()
4539		err = azure.NewAsyncOpIncompleteError("sql.ElasticPoolsDeleteFuture")
4540		return
4541	}
4542	ar.Response = future.Response()
4543	return
4544}
4545
4546// ElasticPoolsFailoverFuture an abstraction for monitoring and retrieving the results of a long-running
4547// operation.
4548type ElasticPoolsFailoverFuture struct {
4549	azure.FutureAPI
4550	// Result returns the result of the asynchronous operation.
4551	// If the operation has not completed it will return an error.
4552	Result func(ElasticPoolsClient) (autorest.Response, error)
4553}
4554
4555// UnmarshalJSON is the custom unmarshaller for CreateFuture.
4556func (future *ElasticPoolsFailoverFuture) UnmarshalJSON(body []byte) error {
4557	var azFuture azure.Future
4558	if err := json.Unmarshal(body, &azFuture); err != nil {
4559		return err
4560	}
4561	future.FutureAPI = &azFuture
4562	future.Result = future.result
4563	return nil
4564}
4565
4566// result is the default implementation for ElasticPoolsFailoverFuture.Result.
4567func (future *ElasticPoolsFailoverFuture) result(client ElasticPoolsClient) (ar autorest.Response, err error) {
4568	var done bool
4569	done, err = future.DoneWithContext(context.Background(), client)
4570	if err != nil {
4571		err = autorest.NewErrorWithError(err, "sql.ElasticPoolsFailoverFuture", "Result", future.Response(), "Polling failure")
4572		return
4573	}
4574	if !done {
4575		ar.Response = future.Response()
4576		err = azure.NewAsyncOpIncompleteError("sql.ElasticPoolsFailoverFuture")
4577		return
4578	}
4579	ar.Response = future.Response()
4580	return
4581}
4582
4583// ElasticPoolsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
4584// operation.
4585type ElasticPoolsUpdateFuture struct {
4586	azure.FutureAPI
4587	// Result returns the result of the asynchronous operation.
4588	// If the operation has not completed it will return an error.
4589	Result func(ElasticPoolsClient) (ElasticPool, error)
4590}
4591
4592// UnmarshalJSON is the custom unmarshaller for CreateFuture.
4593func (future *ElasticPoolsUpdateFuture) UnmarshalJSON(body []byte) error {
4594	var azFuture azure.Future
4595	if err := json.Unmarshal(body, &azFuture); err != nil {
4596		return err
4597	}
4598	future.FutureAPI = &azFuture
4599	future.Result = future.result
4600	return nil
4601}
4602
4603// result is the default implementation for ElasticPoolsUpdateFuture.Result.
4604func (future *ElasticPoolsUpdateFuture) result(client ElasticPoolsClient) (ep ElasticPool, err error) {
4605	var done bool
4606	done, err = future.DoneWithContext(context.Background(), client)
4607	if err != nil {
4608		err = autorest.NewErrorWithError(err, "sql.ElasticPoolsUpdateFuture", "Result", future.Response(), "Polling failure")
4609		return
4610	}
4611	if !done {
4612		ep.Response.Response = future.Response()
4613		err = azure.NewAsyncOpIncompleteError("sql.ElasticPoolsUpdateFuture")
4614		return
4615	}
4616	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4617	if ep.Response.Response, err = future.GetResult(sender); err == nil && ep.Response.Response.StatusCode != http.StatusNoContent {
4618		ep, err = client.UpdateResponder(ep.Response.Response)
4619		if err != nil {
4620			err = autorest.NewErrorWithError(err, "sql.ElasticPoolsUpdateFuture", "Result", ep.Response.Response, "Failure responding to request")
4621		}
4622	}
4623	return
4624}
4625
4626// ElasticPoolUpdate an elastic pool update.
4627type ElasticPoolUpdate struct {
4628	Sku *Sku `json:"sku,omitempty"`
4629	// ElasticPoolUpdateProperties - Resource properties.
4630	*ElasticPoolUpdateProperties `json:"properties,omitempty"`
4631	// Tags - Resource tags.
4632	Tags map[string]*string `json:"tags"`
4633}
4634
4635// MarshalJSON is the custom marshaler for ElasticPoolUpdate.
4636func (epu ElasticPoolUpdate) MarshalJSON() ([]byte, error) {
4637	objectMap := make(map[string]interface{})
4638	if epu.Sku != nil {
4639		objectMap["sku"] = epu.Sku
4640	}
4641	if epu.ElasticPoolUpdateProperties != nil {
4642		objectMap["properties"] = epu.ElasticPoolUpdateProperties
4643	}
4644	if epu.Tags != nil {
4645		objectMap["tags"] = epu.Tags
4646	}
4647	return json.Marshal(objectMap)
4648}
4649
4650// UnmarshalJSON is the custom unmarshaler for ElasticPoolUpdate struct.
4651func (epu *ElasticPoolUpdate) UnmarshalJSON(body []byte) error {
4652	var m map[string]*json.RawMessage
4653	err := json.Unmarshal(body, &m)
4654	if err != nil {
4655		return err
4656	}
4657	for k, v := range m {
4658		switch k {
4659		case "sku":
4660			if v != nil {
4661				var sku Sku
4662				err = json.Unmarshal(*v, &sku)
4663				if err != nil {
4664					return err
4665				}
4666				epu.Sku = &sku
4667			}
4668		case "properties":
4669			if v != nil {
4670				var elasticPoolUpdateProperties ElasticPoolUpdateProperties
4671				err = json.Unmarshal(*v, &elasticPoolUpdateProperties)
4672				if err != nil {
4673					return err
4674				}
4675				epu.ElasticPoolUpdateProperties = &elasticPoolUpdateProperties
4676			}
4677		case "tags":
4678			if v != nil {
4679				var tags map[string]*string
4680				err = json.Unmarshal(*v, &tags)
4681				if err != nil {
4682					return err
4683				}
4684				epu.Tags = tags
4685			}
4686		}
4687	}
4688
4689	return nil
4690}
4691
4692// ElasticPoolUpdateProperties properties of an elastic pool
4693type ElasticPoolUpdateProperties struct {
4694	// MaxSizeBytes - The storage limit for the database elastic pool in bytes.
4695	MaxSizeBytes *int64 `json:"maxSizeBytes,omitempty"`
4696	// PerDatabaseSettings - The per database settings for the elastic pool.
4697	PerDatabaseSettings *ElasticPoolPerDatabaseSettings `json:"perDatabaseSettings,omitempty"`
4698	// 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.
4699	ZoneRedundant *bool `json:"zoneRedundant,omitempty"`
4700	// LicenseType - The license type to apply for this elastic pool. Possible values include: 'ElasticPoolLicenseTypeLicenseIncluded', 'ElasticPoolLicenseTypeBasePrice'
4701	LicenseType ElasticPoolLicenseType `json:"licenseType,omitempty"`
4702}
4703
4704// EncryptionProtector the server encryption protector.
4705type EncryptionProtector struct {
4706	autorest.Response `json:"-"`
4707	// Kind - READ-ONLY; Kind of encryption protector. This is metadata used for the Azure portal experience.
4708	Kind *string `json:"kind,omitempty"`
4709	// Location - READ-ONLY; Resource location.
4710	Location *string `json:"location,omitempty"`
4711	// EncryptionProtectorProperties - Resource properties.
4712	*EncryptionProtectorProperties `json:"properties,omitempty"`
4713	// ID - READ-ONLY; Resource ID.
4714	ID *string `json:"id,omitempty"`
4715	// Name - READ-ONLY; Resource name.
4716	Name *string `json:"name,omitempty"`
4717	// Type - READ-ONLY; Resource type.
4718	Type *string `json:"type,omitempty"`
4719}
4720
4721// MarshalJSON is the custom marshaler for EncryptionProtector.
4722func (ep EncryptionProtector) MarshalJSON() ([]byte, error) {
4723	objectMap := make(map[string]interface{})
4724	if ep.EncryptionProtectorProperties != nil {
4725		objectMap["properties"] = ep.EncryptionProtectorProperties
4726	}
4727	return json.Marshal(objectMap)
4728}
4729
4730// UnmarshalJSON is the custom unmarshaler for EncryptionProtector struct.
4731func (ep *EncryptionProtector) UnmarshalJSON(body []byte) error {
4732	var m map[string]*json.RawMessage
4733	err := json.Unmarshal(body, &m)
4734	if err != nil {
4735		return err
4736	}
4737	for k, v := range m {
4738		switch k {
4739		case "kind":
4740			if v != nil {
4741				var kind string
4742				err = json.Unmarshal(*v, &kind)
4743				if err != nil {
4744					return err
4745				}
4746				ep.Kind = &kind
4747			}
4748		case "location":
4749			if v != nil {
4750				var location string
4751				err = json.Unmarshal(*v, &location)
4752				if err != nil {
4753					return err
4754				}
4755				ep.Location = &location
4756			}
4757		case "properties":
4758			if v != nil {
4759				var encryptionProtectorProperties EncryptionProtectorProperties
4760				err = json.Unmarshal(*v, &encryptionProtectorProperties)
4761				if err != nil {
4762					return err
4763				}
4764				ep.EncryptionProtectorProperties = &encryptionProtectorProperties
4765			}
4766		case "id":
4767			if v != nil {
4768				var ID string
4769				err = json.Unmarshal(*v, &ID)
4770				if err != nil {
4771					return err
4772				}
4773				ep.ID = &ID
4774			}
4775		case "name":
4776			if v != nil {
4777				var name string
4778				err = json.Unmarshal(*v, &name)
4779				if err != nil {
4780					return err
4781				}
4782				ep.Name = &name
4783			}
4784		case "type":
4785			if v != nil {
4786				var typeVar string
4787				err = json.Unmarshal(*v, &typeVar)
4788				if err != nil {
4789					return err
4790				}
4791				ep.Type = &typeVar
4792			}
4793		}
4794	}
4795
4796	return nil
4797}
4798
4799// EncryptionProtectorListResult a list of server encryption protectors.
4800type EncryptionProtectorListResult struct {
4801	autorest.Response `json:"-"`
4802	// Value - READ-ONLY; Array of results.
4803	Value *[]EncryptionProtector `json:"value,omitempty"`
4804	// NextLink - READ-ONLY; Link to retrieve next page of results.
4805	NextLink *string `json:"nextLink,omitempty"`
4806}
4807
4808// MarshalJSON is the custom marshaler for EncryptionProtectorListResult.
4809func (eplr EncryptionProtectorListResult) MarshalJSON() ([]byte, error) {
4810	objectMap := make(map[string]interface{})
4811	return json.Marshal(objectMap)
4812}
4813
4814// EncryptionProtectorListResultIterator provides access to a complete listing of EncryptionProtector
4815// values.
4816type EncryptionProtectorListResultIterator struct {
4817	i    int
4818	page EncryptionProtectorListResultPage
4819}
4820
4821// NextWithContext advances to the next value.  If there was an error making
4822// the request the iterator does not advance and the error is returned.
4823func (iter *EncryptionProtectorListResultIterator) NextWithContext(ctx context.Context) (err error) {
4824	if tracing.IsEnabled() {
4825		ctx = tracing.StartSpan(ctx, fqdn+"/EncryptionProtectorListResultIterator.NextWithContext")
4826		defer func() {
4827			sc := -1
4828			if iter.Response().Response.Response != nil {
4829				sc = iter.Response().Response.Response.StatusCode
4830			}
4831			tracing.EndSpan(ctx, sc, err)
4832		}()
4833	}
4834	iter.i++
4835	if iter.i < len(iter.page.Values()) {
4836		return nil
4837	}
4838	err = iter.page.NextWithContext(ctx)
4839	if err != nil {
4840		iter.i--
4841		return err
4842	}
4843	iter.i = 0
4844	return nil
4845}
4846
4847// Next advances to the next value.  If there was an error making
4848// the request the iterator does not advance and the error is returned.
4849// Deprecated: Use NextWithContext() instead.
4850func (iter *EncryptionProtectorListResultIterator) Next() error {
4851	return iter.NextWithContext(context.Background())
4852}
4853
4854// NotDone returns true if the enumeration should be started or is not yet complete.
4855func (iter EncryptionProtectorListResultIterator) NotDone() bool {
4856	return iter.page.NotDone() && iter.i < len(iter.page.Values())
4857}
4858
4859// Response returns the raw server response from the last page request.
4860func (iter EncryptionProtectorListResultIterator) Response() EncryptionProtectorListResult {
4861	return iter.page.Response()
4862}
4863
4864// Value returns the current value or a zero-initialized value if the
4865// iterator has advanced beyond the end of the collection.
4866func (iter EncryptionProtectorListResultIterator) Value() EncryptionProtector {
4867	if !iter.page.NotDone() {
4868		return EncryptionProtector{}
4869	}
4870	return iter.page.Values()[iter.i]
4871}
4872
4873// Creates a new instance of the EncryptionProtectorListResultIterator type.
4874func NewEncryptionProtectorListResultIterator(page EncryptionProtectorListResultPage) EncryptionProtectorListResultIterator {
4875	return EncryptionProtectorListResultIterator{page: page}
4876}
4877
4878// IsEmpty returns true if the ListResult contains no values.
4879func (eplr EncryptionProtectorListResult) IsEmpty() bool {
4880	return eplr.Value == nil || len(*eplr.Value) == 0
4881}
4882
4883// hasNextLink returns true if the NextLink is not empty.
4884func (eplr EncryptionProtectorListResult) hasNextLink() bool {
4885	return eplr.NextLink != nil && len(*eplr.NextLink) != 0
4886}
4887
4888// encryptionProtectorListResultPreparer prepares a request to retrieve the next set of results.
4889// It returns nil if no more results exist.
4890func (eplr EncryptionProtectorListResult) encryptionProtectorListResultPreparer(ctx context.Context) (*http.Request, error) {
4891	if !eplr.hasNextLink() {
4892		return nil, nil
4893	}
4894	return autorest.Prepare((&http.Request{}).WithContext(ctx),
4895		autorest.AsJSON(),
4896		autorest.AsGet(),
4897		autorest.WithBaseURL(to.String(eplr.NextLink)))
4898}
4899
4900// EncryptionProtectorListResultPage contains a page of EncryptionProtector values.
4901type EncryptionProtectorListResultPage struct {
4902	fn   func(context.Context, EncryptionProtectorListResult) (EncryptionProtectorListResult, error)
4903	eplr EncryptionProtectorListResult
4904}
4905
4906// NextWithContext advances to the next page of values.  If there was an error making
4907// the request the page does not advance and the error is returned.
4908func (page *EncryptionProtectorListResultPage) NextWithContext(ctx context.Context) (err error) {
4909	if tracing.IsEnabled() {
4910		ctx = tracing.StartSpan(ctx, fqdn+"/EncryptionProtectorListResultPage.NextWithContext")
4911		defer func() {
4912			sc := -1
4913			if page.Response().Response.Response != nil {
4914				sc = page.Response().Response.Response.StatusCode
4915			}
4916			tracing.EndSpan(ctx, sc, err)
4917		}()
4918	}
4919	for {
4920		next, err := page.fn(ctx, page.eplr)
4921		if err != nil {
4922			return err
4923		}
4924		page.eplr = next
4925		if !next.hasNextLink() || !next.IsEmpty() {
4926			break
4927		}
4928	}
4929	return nil
4930}
4931
4932// Next advances to the next page of values.  If there was an error making
4933// the request the page does not advance and the error is returned.
4934// Deprecated: Use NextWithContext() instead.
4935func (page *EncryptionProtectorListResultPage) Next() error {
4936	return page.NextWithContext(context.Background())
4937}
4938
4939// NotDone returns true if the page enumeration should be started or is not yet complete.
4940func (page EncryptionProtectorListResultPage) NotDone() bool {
4941	return !page.eplr.IsEmpty()
4942}
4943
4944// Response returns the raw server response from the last page request.
4945func (page EncryptionProtectorListResultPage) Response() EncryptionProtectorListResult {
4946	return page.eplr
4947}
4948
4949// Values returns the slice of values for the current page or nil if there are no values.
4950func (page EncryptionProtectorListResultPage) Values() []EncryptionProtector {
4951	if page.eplr.IsEmpty() {
4952		return nil
4953	}
4954	return *page.eplr.Value
4955}
4956
4957// Creates a new instance of the EncryptionProtectorListResultPage type.
4958func NewEncryptionProtectorListResultPage(cur EncryptionProtectorListResult, getNextPage func(context.Context, EncryptionProtectorListResult) (EncryptionProtectorListResult, error)) EncryptionProtectorListResultPage {
4959	return EncryptionProtectorListResultPage{
4960		fn:   getNextPage,
4961		eplr: cur,
4962	}
4963}
4964
4965// EncryptionProtectorProperties properties for an encryption protector execution.
4966type EncryptionProtectorProperties struct {
4967	// Subregion - READ-ONLY; Subregion of the encryption protector.
4968	Subregion *string `json:"subregion,omitempty"`
4969	// ServerKeyName - The name of the server key.
4970	ServerKeyName *string `json:"serverKeyName,omitempty"`
4971	// ServerKeyType - The encryption protector type like 'ServiceManaged', 'AzureKeyVault'. Possible values include: 'ServiceManaged', 'AzureKeyVault'
4972	ServerKeyType ServerKeyType `json:"serverKeyType,omitempty"`
4973	// URI - READ-ONLY; The URI of the server key.
4974	URI *string `json:"uri,omitempty"`
4975	// Thumbprint - READ-ONLY; Thumbprint of the server key.
4976	Thumbprint *string `json:"thumbprint,omitempty"`
4977}
4978
4979// MarshalJSON is the custom marshaler for EncryptionProtectorProperties.
4980func (epp EncryptionProtectorProperties) MarshalJSON() ([]byte, error) {
4981	objectMap := make(map[string]interface{})
4982	if epp.ServerKeyName != nil {
4983		objectMap["serverKeyName"] = epp.ServerKeyName
4984	}
4985	if epp.ServerKeyType != "" {
4986		objectMap["serverKeyType"] = epp.ServerKeyType
4987	}
4988	return json.Marshal(objectMap)
4989}
4990
4991// EncryptionProtectorsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
4992// long-running operation.
4993type EncryptionProtectorsCreateOrUpdateFuture struct {
4994	azure.FutureAPI
4995	// Result returns the result of the asynchronous operation.
4996	// If the operation has not completed it will return an error.
4997	Result func(EncryptionProtectorsClient) (EncryptionProtector, error)
4998}
4999
5000// UnmarshalJSON is the custom unmarshaller for CreateFuture.
5001func (future *EncryptionProtectorsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
5002	var azFuture azure.Future
5003	if err := json.Unmarshal(body, &azFuture); err != nil {
5004		return err
5005	}
5006	future.FutureAPI = &azFuture
5007	future.Result = future.result
5008	return nil
5009}
5010
5011// result is the default implementation for EncryptionProtectorsCreateOrUpdateFuture.Result.
5012func (future *EncryptionProtectorsCreateOrUpdateFuture) result(client EncryptionProtectorsClient) (ep EncryptionProtector, err error) {
5013	var done bool
5014	done, err = future.DoneWithContext(context.Background(), client)
5015	if err != nil {
5016		err = autorest.NewErrorWithError(err, "sql.EncryptionProtectorsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
5017		return
5018	}
5019	if !done {
5020		ep.Response.Response = future.Response()
5021		err = azure.NewAsyncOpIncompleteError("sql.EncryptionProtectorsCreateOrUpdateFuture")
5022		return
5023	}
5024	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5025	if ep.Response.Response, err = future.GetResult(sender); err == nil && ep.Response.Response.StatusCode != http.StatusNoContent {
5026		ep, err = client.CreateOrUpdateResponder(ep.Response.Response)
5027		if err != nil {
5028			err = autorest.NewErrorWithError(err, "sql.EncryptionProtectorsCreateOrUpdateFuture", "Result", ep.Response.Response, "Failure responding to request")
5029		}
5030	}
5031	return
5032}
5033
5034// EncryptionProtectorsRevalidateFuture an abstraction for monitoring and retrieving the results of a
5035// long-running operation.
5036type EncryptionProtectorsRevalidateFuture struct {
5037	azure.FutureAPI
5038	// Result returns the result of the asynchronous operation.
5039	// If the operation has not completed it will return an error.
5040	Result func(EncryptionProtectorsClient) (autorest.Response, error)
5041}
5042
5043// UnmarshalJSON is the custom unmarshaller for CreateFuture.
5044func (future *EncryptionProtectorsRevalidateFuture) UnmarshalJSON(body []byte) error {
5045	var azFuture azure.Future
5046	if err := json.Unmarshal(body, &azFuture); err != nil {
5047		return err
5048	}
5049	future.FutureAPI = &azFuture
5050	future.Result = future.result
5051	return nil
5052}
5053
5054// result is the default implementation for EncryptionProtectorsRevalidateFuture.Result.
5055func (future *EncryptionProtectorsRevalidateFuture) result(client EncryptionProtectorsClient) (ar autorest.Response, err error) {
5056	var done bool
5057	done, err = future.DoneWithContext(context.Background(), client)
5058	if err != nil {
5059		err = autorest.NewErrorWithError(err, "sql.EncryptionProtectorsRevalidateFuture", "Result", future.Response(), "Polling failure")
5060		return
5061	}
5062	if !done {
5063		ar.Response = future.Response()
5064		err = azure.NewAsyncOpIncompleteError("sql.EncryptionProtectorsRevalidateFuture")
5065		return
5066	}
5067	ar.Response = future.Response()
5068	return
5069}
5070
5071// ExportDatabaseDefinition contains the information necessary to perform export database operation.
5072type ExportDatabaseDefinition struct {
5073	// StorageKeyType - Storage key type. Possible values include: 'SharedAccessKey', 'StorageAccessKey'
5074	StorageKeyType StorageKeyType `json:"storageKeyType,omitempty"`
5075	// StorageKey - Storage key.
5076	StorageKey *string `json:"storageKey,omitempty"`
5077	// StorageURI - Storage Uri.
5078	StorageURI *string `json:"storageUri,omitempty"`
5079	// AdministratorLogin - Administrator login name.
5080	AdministratorLogin *string `json:"administratorLogin,omitempty"`
5081	// AdministratorLoginPassword - Administrator login password.
5082	AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"`
5083	// AuthenticationType - Authentication type.
5084	AuthenticationType *string `json:"authenticationType,omitempty"`
5085	// NetworkIsolation - Optional resource information to enable network isolation for request.
5086	NetworkIsolation *NetworkIsolationSettings `json:"networkIsolation,omitempty"`
5087}
5088
5089// ExtendedDatabaseBlobAuditingPolicy an extended database blob auditing policy.
5090type ExtendedDatabaseBlobAuditingPolicy struct {
5091	autorest.Response `json:"-"`
5092	// ExtendedDatabaseBlobAuditingPolicyProperties - Resource properties.
5093	*ExtendedDatabaseBlobAuditingPolicyProperties `json:"properties,omitempty"`
5094	// ID - READ-ONLY; Resource ID.
5095	ID *string `json:"id,omitempty"`
5096	// Name - READ-ONLY; Resource name.
5097	Name *string `json:"name,omitempty"`
5098	// Type - READ-ONLY; Resource type.
5099	Type *string `json:"type,omitempty"`
5100}
5101
5102// MarshalJSON is the custom marshaler for ExtendedDatabaseBlobAuditingPolicy.
5103func (edbap ExtendedDatabaseBlobAuditingPolicy) MarshalJSON() ([]byte, error) {
5104	objectMap := make(map[string]interface{})
5105	if edbap.ExtendedDatabaseBlobAuditingPolicyProperties != nil {
5106		objectMap["properties"] = edbap.ExtendedDatabaseBlobAuditingPolicyProperties
5107	}
5108	return json.Marshal(objectMap)
5109}
5110
5111// UnmarshalJSON is the custom unmarshaler for ExtendedDatabaseBlobAuditingPolicy struct.
5112func (edbap *ExtendedDatabaseBlobAuditingPolicy) UnmarshalJSON(body []byte) error {
5113	var m map[string]*json.RawMessage
5114	err := json.Unmarshal(body, &m)
5115	if err != nil {
5116		return err
5117	}
5118	for k, v := range m {
5119		switch k {
5120		case "properties":
5121			if v != nil {
5122				var extendedDatabaseBlobAuditingPolicyProperties ExtendedDatabaseBlobAuditingPolicyProperties
5123				err = json.Unmarshal(*v, &extendedDatabaseBlobAuditingPolicyProperties)
5124				if err != nil {
5125					return err
5126				}
5127				edbap.ExtendedDatabaseBlobAuditingPolicyProperties = &extendedDatabaseBlobAuditingPolicyProperties
5128			}
5129		case "id":
5130			if v != nil {
5131				var ID string
5132				err = json.Unmarshal(*v, &ID)
5133				if err != nil {
5134					return err
5135				}
5136				edbap.ID = &ID
5137			}
5138		case "name":
5139			if v != nil {
5140				var name string
5141				err = json.Unmarshal(*v, &name)
5142				if err != nil {
5143					return err
5144				}
5145				edbap.Name = &name
5146			}
5147		case "type":
5148			if v != nil {
5149				var typeVar string
5150				err = json.Unmarshal(*v, &typeVar)
5151				if err != nil {
5152					return err
5153				}
5154				edbap.Type = &typeVar
5155			}
5156		}
5157	}
5158
5159	return nil
5160}
5161
5162// ExtendedDatabaseBlobAuditingPolicyListResult a list of database extended auditing settings.
5163type ExtendedDatabaseBlobAuditingPolicyListResult struct {
5164	autorest.Response `json:"-"`
5165	// Value - READ-ONLY; Array of results.
5166	Value *[]ExtendedDatabaseBlobAuditingPolicy `json:"value,omitempty"`
5167	// NextLink - READ-ONLY; Link to retrieve next page of results.
5168	NextLink *string `json:"nextLink,omitempty"`
5169}
5170
5171// MarshalJSON is the custom marshaler for ExtendedDatabaseBlobAuditingPolicyListResult.
5172func (edbaplr ExtendedDatabaseBlobAuditingPolicyListResult) MarshalJSON() ([]byte, error) {
5173	objectMap := make(map[string]interface{})
5174	return json.Marshal(objectMap)
5175}
5176
5177// ExtendedDatabaseBlobAuditingPolicyListResultIterator provides access to a complete listing of
5178// ExtendedDatabaseBlobAuditingPolicy values.
5179type ExtendedDatabaseBlobAuditingPolicyListResultIterator struct {
5180	i    int
5181	page ExtendedDatabaseBlobAuditingPolicyListResultPage
5182}
5183
5184// NextWithContext advances to the next value.  If there was an error making
5185// the request the iterator does not advance and the error is returned.
5186func (iter *ExtendedDatabaseBlobAuditingPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
5187	if tracing.IsEnabled() {
5188		ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedDatabaseBlobAuditingPolicyListResultIterator.NextWithContext")
5189		defer func() {
5190			sc := -1
5191			if iter.Response().Response.Response != nil {
5192				sc = iter.Response().Response.Response.StatusCode
5193			}
5194			tracing.EndSpan(ctx, sc, err)
5195		}()
5196	}
5197	iter.i++
5198	if iter.i < len(iter.page.Values()) {
5199		return nil
5200	}
5201	err = iter.page.NextWithContext(ctx)
5202	if err != nil {
5203		iter.i--
5204		return err
5205	}
5206	iter.i = 0
5207	return nil
5208}
5209
5210// Next advances to the next value.  If there was an error making
5211// the request the iterator does not advance and the error is returned.
5212// Deprecated: Use NextWithContext() instead.
5213func (iter *ExtendedDatabaseBlobAuditingPolicyListResultIterator) Next() error {
5214	return iter.NextWithContext(context.Background())
5215}
5216
5217// NotDone returns true if the enumeration should be started or is not yet complete.
5218func (iter ExtendedDatabaseBlobAuditingPolicyListResultIterator) NotDone() bool {
5219	return iter.page.NotDone() && iter.i < len(iter.page.Values())
5220}
5221
5222// Response returns the raw server response from the last page request.
5223func (iter ExtendedDatabaseBlobAuditingPolicyListResultIterator) Response() ExtendedDatabaseBlobAuditingPolicyListResult {
5224	return iter.page.Response()
5225}
5226
5227// Value returns the current value or a zero-initialized value if the
5228// iterator has advanced beyond the end of the collection.
5229func (iter ExtendedDatabaseBlobAuditingPolicyListResultIterator) Value() ExtendedDatabaseBlobAuditingPolicy {
5230	if !iter.page.NotDone() {
5231		return ExtendedDatabaseBlobAuditingPolicy{}
5232	}
5233	return iter.page.Values()[iter.i]
5234}
5235
5236// Creates a new instance of the ExtendedDatabaseBlobAuditingPolicyListResultIterator type.
5237func NewExtendedDatabaseBlobAuditingPolicyListResultIterator(page ExtendedDatabaseBlobAuditingPolicyListResultPage) ExtendedDatabaseBlobAuditingPolicyListResultIterator {
5238	return ExtendedDatabaseBlobAuditingPolicyListResultIterator{page: page}
5239}
5240
5241// IsEmpty returns true if the ListResult contains no values.
5242func (edbaplr ExtendedDatabaseBlobAuditingPolicyListResult) IsEmpty() bool {
5243	return edbaplr.Value == nil || len(*edbaplr.Value) == 0
5244}
5245
5246// hasNextLink returns true if the NextLink is not empty.
5247func (edbaplr ExtendedDatabaseBlobAuditingPolicyListResult) hasNextLink() bool {
5248	return edbaplr.NextLink != nil && len(*edbaplr.NextLink) != 0
5249}
5250
5251// extendedDatabaseBlobAuditingPolicyListResultPreparer prepares a request to retrieve the next set of results.
5252// It returns nil if no more results exist.
5253func (edbaplr ExtendedDatabaseBlobAuditingPolicyListResult) extendedDatabaseBlobAuditingPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
5254	if !edbaplr.hasNextLink() {
5255		return nil, nil
5256	}
5257	return autorest.Prepare((&http.Request{}).WithContext(ctx),
5258		autorest.AsJSON(),
5259		autorest.AsGet(),
5260		autorest.WithBaseURL(to.String(edbaplr.NextLink)))
5261}
5262
5263// ExtendedDatabaseBlobAuditingPolicyListResultPage contains a page of ExtendedDatabaseBlobAuditingPolicy
5264// values.
5265type ExtendedDatabaseBlobAuditingPolicyListResultPage struct {
5266	fn      func(context.Context, ExtendedDatabaseBlobAuditingPolicyListResult) (ExtendedDatabaseBlobAuditingPolicyListResult, error)
5267	edbaplr ExtendedDatabaseBlobAuditingPolicyListResult
5268}
5269
5270// NextWithContext advances to the next page of values.  If there was an error making
5271// the request the page does not advance and the error is returned.
5272func (page *ExtendedDatabaseBlobAuditingPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
5273	if tracing.IsEnabled() {
5274		ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedDatabaseBlobAuditingPolicyListResultPage.NextWithContext")
5275		defer func() {
5276			sc := -1
5277			if page.Response().Response.Response != nil {
5278				sc = page.Response().Response.Response.StatusCode
5279			}
5280			tracing.EndSpan(ctx, sc, err)
5281		}()
5282	}
5283	for {
5284		next, err := page.fn(ctx, page.edbaplr)
5285		if err != nil {
5286			return err
5287		}
5288		page.edbaplr = next
5289		if !next.hasNextLink() || !next.IsEmpty() {
5290			break
5291		}
5292	}
5293	return nil
5294}
5295
5296// Next advances to the next page of values.  If there was an error making
5297// the request the page does not advance and the error is returned.
5298// Deprecated: Use NextWithContext() instead.
5299func (page *ExtendedDatabaseBlobAuditingPolicyListResultPage) Next() error {
5300	return page.NextWithContext(context.Background())
5301}
5302
5303// NotDone returns true if the page enumeration should be started or is not yet complete.
5304func (page ExtendedDatabaseBlobAuditingPolicyListResultPage) NotDone() bool {
5305	return !page.edbaplr.IsEmpty()
5306}
5307
5308// Response returns the raw server response from the last page request.
5309func (page ExtendedDatabaseBlobAuditingPolicyListResultPage) Response() ExtendedDatabaseBlobAuditingPolicyListResult {
5310	return page.edbaplr
5311}
5312
5313// Values returns the slice of values for the current page or nil if there are no values.
5314func (page ExtendedDatabaseBlobAuditingPolicyListResultPage) Values() []ExtendedDatabaseBlobAuditingPolicy {
5315	if page.edbaplr.IsEmpty() {
5316		return nil
5317	}
5318	return *page.edbaplr.Value
5319}
5320
5321// Creates a new instance of the ExtendedDatabaseBlobAuditingPolicyListResultPage type.
5322func NewExtendedDatabaseBlobAuditingPolicyListResultPage(cur ExtendedDatabaseBlobAuditingPolicyListResult, getNextPage func(context.Context, ExtendedDatabaseBlobAuditingPolicyListResult) (ExtendedDatabaseBlobAuditingPolicyListResult, error)) ExtendedDatabaseBlobAuditingPolicyListResultPage {
5323	return ExtendedDatabaseBlobAuditingPolicyListResultPage{
5324		fn:      getNextPage,
5325		edbaplr: cur,
5326	}
5327}
5328
5329// ExtendedDatabaseBlobAuditingPolicyProperties properties of an extended database blob auditing policy.
5330type ExtendedDatabaseBlobAuditingPolicyProperties struct {
5331	// PredicateExpression - Specifies condition of where clause when creating an audit.
5332	PredicateExpression *string `json:"predicateExpression,omitempty"`
5333	// State - Specifies the state of the policy. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. Possible values include: 'BlobAuditingPolicyStateEnabled', 'BlobAuditingPolicyStateDisabled'
5334	State BlobAuditingPolicyState `json:"state,omitempty"`
5335	// StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required.
5336	StorageEndpoint *string `json:"storageEndpoint,omitempty"`
5337	// StorageAccountAccessKey - Specifies the identifier key of the auditing storage account.
5338	// If state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage.
5339	// Prerequisites for using managed identity authentication:
5340	// 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD).
5341	// 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity.
5342	// For more information, see [Auditing to storage using Managed Identity authentication](https://go.microsoft.com/fwlink/?linkid=2114355)
5343	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
5344	// RetentionDays - Specifies the number of days to keep in the audit logs in the storage account.
5345	RetentionDays *int32 `json:"retentionDays,omitempty"`
5346	// AuditActionsAndGroups - Specifies the Actions-Groups and Actions to audit.
5347	//
5348	// 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:
5349	//
5350	// BATCH_COMPLETED_GROUP,
5351	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP,
5352	// FAILED_DATABASE_AUTHENTICATION_GROUP.
5353	//
5354	// This above combination is also the set that is configured by default when enabling auditing from the Azure portal.
5355	//
5356	// 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):
5357	//
5358	// APPLICATION_ROLE_CHANGE_PASSWORD_GROUP
5359	// BACKUP_RESTORE_GROUP
5360	// DATABASE_LOGOUT_GROUP
5361	// DATABASE_OBJECT_CHANGE_GROUP
5362	// DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP
5363	// DATABASE_OBJECT_PERMISSION_CHANGE_GROUP
5364	// DATABASE_OPERATION_GROUP
5365	// DATABASE_PERMISSION_CHANGE_GROUP
5366	// DATABASE_PRINCIPAL_CHANGE_GROUP
5367	// DATABASE_PRINCIPAL_IMPERSONATION_GROUP
5368	// DATABASE_ROLE_MEMBER_CHANGE_GROUP
5369	// FAILED_DATABASE_AUTHENTICATION_GROUP
5370	// SCHEMA_OBJECT_ACCESS_GROUP
5371	// SCHEMA_OBJECT_CHANGE_GROUP
5372	// SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP
5373	// SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP
5374	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP
5375	// USER_CHANGE_PASSWORD_GROUP
5376	// BATCH_STARTED_GROUP
5377	// BATCH_COMPLETED_GROUP
5378	//
5379	// 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.
5380	//
5381	// 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).
5382	//
5383	// 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:
5384	// SELECT
5385	// UPDATE
5386	// INSERT
5387	// DELETE
5388	// EXECUTE
5389	// RECEIVE
5390	// REFERENCES
5391	//
5392	// The general form for defining an action to be audited is:
5393	// {action} ON {object} BY {principal}
5394	//
5395	// 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.
5396	//
5397	// For example:
5398	// SELECT on dbo.myTable by public
5399	// SELECT on DATABASE::myDatabase by public
5400	// SELECT on SCHEMA::mySchema by public
5401	//
5402	// 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)
5403	AuditActionsAndGroups *[]string `json:"auditActionsAndGroups,omitempty"`
5404	// StorageAccountSubscriptionID - Specifies the blob storage subscription Id.
5405	StorageAccountSubscriptionID *uuid.UUID `json:"storageAccountSubscriptionId,omitempty"`
5406	// IsStorageSecondaryKeyInUse - Specifies whether storageAccountAccessKey value is the storage's secondary key.
5407	IsStorageSecondaryKeyInUse *bool `json:"isStorageSecondaryKeyInUse,omitempty"`
5408	// IsAzureMonitorTargetEnabled - Specifies whether audit events are sent to Azure Monitor.
5409	// In order to send the events to Azure Monitor, specify 'state' as 'Enabled' and 'isAzureMonitorTargetEnabled' as true.
5410	//
5411	// When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created.
5412	// Note that for server level audit you should use the 'master' database as {databaseName}.
5413	//
5414	// Diagnostic Settings URI format:
5415	// 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
5416	//
5417	// For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207)
5418	// or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)
5419	IsAzureMonitorTargetEnabled *bool `json:"isAzureMonitorTargetEnabled,omitempty"`
5420	// QueueDelayMs - Specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed.
5421	// The default minimum value is 1000 (1 second). The maximum is 2,147,483,647.
5422	QueueDelayMs *int32 `json:"queueDelayMs,omitempty"`
5423}
5424
5425// ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the
5426// results of a long-running operation.
5427type ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture struct {
5428	azure.FutureAPI
5429	// Result returns the result of the asynchronous operation.
5430	// If the operation has not completed it will return an error.
5431	Result func(ExtendedServerBlobAuditingPoliciesClient) (ExtendedServerBlobAuditingPolicy, error)
5432}
5433
5434// UnmarshalJSON is the custom unmarshaller for CreateFuture.
5435func (future *ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
5436	var azFuture azure.Future
5437	if err := json.Unmarshal(body, &azFuture); err != nil {
5438		return err
5439	}
5440	future.FutureAPI = &azFuture
5441	future.Result = future.result
5442	return nil
5443}
5444
5445// result is the default implementation for ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture.Result.
5446func (future *ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture) result(client ExtendedServerBlobAuditingPoliciesClient) (esbap ExtendedServerBlobAuditingPolicy, err error) {
5447	var done bool
5448	done, err = future.DoneWithContext(context.Background(), client)
5449	if err != nil {
5450		err = autorest.NewErrorWithError(err, "sql.ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
5451		return
5452	}
5453	if !done {
5454		esbap.Response.Response = future.Response()
5455		err = azure.NewAsyncOpIncompleteError("sql.ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture")
5456		return
5457	}
5458	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5459	if esbap.Response.Response, err = future.GetResult(sender); err == nil && esbap.Response.Response.StatusCode != http.StatusNoContent {
5460		esbap, err = client.CreateOrUpdateResponder(esbap.Response.Response)
5461		if err != nil {
5462			err = autorest.NewErrorWithError(err, "sql.ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture", "Result", esbap.Response.Response, "Failure responding to request")
5463		}
5464	}
5465	return
5466}
5467
5468// ExtendedServerBlobAuditingPolicy an extended server blob auditing policy.
5469type ExtendedServerBlobAuditingPolicy struct {
5470	autorest.Response `json:"-"`
5471	// ExtendedServerBlobAuditingPolicyProperties - Resource properties.
5472	*ExtendedServerBlobAuditingPolicyProperties `json:"properties,omitempty"`
5473	// ID - READ-ONLY; Resource ID.
5474	ID *string `json:"id,omitempty"`
5475	// Name - READ-ONLY; Resource name.
5476	Name *string `json:"name,omitempty"`
5477	// Type - READ-ONLY; Resource type.
5478	Type *string `json:"type,omitempty"`
5479}
5480
5481// MarshalJSON is the custom marshaler for ExtendedServerBlobAuditingPolicy.
5482func (esbap ExtendedServerBlobAuditingPolicy) MarshalJSON() ([]byte, error) {
5483	objectMap := make(map[string]interface{})
5484	if esbap.ExtendedServerBlobAuditingPolicyProperties != nil {
5485		objectMap["properties"] = esbap.ExtendedServerBlobAuditingPolicyProperties
5486	}
5487	return json.Marshal(objectMap)
5488}
5489
5490// UnmarshalJSON is the custom unmarshaler for ExtendedServerBlobAuditingPolicy struct.
5491func (esbap *ExtendedServerBlobAuditingPolicy) UnmarshalJSON(body []byte) error {
5492	var m map[string]*json.RawMessage
5493	err := json.Unmarshal(body, &m)
5494	if err != nil {
5495		return err
5496	}
5497	for k, v := range m {
5498		switch k {
5499		case "properties":
5500			if v != nil {
5501				var extendedServerBlobAuditingPolicyProperties ExtendedServerBlobAuditingPolicyProperties
5502				err = json.Unmarshal(*v, &extendedServerBlobAuditingPolicyProperties)
5503				if err != nil {
5504					return err
5505				}
5506				esbap.ExtendedServerBlobAuditingPolicyProperties = &extendedServerBlobAuditingPolicyProperties
5507			}
5508		case "id":
5509			if v != nil {
5510				var ID string
5511				err = json.Unmarshal(*v, &ID)
5512				if err != nil {
5513					return err
5514				}
5515				esbap.ID = &ID
5516			}
5517		case "name":
5518			if v != nil {
5519				var name string
5520				err = json.Unmarshal(*v, &name)
5521				if err != nil {
5522					return err
5523				}
5524				esbap.Name = &name
5525			}
5526		case "type":
5527			if v != nil {
5528				var typeVar string
5529				err = json.Unmarshal(*v, &typeVar)
5530				if err != nil {
5531					return err
5532				}
5533				esbap.Type = &typeVar
5534			}
5535		}
5536	}
5537
5538	return nil
5539}
5540
5541// ExtendedServerBlobAuditingPolicyListResult a list of server extended auditing settings.
5542type ExtendedServerBlobAuditingPolicyListResult struct {
5543	autorest.Response `json:"-"`
5544	// Value - READ-ONLY; Array of results.
5545	Value *[]ExtendedServerBlobAuditingPolicy `json:"value,omitempty"`
5546	// NextLink - READ-ONLY; Link to retrieve next page of results.
5547	NextLink *string `json:"nextLink,omitempty"`
5548}
5549
5550// MarshalJSON is the custom marshaler for ExtendedServerBlobAuditingPolicyListResult.
5551func (esbaplr ExtendedServerBlobAuditingPolicyListResult) MarshalJSON() ([]byte, error) {
5552	objectMap := make(map[string]interface{})
5553	return json.Marshal(objectMap)
5554}
5555
5556// ExtendedServerBlobAuditingPolicyListResultIterator provides access to a complete listing of
5557// ExtendedServerBlobAuditingPolicy values.
5558type ExtendedServerBlobAuditingPolicyListResultIterator struct {
5559	i    int
5560	page ExtendedServerBlobAuditingPolicyListResultPage
5561}
5562
5563// NextWithContext advances to the next value.  If there was an error making
5564// the request the iterator does not advance and the error is returned.
5565func (iter *ExtendedServerBlobAuditingPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
5566	if tracing.IsEnabled() {
5567		ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedServerBlobAuditingPolicyListResultIterator.NextWithContext")
5568		defer func() {
5569			sc := -1
5570			if iter.Response().Response.Response != nil {
5571				sc = iter.Response().Response.Response.StatusCode
5572			}
5573			tracing.EndSpan(ctx, sc, err)
5574		}()
5575	}
5576	iter.i++
5577	if iter.i < len(iter.page.Values()) {
5578		return nil
5579	}
5580	err = iter.page.NextWithContext(ctx)
5581	if err != nil {
5582		iter.i--
5583		return err
5584	}
5585	iter.i = 0
5586	return nil
5587}
5588
5589// Next advances to the next value.  If there was an error making
5590// the request the iterator does not advance and the error is returned.
5591// Deprecated: Use NextWithContext() instead.
5592func (iter *ExtendedServerBlobAuditingPolicyListResultIterator) Next() error {
5593	return iter.NextWithContext(context.Background())
5594}
5595
5596// NotDone returns true if the enumeration should be started or is not yet complete.
5597func (iter ExtendedServerBlobAuditingPolicyListResultIterator) NotDone() bool {
5598	return iter.page.NotDone() && iter.i < len(iter.page.Values())
5599}
5600
5601// Response returns the raw server response from the last page request.
5602func (iter ExtendedServerBlobAuditingPolicyListResultIterator) Response() ExtendedServerBlobAuditingPolicyListResult {
5603	return iter.page.Response()
5604}
5605
5606// Value returns the current value or a zero-initialized value if the
5607// iterator has advanced beyond the end of the collection.
5608func (iter ExtendedServerBlobAuditingPolicyListResultIterator) Value() ExtendedServerBlobAuditingPolicy {
5609	if !iter.page.NotDone() {
5610		return ExtendedServerBlobAuditingPolicy{}
5611	}
5612	return iter.page.Values()[iter.i]
5613}
5614
5615// Creates a new instance of the ExtendedServerBlobAuditingPolicyListResultIterator type.
5616func NewExtendedServerBlobAuditingPolicyListResultIterator(page ExtendedServerBlobAuditingPolicyListResultPage) ExtendedServerBlobAuditingPolicyListResultIterator {
5617	return ExtendedServerBlobAuditingPolicyListResultIterator{page: page}
5618}
5619
5620// IsEmpty returns true if the ListResult contains no values.
5621func (esbaplr ExtendedServerBlobAuditingPolicyListResult) IsEmpty() bool {
5622	return esbaplr.Value == nil || len(*esbaplr.Value) == 0
5623}
5624
5625// hasNextLink returns true if the NextLink is not empty.
5626func (esbaplr ExtendedServerBlobAuditingPolicyListResult) hasNextLink() bool {
5627	return esbaplr.NextLink != nil && len(*esbaplr.NextLink) != 0
5628}
5629
5630// extendedServerBlobAuditingPolicyListResultPreparer prepares a request to retrieve the next set of results.
5631// It returns nil if no more results exist.
5632func (esbaplr ExtendedServerBlobAuditingPolicyListResult) extendedServerBlobAuditingPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
5633	if !esbaplr.hasNextLink() {
5634		return nil, nil
5635	}
5636	return autorest.Prepare((&http.Request{}).WithContext(ctx),
5637		autorest.AsJSON(),
5638		autorest.AsGet(),
5639		autorest.WithBaseURL(to.String(esbaplr.NextLink)))
5640}
5641
5642// ExtendedServerBlobAuditingPolicyListResultPage contains a page of ExtendedServerBlobAuditingPolicy
5643// values.
5644type ExtendedServerBlobAuditingPolicyListResultPage struct {
5645	fn      func(context.Context, ExtendedServerBlobAuditingPolicyListResult) (ExtendedServerBlobAuditingPolicyListResult, error)
5646	esbaplr ExtendedServerBlobAuditingPolicyListResult
5647}
5648
5649// NextWithContext advances to the next page of values.  If there was an error making
5650// the request the page does not advance and the error is returned.
5651func (page *ExtendedServerBlobAuditingPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
5652	if tracing.IsEnabled() {
5653		ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedServerBlobAuditingPolicyListResultPage.NextWithContext")
5654		defer func() {
5655			sc := -1
5656			if page.Response().Response.Response != nil {
5657				sc = page.Response().Response.Response.StatusCode
5658			}
5659			tracing.EndSpan(ctx, sc, err)
5660		}()
5661	}
5662	for {
5663		next, err := page.fn(ctx, page.esbaplr)
5664		if err != nil {
5665			return err
5666		}
5667		page.esbaplr = next
5668		if !next.hasNextLink() || !next.IsEmpty() {
5669			break
5670		}
5671	}
5672	return nil
5673}
5674
5675// Next advances to the next page of values.  If there was an error making
5676// the request the page does not advance and the error is returned.
5677// Deprecated: Use NextWithContext() instead.
5678func (page *ExtendedServerBlobAuditingPolicyListResultPage) Next() error {
5679	return page.NextWithContext(context.Background())
5680}
5681
5682// NotDone returns true if the page enumeration should be started or is not yet complete.
5683func (page ExtendedServerBlobAuditingPolicyListResultPage) NotDone() bool {
5684	return !page.esbaplr.IsEmpty()
5685}
5686
5687// Response returns the raw server response from the last page request.
5688func (page ExtendedServerBlobAuditingPolicyListResultPage) Response() ExtendedServerBlobAuditingPolicyListResult {
5689	return page.esbaplr
5690}
5691
5692// Values returns the slice of values for the current page or nil if there are no values.
5693func (page ExtendedServerBlobAuditingPolicyListResultPage) Values() []ExtendedServerBlobAuditingPolicy {
5694	if page.esbaplr.IsEmpty() {
5695		return nil
5696	}
5697	return *page.esbaplr.Value
5698}
5699
5700// Creates a new instance of the ExtendedServerBlobAuditingPolicyListResultPage type.
5701func NewExtendedServerBlobAuditingPolicyListResultPage(cur ExtendedServerBlobAuditingPolicyListResult, getNextPage func(context.Context, ExtendedServerBlobAuditingPolicyListResult) (ExtendedServerBlobAuditingPolicyListResult, error)) ExtendedServerBlobAuditingPolicyListResultPage {
5702	return ExtendedServerBlobAuditingPolicyListResultPage{
5703		fn:      getNextPage,
5704		esbaplr: cur,
5705	}
5706}
5707
5708// ExtendedServerBlobAuditingPolicyProperties properties of an extended server blob auditing policy.
5709type ExtendedServerBlobAuditingPolicyProperties struct {
5710	// PredicateExpression - Specifies condition of where clause when creating an audit.
5711	PredicateExpression *string `json:"predicateExpression,omitempty"`
5712	// State - Specifies the state of the policy. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. Possible values include: 'BlobAuditingPolicyStateEnabled', 'BlobAuditingPolicyStateDisabled'
5713	State BlobAuditingPolicyState `json:"state,omitempty"`
5714	// StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required.
5715	StorageEndpoint *string `json:"storageEndpoint,omitempty"`
5716	// StorageAccountAccessKey - Specifies the identifier key of the auditing storage account.
5717	// If state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage.
5718	// Prerequisites for using managed identity authentication:
5719	// 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD).
5720	// 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity.
5721	// For more information, see [Auditing to storage using Managed Identity authentication](https://go.microsoft.com/fwlink/?linkid=2114355)
5722	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
5723	// RetentionDays - Specifies the number of days to keep in the audit logs in the storage account.
5724	RetentionDays *int32 `json:"retentionDays,omitempty"`
5725	// AuditActionsAndGroups - Specifies the Actions-Groups and Actions to audit.
5726	//
5727	// 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:
5728	//
5729	// BATCH_COMPLETED_GROUP,
5730	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP,
5731	// FAILED_DATABASE_AUTHENTICATION_GROUP.
5732	//
5733	// This above combination is also the set that is configured by default when enabling auditing from the Azure portal.
5734	//
5735	// 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):
5736	//
5737	// APPLICATION_ROLE_CHANGE_PASSWORD_GROUP
5738	// BACKUP_RESTORE_GROUP
5739	// DATABASE_LOGOUT_GROUP
5740	// DATABASE_OBJECT_CHANGE_GROUP
5741	// DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP
5742	// DATABASE_OBJECT_PERMISSION_CHANGE_GROUP
5743	// DATABASE_OPERATION_GROUP
5744	// DATABASE_PERMISSION_CHANGE_GROUP
5745	// DATABASE_PRINCIPAL_CHANGE_GROUP
5746	// DATABASE_PRINCIPAL_IMPERSONATION_GROUP
5747	// DATABASE_ROLE_MEMBER_CHANGE_GROUP
5748	// FAILED_DATABASE_AUTHENTICATION_GROUP
5749	// SCHEMA_OBJECT_ACCESS_GROUP
5750	// SCHEMA_OBJECT_CHANGE_GROUP
5751	// SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP
5752	// SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP
5753	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP
5754	// USER_CHANGE_PASSWORD_GROUP
5755	// BATCH_STARTED_GROUP
5756	// BATCH_COMPLETED_GROUP
5757	//
5758	// 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.
5759	//
5760	// 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).
5761	//
5762	// 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:
5763	// SELECT
5764	// UPDATE
5765	// INSERT
5766	// DELETE
5767	// EXECUTE
5768	// RECEIVE
5769	// REFERENCES
5770	//
5771	// The general form for defining an action to be audited is:
5772	// {action} ON {object} BY {principal}
5773	//
5774	// 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.
5775	//
5776	// For example:
5777	// SELECT on dbo.myTable by public
5778	// SELECT on DATABASE::myDatabase by public
5779	// SELECT on SCHEMA::mySchema by public
5780	//
5781	// 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)
5782	AuditActionsAndGroups *[]string `json:"auditActionsAndGroups,omitempty"`
5783	// StorageAccountSubscriptionID - Specifies the blob storage subscription Id.
5784	StorageAccountSubscriptionID *uuid.UUID `json:"storageAccountSubscriptionId,omitempty"`
5785	// IsStorageSecondaryKeyInUse - Specifies whether storageAccountAccessKey value is the storage's secondary key.
5786	IsStorageSecondaryKeyInUse *bool `json:"isStorageSecondaryKeyInUse,omitempty"`
5787	// IsAzureMonitorTargetEnabled - Specifies whether audit events are sent to Azure Monitor.
5788	// In order to send the events to Azure Monitor, specify 'state' as 'Enabled' and 'isAzureMonitorTargetEnabled' as true.
5789	//
5790	// When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created.
5791	// Note that for server level audit you should use the 'master' database as {databaseName}.
5792	//
5793	// Diagnostic Settings URI format:
5794	// 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
5795	//
5796	// For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207)
5797	// or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)
5798	IsAzureMonitorTargetEnabled *bool `json:"isAzureMonitorTargetEnabled,omitempty"`
5799	// QueueDelayMs - Specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed.
5800	// The default minimum value is 1000 (1 second). The maximum is 2,147,483,647.
5801	QueueDelayMs *int32 `json:"queueDelayMs,omitempty"`
5802}
5803
5804// FailoverGroup a failover group.
5805type FailoverGroup struct {
5806	autorest.Response `json:"-"`
5807	// Location - READ-ONLY; Resource location.
5808	Location *string `json:"location,omitempty"`
5809	// Tags - Resource tags.
5810	Tags map[string]*string `json:"tags"`
5811	// FailoverGroupProperties - Resource properties.
5812	*FailoverGroupProperties `json:"properties,omitempty"`
5813	// ID - READ-ONLY; Resource ID.
5814	ID *string `json:"id,omitempty"`
5815	// Name - READ-ONLY; Resource name.
5816	Name *string `json:"name,omitempty"`
5817	// Type - READ-ONLY; Resource type.
5818	Type *string `json:"type,omitempty"`
5819}
5820
5821// MarshalJSON is the custom marshaler for FailoverGroup.
5822func (fg FailoverGroup) MarshalJSON() ([]byte, error) {
5823	objectMap := make(map[string]interface{})
5824	if fg.Tags != nil {
5825		objectMap["tags"] = fg.Tags
5826	}
5827	if fg.FailoverGroupProperties != nil {
5828		objectMap["properties"] = fg.FailoverGroupProperties
5829	}
5830	return json.Marshal(objectMap)
5831}
5832
5833// UnmarshalJSON is the custom unmarshaler for FailoverGroup struct.
5834func (fg *FailoverGroup) UnmarshalJSON(body []byte) error {
5835	var m map[string]*json.RawMessage
5836	err := json.Unmarshal(body, &m)
5837	if err != nil {
5838		return err
5839	}
5840	for k, v := range m {
5841		switch k {
5842		case "location":
5843			if v != nil {
5844				var location string
5845				err = json.Unmarshal(*v, &location)
5846				if err != nil {
5847					return err
5848				}
5849				fg.Location = &location
5850			}
5851		case "tags":
5852			if v != nil {
5853				var tags map[string]*string
5854				err = json.Unmarshal(*v, &tags)
5855				if err != nil {
5856					return err
5857				}
5858				fg.Tags = tags
5859			}
5860		case "properties":
5861			if v != nil {
5862				var failoverGroupProperties FailoverGroupProperties
5863				err = json.Unmarshal(*v, &failoverGroupProperties)
5864				if err != nil {
5865					return err
5866				}
5867				fg.FailoverGroupProperties = &failoverGroupProperties
5868			}
5869		case "id":
5870			if v != nil {
5871				var ID string
5872				err = json.Unmarshal(*v, &ID)
5873				if err != nil {
5874					return err
5875				}
5876				fg.ID = &ID
5877			}
5878		case "name":
5879			if v != nil {
5880				var name string
5881				err = json.Unmarshal(*v, &name)
5882				if err != nil {
5883					return err
5884				}
5885				fg.Name = &name
5886			}
5887		case "type":
5888			if v != nil {
5889				var typeVar string
5890				err = json.Unmarshal(*v, &typeVar)
5891				if err != nil {
5892					return err
5893				}
5894				fg.Type = &typeVar
5895			}
5896		}
5897	}
5898
5899	return nil
5900}
5901
5902// FailoverGroupListResult a list of failover groups.
5903type FailoverGroupListResult struct {
5904	autorest.Response `json:"-"`
5905	// Value - READ-ONLY; Array of results.
5906	Value *[]FailoverGroup `json:"value,omitempty"`
5907	// NextLink - READ-ONLY; Link to retrieve next page of results.
5908	NextLink *string `json:"nextLink,omitempty"`
5909}
5910
5911// MarshalJSON is the custom marshaler for FailoverGroupListResult.
5912func (fglr FailoverGroupListResult) MarshalJSON() ([]byte, error) {
5913	objectMap := make(map[string]interface{})
5914	return json.Marshal(objectMap)
5915}
5916
5917// FailoverGroupListResultIterator provides access to a complete listing of FailoverGroup values.
5918type FailoverGroupListResultIterator struct {
5919	i    int
5920	page FailoverGroupListResultPage
5921}
5922
5923// NextWithContext advances to the next value.  If there was an error making
5924// the request the iterator does not advance and the error is returned.
5925func (iter *FailoverGroupListResultIterator) NextWithContext(ctx context.Context) (err error) {
5926	if tracing.IsEnabled() {
5927		ctx = tracing.StartSpan(ctx, fqdn+"/FailoverGroupListResultIterator.NextWithContext")
5928		defer func() {
5929			sc := -1
5930			if iter.Response().Response.Response != nil {
5931				sc = iter.Response().Response.Response.StatusCode
5932			}
5933			tracing.EndSpan(ctx, sc, err)
5934		}()
5935	}
5936	iter.i++
5937	if iter.i < len(iter.page.Values()) {
5938		return nil
5939	}
5940	err = iter.page.NextWithContext(ctx)
5941	if err != nil {
5942		iter.i--
5943		return err
5944	}
5945	iter.i = 0
5946	return nil
5947}
5948
5949// Next advances to the next value.  If there was an error making
5950// the request the iterator does not advance and the error is returned.
5951// Deprecated: Use NextWithContext() instead.
5952func (iter *FailoverGroupListResultIterator) Next() error {
5953	return iter.NextWithContext(context.Background())
5954}
5955
5956// NotDone returns true if the enumeration should be started or is not yet complete.
5957func (iter FailoverGroupListResultIterator) NotDone() bool {
5958	return iter.page.NotDone() && iter.i < len(iter.page.Values())
5959}
5960
5961// Response returns the raw server response from the last page request.
5962func (iter FailoverGroupListResultIterator) Response() FailoverGroupListResult {
5963	return iter.page.Response()
5964}
5965
5966// Value returns the current value or a zero-initialized value if the
5967// iterator has advanced beyond the end of the collection.
5968func (iter FailoverGroupListResultIterator) Value() FailoverGroup {
5969	if !iter.page.NotDone() {
5970		return FailoverGroup{}
5971	}
5972	return iter.page.Values()[iter.i]
5973}
5974
5975// Creates a new instance of the FailoverGroupListResultIterator type.
5976func NewFailoverGroupListResultIterator(page FailoverGroupListResultPage) FailoverGroupListResultIterator {
5977	return FailoverGroupListResultIterator{page: page}
5978}
5979
5980// IsEmpty returns true if the ListResult contains no values.
5981func (fglr FailoverGroupListResult) IsEmpty() bool {
5982	return fglr.Value == nil || len(*fglr.Value) == 0
5983}
5984
5985// hasNextLink returns true if the NextLink is not empty.
5986func (fglr FailoverGroupListResult) hasNextLink() bool {
5987	return fglr.NextLink != nil && len(*fglr.NextLink) != 0
5988}
5989
5990// failoverGroupListResultPreparer prepares a request to retrieve the next set of results.
5991// It returns nil if no more results exist.
5992func (fglr FailoverGroupListResult) failoverGroupListResultPreparer(ctx context.Context) (*http.Request, error) {
5993	if !fglr.hasNextLink() {
5994		return nil, nil
5995	}
5996	return autorest.Prepare((&http.Request{}).WithContext(ctx),
5997		autorest.AsJSON(),
5998		autorest.AsGet(),
5999		autorest.WithBaseURL(to.String(fglr.NextLink)))
6000}
6001
6002// FailoverGroupListResultPage contains a page of FailoverGroup values.
6003type FailoverGroupListResultPage struct {
6004	fn   func(context.Context, FailoverGroupListResult) (FailoverGroupListResult, error)
6005	fglr FailoverGroupListResult
6006}
6007
6008// NextWithContext advances to the next page of values.  If there was an error making
6009// the request the page does not advance and the error is returned.
6010func (page *FailoverGroupListResultPage) NextWithContext(ctx context.Context) (err error) {
6011	if tracing.IsEnabled() {
6012		ctx = tracing.StartSpan(ctx, fqdn+"/FailoverGroupListResultPage.NextWithContext")
6013		defer func() {
6014			sc := -1
6015			if page.Response().Response.Response != nil {
6016				sc = page.Response().Response.Response.StatusCode
6017			}
6018			tracing.EndSpan(ctx, sc, err)
6019		}()
6020	}
6021	for {
6022		next, err := page.fn(ctx, page.fglr)
6023		if err != nil {
6024			return err
6025		}
6026		page.fglr = next
6027		if !next.hasNextLink() || !next.IsEmpty() {
6028			break
6029		}
6030	}
6031	return nil
6032}
6033
6034// Next advances to the next page of values.  If there was an error making
6035// the request the page does not advance and the error is returned.
6036// Deprecated: Use NextWithContext() instead.
6037func (page *FailoverGroupListResultPage) Next() error {
6038	return page.NextWithContext(context.Background())
6039}
6040
6041// NotDone returns true if the page enumeration should be started or is not yet complete.
6042func (page FailoverGroupListResultPage) NotDone() bool {
6043	return !page.fglr.IsEmpty()
6044}
6045
6046// Response returns the raw server response from the last page request.
6047func (page FailoverGroupListResultPage) Response() FailoverGroupListResult {
6048	return page.fglr
6049}
6050
6051// Values returns the slice of values for the current page or nil if there are no values.
6052func (page FailoverGroupListResultPage) Values() []FailoverGroup {
6053	if page.fglr.IsEmpty() {
6054		return nil
6055	}
6056	return *page.fglr.Value
6057}
6058
6059// Creates a new instance of the FailoverGroupListResultPage type.
6060func NewFailoverGroupListResultPage(cur FailoverGroupListResult, getNextPage func(context.Context, FailoverGroupListResult) (FailoverGroupListResult, error)) FailoverGroupListResultPage {
6061	return FailoverGroupListResultPage{
6062		fn:   getNextPage,
6063		fglr: cur,
6064	}
6065}
6066
6067// FailoverGroupProperties properties of a failover group.
6068type FailoverGroupProperties struct {
6069	// ReadWriteEndpoint - Read-write endpoint of the failover group instance.
6070	ReadWriteEndpoint *FailoverGroupReadWriteEndpoint `json:"readWriteEndpoint,omitempty"`
6071	// ReadOnlyEndpoint - Read-only endpoint of the failover group instance.
6072	ReadOnlyEndpoint *FailoverGroupReadOnlyEndpoint `json:"readOnlyEndpoint,omitempty"`
6073	// ReplicationRole - READ-ONLY; Local replication role of the failover group instance. Possible values include: 'Primary', 'Secondary'
6074	ReplicationRole FailoverGroupReplicationRole `json:"replicationRole,omitempty"`
6075	// ReplicationState - READ-ONLY; Replication state of the failover group instance.
6076	ReplicationState *string `json:"replicationState,omitempty"`
6077	// PartnerServers - List of partner server information for the failover group.
6078	PartnerServers *[]PartnerInfo `json:"partnerServers,omitempty"`
6079	// Databases - List of databases in the failover group.
6080	Databases *[]string `json:"databases,omitempty"`
6081}
6082
6083// MarshalJSON is the custom marshaler for FailoverGroupProperties.
6084func (fgp FailoverGroupProperties) MarshalJSON() ([]byte, error) {
6085	objectMap := make(map[string]interface{})
6086	if fgp.ReadWriteEndpoint != nil {
6087		objectMap["readWriteEndpoint"] = fgp.ReadWriteEndpoint
6088	}
6089	if fgp.ReadOnlyEndpoint != nil {
6090		objectMap["readOnlyEndpoint"] = fgp.ReadOnlyEndpoint
6091	}
6092	if fgp.PartnerServers != nil {
6093		objectMap["partnerServers"] = fgp.PartnerServers
6094	}
6095	if fgp.Databases != nil {
6096		objectMap["databases"] = fgp.Databases
6097	}
6098	return json.Marshal(objectMap)
6099}
6100
6101// FailoverGroupReadOnlyEndpoint read-only endpoint of the failover group instance.
6102type FailoverGroupReadOnlyEndpoint struct {
6103	// FailoverPolicy - Failover policy of the read-only endpoint for the failover group. Possible values include: 'ReadOnlyEndpointFailoverPolicyDisabled', 'ReadOnlyEndpointFailoverPolicyEnabled'
6104	FailoverPolicy ReadOnlyEndpointFailoverPolicy `json:"failoverPolicy,omitempty"`
6105}
6106
6107// FailoverGroupReadWriteEndpoint read-write endpoint of the failover group instance.
6108type FailoverGroupReadWriteEndpoint struct {
6109	// FailoverPolicy - Failover policy of the read-write endpoint for the failover group. If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible values include: 'Manual', 'Automatic'
6110	FailoverPolicy ReadWriteEndpointFailoverPolicy `json:"failoverPolicy,omitempty"`
6111	// FailoverWithDataLossGracePeriodMinutes - Grace period before failover with data loss is attempted for the read-write endpoint. If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required.
6112	FailoverWithDataLossGracePeriodMinutes *int32 `json:"failoverWithDataLossGracePeriodMinutes,omitempty"`
6113}
6114
6115// FailoverGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
6116// long-running operation.
6117type FailoverGroupsCreateOrUpdateFuture struct {
6118	azure.FutureAPI
6119	// Result returns the result of the asynchronous operation.
6120	// If the operation has not completed it will return an error.
6121	Result func(FailoverGroupsClient) (FailoverGroup, error)
6122}
6123
6124// UnmarshalJSON is the custom unmarshaller for CreateFuture.
6125func (future *FailoverGroupsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
6126	var azFuture azure.Future
6127	if err := json.Unmarshal(body, &azFuture); err != nil {
6128		return err
6129	}
6130	future.FutureAPI = &azFuture
6131	future.Result = future.result
6132	return nil
6133}
6134
6135// result is the default implementation for FailoverGroupsCreateOrUpdateFuture.Result.
6136func (future *FailoverGroupsCreateOrUpdateFuture) result(client FailoverGroupsClient) (fg FailoverGroup, err error) {
6137	var done bool
6138	done, err = future.DoneWithContext(context.Background(), client)
6139	if err != nil {
6140		err = autorest.NewErrorWithError(err, "sql.FailoverGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
6141		return
6142	}
6143	if !done {
6144		fg.Response.Response = future.Response()
6145		err = azure.NewAsyncOpIncompleteError("sql.FailoverGroupsCreateOrUpdateFuture")
6146		return
6147	}
6148	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6149	if fg.Response.Response, err = future.GetResult(sender); err == nil && fg.Response.Response.StatusCode != http.StatusNoContent {
6150		fg, err = client.CreateOrUpdateResponder(fg.Response.Response)
6151		if err != nil {
6152			err = autorest.NewErrorWithError(err, "sql.FailoverGroupsCreateOrUpdateFuture", "Result", fg.Response.Response, "Failure responding to request")
6153		}
6154	}
6155	return
6156}
6157
6158// FailoverGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
6159// operation.
6160type FailoverGroupsDeleteFuture struct {
6161	azure.FutureAPI
6162	// Result returns the result of the asynchronous operation.
6163	// If the operation has not completed it will return an error.
6164	Result func(FailoverGroupsClient) (autorest.Response, error)
6165}
6166
6167// UnmarshalJSON is the custom unmarshaller for CreateFuture.
6168func (future *FailoverGroupsDeleteFuture) UnmarshalJSON(body []byte) error {
6169	var azFuture azure.Future
6170	if err := json.Unmarshal(body, &azFuture); err != nil {
6171		return err
6172	}
6173	future.FutureAPI = &azFuture
6174	future.Result = future.result
6175	return nil
6176}
6177
6178// result is the default implementation for FailoverGroupsDeleteFuture.Result.
6179func (future *FailoverGroupsDeleteFuture) result(client FailoverGroupsClient) (ar autorest.Response, err error) {
6180	var done bool
6181	done, err = future.DoneWithContext(context.Background(), client)
6182	if err != nil {
6183		err = autorest.NewErrorWithError(err, "sql.FailoverGroupsDeleteFuture", "Result", future.Response(), "Polling failure")
6184		return
6185	}
6186	if !done {
6187		ar.Response = future.Response()
6188		err = azure.NewAsyncOpIncompleteError("sql.FailoverGroupsDeleteFuture")
6189		return
6190	}
6191	ar.Response = future.Response()
6192	return
6193}
6194
6195// FailoverGroupsFailoverFuture an abstraction for monitoring and retrieving the results of a long-running
6196// operation.
6197type FailoverGroupsFailoverFuture struct {
6198	azure.FutureAPI
6199	// Result returns the result of the asynchronous operation.
6200	// If the operation has not completed it will return an error.
6201	Result func(FailoverGroupsClient) (FailoverGroup, error)
6202}
6203
6204// UnmarshalJSON is the custom unmarshaller for CreateFuture.
6205func (future *FailoverGroupsFailoverFuture) UnmarshalJSON(body []byte) error {
6206	var azFuture azure.Future
6207	if err := json.Unmarshal(body, &azFuture); err != nil {
6208		return err
6209	}
6210	future.FutureAPI = &azFuture
6211	future.Result = future.result
6212	return nil
6213}
6214
6215// result is the default implementation for FailoverGroupsFailoverFuture.Result.
6216func (future *FailoverGroupsFailoverFuture) result(client FailoverGroupsClient) (fg FailoverGroup, err error) {
6217	var done bool
6218	done, err = future.DoneWithContext(context.Background(), client)
6219	if err != nil {
6220		err = autorest.NewErrorWithError(err, "sql.FailoverGroupsFailoverFuture", "Result", future.Response(), "Polling failure")
6221		return
6222	}
6223	if !done {
6224		fg.Response.Response = future.Response()
6225		err = azure.NewAsyncOpIncompleteError("sql.FailoverGroupsFailoverFuture")
6226		return
6227	}
6228	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6229	if fg.Response.Response, err = future.GetResult(sender); err == nil && fg.Response.Response.StatusCode != http.StatusNoContent {
6230		fg, err = client.FailoverResponder(fg.Response.Response)
6231		if err != nil {
6232			err = autorest.NewErrorWithError(err, "sql.FailoverGroupsFailoverFuture", "Result", fg.Response.Response, "Failure responding to request")
6233		}
6234	}
6235	return
6236}
6237
6238// FailoverGroupsForceFailoverAllowDataLossFuture an abstraction for monitoring and retrieving the results
6239// of a long-running operation.
6240type FailoverGroupsForceFailoverAllowDataLossFuture struct {
6241	azure.FutureAPI
6242	// Result returns the result of the asynchronous operation.
6243	// If the operation has not completed it will return an error.
6244	Result func(FailoverGroupsClient) (FailoverGroup, error)
6245}
6246
6247// UnmarshalJSON is the custom unmarshaller for CreateFuture.
6248func (future *FailoverGroupsForceFailoverAllowDataLossFuture) UnmarshalJSON(body []byte) error {
6249	var azFuture azure.Future
6250	if err := json.Unmarshal(body, &azFuture); err != nil {
6251		return err
6252	}
6253	future.FutureAPI = &azFuture
6254	future.Result = future.result
6255	return nil
6256}
6257
6258// result is the default implementation for FailoverGroupsForceFailoverAllowDataLossFuture.Result.
6259func (future *FailoverGroupsForceFailoverAllowDataLossFuture) result(client FailoverGroupsClient) (fg FailoverGroup, err error) {
6260	var done bool
6261	done, err = future.DoneWithContext(context.Background(), client)
6262	if err != nil {
6263		err = autorest.NewErrorWithError(err, "sql.FailoverGroupsForceFailoverAllowDataLossFuture", "Result", future.Response(), "Polling failure")
6264		return
6265	}
6266	if !done {
6267		fg.Response.Response = future.Response()
6268		err = azure.NewAsyncOpIncompleteError("sql.FailoverGroupsForceFailoverAllowDataLossFuture")
6269		return
6270	}
6271	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6272	if fg.Response.Response, err = future.GetResult(sender); err == nil && fg.Response.Response.StatusCode != http.StatusNoContent {
6273		fg, err = client.ForceFailoverAllowDataLossResponder(fg.Response.Response)
6274		if err != nil {
6275			err = autorest.NewErrorWithError(err, "sql.FailoverGroupsForceFailoverAllowDataLossFuture", "Result", fg.Response.Response, "Failure responding to request")
6276		}
6277	}
6278	return
6279}
6280
6281// FailoverGroupsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
6282// operation.
6283type FailoverGroupsUpdateFuture struct {
6284	azure.FutureAPI
6285	// Result returns the result of the asynchronous operation.
6286	// If the operation has not completed it will return an error.
6287	Result func(FailoverGroupsClient) (FailoverGroup, error)
6288}
6289
6290// UnmarshalJSON is the custom unmarshaller for CreateFuture.
6291func (future *FailoverGroupsUpdateFuture) UnmarshalJSON(body []byte) error {
6292	var azFuture azure.Future
6293	if err := json.Unmarshal(body, &azFuture); err != nil {
6294		return err
6295	}
6296	future.FutureAPI = &azFuture
6297	future.Result = future.result
6298	return nil
6299}
6300
6301// result is the default implementation for FailoverGroupsUpdateFuture.Result.
6302func (future *FailoverGroupsUpdateFuture) result(client FailoverGroupsClient) (fg FailoverGroup, err error) {
6303	var done bool
6304	done, err = future.DoneWithContext(context.Background(), client)
6305	if err != nil {
6306		err = autorest.NewErrorWithError(err, "sql.FailoverGroupsUpdateFuture", "Result", future.Response(), "Polling failure")
6307		return
6308	}
6309	if !done {
6310		fg.Response.Response = future.Response()
6311		err = azure.NewAsyncOpIncompleteError("sql.FailoverGroupsUpdateFuture")
6312		return
6313	}
6314	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6315	if fg.Response.Response, err = future.GetResult(sender); err == nil && fg.Response.Response.StatusCode != http.StatusNoContent {
6316		fg, err = client.UpdateResponder(fg.Response.Response)
6317		if err != nil {
6318			err = autorest.NewErrorWithError(err, "sql.FailoverGroupsUpdateFuture", "Result", fg.Response.Response, "Failure responding to request")
6319		}
6320	}
6321	return
6322}
6323
6324// FailoverGroupUpdate a failover group update request.
6325type FailoverGroupUpdate struct {
6326	// FailoverGroupUpdateProperties - Resource properties.
6327	*FailoverGroupUpdateProperties `json:"properties,omitempty"`
6328	// Tags - Resource tags.
6329	Tags map[string]*string `json:"tags"`
6330}
6331
6332// MarshalJSON is the custom marshaler for FailoverGroupUpdate.
6333func (fgu FailoverGroupUpdate) MarshalJSON() ([]byte, error) {
6334	objectMap := make(map[string]interface{})
6335	if fgu.FailoverGroupUpdateProperties != nil {
6336		objectMap["properties"] = fgu.FailoverGroupUpdateProperties
6337	}
6338	if fgu.Tags != nil {
6339		objectMap["tags"] = fgu.Tags
6340	}
6341	return json.Marshal(objectMap)
6342}
6343
6344// UnmarshalJSON is the custom unmarshaler for FailoverGroupUpdate struct.
6345func (fgu *FailoverGroupUpdate) UnmarshalJSON(body []byte) error {
6346	var m map[string]*json.RawMessage
6347	err := json.Unmarshal(body, &m)
6348	if err != nil {
6349		return err
6350	}
6351	for k, v := range m {
6352		switch k {
6353		case "properties":
6354			if v != nil {
6355				var failoverGroupUpdateProperties FailoverGroupUpdateProperties
6356				err = json.Unmarshal(*v, &failoverGroupUpdateProperties)
6357				if err != nil {
6358					return err
6359				}
6360				fgu.FailoverGroupUpdateProperties = &failoverGroupUpdateProperties
6361			}
6362		case "tags":
6363			if v != nil {
6364				var tags map[string]*string
6365				err = json.Unmarshal(*v, &tags)
6366				if err != nil {
6367					return err
6368				}
6369				fgu.Tags = tags
6370			}
6371		}
6372	}
6373
6374	return nil
6375}
6376
6377// FailoverGroupUpdateProperties properties of a failover group update.
6378type FailoverGroupUpdateProperties struct {
6379	// ReadWriteEndpoint - Read-write endpoint of the failover group instance.
6380	ReadWriteEndpoint *FailoverGroupReadWriteEndpoint `json:"readWriteEndpoint,omitempty"`
6381	// ReadOnlyEndpoint - Read-only endpoint of the failover group instance.
6382	ReadOnlyEndpoint *FailoverGroupReadOnlyEndpoint `json:"readOnlyEndpoint,omitempty"`
6383	// Databases - List of databases in the failover group.
6384	Databases *[]string `json:"databases,omitempty"`
6385}
6386
6387// FirewallRule represents a server firewall rule.
6388type FirewallRule struct {
6389	autorest.Response `json:"-"`
6390	// Kind - READ-ONLY; Kind of server that contains this firewall rule.
6391	Kind *string `json:"kind,omitempty"`
6392	// Location - READ-ONLY; Location of the server that contains this firewall rule.
6393	Location *string `json:"location,omitempty"`
6394	// FirewallRuleProperties - The properties representing the resource.
6395	*FirewallRuleProperties `json:"properties,omitempty"`
6396	// ID - READ-ONLY; Resource ID.
6397	ID *string `json:"id,omitempty"`
6398	// Name - READ-ONLY; Resource name.
6399	Name *string `json:"name,omitempty"`
6400	// Type - READ-ONLY; Resource type.
6401	Type *string `json:"type,omitempty"`
6402}
6403
6404// MarshalJSON is the custom marshaler for FirewallRule.
6405func (fr FirewallRule) MarshalJSON() ([]byte, error) {
6406	objectMap := make(map[string]interface{})
6407	if fr.FirewallRuleProperties != nil {
6408		objectMap["properties"] = fr.FirewallRuleProperties
6409	}
6410	return json.Marshal(objectMap)
6411}
6412
6413// UnmarshalJSON is the custom unmarshaler for FirewallRule struct.
6414func (fr *FirewallRule) UnmarshalJSON(body []byte) error {
6415	var m map[string]*json.RawMessage
6416	err := json.Unmarshal(body, &m)
6417	if err != nil {
6418		return err
6419	}
6420	for k, v := range m {
6421		switch k {
6422		case "kind":
6423			if v != nil {
6424				var kind string
6425				err = json.Unmarshal(*v, &kind)
6426				if err != nil {
6427					return err
6428				}
6429				fr.Kind = &kind
6430			}
6431		case "location":
6432			if v != nil {
6433				var location string
6434				err = json.Unmarshal(*v, &location)
6435				if err != nil {
6436					return err
6437				}
6438				fr.Location = &location
6439			}
6440		case "properties":
6441			if v != nil {
6442				var firewallRuleProperties FirewallRuleProperties
6443				err = json.Unmarshal(*v, &firewallRuleProperties)
6444				if err != nil {
6445					return err
6446				}
6447				fr.FirewallRuleProperties = &firewallRuleProperties
6448			}
6449		case "id":
6450			if v != nil {
6451				var ID string
6452				err = json.Unmarshal(*v, &ID)
6453				if err != nil {
6454					return err
6455				}
6456				fr.ID = &ID
6457			}
6458		case "name":
6459			if v != nil {
6460				var name string
6461				err = json.Unmarshal(*v, &name)
6462				if err != nil {
6463					return err
6464				}
6465				fr.Name = &name
6466			}
6467		case "type":
6468			if v != nil {
6469				var typeVar string
6470				err = json.Unmarshal(*v, &typeVar)
6471				if err != nil {
6472					return err
6473				}
6474				fr.Type = &typeVar
6475			}
6476		}
6477	}
6478
6479	return nil
6480}
6481
6482// FirewallRuleListResult represents the response to a List Firewall Rules request.
6483type FirewallRuleListResult struct {
6484	autorest.Response `json:"-"`
6485	// Value - The list of server firewall rules.
6486	Value *[]FirewallRule `json:"value,omitempty"`
6487}
6488
6489// FirewallRuleProperties represents the properties of a server firewall rule.
6490type FirewallRuleProperties struct {
6491	// StartIPAddress - The start IP address of the firewall rule. Must be IPv4 format. Use value '0.0.0.0' to represent all Azure-internal IP addresses.
6492	StartIPAddress *string `json:"startIpAddress,omitempty"`
6493	// EndIPAddress - The end IP address of the firewall rule. Must be IPv4 format. Must be greater than or equal to startIpAddress. Use value '0.0.0.0' to represent all Azure-internal IP addresses.
6494	EndIPAddress *string `json:"endIpAddress,omitempty"`
6495}
6496
6497// GeoBackupPolicy a database geo backup policy.
6498type GeoBackupPolicy struct {
6499	autorest.Response `json:"-"`
6500	// GeoBackupPolicyProperties - The properties of the geo backup policy.
6501	*GeoBackupPolicyProperties `json:"properties,omitempty"`
6502	// Kind - READ-ONLY; Kind of geo backup policy.  This is metadata used for the Azure portal experience.
6503	Kind *string `json:"kind,omitempty"`
6504	// Location - READ-ONLY; Backup policy location.
6505	Location *string `json:"location,omitempty"`
6506	// ID - READ-ONLY; Resource ID.
6507	ID *string `json:"id,omitempty"`
6508	// Name - READ-ONLY; Resource name.
6509	Name *string `json:"name,omitempty"`
6510	// Type - READ-ONLY; Resource type.
6511	Type *string `json:"type,omitempty"`
6512}
6513
6514// MarshalJSON is the custom marshaler for GeoBackupPolicy.
6515func (gbp GeoBackupPolicy) MarshalJSON() ([]byte, error) {
6516	objectMap := make(map[string]interface{})
6517	if gbp.GeoBackupPolicyProperties != nil {
6518		objectMap["properties"] = gbp.GeoBackupPolicyProperties
6519	}
6520	return json.Marshal(objectMap)
6521}
6522
6523// UnmarshalJSON is the custom unmarshaler for GeoBackupPolicy struct.
6524func (gbp *GeoBackupPolicy) UnmarshalJSON(body []byte) error {
6525	var m map[string]*json.RawMessage
6526	err := json.Unmarshal(body, &m)
6527	if err != nil {
6528		return err
6529	}
6530	for k, v := range m {
6531		switch k {
6532		case "properties":
6533			if v != nil {
6534				var geoBackupPolicyProperties GeoBackupPolicyProperties
6535				err = json.Unmarshal(*v, &geoBackupPolicyProperties)
6536				if err != nil {
6537					return err
6538				}
6539				gbp.GeoBackupPolicyProperties = &geoBackupPolicyProperties
6540			}
6541		case "kind":
6542			if v != nil {
6543				var kind string
6544				err = json.Unmarshal(*v, &kind)
6545				if err != nil {
6546					return err
6547				}
6548				gbp.Kind = &kind
6549			}
6550		case "location":
6551			if v != nil {
6552				var location string
6553				err = json.Unmarshal(*v, &location)
6554				if err != nil {
6555					return err
6556				}
6557				gbp.Location = &location
6558			}
6559		case "id":
6560			if v != nil {
6561				var ID string
6562				err = json.Unmarshal(*v, &ID)
6563				if err != nil {
6564					return err
6565				}
6566				gbp.ID = &ID
6567			}
6568		case "name":
6569			if v != nil {
6570				var name string
6571				err = json.Unmarshal(*v, &name)
6572				if err != nil {
6573					return err
6574				}
6575				gbp.Name = &name
6576			}
6577		case "type":
6578			if v != nil {
6579				var typeVar string
6580				err = json.Unmarshal(*v, &typeVar)
6581				if err != nil {
6582					return err
6583				}
6584				gbp.Type = &typeVar
6585			}
6586		}
6587	}
6588
6589	return nil
6590}
6591
6592// GeoBackupPolicyListResult the response to a list geo backup policies request.
6593type GeoBackupPolicyListResult struct {
6594	autorest.Response `json:"-"`
6595	// Value - The list of geo backup policies.
6596	Value *[]GeoBackupPolicy `json:"value,omitempty"`
6597}
6598
6599// GeoBackupPolicyProperties the properties of the geo backup policy.
6600type GeoBackupPolicyProperties struct {
6601	// State - The state of the geo backup policy. Possible values include: 'GeoBackupPolicyStateDisabled', 'GeoBackupPolicyStateEnabled'
6602	State GeoBackupPolicyState `json:"state,omitempty"`
6603	// StorageType - READ-ONLY; The storage type of the geo backup policy.
6604	StorageType *string `json:"storageType,omitempty"`
6605}
6606
6607// MarshalJSON is the custom marshaler for GeoBackupPolicyProperties.
6608func (gbpp GeoBackupPolicyProperties) MarshalJSON() ([]byte, error) {
6609	objectMap := make(map[string]interface{})
6610	if gbpp.State != "" {
6611		objectMap["state"] = gbpp.State
6612	}
6613	return json.Marshal(objectMap)
6614}
6615
6616// ImportExistingDatabaseDefinition contains the information necessary to perform import operation for
6617// existing database.
6618type ImportExistingDatabaseDefinition struct {
6619	// StorageKeyType - Storage key type. Possible values include: 'SharedAccessKey', 'StorageAccessKey'
6620	StorageKeyType StorageKeyType `json:"storageKeyType,omitempty"`
6621	// StorageKey - Storage key.
6622	StorageKey *string `json:"storageKey,omitempty"`
6623	// StorageURI - Storage Uri.
6624	StorageURI *string `json:"storageUri,omitempty"`
6625	// AdministratorLogin - Administrator login name.
6626	AdministratorLogin *string `json:"administratorLogin,omitempty"`
6627	// AdministratorLoginPassword - Administrator login password.
6628	AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"`
6629	// AuthenticationType - Authentication type.
6630	AuthenticationType *string `json:"authenticationType,omitempty"`
6631	// NetworkIsolation - Optional resource information to enable network isolation for request.
6632	NetworkIsolation *NetworkIsolationSettings `json:"networkIsolation,omitempty"`
6633}
6634
6635// ImportExportImportFuture an abstraction for monitoring and retrieving the results of a long-running
6636// operation.
6637type ImportExportImportFuture struct {
6638	azure.FutureAPI
6639	// Result returns the result of the asynchronous operation.
6640	// If the operation has not completed it will return an error.
6641	Result func(ImportExportClient) (ImportExportOperationResult, error)
6642}
6643
6644// UnmarshalJSON is the custom unmarshaller for CreateFuture.
6645func (future *ImportExportImportFuture) UnmarshalJSON(body []byte) error {
6646	var azFuture azure.Future
6647	if err := json.Unmarshal(body, &azFuture); err != nil {
6648		return err
6649	}
6650	future.FutureAPI = &azFuture
6651	future.Result = future.result
6652	return nil
6653}
6654
6655// result is the default implementation for ImportExportImportFuture.Result.
6656func (future *ImportExportImportFuture) result(client ImportExportClient) (ieor ImportExportOperationResult, err error) {
6657	var done bool
6658	done, err = future.DoneWithContext(context.Background(), client)
6659	if err != nil {
6660		err = autorest.NewErrorWithError(err, "sql.ImportExportImportFuture", "Result", future.Response(), "Polling failure")
6661		return
6662	}
6663	if !done {
6664		ieor.Response.Response = future.Response()
6665		err = azure.NewAsyncOpIncompleteError("sql.ImportExportImportFuture")
6666		return
6667	}
6668	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6669	if ieor.Response.Response, err = future.GetResult(sender); err == nil && ieor.Response.Response.StatusCode != http.StatusNoContent {
6670		ieor, err = client.ImportResponder(ieor.Response.Response)
6671		if err != nil {
6672			err = autorest.NewErrorWithError(err, "sql.ImportExportImportFuture", "Result", ieor.Response.Response, "Failure responding to request")
6673		}
6674	}
6675	return
6676}
6677
6678// ImportExportOperationResult an ImportExport operation result resource.
6679type ImportExportOperationResult struct {
6680	autorest.Response `json:"-"`
6681	// ImportExportOperationResultProperties - Resource properties.
6682	*ImportExportOperationResultProperties `json:"properties,omitempty"`
6683	// ID - READ-ONLY; Resource ID.
6684	ID *string `json:"id,omitempty"`
6685	// Name - READ-ONLY; Resource name.
6686	Name *string `json:"name,omitempty"`
6687	// Type - READ-ONLY; Resource type.
6688	Type *string `json:"type,omitempty"`
6689}
6690
6691// MarshalJSON is the custom marshaler for ImportExportOperationResult.
6692func (ieor ImportExportOperationResult) MarshalJSON() ([]byte, error) {
6693	objectMap := make(map[string]interface{})
6694	if ieor.ImportExportOperationResultProperties != nil {
6695		objectMap["properties"] = ieor.ImportExportOperationResultProperties
6696	}
6697	return json.Marshal(objectMap)
6698}
6699
6700// UnmarshalJSON is the custom unmarshaler for ImportExportOperationResult struct.
6701func (ieor *ImportExportOperationResult) UnmarshalJSON(body []byte) error {
6702	var m map[string]*json.RawMessage
6703	err := json.Unmarshal(body, &m)
6704	if err != nil {
6705		return err
6706	}
6707	for k, v := range m {
6708		switch k {
6709		case "properties":
6710			if v != nil {
6711				var importExportOperationResultProperties ImportExportOperationResultProperties
6712				err = json.Unmarshal(*v, &importExportOperationResultProperties)
6713				if err != nil {
6714					return err
6715				}
6716				ieor.ImportExportOperationResultProperties = &importExportOperationResultProperties
6717			}
6718		case "id":
6719			if v != nil {
6720				var ID string
6721				err = json.Unmarshal(*v, &ID)
6722				if err != nil {
6723					return err
6724				}
6725				ieor.ID = &ID
6726			}
6727		case "name":
6728			if v != nil {
6729				var name string
6730				err = json.Unmarshal(*v, &name)
6731				if err != nil {
6732					return err
6733				}
6734				ieor.Name = &name
6735			}
6736		case "type":
6737			if v != nil {
6738				var typeVar string
6739				err = json.Unmarshal(*v, &typeVar)
6740				if err != nil {
6741					return err
6742				}
6743				ieor.Type = &typeVar
6744			}
6745		}
6746	}
6747
6748	return nil
6749}
6750
6751// ImportExportOperationResultProperties contains the operation result properties for import/export
6752// operation.
6753type ImportExportOperationResultProperties struct {
6754	// RequestID - READ-ONLY; Request Id.
6755	RequestID *uuid.UUID `json:"requestId,omitempty"`
6756	// RequestType - READ-ONLY; Request type.
6757	RequestType *string `json:"requestType,omitempty"`
6758	// QueuedTime - READ-ONLY; Queued time.
6759	QueuedTime *string `json:"queuedTime,omitempty"`
6760	// LastModifiedTime - READ-ONLY; Last modified time.
6761	LastModifiedTime *string `json:"lastModifiedTime,omitempty"`
6762	// BlobURI - READ-ONLY; Blob Uri.
6763	BlobURI *string `json:"blobUri,omitempty"`
6764	// ServerName - READ-ONLY; Server name.
6765	ServerName *string `json:"serverName,omitempty"`
6766	// DatabaseName - READ-ONLY; Database name.
6767	DatabaseName *string `json:"databaseName,omitempty"`
6768	// Status - READ-ONLY; Operation status.
6769	Status *string `json:"status,omitempty"`
6770	// ErrorMessage - READ-ONLY; Error message.
6771	ErrorMessage *string `json:"errorMessage,omitempty"`
6772	// PrivateEndpointConnections - READ-ONLY; Gets the status of private endpoints associated with this request.
6773	PrivateEndpointConnections *[]PrivateEndpointConnectionRequestStatus `json:"privateEndpointConnections,omitempty"`
6774}
6775
6776// MarshalJSON is the custom marshaler for ImportExportOperationResultProperties.
6777func (ieorp ImportExportOperationResultProperties) MarshalJSON() ([]byte, error) {
6778	objectMap := make(map[string]interface{})
6779	return json.Marshal(objectMap)
6780}
6781
6782// ImportNewDatabaseDefinition contains the information necessary to perform import operation for new
6783// database.
6784type ImportNewDatabaseDefinition struct {
6785	// DatabaseName - Name of the import database.
6786	DatabaseName *string `json:"databaseName,omitempty"`
6787	// Edition - Edition of the import database.
6788	Edition *string `json:"edition,omitempty"`
6789	// ServiceObjectiveName - Service level objective name of the import database.
6790	ServiceObjectiveName *string `json:"serviceObjectiveName,omitempty"`
6791	// MaxSizeBytes - Max size in bytes for the import database.
6792	MaxSizeBytes *string `json:"maxSizeBytes,omitempty"`
6793	// StorageKeyType - Storage key type. Possible values include: 'SharedAccessKey', 'StorageAccessKey'
6794	StorageKeyType StorageKeyType `json:"storageKeyType,omitempty"`
6795	// StorageKey - Storage key.
6796	StorageKey *string `json:"storageKey,omitempty"`
6797	// StorageURI - Storage Uri.
6798	StorageURI *string `json:"storageUri,omitempty"`
6799	// AdministratorLogin - Administrator login name.
6800	AdministratorLogin *string `json:"administratorLogin,omitempty"`
6801	// AdministratorLoginPassword - Administrator login password.
6802	AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"`
6803	// AuthenticationType - Authentication type.
6804	AuthenticationType *string `json:"authenticationType,omitempty"`
6805	// NetworkIsolation - Optional resource information to enable network isolation for request.
6806	NetworkIsolation *NetworkIsolationSettings `json:"networkIsolation,omitempty"`
6807}
6808
6809// InstanceFailoverGroup an instance failover group.
6810type InstanceFailoverGroup struct {
6811	autorest.Response `json:"-"`
6812	// InstanceFailoverGroupProperties - Resource properties.
6813	*InstanceFailoverGroupProperties `json:"properties,omitempty"`
6814	// ID - READ-ONLY; Resource ID.
6815	ID *string `json:"id,omitempty"`
6816	// Name - READ-ONLY; Resource name.
6817	Name *string `json:"name,omitempty"`
6818	// Type - READ-ONLY; Resource type.
6819	Type *string `json:"type,omitempty"`
6820}
6821
6822// MarshalJSON is the custom marshaler for InstanceFailoverGroup.
6823func (ifg InstanceFailoverGroup) MarshalJSON() ([]byte, error) {
6824	objectMap := make(map[string]interface{})
6825	if ifg.InstanceFailoverGroupProperties != nil {
6826		objectMap["properties"] = ifg.InstanceFailoverGroupProperties
6827	}
6828	return json.Marshal(objectMap)
6829}
6830
6831// UnmarshalJSON is the custom unmarshaler for InstanceFailoverGroup struct.
6832func (ifg *InstanceFailoverGroup) UnmarshalJSON(body []byte) error {
6833	var m map[string]*json.RawMessage
6834	err := json.Unmarshal(body, &m)
6835	if err != nil {
6836		return err
6837	}
6838	for k, v := range m {
6839		switch k {
6840		case "properties":
6841			if v != nil {
6842				var instanceFailoverGroupProperties InstanceFailoverGroupProperties
6843				err = json.Unmarshal(*v, &instanceFailoverGroupProperties)
6844				if err != nil {
6845					return err
6846				}
6847				ifg.InstanceFailoverGroupProperties = &instanceFailoverGroupProperties
6848			}
6849		case "id":
6850			if v != nil {
6851				var ID string
6852				err = json.Unmarshal(*v, &ID)
6853				if err != nil {
6854					return err
6855				}
6856				ifg.ID = &ID
6857			}
6858		case "name":
6859			if v != nil {
6860				var name string
6861				err = json.Unmarshal(*v, &name)
6862				if err != nil {
6863					return err
6864				}
6865				ifg.Name = &name
6866			}
6867		case "type":
6868			if v != nil {
6869				var typeVar string
6870				err = json.Unmarshal(*v, &typeVar)
6871				if err != nil {
6872					return err
6873				}
6874				ifg.Type = &typeVar
6875			}
6876		}
6877	}
6878
6879	return nil
6880}
6881
6882// InstanceFailoverGroupListResult a list of instance failover groups.
6883type InstanceFailoverGroupListResult struct {
6884	autorest.Response `json:"-"`
6885	// Value - READ-ONLY; Array of results.
6886	Value *[]InstanceFailoverGroup `json:"value,omitempty"`
6887	// NextLink - READ-ONLY; Link to retrieve next page of results.
6888	NextLink *string `json:"nextLink,omitempty"`
6889}
6890
6891// MarshalJSON is the custom marshaler for InstanceFailoverGroupListResult.
6892func (ifglr InstanceFailoverGroupListResult) MarshalJSON() ([]byte, error) {
6893	objectMap := make(map[string]interface{})
6894	return json.Marshal(objectMap)
6895}
6896
6897// InstanceFailoverGroupListResultIterator provides access to a complete listing of InstanceFailoverGroup
6898// values.
6899type InstanceFailoverGroupListResultIterator struct {
6900	i    int
6901	page InstanceFailoverGroupListResultPage
6902}
6903
6904// NextWithContext advances to the next value.  If there was an error making
6905// the request the iterator does not advance and the error is returned.
6906func (iter *InstanceFailoverGroupListResultIterator) NextWithContext(ctx context.Context) (err error) {
6907	if tracing.IsEnabled() {
6908		ctx = tracing.StartSpan(ctx, fqdn+"/InstanceFailoverGroupListResultIterator.NextWithContext")
6909		defer func() {
6910			sc := -1
6911			if iter.Response().Response.Response != nil {
6912				sc = iter.Response().Response.Response.StatusCode
6913			}
6914			tracing.EndSpan(ctx, sc, err)
6915		}()
6916	}
6917	iter.i++
6918	if iter.i < len(iter.page.Values()) {
6919		return nil
6920	}
6921	err = iter.page.NextWithContext(ctx)
6922	if err != nil {
6923		iter.i--
6924		return err
6925	}
6926	iter.i = 0
6927	return nil
6928}
6929
6930// Next advances to the next value.  If there was an error making
6931// the request the iterator does not advance and the error is returned.
6932// Deprecated: Use NextWithContext() instead.
6933func (iter *InstanceFailoverGroupListResultIterator) Next() error {
6934	return iter.NextWithContext(context.Background())
6935}
6936
6937// NotDone returns true if the enumeration should be started or is not yet complete.
6938func (iter InstanceFailoverGroupListResultIterator) NotDone() bool {
6939	return iter.page.NotDone() && iter.i < len(iter.page.Values())
6940}
6941
6942// Response returns the raw server response from the last page request.
6943func (iter InstanceFailoverGroupListResultIterator) Response() InstanceFailoverGroupListResult {
6944	return iter.page.Response()
6945}
6946
6947// Value returns the current value or a zero-initialized value if the
6948// iterator has advanced beyond the end of the collection.
6949func (iter InstanceFailoverGroupListResultIterator) Value() InstanceFailoverGroup {
6950	if !iter.page.NotDone() {
6951		return InstanceFailoverGroup{}
6952	}
6953	return iter.page.Values()[iter.i]
6954}
6955
6956// Creates a new instance of the InstanceFailoverGroupListResultIterator type.
6957func NewInstanceFailoverGroupListResultIterator(page InstanceFailoverGroupListResultPage) InstanceFailoverGroupListResultIterator {
6958	return InstanceFailoverGroupListResultIterator{page: page}
6959}
6960
6961// IsEmpty returns true if the ListResult contains no values.
6962func (ifglr InstanceFailoverGroupListResult) IsEmpty() bool {
6963	return ifglr.Value == nil || len(*ifglr.Value) == 0
6964}
6965
6966// hasNextLink returns true if the NextLink is not empty.
6967func (ifglr InstanceFailoverGroupListResult) hasNextLink() bool {
6968	return ifglr.NextLink != nil && len(*ifglr.NextLink) != 0
6969}
6970
6971// instanceFailoverGroupListResultPreparer prepares a request to retrieve the next set of results.
6972// It returns nil if no more results exist.
6973func (ifglr InstanceFailoverGroupListResult) instanceFailoverGroupListResultPreparer(ctx context.Context) (*http.Request, error) {
6974	if !ifglr.hasNextLink() {
6975		return nil, nil
6976	}
6977	return autorest.Prepare((&http.Request{}).WithContext(ctx),
6978		autorest.AsJSON(),
6979		autorest.AsGet(),
6980		autorest.WithBaseURL(to.String(ifglr.NextLink)))
6981}
6982
6983// InstanceFailoverGroupListResultPage contains a page of InstanceFailoverGroup values.
6984type InstanceFailoverGroupListResultPage struct {
6985	fn    func(context.Context, InstanceFailoverGroupListResult) (InstanceFailoverGroupListResult, error)
6986	ifglr InstanceFailoverGroupListResult
6987}
6988
6989// NextWithContext advances to the next page of values.  If there was an error making
6990// the request the page does not advance and the error is returned.
6991func (page *InstanceFailoverGroupListResultPage) NextWithContext(ctx context.Context) (err error) {
6992	if tracing.IsEnabled() {
6993		ctx = tracing.StartSpan(ctx, fqdn+"/InstanceFailoverGroupListResultPage.NextWithContext")
6994		defer func() {
6995			sc := -1
6996			if page.Response().Response.Response != nil {
6997				sc = page.Response().Response.Response.StatusCode
6998			}
6999			tracing.EndSpan(ctx, sc, err)
7000		}()
7001	}
7002	for {
7003		next, err := page.fn(ctx, page.ifglr)
7004		if err != nil {
7005			return err
7006		}
7007		page.ifglr = next
7008		if !next.hasNextLink() || !next.IsEmpty() {
7009			break
7010		}
7011	}
7012	return nil
7013}
7014
7015// Next advances to the next page of values.  If there was an error making
7016// the request the page does not advance and the error is returned.
7017// Deprecated: Use NextWithContext() instead.
7018func (page *InstanceFailoverGroupListResultPage) Next() error {
7019	return page.NextWithContext(context.Background())
7020}
7021
7022// NotDone returns true if the page enumeration should be started or is not yet complete.
7023func (page InstanceFailoverGroupListResultPage) NotDone() bool {
7024	return !page.ifglr.IsEmpty()
7025}
7026
7027// Response returns the raw server response from the last page request.
7028func (page InstanceFailoverGroupListResultPage) Response() InstanceFailoverGroupListResult {
7029	return page.ifglr
7030}
7031
7032// Values returns the slice of values for the current page or nil if there are no values.
7033func (page InstanceFailoverGroupListResultPage) Values() []InstanceFailoverGroup {
7034	if page.ifglr.IsEmpty() {
7035		return nil
7036	}
7037	return *page.ifglr.Value
7038}
7039
7040// Creates a new instance of the InstanceFailoverGroupListResultPage type.
7041func NewInstanceFailoverGroupListResultPage(cur InstanceFailoverGroupListResult, getNextPage func(context.Context, InstanceFailoverGroupListResult) (InstanceFailoverGroupListResult, error)) InstanceFailoverGroupListResultPage {
7042	return InstanceFailoverGroupListResultPage{
7043		fn:    getNextPage,
7044		ifglr: cur,
7045	}
7046}
7047
7048// InstanceFailoverGroupProperties properties of a instance failover group.
7049type InstanceFailoverGroupProperties struct {
7050	// ReadWriteEndpoint - Read-write endpoint of the failover group instance.
7051	ReadWriteEndpoint *InstanceFailoverGroupReadWriteEndpoint `json:"readWriteEndpoint,omitempty"`
7052	// ReadOnlyEndpoint - Read-only endpoint of the failover group instance.
7053	ReadOnlyEndpoint *InstanceFailoverGroupReadOnlyEndpoint `json:"readOnlyEndpoint,omitempty"`
7054	// ReplicationRole - READ-ONLY; Local replication role of the failover group instance. Possible values include: 'InstanceFailoverGroupReplicationRolePrimary', 'InstanceFailoverGroupReplicationRoleSecondary'
7055	ReplicationRole InstanceFailoverGroupReplicationRole `json:"replicationRole,omitempty"`
7056	// ReplicationState - READ-ONLY; Replication state of the failover group instance.
7057	ReplicationState *string `json:"replicationState,omitempty"`
7058	// PartnerRegions - Partner region information for the failover group.
7059	PartnerRegions *[]PartnerRegionInfo `json:"partnerRegions,omitempty"`
7060	// ManagedInstancePairs - List of managed instance pairs in the failover group.
7061	ManagedInstancePairs *[]ManagedInstancePairInfo `json:"managedInstancePairs,omitempty"`
7062}
7063
7064// MarshalJSON is the custom marshaler for InstanceFailoverGroupProperties.
7065func (ifgp InstanceFailoverGroupProperties) MarshalJSON() ([]byte, error) {
7066	objectMap := make(map[string]interface{})
7067	if ifgp.ReadWriteEndpoint != nil {
7068		objectMap["readWriteEndpoint"] = ifgp.ReadWriteEndpoint
7069	}
7070	if ifgp.ReadOnlyEndpoint != nil {
7071		objectMap["readOnlyEndpoint"] = ifgp.ReadOnlyEndpoint
7072	}
7073	if ifgp.PartnerRegions != nil {
7074		objectMap["partnerRegions"] = ifgp.PartnerRegions
7075	}
7076	if ifgp.ManagedInstancePairs != nil {
7077		objectMap["managedInstancePairs"] = ifgp.ManagedInstancePairs
7078	}
7079	return json.Marshal(objectMap)
7080}
7081
7082// InstanceFailoverGroupReadOnlyEndpoint read-only endpoint of the failover group instance.
7083type InstanceFailoverGroupReadOnlyEndpoint struct {
7084	// FailoverPolicy - Failover policy of the read-only endpoint for the failover group. Possible values include: 'ReadOnlyEndpointFailoverPolicyDisabled', 'ReadOnlyEndpointFailoverPolicyEnabled'
7085	FailoverPolicy ReadOnlyEndpointFailoverPolicy `json:"failoverPolicy,omitempty"`
7086}
7087
7088// InstanceFailoverGroupReadWriteEndpoint read-write endpoint of the failover group instance.
7089type InstanceFailoverGroupReadWriteEndpoint struct {
7090	// FailoverPolicy - Failover policy of the read-write endpoint for the failover group. If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible values include: 'Manual', 'Automatic'
7091	FailoverPolicy ReadWriteEndpointFailoverPolicy `json:"failoverPolicy,omitempty"`
7092	// FailoverWithDataLossGracePeriodMinutes - Grace period before failover with data loss is attempted for the read-write endpoint. If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required.
7093	FailoverWithDataLossGracePeriodMinutes *int32 `json:"failoverWithDataLossGracePeriodMinutes,omitempty"`
7094}
7095
7096// InstanceFailoverGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
7097// long-running operation.
7098type InstanceFailoverGroupsCreateOrUpdateFuture struct {
7099	azure.FutureAPI
7100	// Result returns the result of the asynchronous operation.
7101	// If the operation has not completed it will return an error.
7102	Result func(InstanceFailoverGroupsClient) (InstanceFailoverGroup, error)
7103}
7104
7105// UnmarshalJSON is the custom unmarshaller for CreateFuture.
7106func (future *InstanceFailoverGroupsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
7107	var azFuture azure.Future
7108	if err := json.Unmarshal(body, &azFuture); err != nil {
7109		return err
7110	}
7111	future.FutureAPI = &azFuture
7112	future.Result = future.result
7113	return nil
7114}
7115
7116// result is the default implementation for InstanceFailoverGroupsCreateOrUpdateFuture.Result.
7117func (future *InstanceFailoverGroupsCreateOrUpdateFuture) result(client InstanceFailoverGroupsClient) (ifg InstanceFailoverGroup, err error) {
7118	var done bool
7119	done, err = future.DoneWithContext(context.Background(), client)
7120	if err != nil {
7121		err = autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
7122		return
7123	}
7124	if !done {
7125		ifg.Response.Response = future.Response()
7126		err = azure.NewAsyncOpIncompleteError("sql.InstanceFailoverGroupsCreateOrUpdateFuture")
7127		return
7128	}
7129	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7130	if ifg.Response.Response, err = future.GetResult(sender); err == nil && ifg.Response.Response.StatusCode != http.StatusNoContent {
7131		ifg, err = client.CreateOrUpdateResponder(ifg.Response.Response)
7132		if err != nil {
7133			err = autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsCreateOrUpdateFuture", "Result", ifg.Response.Response, "Failure responding to request")
7134		}
7135	}
7136	return
7137}
7138
7139// InstanceFailoverGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a
7140// long-running operation.
7141type InstanceFailoverGroupsDeleteFuture struct {
7142	azure.FutureAPI
7143	// Result returns the result of the asynchronous operation.
7144	// If the operation has not completed it will return an error.
7145	Result func(InstanceFailoverGroupsClient) (autorest.Response, error)
7146}
7147
7148// UnmarshalJSON is the custom unmarshaller for CreateFuture.
7149func (future *InstanceFailoverGroupsDeleteFuture) UnmarshalJSON(body []byte) error {
7150	var azFuture azure.Future
7151	if err := json.Unmarshal(body, &azFuture); err != nil {
7152		return err
7153	}
7154	future.FutureAPI = &azFuture
7155	future.Result = future.result
7156	return nil
7157}
7158
7159// result is the default implementation for InstanceFailoverGroupsDeleteFuture.Result.
7160func (future *InstanceFailoverGroupsDeleteFuture) result(client InstanceFailoverGroupsClient) (ar autorest.Response, err error) {
7161	var done bool
7162	done, err = future.DoneWithContext(context.Background(), client)
7163	if err != nil {
7164		err = autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsDeleteFuture", "Result", future.Response(), "Polling failure")
7165		return
7166	}
7167	if !done {
7168		ar.Response = future.Response()
7169		err = azure.NewAsyncOpIncompleteError("sql.InstanceFailoverGroupsDeleteFuture")
7170		return
7171	}
7172	ar.Response = future.Response()
7173	return
7174}
7175
7176// InstanceFailoverGroupsFailoverFuture an abstraction for monitoring and retrieving the results of a
7177// long-running operation.
7178type InstanceFailoverGroupsFailoverFuture struct {
7179	azure.FutureAPI
7180	// Result returns the result of the asynchronous operation.
7181	// If the operation has not completed it will return an error.
7182	Result func(InstanceFailoverGroupsClient) (InstanceFailoverGroup, error)
7183}
7184
7185// UnmarshalJSON is the custom unmarshaller for CreateFuture.
7186func (future *InstanceFailoverGroupsFailoverFuture) UnmarshalJSON(body []byte) error {
7187	var azFuture azure.Future
7188	if err := json.Unmarshal(body, &azFuture); err != nil {
7189		return err
7190	}
7191	future.FutureAPI = &azFuture
7192	future.Result = future.result
7193	return nil
7194}
7195
7196// result is the default implementation for InstanceFailoverGroupsFailoverFuture.Result.
7197func (future *InstanceFailoverGroupsFailoverFuture) result(client InstanceFailoverGroupsClient) (ifg InstanceFailoverGroup, err error) {
7198	var done bool
7199	done, err = future.DoneWithContext(context.Background(), client)
7200	if err != nil {
7201		err = autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsFailoverFuture", "Result", future.Response(), "Polling failure")
7202		return
7203	}
7204	if !done {
7205		ifg.Response.Response = future.Response()
7206		err = azure.NewAsyncOpIncompleteError("sql.InstanceFailoverGroupsFailoverFuture")
7207		return
7208	}
7209	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7210	if ifg.Response.Response, err = future.GetResult(sender); err == nil && ifg.Response.Response.StatusCode != http.StatusNoContent {
7211		ifg, err = client.FailoverResponder(ifg.Response.Response)
7212		if err != nil {
7213			err = autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsFailoverFuture", "Result", ifg.Response.Response, "Failure responding to request")
7214		}
7215	}
7216	return
7217}
7218
7219// InstanceFailoverGroupsForceFailoverAllowDataLossFuture an abstraction for monitoring and retrieving the
7220// results of a long-running operation.
7221type InstanceFailoverGroupsForceFailoverAllowDataLossFuture struct {
7222	azure.FutureAPI
7223	// Result returns the result of the asynchronous operation.
7224	// If the operation has not completed it will return an error.
7225	Result func(InstanceFailoverGroupsClient) (InstanceFailoverGroup, error)
7226}
7227
7228// UnmarshalJSON is the custom unmarshaller for CreateFuture.
7229func (future *InstanceFailoverGroupsForceFailoverAllowDataLossFuture) UnmarshalJSON(body []byte) error {
7230	var azFuture azure.Future
7231	if err := json.Unmarshal(body, &azFuture); err != nil {
7232		return err
7233	}
7234	future.FutureAPI = &azFuture
7235	future.Result = future.result
7236	return nil
7237}
7238
7239// result is the default implementation for InstanceFailoverGroupsForceFailoverAllowDataLossFuture.Result.
7240func (future *InstanceFailoverGroupsForceFailoverAllowDataLossFuture) result(client InstanceFailoverGroupsClient) (ifg InstanceFailoverGroup, err error) {
7241	var done bool
7242	done, err = future.DoneWithContext(context.Background(), client)
7243	if err != nil {
7244		err = autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsForceFailoverAllowDataLossFuture", "Result", future.Response(), "Polling failure")
7245		return
7246	}
7247	if !done {
7248		ifg.Response.Response = future.Response()
7249		err = azure.NewAsyncOpIncompleteError("sql.InstanceFailoverGroupsForceFailoverAllowDataLossFuture")
7250		return
7251	}
7252	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7253	if ifg.Response.Response, err = future.GetResult(sender); err == nil && ifg.Response.Response.StatusCode != http.StatusNoContent {
7254		ifg, err = client.ForceFailoverAllowDataLossResponder(ifg.Response.Response)
7255		if err != nil {
7256			err = autorest.NewErrorWithError(err, "sql.InstanceFailoverGroupsForceFailoverAllowDataLossFuture", "Result", ifg.Response.Response, "Failure responding to request")
7257		}
7258	}
7259	return
7260}
7261
7262// InstancePool an Azure SQL instance pool.
7263type InstancePool struct {
7264	autorest.Response `json:"-"`
7265	// Sku - The name and tier of the SKU.
7266	Sku *Sku `json:"sku,omitempty"`
7267	// InstancePoolProperties - Resource properties.
7268	*InstancePoolProperties `json:"properties,omitempty"`
7269	// Location - Resource location.
7270	Location *string `json:"location,omitempty"`
7271	// Tags - Resource tags.
7272	Tags map[string]*string `json:"tags"`
7273	// ID - READ-ONLY; Resource ID.
7274	ID *string `json:"id,omitempty"`
7275	// Name - READ-ONLY; Resource name.
7276	Name *string `json:"name,omitempty"`
7277	// Type - READ-ONLY; Resource type.
7278	Type *string `json:"type,omitempty"`
7279}
7280
7281// MarshalJSON is the custom marshaler for InstancePool.
7282func (IP InstancePool) MarshalJSON() ([]byte, error) {
7283	objectMap := make(map[string]interface{})
7284	if IP.Sku != nil {
7285		objectMap["sku"] = IP.Sku
7286	}
7287	if IP.InstancePoolProperties != nil {
7288		objectMap["properties"] = IP.InstancePoolProperties
7289	}
7290	if IP.Location != nil {
7291		objectMap["location"] = IP.Location
7292	}
7293	if IP.Tags != nil {
7294		objectMap["tags"] = IP.Tags
7295	}
7296	return json.Marshal(objectMap)
7297}
7298
7299// UnmarshalJSON is the custom unmarshaler for InstancePool struct.
7300func (IP *InstancePool) UnmarshalJSON(body []byte) error {
7301	var m map[string]*json.RawMessage
7302	err := json.Unmarshal(body, &m)
7303	if err != nil {
7304		return err
7305	}
7306	for k, v := range m {
7307		switch k {
7308		case "sku":
7309			if v != nil {
7310				var sku Sku
7311				err = json.Unmarshal(*v, &sku)
7312				if err != nil {
7313					return err
7314				}
7315				IP.Sku = &sku
7316			}
7317		case "properties":
7318			if v != nil {
7319				var instancePoolProperties InstancePoolProperties
7320				err = json.Unmarshal(*v, &instancePoolProperties)
7321				if err != nil {
7322					return err
7323				}
7324				IP.InstancePoolProperties = &instancePoolProperties
7325			}
7326		case "location":
7327			if v != nil {
7328				var location string
7329				err = json.Unmarshal(*v, &location)
7330				if err != nil {
7331					return err
7332				}
7333				IP.Location = &location
7334			}
7335		case "tags":
7336			if v != nil {
7337				var tags map[string]*string
7338				err = json.Unmarshal(*v, &tags)
7339				if err != nil {
7340					return err
7341				}
7342				IP.Tags = tags
7343			}
7344		case "id":
7345			if v != nil {
7346				var ID string
7347				err = json.Unmarshal(*v, &ID)
7348				if err != nil {
7349					return err
7350				}
7351				IP.ID = &ID
7352			}
7353		case "name":
7354			if v != nil {
7355				var name string
7356				err = json.Unmarshal(*v, &name)
7357				if err != nil {
7358					return err
7359				}
7360				IP.Name = &name
7361			}
7362		case "type":
7363			if v != nil {
7364				var typeVar string
7365				err = json.Unmarshal(*v, &typeVar)
7366				if err != nil {
7367					return err
7368				}
7369				IP.Type = &typeVar
7370			}
7371		}
7372	}
7373
7374	return nil
7375}
7376
7377// InstancePoolEditionCapability the instance pool capability
7378type InstancePoolEditionCapability struct {
7379	// Name - READ-ONLY; The instance pool version name.
7380	Name *string `json:"name,omitempty"`
7381	// SupportedFamilies - READ-ONLY; The supported families.
7382	SupportedFamilies *[]InstancePoolFamilyCapability `json:"supportedFamilies,omitempty"`
7383	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
7384	Status CapabilityStatus `json:"status,omitempty"`
7385	// Reason - The reason for the capability not being available.
7386	Reason *string `json:"reason,omitempty"`
7387}
7388
7389// MarshalJSON is the custom marshaler for InstancePoolEditionCapability.
7390func (ipec InstancePoolEditionCapability) MarshalJSON() ([]byte, error) {
7391	objectMap := make(map[string]interface{})
7392	if ipec.Reason != nil {
7393		objectMap["reason"] = ipec.Reason
7394	}
7395	return json.Marshal(objectMap)
7396}
7397
7398// InstancePoolFamilyCapability the instance pool family capability.
7399type InstancePoolFamilyCapability struct {
7400	// Name - READ-ONLY; Family name.
7401	Name *string `json:"name,omitempty"`
7402	// SupportedLicenseTypes - READ-ONLY; List of supported license types.
7403	SupportedLicenseTypes *[]LicenseTypeCapability `json:"supportedLicenseTypes,omitempty"`
7404	// SupportedVcoresValues - READ-ONLY; List of supported virtual cores values.
7405	SupportedVcoresValues *[]InstancePoolVcoresCapability `json:"supportedVcoresValues,omitempty"`
7406	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
7407	Status CapabilityStatus `json:"status,omitempty"`
7408	// Reason - The reason for the capability not being available.
7409	Reason *string `json:"reason,omitempty"`
7410}
7411
7412// MarshalJSON is the custom marshaler for InstancePoolFamilyCapability.
7413func (ipfc InstancePoolFamilyCapability) MarshalJSON() ([]byte, error) {
7414	objectMap := make(map[string]interface{})
7415	if ipfc.Reason != nil {
7416		objectMap["reason"] = ipfc.Reason
7417	}
7418	return json.Marshal(objectMap)
7419}
7420
7421// InstancePoolListResult a list of Azure SQL instance pools.
7422type InstancePoolListResult struct {
7423	autorest.Response `json:"-"`
7424	// Value - READ-ONLY; Array of results.
7425	Value *[]InstancePool `json:"value,omitempty"`
7426	// NextLink - READ-ONLY; Link to retrieve next page of results.
7427	NextLink *string `json:"nextLink,omitempty"`
7428}
7429
7430// MarshalJSON is the custom marshaler for InstancePoolListResult.
7431func (iplr InstancePoolListResult) MarshalJSON() ([]byte, error) {
7432	objectMap := make(map[string]interface{})
7433	return json.Marshal(objectMap)
7434}
7435
7436// InstancePoolListResultIterator provides access to a complete listing of InstancePool values.
7437type InstancePoolListResultIterator struct {
7438	i    int
7439	page InstancePoolListResultPage
7440}
7441
7442// NextWithContext advances to the next value.  If there was an error making
7443// the request the iterator does not advance and the error is returned.
7444func (iter *InstancePoolListResultIterator) NextWithContext(ctx context.Context) (err error) {
7445	if tracing.IsEnabled() {
7446		ctx = tracing.StartSpan(ctx, fqdn+"/InstancePoolListResultIterator.NextWithContext")
7447		defer func() {
7448			sc := -1
7449			if iter.Response().Response.Response != nil {
7450				sc = iter.Response().Response.Response.StatusCode
7451			}
7452			tracing.EndSpan(ctx, sc, err)
7453		}()
7454	}
7455	iter.i++
7456	if iter.i < len(iter.page.Values()) {
7457		return nil
7458	}
7459	err = iter.page.NextWithContext(ctx)
7460	if err != nil {
7461		iter.i--
7462		return err
7463	}
7464	iter.i = 0
7465	return nil
7466}
7467
7468// Next advances to the next value.  If there was an error making
7469// the request the iterator does not advance and the error is returned.
7470// Deprecated: Use NextWithContext() instead.
7471func (iter *InstancePoolListResultIterator) Next() error {
7472	return iter.NextWithContext(context.Background())
7473}
7474
7475// NotDone returns true if the enumeration should be started or is not yet complete.
7476func (iter InstancePoolListResultIterator) NotDone() bool {
7477	return iter.page.NotDone() && iter.i < len(iter.page.Values())
7478}
7479
7480// Response returns the raw server response from the last page request.
7481func (iter InstancePoolListResultIterator) Response() InstancePoolListResult {
7482	return iter.page.Response()
7483}
7484
7485// Value returns the current value or a zero-initialized value if the
7486// iterator has advanced beyond the end of the collection.
7487func (iter InstancePoolListResultIterator) Value() InstancePool {
7488	if !iter.page.NotDone() {
7489		return InstancePool{}
7490	}
7491	return iter.page.Values()[iter.i]
7492}
7493
7494// Creates a new instance of the InstancePoolListResultIterator type.
7495func NewInstancePoolListResultIterator(page InstancePoolListResultPage) InstancePoolListResultIterator {
7496	return InstancePoolListResultIterator{page: page}
7497}
7498
7499// IsEmpty returns true if the ListResult contains no values.
7500func (iplr InstancePoolListResult) IsEmpty() bool {
7501	return iplr.Value == nil || len(*iplr.Value) == 0
7502}
7503
7504// hasNextLink returns true if the NextLink is not empty.
7505func (iplr InstancePoolListResult) hasNextLink() bool {
7506	return iplr.NextLink != nil && len(*iplr.NextLink) != 0
7507}
7508
7509// instancePoolListResultPreparer prepares a request to retrieve the next set of results.
7510// It returns nil if no more results exist.
7511func (iplr InstancePoolListResult) instancePoolListResultPreparer(ctx context.Context) (*http.Request, error) {
7512	if !iplr.hasNextLink() {
7513		return nil, nil
7514	}
7515	return autorest.Prepare((&http.Request{}).WithContext(ctx),
7516		autorest.AsJSON(),
7517		autorest.AsGet(),
7518		autorest.WithBaseURL(to.String(iplr.NextLink)))
7519}
7520
7521// InstancePoolListResultPage contains a page of InstancePool values.
7522type InstancePoolListResultPage struct {
7523	fn   func(context.Context, InstancePoolListResult) (InstancePoolListResult, error)
7524	iplr InstancePoolListResult
7525}
7526
7527// NextWithContext advances to the next page of values.  If there was an error making
7528// the request the page does not advance and the error is returned.
7529func (page *InstancePoolListResultPage) NextWithContext(ctx context.Context) (err error) {
7530	if tracing.IsEnabled() {
7531		ctx = tracing.StartSpan(ctx, fqdn+"/InstancePoolListResultPage.NextWithContext")
7532		defer func() {
7533			sc := -1
7534			if page.Response().Response.Response != nil {
7535				sc = page.Response().Response.Response.StatusCode
7536			}
7537			tracing.EndSpan(ctx, sc, err)
7538		}()
7539	}
7540	for {
7541		next, err := page.fn(ctx, page.iplr)
7542		if err != nil {
7543			return err
7544		}
7545		page.iplr = next
7546		if !next.hasNextLink() || !next.IsEmpty() {
7547			break
7548		}
7549	}
7550	return nil
7551}
7552
7553// Next advances to the next page of values.  If there was an error making
7554// the request the page does not advance and the error is returned.
7555// Deprecated: Use NextWithContext() instead.
7556func (page *InstancePoolListResultPage) Next() error {
7557	return page.NextWithContext(context.Background())
7558}
7559
7560// NotDone returns true if the page enumeration should be started or is not yet complete.
7561func (page InstancePoolListResultPage) NotDone() bool {
7562	return !page.iplr.IsEmpty()
7563}
7564
7565// Response returns the raw server response from the last page request.
7566func (page InstancePoolListResultPage) Response() InstancePoolListResult {
7567	return page.iplr
7568}
7569
7570// Values returns the slice of values for the current page or nil if there are no values.
7571func (page InstancePoolListResultPage) Values() []InstancePool {
7572	if page.iplr.IsEmpty() {
7573		return nil
7574	}
7575	return *page.iplr.Value
7576}
7577
7578// Creates a new instance of the InstancePoolListResultPage type.
7579func NewInstancePoolListResultPage(cur InstancePoolListResult, getNextPage func(context.Context, InstancePoolListResult) (InstancePoolListResult, error)) InstancePoolListResultPage {
7580	return InstancePoolListResultPage{
7581		fn:   getNextPage,
7582		iplr: cur,
7583	}
7584}
7585
7586// InstancePoolProperties properties of an instance pool.
7587type InstancePoolProperties struct {
7588	// SubnetID - Resource ID of the subnet to place this instance pool in.
7589	SubnetID *string `json:"subnetId,omitempty"`
7590	// VCores - Count of vCores belonging to this instance pool.
7591	VCores *int32 `json:"vCores,omitempty"`
7592	// 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'
7593	LicenseType InstancePoolLicenseType `json:"licenseType,omitempty"`
7594}
7595
7596// InstancePoolsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
7597// long-running operation.
7598type InstancePoolsCreateOrUpdateFuture struct {
7599	azure.FutureAPI
7600	// Result returns the result of the asynchronous operation.
7601	// If the operation has not completed it will return an error.
7602	Result func(InstancePoolsClient) (InstancePool, error)
7603}
7604
7605// UnmarshalJSON is the custom unmarshaller for CreateFuture.
7606func (future *InstancePoolsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
7607	var azFuture azure.Future
7608	if err := json.Unmarshal(body, &azFuture); err != nil {
7609		return err
7610	}
7611	future.FutureAPI = &azFuture
7612	future.Result = future.result
7613	return nil
7614}
7615
7616// result is the default implementation for InstancePoolsCreateOrUpdateFuture.Result.
7617func (future *InstancePoolsCreateOrUpdateFuture) result(client InstancePoolsClient) (IP InstancePool, err error) {
7618	var done bool
7619	done, err = future.DoneWithContext(context.Background(), client)
7620	if err != nil {
7621		err = autorest.NewErrorWithError(err, "sql.InstancePoolsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
7622		return
7623	}
7624	if !done {
7625		IP.Response.Response = future.Response()
7626		err = azure.NewAsyncOpIncompleteError("sql.InstancePoolsCreateOrUpdateFuture")
7627		return
7628	}
7629	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7630	if IP.Response.Response, err = future.GetResult(sender); err == nil && IP.Response.Response.StatusCode != http.StatusNoContent {
7631		IP, err = client.CreateOrUpdateResponder(IP.Response.Response)
7632		if err != nil {
7633			err = autorest.NewErrorWithError(err, "sql.InstancePoolsCreateOrUpdateFuture", "Result", IP.Response.Response, "Failure responding to request")
7634		}
7635	}
7636	return
7637}
7638
7639// InstancePoolsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
7640// operation.
7641type InstancePoolsDeleteFuture struct {
7642	azure.FutureAPI
7643	// Result returns the result of the asynchronous operation.
7644	// If the operation has not completed it will return an error.
7645	Result func(InstancePoolsClient) (autorest.Response, error)
7646}
7647
7648// UnmarshalJSON is the custom unmarshaller for CreateFuture.
7649func (future *InstancePoolsDeleteFuture) UnmarshalJSON(body []byte) error {
7650	var azFuture azure.Future
7651	if err := json.Unmarshal(body, &azFuture); err != nil {
7652		return err
7653	}
7654	future.FutureAPI = &azFuture
7655	future.Result = future.result
7656	return nil
7657}
7658
7659// result is the default implementation for InstancePoolsDeleteFuture.Result.
7660func (future *InstancePoolsDeleteFuture) result(client InstancePoolsClient) (ar autorest.Response, err error) {
7661	var done bool
7662	done, err = future.DoneWithContext(context.Background(), client)
7663	if err != nil {
7664		err = autorest.NewErrorWithError(err, "sql.InstancePoolsDeleteFuture", "Result", future.Response(), "Polling failure")
7665		return
7666	}
7667	if !done {
7668		ar.Response = future.Response()
7669		err = azure.NewAsyncOpIncompleteError("sql.InstancePoolsDeleteFuture")
7670		return
7671	}
7672	ar.Response = future.Response()
7673	return
7674}
7675
7676// InstancePoolsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
7677// operation.
7678type InstancePoolsUpdateFuture struct {
7679	azure.FutureAPI
7680	// Result returns the result of the asynchronous operation.
7681	// If the operation has not completed it will return an error.
7682	Result func(InstancePoolsClient) (InstancePool, error)
7683}
7684
7685// UnmarshalJSON is the custom unmarshaller for CreateFuture.
7686func (future *InstancePoolsUpdateFuture) UnmarshalJSON(body []byte) error {
7687	var azFuture azure.Future
7688	if err := json.Unmarshal(body, &azFuture); err != nil {
7689		return err
7690	}
7691	future.FutureAPI = &azFuture
7692	future.Result = future.result
7693	return nil
7694}
7695
7696// result is the default implementation for InstancePoolsUpdateFuture.Result.
7697func (future *InstancePoolsUpdateFuture) result(client InstancePoolsClient) (IP InstancePool, err error) {
7698	var done bool
7699	done, err = future.DoneWithContext(context.Background(), client)
7700	if err != nil {
7701		err = autorest.NewErrorWithError(err, "sql.InstancePoolsUpdateFuture", "Result", future.Response(), "Polling failure")
7702		return
7703	}
7704	if !done {
7705		IP.Response.Response = future.Response()
7706		err = azure.NewAsyncOpIncompleteError("sql.InstancePoolsUpdateFuture")
7707		return
7708	}
7709	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7710	if IP.Response.Response, err = future.GetResult(sender); err == nil && IP.Response.Response.StatusCode != http.StatusNoContent {
7711		IP, err = client.UpdateResponder(IP.Response.Response)
7712		if err != nil {
7713			err = autorest.NewErrorWithError(err, "sql.InstancePoolsUpdateFuture", "Result", IP.Response.Response, "Failure responding to request")
7714		}
7715	}
7716	return
7717}
7718
7719// InstancePoolUpdate an update to an Instance pool.
7720type InstancePoolUpdate struct {
7721	// Tags - Resource tags.
7722	Tags map[string]*string `json:"tags"`
7723}
7724
7725// MarshalJSON is the custom marshaler for InstancePoolUpdate.
7726func (ipu InstancePoolUpdate) MarshalJSON() ([]byte, error) {
7727	objectMap := make(map[string]interface{})
7728	if ipu.Tags != nil {
7729		objectMap["tags"] = ipu.Tags
7730	}
7731	return json.Marshal(objectMap)
7732}
7733
7734// InstancePoolVcoresCapability the managed instance virtual cores capability.
7735type InstancePoolVcoresCapability struct {
7736	// Name - READ-ONLY; The virtual cores identifier.
7737	Name *string `json:"name,omitempty"`
7738	// Value - READ-ONLY; The virtual cores value.
7739	Value *int32 `json:"value,omitempty"`
7740	// StorageLimit - READ-ONLY; Storage limit.
7741	StorageLimit *MaxSizeCapability `json:"storageLimit,omitempty"`
7742	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
7743	Status CapabilityStatus `json:"status,omitempty"`
7744	// Reason - The reason for the capability not being available.
7745	Reason *string `json:"reason,omitempty"`
7746}
7747
7748// MarshalJSON is the custom marshaler for InstancePoolVcoresCapability.
7749func (ipvc InstancePoolVcoresCapability) MarshalJSON() ([]byte, error) {
7750	objectMap := make(map[string]interface{})
7751	if ipvc.Reason != nil {
7752		objectMap["reason"] = ipvc.Reason
7753	}
7754	return json.Marshal(objectMap)
7755}
7756
7757// Job a job.
7758type Job struct {
7759	autorest.Response `json:"-"`
7760	// JobProperties - Resource properties.
7761	*JobProperties `json:"properties,omitempty"`
7762	// ID - READ-ONLY; Resource ID.
7763	ID *string `json:"id,omitempty"`
7764	// Name - READ-ONLY; Resource name.
7765	Name *string `json:"name,omitempty"`
7766	// Type - READ-ONLY; Resource type.
7767	Type *string `json:"type,omitempty"`
7768}
7769
7770// MarshalJSON is the custom marshaler for Job.
7771func (j Job) MarshalJSON() ([]byte, error) {
7772	objectMap := make(map[string]interface{})
7773	if j.JobProperties != nil {
7774		objectMap["properties"] = j.JobProperties
7775	}
7776	return json.Marshal(objectMap)
7777}
7778
7779// UnmarshalJSON is the custom unmarshaler for Job struct.
7780func (j *Job) UnmarshalJSON(body []byte) error {
7781	var m map[string]*json.RawMessage
7782	err := json.Unmarshal(body, &m)
7783	if err != nil {
7784		return err
7785	}
7786	for k, v := range m {
7787		switch k {
7788		case "properties":
7789			if v != nil {
7790				var jobProperties JobProperties
7791				err = json.Unmarshal(*v, &jobProperties)
7792				if err != nil {
7793					return err
7794				}
7795				j.JobProperties = &jobProperties
7796			}
7797		case "id":
7798			if v != nil {
7799				var ID string
7800				err = json.Unmarshal(*v, &ID)
7801				if err != nil {
7802					return err
7803				}
7804				j.ID = &ID
7805			}
7806		case "name":
7807			if v != nil {
7808				var name string
7809				err = json.Unmarshal(*v, &name)
7810				if err != nil {
7811					return err
7812				}
7813				j.Name = &name
7814			}
7815		case "type":
7816			if v != nil {
7817				var typeVar string
7818				err = json.Unmarshal(*v, &typeVar)
7819				if err != nil {
7820					return err
7821				}
7822				j.Type = &typeVar
7823			}
7824		}
7825	}
7826
7827	return nil
7828}
7829
7830// JobAgent an Azure SQL job agent.
7831type JobAgent struct {
7832	autorest.Response `json:"-"`
7833	// Sku - The name and tier of the SKU.
7834	Sku *Sku `json:"sku,omitempty"`
7835	// JobAgentProperties - Resource properties.
7836	*JobAgentProperties `json:"properties,omitempty"`
7837	// Location - Resource location.
7838	Location *string `json:"location,omitempty"`
7839	// Tags - Resource tags.
7840	Tags map[string]*string `json:"tags"`
7841	// ID - READ-ONLY; Resource ID.
7842	ID *string `json:"id,omitempty"`
7843	// Name - READ-ONLY; Resource name.
7844	Name *string `json:"name,omitempty"`
7845	// Type - READ-ONLY; Resource type.
7846	Type *string `json:"type,omitempty"`
7847}
7848
7849// MarshalJSON is the custom marshaler for JobAgent.
7850func (ja JobAgent) MarshalJSON() ([]byte, error) {
7851	objectMap := make(map[string]interface{})
7852	if ja.Sku != nil {
7853		objectMap["sku"] = ja.Sku
7854	}
7855	if ja.JobAgentProperties != nil {
7856		objectMap["properties"] = ja.JobAgentProperties
7857	}
7858	if ja.Location != nil {
7859		objectMap["location"] = ja.Location
7860	}
7861	if ja.Tags != nil {
7862		objectMap["tags"] = ja.Tags
7863	}
7864	return json.Marshal(objectMap)
7865}
7866
7867// UnmarshalJSON is the custom unmarshaler for JobAgent struct.
7868func (ja *JobAgent) UnmarshalJSON(body []byte) error {
7869	var m map[string]*json.RawMessage
7870	err := json.Unmarshal(body, &m)
7871	if err != nil {
7872		return err
7873	}
7874	for k, v := range m {
7875		switch k {
7876		case "sku":
7877			if v != nil {
7878				var sku Sku
7879				err = json.Unmarshal(*v, &sku)
7880				if err != nil {
7881					return err
7882				}
7883				ja.Sku = &sku
7884			}
7885		case "properties":
7886			if v != nil {
7887				var jobAgentProperties JobAgentProperties
7888				err = json.Unmarshal(*v, &jobAgentProperties)
7889				if err != nil {
7890					return err
7891				}
7892				ja.JobAgentProperties = &jobAgentProperties
7893			}
7894		case "location":
7895			if v != nil {
7896				var location string
7897				err = json.Unmarshal(*v, &location)
7898				if err != nil {
7899					return err
7900				}
7901				ja.Location = &location
7902			}
7903		case "tags":
7904			if v != nil {
7905				var tags map[string]*string
7906				err = json.Unmarshal(*v, &tags)
7907				if err != nil {
7908					return err
7909				}
7910				ja.Tags = tags
7911			}
7912		case "id":
7913			if v != nil {
7914				var ID string
7915				err = json.Unmarshal(*v, &ID)
7916				if err != nil {
7917					return err
7918				}
7919				ja.ID = &ID
7920			}
7921		case "name":
7922			if v != nil {
7923				var name string
7924				err = json.Unmarshal(*v, &name)
7925				if err != nil {
7926					return err
7927				}
7928				ja.Name = &name
7929			}
7930		case "type":
7931			if v != nil {
7932				var typeVar string
7933				err = json.Unmarshal(*v, &typeVar)
7934				if err != nil {
7935					return err
7936				}
7937				ja.Type = &typeVar
7938			}
7939		}
7940	}
7941
7942	return nil
7943}
7944
7945// JobAgentListResult a list of Azure SQL job agents.
7946type JobAgentListResult struct {
7947	autorest.Response `json:"-"`
7948	// Value - READ-ONLY; Array of results.
7949	Value *[]JobAgent `json:"value,omitempty"`
7950	// NextLink - READ-ONLY; Link to retrieve next page of results.
7951	NextLink *string `json:"nextLink,omitempty"`
7952}
7953
7954// MarshalJSON is the custom marshaler for JobAgentListResult.
7955func (jalr JobAgentListResult) MarshalJSON() ([]byte, error) {
7956	objectMap := make(map[string]interface{})
7957	return json.Marshal(objectMap)
7958}
7959
7960// JobAgentListResultIterator provides access to a complete listing of JobAgent values.
7961type JobAgentListResultIterator struct {
7962	i    int
7963	page JobAgentListResultPage
7964}
7965
7966// NextWithContext advances to the next value.  If there was an error making
7967// the request the iterator does not advance and the error is returned.
7968func (iter *JobAgentListResultIterator) NextWithContext(ctx context.Context) (err error) {
7969	if tracing.IsEnabled() {
7970		ctx = tracing.StartSpan(ctx, fqdn+"/JobAgentListResultIterator.NextWithContext")
7971		defer func() {
7972			sc := -1
7973			if iter.Response().Response.Response != nil {
7974				sc = iter.Response().Response.Response.StatusCode
7975			}
7976			tracing.EndSpan(ctx, sc, err)
7977		}()
7978	}
7979	iter.i++
7980	if iter.i < len(iter.page.Values()) {
7981		return nil
7982	}
7983	err = iter.page.NextWithContext(ctx)
7984	if err != nil {
7985		iter.i--
7986		return err
7987	}
7988	iter.i = 0
7989	return nil
7990}
7991
7992// Next advances to the next value.  If there was an error making
7993// the request the iterator does not advance and the error is returned.
7994// Deprecated: Use NextWithContext() instead.
7995func (iter *JobAgentListResultIterator) Next() error {
7996	return iter.NextWithContext(context.Background())
7997}
7998
7999// NotDone returns true if the enumeration should be started or is not yet complete.
8000func (iter JobAgentListResultIterator) NotDone() bool {
8001	return iter.page.NotDone() && iter.i < len(iter.page.Values())
8002}
8003
8004// Response returns the raw server response from the last page request.
8005func (iter JobAgentListResultIterator) Response() JobAgentListResult {
8006	return iter.page.Response()
8007}
8008
8009// Value returns the current value or a zero-initialized value if the
8010// iterator has advanced beyond the end of the collection.
8011func (iter JobAgentListResultIterator) Value() JobAgent {
8012	if !iter.page.NotDone() {
8013		return JobAgent{}
8014	}
8015	return iter.page.Values()[iter.i]
8016}
8017
8018// Creates a new instance of the JobAgentListResultIterator type.
8019func NewJobAgentListResultIterator(page JobAgentListResultPage) JobAgentListResultIterator {
8020	return JobAgentListResultIterator{page: page}
8021}
8022
8023// IsEmpty returns true if the ListResult contains no values.
8024func (jalr JobAgentListResult) IsEmpty() bool {
8025	return jalr.Value == nil || len(*jalr.Value) == 0
8026}
8027
8028// hasNextLink returns true if the NextLink is not empty.
8029func (jalr JobAgentListResult) hasNextLink() bool {
8030	return jalr.NextLink != nil && len(*jalr.NextLink) != 0
8031}
8032
8033// jobAgentListResultPreparer prepares a request to retrieve the next set of results.
8034// It returns nil if no more results exist.
8035func (jalr JobAgentListResult) jobAgentListResultPreparer(ctx context.Context) (*http.Request, error) {
8036	if !jalr.hasNextLink() {
8037		return nil, nil
8038	}
8039	return autorest.Prepare((&http.Request{}).WithContext(ctx),
8040		autorest.AsJSON(),
8041		autorest.AsGet(),
8042		autorest.WithBaseURL(to.String(jalr.NextLink)))
8043}
8044
8045// JobAgentListResultPage contains a page of JobAgent values.
8046type JobAgentListResultPage struct {
8047	fn   func(context.Context, JobAgentListResult) (JobAgentListResult, error)
8048	jalr JobAgentListResult
8049}
8050
8051// NextWithContext advances to the next page of values.  If there was an error making
8052// the request the page does not advance and the error is returned.
8053func (page *JobAgentListResultPage) NextWithContext(ctx context.Context) (err error) {
8054	if tracing.IsEnabled() {
8055		ctx = tracing.StartSpan(ctx, fqdn+"/JobAgentListResultPage.NextWithContext")
8056		defer func() {
8057			sc := -1
8058			if page.Response().Response.Response != nil {
8059				sc = page.Response().Response.Response.StatusCode
8060			}
8061			tracing.EndSpan(ctx, sc, err)
8062		}()
8063	}
8064	for {
8065		next, err := page.fn(ctx, page.jalr)
8066		if err != nil {
8067			return err
8068		}
8069		page.jalr = next
8070		if !next.hasNextLink() || !next.IsEmpty() {
8071			break
8072		}
8073	}
8074	return nil
8075}
8076
8077// Next advances to the next page of values.  If there was an error making
8078// the request the page does not advance and the error is returned.
8079// Deprecated: Use NextWithContext() instead.
8080func (page *JobAgentListResultPage) Next() error {
8081	return page.NextWithContext(context.Background())
8082}
8083
8084// NotDone returns true if the page enumeration should be started or is not yet complete.
8085func (page JobAgentListResultPage) NotDone() bool {
8086	return !page.jalr.IsEmpty()
8087}
8088
8089// Response returns the raw server response from the last page request.
8090func (page JobAgentListResultPage) Response() JobAgentListResult {
8091	return page.jalr
8092}
8093
8094// Values returns the slice of values for the current page or nil if there are no values.
8095func (page JobAgentListResultPage) Values() []JobAgent {
8096	if page.jalr.IsEmpty() {
8097		return nil
8098	}
8099	return *page.jalr.Value
8100}
8101
8102// Creates a new instance of the JobAgentListResultPage type.
8103func NewJobAgentListResultPage(cur JobAgentListResult, getNextPage func(context.Context, JobAgentListResult) (JobAgentListResult, error)) JobAgentListResultPage {
8104	return JobAgentListResultPage{
8105		fn:   getNextPage,
8106		jalr: cur,
8107	}
8108}
8109
8110// JobAgentProperties properties of a job agent.
8111type JobAgentProperties struct {
8112	// DatabaseID - Resource ID of the database to store job metadata in.
8113	DatabaseID *string `json:"databaseId,omitempty"`
8114	// State - READ-ONLY; The state of the job agent. Possible values include: 'JobAgentStateCreating', 'JobAgentStateReady', 'JobAgentStateUpdating', 'JobAgentStateDeleting', 'JobAgentStateDisabled'
8115	State JobAgentState `json:"state,omitempty"`
8116}
8117
8118// MarshalJSON is the custom marshaler for JobAgentProperties.
8119func (jap JobAgentProperties) MarshalJSON() ([]byte, error) {
8120	objectMap := make(map[string]interface{})
8121	if jap.DatabaseID != nil {
8122		objectMap["databaseId"] = jap.DatabaseID
8123	}
8124	return json.Marshal(objectMap)
8125}
8126
8127// JobAgentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
8128// operation.
8129type JobAgentsCreateOrUpdateFuture struct {
8130	azure.FutureAPI
8131	// Result returns the result of the asynchronous operation.
8132	// If the operation has not completed it will return an error.
8133	Result func(JobAgentsClient) (JobAgent, error)
8134}
8135
8136// UnmarshalJSON is the custom unmarshaller for CreateFuture.
8137func (future *JobAgentsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
8138	var azFuture azure.Future
8139	if err := json.Unmarshal(body, &azFuture); err != nil {
8140		return err
8141	}
8142	future.FutureAPI = &azFuture
8143	future.Result = future.result
8144	return nil
8145}
8146
8147// result is the default implementation for JobAgentsCreateOrUpdateFuture.Result.
8148func (future *JobAgentsCreateOrUpdateFuture) result(client JobAgentsClient) (ja JobAgent, err error) {
8149	var done bool
8150	done, err = future.DoneWithContext(context.Background(), client)
8151	if err != nil {
8152		err = autorest.NewErrorWithError(err, "sql.JobAgentsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
8153		return
8154	}
8155	if !done {
8156		ja.Response.Response = future.Response()
8157		err = azure.NewAsyncOpIncompleteError("sql.JobAgentsCreateOrUpdateFuture")
8158		return
8159	}
8160	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8161	if ja.Response.Response, err = future.GetResult(sender); err == nil && ja.Response.Response.StatusCode != http.StatusNoContent {
8162		ja, err = client.CreateOrUpdateResponder(ja.Response.Response)
8163		if err != nil {
8164			err = autorest.NewErrorWithError(err, "sql.JobAgentsCreateOrUpdateFuture", "Result", ja.Response.Response, "Failure responding to request")
8165		}
8166	}
8167	return
8168}
8169
8170// JobAgentsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
8171// operation.
8172type JobAgentsDeleteFuture struct {
8173	azure.FutureAPI
8174	// Result returns the result of the asynchronous operation.
8175	// If the operation has not completed it will return an error.
8176	Result func(JobAgentsClient) (autorest.Response, error)
8177}
8178
8179// UnmarshalJSON is the custom unmarshaller for CreateFuture.
8180func (future *JobAgentsDeleteFuture) UnmarshalJSON(body []byte) error {
8181	var azFuture azure.Future
8182	if err := json.Unmarshal(body, &azFuture); err != nil {
8183		return err
8184	}
8185	future.FutureAPI = &azFuture
8186	future.Result = future.result
8187	return nil
8188}
8189
8190// result is the default implementation for JobAgentsDeleteFuture.Result.
8191func (future *JobAgentsDeleteFuture) result(client JobAgentsClient) (ar autorest.Response, err error) {
8192	var done bool
8193	done, err = future.DoneWithContext(context.Background(), client)
8194	if err != nil {
8195		err = autorest.NewErrorWithError(err, "sql.JobAgentsDeleteFuture", "Result", future.Response(), "Polling failure")
8196		return
8197	}
8198	if !done {
8199		ar.Response = future.Response()
8200		err = azure.NewAsyncOpIncompleteError("sql.JobAgentsDeleteFuture")
8201		return
8202	}
8203	ar.Response = future.Response()
8204	return
8205}
8206
8207// JobAgentsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
8208// operation.
8209type JobAgentsUpdateFuture struct {
8210	azure.FutureAPI
8211	// Result returns the result of the asynchronous operation.
8212	// If the operation has not completed it will return an error.
8213	Result func(JobAgentsClient) (JobAgent, error)
8214}
8215
8216// UnmarshalJSON is the custom unmarshaller for CreateFuture.
8217func (future *JobAgentsUpdateFuture) UnmarshalJSON(body []byte) error {
8218	var azFuture azure.Future
8219	if err := json.Unmarshal(body, &azFuture); err != nil {
8220		return err
8221	}
8222	future.FutureAPI = &azFuture
8223	future.Result = future.result
8224	return nil
8225}
8226
8227// result is the default implementation for JobAgentsUpdateFuture.Result.
8228func (future *JobAgentsUpdateFuture) result(client JobAgentsClient) (ja JobAgent, err error) {
8229	var done bool
8230	done, err = future.DoneWithContext(context.Background(), client)
8231	if err != nil {
8232		err = autorest.NewErrorWithError(err, "sql.JobAgentsUpdateFuture", "Result", future.Response(), "Polling failure")
8233		return
8234	}
8235	if !done {
8236		ja.Response.Response = future.Response()
8237		err = azure.NewAsyncOpIncompleteError("sql.JobAgentsUpdateFuture")
8238		return
8239	}
8240	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8241	if ja.Response.Response, err = future.GetResult(sender); err == nil && ja.Response.Response.StatusCode != http.StatusNoContent {
8242		ja, err = client.UpdateResponder(ja.Response.Response)
8243		if err != nil {
8244			err = autorest.NewErrorWithError(err, "sql.JobAgentsUpdateFuture", "Result", ja.Response.Response, "Failure responding to request")
8245		}
8246	}
8247	return
8248}
8249
8250// JobAgentUpdate an update to an Azure SQL job agent.
8251type JobAgentUpdate struct {
8252	// Tags - Resource tags.
8253	Tags map[string]*string `json:"tags"`
8254}
8255
8256// MarshalJSON is the custom marshaler for JobAgentUpdate.
8257func (jau JobAgentUpdate) MarshalJSON() ([]byte, error) {
8258	objectMap := make(map[string]interface{})
8259	if jau.Tags != nil {
8260		objectMap["tags"] = jau.Tags
8261	}
8262	return json.Marshal(objectMap)
8263}
8264
8265// JobCredential a stored credential that can be used by a job to connect to target databases.
8266type JobCredential struct {
8267	autorest.Response `json:"-"`
8268	// JobCredentialProperties - Resource properties.
8269	*JobCredentialProperties `json:"properties,omitempty"`
8270	// ID - READ-ONLY; Resource ID.
8271	ID *string `json:"id,omitempty"`
8272	// Name - READ-ONLY; Resource name.
8273	Name *string `json:"name,omitempty"`
8274	// Type - READ-ONLY; Resource type.
8275	Type *string `json:"type,omitempty"`
8276}
8277
8278// MarshalJSON is the custom marshaler for JobCredential.
8279func (jc JobCredential) MarshalJSON() ([]byte, error) {
8280	objectMap := make(map[string]interface{})
8281	if jc.JobCredentialProperties != nil {
8282		objectMap["properties"] = jc.JobCredentialProperties
8283	}
8284	return json.Marshal(objectMap)
8285}
8286
8287// UnmarshalJSON is the custom unmarshaler for JobCredential struct.
8288func (jc *JobCredential) UnmarshalJSON(body []byte) error {
8289	var m map[string]*json.RawMessage
8290	err := json.Unmarshal(body, &m)
8291	if err != nil {
8292		return err
8293	}
8294	for k, v := range m {
8295		switch k {
8296		case "properties":
8297			if v != nil {
8298				var jobCredentialProperties JobCredentialProperties
8299				err = json.Unmarshal(*v, &jobCredentialProperties)
8300				if err != nil {
8301					return err
8302				}
8303				jc.JobCredentialProperties = &jobCredentialProperties
8304			}
8305		case "id":
8306			if v != nil {
8307				var ID string
8308				err = json.Unmarshal(*v, &ID)
8309				if err != nil {
8310					return err
8311				}
8312				jc.ID = &ID
8313			}
8314		case "name":
8315			if v != nil {
8316				var name string
8317				err = json.Unmarshal(*v, &name)
8318				if err != nil {
8319					return err
8320				}
8321				jc.Name = &name
8322			}
8323		case "type":
8324			if v != nil {
8325				var typeVar string
8326				err = json.Unmarshal(*v, &typeVar)
8327				if err != nil {
8328					return err
8329				}
8330				jc.Type = &typeVar
8331			}
8332		}
8333	}
8334
8335	return nil
8336}
8337
8338// JobCredentialListResult a list of job credentials.
8339type JobCredentialListResult struct {
8340	autorest.Response `json:"-"`
8341	// Value - READ-ONLY; Array of results.
8342	Value *[]JobCredential `json:"value,omitempty"`
8343	// NextLink - READ-ONLY; Link to retrieve next page of results.
8344	NextLink *string `json:"nextLink,omitempty"`
8345}
8346
8347// MarshalJSON is the custom marshaler for JobCredentialListResult.
8348func (jclr JobCredentialListResult) MarshalJSON() ([]byte, error) {
8349	objectMap := make(map[string]interface{})
8350	return json.Marshal(objectMap)
8351}
8352
8353// JobCredentialListResultIterator provides access to a complete listing of JobCredential values.
8354type JobCredentialListResultIterator struct {
8355	i    int
8356	page JobCredentialListResultPage
8357}
8358
8359// NextWithContext advances to the next value.  If there was an error making
8360// the request the iterator does not advance and the error is returned.
8361func (iter *JobCredentialListResultIterator) NextWithContext(ctx context.Context) (err error) {
8362	if tracing.IsEnabled() {
8363		ctx = tracing.StartSpan(ctx, fqdn+"/JobCredentialListResultIterator.NextWithContext")
8364		defer func() {
8365			sc := -1
8366			if iter.Response().Response.Response != nil {
8367				sc = iter.Response().Response.Response.StatusCode
8368			}
8369			tracing.EndSpan(ctx, sc, err)
8370		}()
8371	}
8372	iter.i++
8373	if iter.i < len(iter.page.Values()) {
8374		return nil
8375	}
8376	err = iter.page.NextWithContext(ctx)
8377	if err != nil {
8378		iter.i--
8379		return err
8380	}
8381	iter.i = 0
8382	return nil
8383}
8384
8385// Next advances to the next value.  If there was an error making
8386// the request the iterator does not advance and the error is returned.
8387// Deprecated: Use NextWithContext() instead.
8388func (iter *JobCredentialListResultIterator) Next() error {
8389	return iter.NextWithContext(context.Background())
8390}
8391
8392// NotDone returns true if the enumeration should be started or is not yet complete.
8393func (iter JobCredentialListResultIterator) NotDone() bool {
8394	return iter.page.NotDone() && iter.i < len(iter.page.Values())
8395}
8396
8397// Response returns the raw server response from the last page request.
8398func (iter JobCredentialListResultIterator) Response() JobCredentialListResult {
8399	return iter.page.Response()
8400}
8401
8402// Value returns the current value or a zero-initialized value if the
8403// iterator has advanced beyond the end of the collection.
8404func (iter JobCredentialListResultIterator) Value() JobCredential {
8405	if !iter.page.NotDone() {
8406		return JobCredential{}
8407	}
8408	return iter.page.Values()[iter.i]
8409}
8410
8411// Creates a new instance of the JobCredentialListResultIterator type.
8412func NewJobCredentialListResultIterator(page JobCredentialListResultPage) JobCredentialListResultIterator {
8413	return JobCredentialListResultIterator{page: page}
8414}
8415
8416// IsEmpty returns true if the ListResult contains no values.
8417func (jclr JobCredentialListResult) IsEmpty() bool {
8418	return jclr.Value == nil || len(*jclr.Value) == 0
8419}
8420
8421// hasNextLink returns true if the NextLink is not empty.
8422func (jclr JobCredentialListResult) hasNextLink() bool {
8423	return jclr.NextLink != nil && len(*jclr.NextLink) != 0
8424}
8425
8426// jobCredentialListResultPreparer prepares a request to retrieve the next set of results.
8427// It returns nil if no more results exist.
8428func (jclr JobCredentialListResult) jobCredentialListResultPreparer(ctx context.Context) (*http.Request, error) {
8429	if !jclr.hasNextLink() {
8430		return nil, nil
8431	}
8432	return autorest.Prepare((&http.Request{}).WithContext(ctx),
8433		autorest.AsJSON(),
8434		autorest.AsGet(),
8435		autorest.WithBaseURL(to.String(jclr.NextLink)))
8436}
8437
8438// JobCredentialListResultPage contains a page of JobCredential values.
8439type JobCredentialListResultPage struct {
8440	fn   func(context.Context, JobCredentialListResult) (JobCredentialListResult, error)
8441	jclr JobCredentialListResult
8442}
8443
8444// NextWithContext advances to the next page of values.  If there was an error making
8445// the request the page does not advance and the error is returned.
8446func (page *JobCredentialListResultPage) NextWithContext(ctx context.Context) (err error) {
8447	if tracing.IsEnabled() {
8448		ctx = tracing.StartSpan(ctx, fqdn+"/JobCredentialListResultPage.NextWithContext")
8449		defer func() {
8450			sc := -1
8451			if page.Response().Response.Response != nil {
8452				sc = page.Response().Response.Response.StatusCode
8453			}
8454			tracing.EndSpan(ctx, sc, err)
8455		}()
8456	}
8457	for {
8458		next, err := page.fn(ctx, page.jclr)
8459		if err != nil {
8460			return err
8461		}
8462		page.jclr = next
8463		if !next.hasNextLink() || !next.IsEmpty() {
8464			break
8465		}
8466	}
8467	return nil
8468}
8469
8470// Next advances to the next page of values.  If there was an error making
8471// the request the page does not advance and the error is returned.
8472// Deprecated: Use NextWithContext() instead.
8473func (page *JobCredentialListResultPage) Next() error {
8474	return page.NextWithContext(context.Background())
8475}
8476
8477// NotDone returns true if the page enumeration should be started or is not yet complete.
8478func (page JobCredentialListResultPage) NotDone() bool {
8479	return !page.jclr.IsEmpty()
8480}
8481
8482// Response returns the raw server response from the last page request.
8483func (page JobCredentialListResultPage) Response() JobCredentialListResult {
8484	return page.jclr
8485}
8486
8487// Values returns the slice of values for the current page or nil if there are no values.
8488func (page JobCredentialListResultPage) Values() []JobCredential {
8489	if page.jclr.IsEmpty() {
8490		return nil
8491	}
8492	return *page.jclr.Value
8493}
8494
8495// Creates a new instance of the JobCredentialListResultPage type.
8496func NewJobCredentialListResultPage(cur JobCredentialListResult, getNextPage func(context.Context, JobCredentialListResult) (JobCredentialListResult, error)) JobCredentialListResultPage {
8497	return JobCredentialListResultPage{
8498		fn:   getNextPage,
8499		jclr: cur,
8500	}
8501}
8502
8503// JobCredentialProperties properties of a job credential.
8504type JobCredentialProperties struct {
8505	// Username - The credential user name.
8506	Username *string `json:"username,omitempty"`
8507	// Password - The credential password.
8508	Password *string `json:"password,omitempty"`
8509}
8510
8511// JobExecution an execution of a job
8512type JobExecution struct {
8513	autorest.Response `json:"-"`
8514	// JobExecutionProperties - Resource properties.
8515	*JobExecutionProperties `json:"properties,omitempty"`
8516	// ID - READ-ONLY; Resource ID.
8517	ID *string `json:"id,omitempty"`
8518	// Name - READ-ONLY; Resource name.
8519	Name *string `json:"name,omitempty"`
8520	// Type - READ-ONLY; Resource type.
8521	Type *string `json:"type,omitempty"`
8522}
8523
8524// MarshalJSON is the custom marshaler for JobExecution.
8525func (je JobExecution) MarshalJSON() ([]byte, error) {
8526	objectMap := make(map[string]interface{})
8527	if je.JobExecutionProperties != nil {
8528		objectMap["properties"] = je.JobExecutionProperties
8529	}
8530	return json.Marshal(objectMap)
8531}
8532
8533// UnmarshalJSON is the custom unmarshaler for JobExecution struct.
8534func (je *JobExecution) UnmarshalJSON(body []byte) error {
8535	var m map[string]*json.RawMessage
8536	err := json.Unmarshal(body, &m)
8537	if err != nil {
8538		return err
8539	}
8540	for k, v := range m {
8541		switch k {
8542		case "properties":
8543			if v != nil {
8544				var jobExecutionProperties JobExecutionProperties
8545				err = json.Unmarshal(*v, &jobExecutionProperties)
8546				if err != nil {
8547					return err
8548				}
8549				je.JobExecutionProperties = &jobExecutionProperties
8550			}
8551		case "id":
8552			if v != nil {
8553				var ID string
8554				err = json.Unmarshal(*v, &ID)
8555				if err != nil {
8556					return err
8557				}
8558				je.ID = &ID
8559			}
8560		case "name":
8561			if v != nil {
8562				var name string
8563				err = json.Unmarshal(*v, &name)
8564				if err != nil {
8565					return err
8566				}
8567				je.Name = &name
8568			}
8569		case "type":
8570			if v != nil {
8571				var typeVar string
8572				err = json.Unmarshal(*v, &typeVar)
8573				if err != nil {
8574					return err
8575				}
8576				je.Type = &typeVar
8577			}
8578		}
8579	}
8580
8581	return nil
8582}
8583
8584// JobExecutionListResult a list of job executions.
8585type JobExecutionListResult struct {
8586	autorest.Response `json:"-"`
8587	// Value - READ-ONLY; Array of results.
8588	Value *[]JobExecution `json:"value,omitempty"`
8589	// NextLink - READ-ONLY; Link to retrieve next page of results.
8590	NextLink *string `json:"nextLink,omitempty"`
8591}
8592
8593// MarshalJSON is the custom marshaler for JobExecutionListResult.
8594func (jelr JobExecutionListResult) MarshalJSON() ([]byte, error) {
8595	objectMap := make(map[string]interface{})
8596	return json.Marshal(objectMap)
8597}
8598
8599// JobExecutionListResultIterator provides access to a complete listing of JobExecution values.
8600type JobExecutionListResultIterator struct {
8601	i    int
8602	page JobExecutionListResultPage
8603}
8604
8605// NextWithContext advances to the next value.  If there was an error making
8606// the request the iterator does not advance and the error is returned.
8607func (iter *JobExecutionListResultIterator) NextWithContext(ctx context.Context) (err error) {
8608	if tracing.IsEnabled() {
8609		ctx = tracing.StartSpan(ctx, fqdn+"/JobExecutionListResultIterator.NextWithContext")
8610		defer func() {
8611			sc := -1
8612			if iter.Response().Response.Response != nil {
8613				sc = iter.Response().Response.Response.StatusCode
8614			}
8615			tracing.EndSpan(ctx, sc, err)
8616		}()
8617	}
8618	iter.i++
8619	if iter.i < len(iter.page.Values()) {
8620		return nil
8621	}
8622	err = iter.page.NextWithContext(ctx)
8623	if err != nil {
8624		iter.i--
8625		return err
8626	}
8627	iter.i = 0
8628	return nil
8629}
8630
8631// Next advances to the next value.  If there was an error making
8632// the request the iterator does not advance and the error is returned.
8633// Deprecated: Use NextWithContext() instead.
8634func (iter *JobExecutionListResultIterator) Next() error {
8635	return iter.NextWithContext(context.Background())
8636}
8637
8638// NotDone returns true if the enumeration should be started or is not yet complete.
8639func (iter JobExecutionListResultIterator) NotDone() bool {
8640	return iter.page.NotDone() && iter.i < len(iter.page.Values())
8641}
8642
8643// Response returns the raw server response from the last page request.
8644func (iter JobExecutionListResultIterator) Response() JobExecutionListResult {
8645	return iter.page.Response()
8646}
8647
8648// Value returns the current value or a zero-initialized value if the
8649// iterator has advanced beyond the end of the collection.
8650func (iter JobExecutionListResultIterator) Value() JobExecution {
8651	if !iter.page.NotDone() {
8652		return JobExecution{}
8653	}
8654	return iter.page.Values()[iter.i]
8655}
8656
8657// Creates a new instance of the JobExecutionListResultIterator type.
8658func NewJobExecutionListResultIterator(page JobExecutionListResultPage) JobExecutionListResultIterator {
8659	return JobExecutionListResultIterator{page: page}
8660}
8661
8662// IsEmpty returns true if the ListResult contains no values.
8663func (jelr JobExecutionListResult) IsEmpty() bool {
8664	return jelr.Value == nil || len(*jelr.Value) == 0
8665}
8666
8667// hasNextLink returns true if the NextLink is not empty.
8668func (jelr JobExecutionListResult) hasNextLink() bool {
8669	return jelr.NextLink != nil && len(*jelr.NextLink) != 0
8670}
8671
8672// jobExecutionListResultPreparer prepares a request to retrieve the next set of results.
8673// It returns nil if no more results exist.
8674func (jelr JobExecutionListResult) jobExecutionListResultPreparer(ctx context.Context) (*http.Request, error) {
8675	if !jelr.hasNextLink() {
8676		return nil, nil
8677	}
8678	return autorest.Prepare((&http.Request{}).WithContext(ctx),
8679		autorest.AsJSON(),
8680		autorest.AsGet(),
8681		autorest.WithBaseURL(to.String(jelr.NextLink)))
8682}
8683
8684// JobExecutionListResultPage contains a page of JobExecution values.
8685type JobExecutionListResultPage struct {
8686	fn   func(context.Context, JobExecutionListResult) (JobExecutionListResult, error)
8687	jelr JobExecutionListResult
8688}
8689
8690// NextWithContext advances to the next page of values.  If there was an error making
8691// the request the page does not advance and the error is returned.
8692func (page *JobExecutionListResultPage) NextWithContext(ctx context.Context) (err error) {
8693	if tracing.IsEnabled() {
8694		ctx = tracing.StartSpan(ctx, fqdn+"/JobExecutionListResultPage.NextWithContext")
8695		defer func() {
8696			sc := -1
8697			if page.Response().Response.Response != nil {
8698				sc = page.Response().Response.Response.StatusCode
8699			}
8700			tracing.EndSpan(ctx, sc, err)
8701		}()
8702	}
8703	for {
8704		next, err := page.fn(ctx, page.jelr)
8705		if err != nil {
8706			return err
8707		}
8708		page.jelr = next
8709		if !next.hasNextLink() || !next.IsEmpty() {
8710			break
8711		}
8712	}
8713	return nil
8714}
8715
8716// Next advances to the next page of values.  If there was an error making
8717// the request the page does not advance and the error is returned.
8718// Deprecated: Use NextWithContext() instead.
8719func (page *JobExecutionListResultPage) Next() error {
8720	return page.NextWithContext(context.Background())
8721}
8722
8723// NotDone returns true if the page enumeration should be started or is not yet complete.
8724func (page JobExecutionListResultPage) NotDone() bool {
8725	return !page.jelr.IsEmpty()
8726}
8727
8728// Response returns the raw server response from the last page request.
8729func (page JobExecutionListResultPage) Response() JobExecutionListResult {
8730	return page.jelr
8731}
8732
8733// Values returns the slice of values for the current page or nil if there are no values.
8734func (page JobExecutionListResultPage) Values() []JobExecution {
8735	if page.jelr.IsEmpty() {
8736		return nil
8737	}
8738	return *page.jelr.Value
8739}
8740
8741// Creates a new instance of the JobExecutionListResultPage type.
8742func NewJobExecutionListResultPage(cur JobExecutionListResult, getNextPage func(context.Context, JobExecutionListResult) (JobExecutionListResult, error)) JobExecutionListResultPage {
8743	return JobExecutionListResultPage{
8744		fn:   getNextPage,
8745		jelr: cur,
8746	}
8747}
8748
8749// JobExecutionProperties properties for an Azure SQL Database Elastic job execution.
8750type JobExecutionProperties struct {
8751	// JobVersion - READ-ONLY; The job version number.
8752	JobVersion *int32 `json:"jobVersion,omitempty"`
8753	// StepName - READ-ONLY; The job step name.
8754	StepName *string `json:"stepName,omitempty"`
8755	// StepID - READ-ONLY; The job step id.
8756	StepID *int32 `json:"stepId,omitempty"`
8757	// JobExecutionID - READ-ONLY; The unique identifier of the job execution.
8758	JobExecutionID *uuid.UUID `json:"jobExecutionId,omitempty"`
8759	// Lifecycle - READ-ONLY; The detailed state of the job execution. Possible values include: 'Created', 'InProgress', 'WaitingForChildJobExecutions', 'WaitingForRetry', 'Succeeded', 'SucceededWithSkipped', 'Failed', 'TimedOut', 'Canceled', 'Skipped'
8760	Lifecycle JobExecutionLifecycle `json:"lifecycle,omitempty"`
8761	// ProvisioningState - READ-ONLY; The ARM provisioning state of the job execution. Possible values include: 'ProvisioningStateCreated', 'ProvisioningStateInProgress', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled'
8762	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
8763	// CreateTime - READ-ONLY; The time that the job execution was created.
8764	CreateTime *date.Time `json:"createTime,omitempty"`
8765	// StartTime - READ-ONLY; The time that the job execution started.
8766	StartTime *date.Time `json:"startTime,omitempty"`
8767	// EndTime - READ-ONLY; The time that the job execution completed.
8768	EndTime *date.Time `json:"endTime,omitempty"`
8769	// CurrentAttempts - Number of times the job execution has been attempted.
8770	CurrentAttempts *int32 `json:"currentAttempts,omitempty"`
8771	// CurrentAttemptStartTime - READ-ONLY; Start time of the current attempt.
8772	CurrentAttemptStartTime *date.Time `json:"currentAttemptStartTime,omitempty"`
8773	// LastMessage - READ-ONLY; The last status or error message.
8774	LastMessage *string `json:"lastMessage,omitempty"`
8775	// Target - READ-ONLY; The target that this execution is executed on.
8776	Target *JobExecutionTarget `json:"target,omitempty"`
8777}
8778
8779// MarshalJSON is the custom marshaler for JobExecutionProperties.
8780func (jep JobExecutionProperties) MarshalJSON() ([]byte, error) {
8781	objectMap := make(map[string]interface{})
8782	if jep.CurrentAttempts != nil {
8783		objectMap["currentAttempts"] = jep.CurrentAttempts
8784	}
8785	return json.Marshal(objectMap)
8786}
8787
8788// JobExecutionsCreateFuture an abstraction for monitoring and retrieving the results of a long-running
8789// operation.
8790type JobExecutionsCreateFuture struct {
8791	azure.FutureAPI
8792	// Result returns the result of the asynchronous operation.
8793	// If the operation has not completed it will return an error.
8794	Result func(JobExecutionsClient) (JobExecution, error)
8795}
8796
8797// UnmarshalJSON is the custom unmarshaller for CreateFuture.
8798func (future *JobExecutionsCreateFuture) UnmarshalJSON(body []byte) error {
8799	var azFuture azure.Future
8800	if err := json.Unmarshal(body, &azFuture); err != nil {
8801		return err
8802	}
8803	future.FutureAPI = &azFuture
8804	future.Result = future.result
8805	return nil
8806}
8807
8808// result is the default implementation for JobExecutionsCreateFuture.Result.
8809func (future *JobExecutionsCreateFuture) result(client JobExecutionsClient) (je JobExecution, err error) {
8810	var done bool
8811	done, err = future.DoneWithContext(context.Background(), client)
8812	if err != nil {
8813		err = autorest.NewErrorWithError(err, "sql.JobExecutionsCreateFuture", "Result", future.Response(), "Polling failure")
8814		return
8815	}
8816	if !done {
8817		je.Response.Response = future.Response()
8818		err = azure.NewAsyncOpIncompleteError("sql.JobExecutionsCreateFuture")
8819		return
8820	}
8821	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8822	if je.Response.Response, err = future.GetResult(sender); err == nil && je.Response.Response.StatusCode != http.StatusNoContent {
8823		je, err = client.CreateResponder(je.Response.Response)
8824		if err != nil {
8825			err = autorest.NewErrorWithError(err, "sql.JobExecutionsCreateFuture", "Result", je.Response.Response, "Failure responding to request")
8826		}
8827	}
8828	return
8829}
8830
8831// JobExecutionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
8832// long-running operation.
8833type JobExecutionsCreateOrUpdateFuture struct {
8834	azure.FutureAPI
8835	// Result returns the result of the asynchronous operation.
8836	// If the operation has not completed it will return an error.
8837	Result func(JobExecutionsClient) (JobExecution, error)
8838}
8839
8840// UnmarshalJSON is the custom unmarshaller for CreateFuture.
8841func (future *JobExecutionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
8842	var azFuture azure.Future
8843	if err := json.Unmarshal(body, &azFuture); err != nil {
8844		return err
8845	}
8846	future.FutureAPI = &azFuture
8847	future.Result = future.result
8848	return nil
8849}
8850
8851// result is the default implementation for JobExecutionsCreateOrUpdateFuture.Result.
8852func (future *JobExecutionsCreateOrUpdateFuture) result(client JobExecutionsClient) (je JobExecution, err error) {
8853	var done bool
8854	done, err = future.DoneWithContext(context.Background(), client)
8855	if err != nil {
8856		err = autorest.NewErrorWithError(err, "sql.JobExecutionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
8857		return
8858	}
8859	if !done {
8860		je.Response.Response = future.Response()
8861		err = azure.NewAsyncOpIncompleteError("sql.JobExecutionsCreateOrUpdateFuture")
8862		return
8863	}
8864	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8865	if je.Response.Response, err = future.GetResult(sender); err == nil && je.Response.Response.StatusCode != http.StatusNoContent {
8866		je, err = client.CreateOrUpdateResponder(je.Response.Response)
8867		if err != nil {
8868			err = autorest.NewErrorWithError(err, "sql.JobExecutionsCreateOrUpdateFuture", "Result", je.Response.Response, "Failure responding to request")
8869		}
8870	}
8871	return
8872}
8873
8874// JobExecutionTarget the target that a job execution is executed on.
8875type JobExecutionTarget struct {
8876	// Type - READ-ONLY; The type of the target. Possible values include: 'JobTargetTypeTargetGroup', 'JobTargetTypeSQLDatabase', 'JobTargetTypeSQLElasticPool', 'JobTargetTypeSQLShardMap', 'JobTargetTypeSQLServer'
8877	Type JobTargetType `json:"type,omitempty"`
8878	// ServerName - READ-ONLY; The server name.
8879	ServerName *string `json:"serverName,omitempty"`
8880	// DatabaseName - READ-ONLY; The database name.
8881	DatabaseName *string `json:"databaseName,omitempty"`
8882}
8883
8884// MarshalJSON is the custom marshaler for JobExecutionTarget.
8885func (jet JobExecutionTarget) MarshalJSON() ([]byte, error) {
8886	objectMap := make(map[string]interface{})
8887	return json.Marshal(objectMap)
8888}
8889
8890// JobListResult a list of jobs.
8891type JobListResult struct {
8892	autorest.Response `json:"-"`
8893	// Value - READ-ONLY; Array of results.
8894	Value *[]Job `json:"value,omitempty"`
8895	// NextLink - READ-ONLY; Link to retrieve next page of results.
8896	NextLink *string `json:"nextLink,omitempty"`
8897}
8898
8899// MarshalJSON is the custom marshaler for JobListResult.
8900func (jlr JobListResult) MarshalJSON() ([]byte, error) {
8901	objectMap := make(map[string]interface{})
8902	return json.Marshal(objectMap)
8903}
8904
8905// JobListResultIterator provides access to a complete listing of Job values.
8906type JobListResultIterator struct {
8907	i    int
8908	page JobListResultPage
8909}
8910
8911// NextWithContext advances to the next value.  If there was an error making
8912// the request the iterator does not advance and the error is returned.
8913func (iter *JobListResultIterator) NextWithContext(ctx context.Context) (err error) {
8914	if tracing.IsEnabled() {
8915		ctx = tracing.StartSpan(ctx, fqdn+"/JobListResultIterator.NextWithContext")
8916		defer func() {
8917			sc := -1
8918			if iter.Response().Response.Response != nil {
8919				sc = iter.Response().Response.Response.StatusCode
8920			}
8921			tracing.EndSpan(ctx, sc, err)
8922		}()
8923	}
8924	iter.i++
8925	if iter.i < len(iter.page.Values()) {
8926		return nil
8927	}
8928	err = iter.page.NextWithContext(ctx)
8929	if err != nil {
8930		iter.i--
8931		return err
8932	}
8933	iter.i = 0
8934	return nil
8935}
8936
8937// Next advances to the next value.  If there was an error making
8938// the request the iterator does not advance and the error is returned.
8939// Deprecated: Use NextWithContext() instead.
8940func (iter *JobListResultIterator) Next() error {
8941	return iter.NextWithContext(context.Background())
8942}
8943
8944// NotDone returns true if the enumeration should be started or is not yet complete.
8945func (iter JobListResultIterator) NotDone() bool {
8946	return iter.page.NotDone() && iter.i < len(iter.page.Values())
8947}
8948
8949// Response returns the raw server response from the last page request.
8950func (iter JobListResultIterator) Response() JobListResult {
8951	return iter.page.Response()
8952}
8953
8954// Value returns the current value or a zero-initialized value if the
8955// iterator has advanced beyond the end of the collection.
8956func (iter JobListResultIterator) Value() Job {
8957	if !iter.page.NotDone() {
8958		return Job{}
8959	}
8960	return iter.page.Values()[iter.i]
8961}
8962
8963// Creates a new instance of the JobListResultIterator type.
8964func NewJobListResultIterator(page JobListResultPage) JobListResultIterator {
8965	return JobListResultIterator{page: page}
8966}
8967
8968// IsEmpty returns true if the ListResult contains no values.
8969func (jlr JobListResult) IsEmpty() bool {
8970	return jlr.Value == nil || len(*jlr.Value) == 0
8971}
8972
8973// hasNextLink returns true if the NextLink is not empty.
8974func (jlr JobListResult) hasNextLink() bool {
8975	return jlr.NextLink != nil && len(*jlr.NextLink) != 0
8976}
8977
8978// jobListResultPreparer prepares a request to retrieve the next set of results.
8979// It returns nil if no more results exist.
8980func (jlr JobListResult) jobListResultPreparer(ctx context.Context) (*http.Request, error) {
8981	if !jlr.hasNextLink() {
8982		return nil, nil
8983	}
8984	return autorest.Prepare((&http.Request{}).WithContext(ctx),
8985		autorest.AsJSON(),
8986		autorest.AsGet(),
8987		autorest.WithBaseURL(to.String(jlr.NextLink)))
8988}
8989
8990// JobListResultPage contains a page of Job values.
8991type JobListResultPage struct {
8992	fn  func(context.Context, JobListResult) (JobListResult, error)
8993	jlr JobListResult
8994}
8995
8996// NextWithContext advances to the next page of values.  If there was an error making
8997// the request the page does not advance and the error is returned.
8998func (page *JobListResultPage) NextWithContext(ctx context.Context) (err error) {
8999	if tracing.IsEnabled() {
9000		ctx = tracing.StartSpan(ctx, fqdn+"/JobListResultPage.NextWithContext")
9001		defer func() {
9002			sc := -1
9003			if page.Response().Response.Response != nil {
9004				sc = page.Response().Response.Response.StatusCode
9005			}
9006			tracing.EndSpan(ctx, sc, err)
9007		}()
9008	}
9009	for {
9010		next, err := page.fn(ctx, page.jlr)
9011		if err != nil {
9012			return err
9013		}
9014		page.jlr = next
9015		if !next.hasNextLink() || !next.IsEmpty() {
9016			break
9017		}
9018	}
9019	return nil
9020}
9021
9022// Next advances to the next page of values.  If there was an error making
9023// the request the page does not advance and the error is returned.
9024// Deprecated: Use NextWithContext() instead.
9025func (page *JobListResultPage) Next() error {
9026	return page.NextWithContext(context.Background())
9027}
9028
9029// NotDone returns true if the page enumeration should be started or is not yet complete.
9030func (page JobListResultPage) NotDone() bool {
9031	return !page.jlr.IsEmpty()
9032}
9033
9034// Response returns the raw server response from the last page request.
9035func (page JobListResultPage) Response() JobListResult {
9036	return page.jlr
9037}
9038
9039// Values returns the slice of values for the current page or nil if there are no values.
9040func (page JobListResultPage) Values() []Job {
9041	if page.jlr.IsEmpty() {
9042		return nil
9043	}
9044	return *page.jlr.Value
9045}
9046
9047// Creates a new instance of the JobListResultPage type.
9048func NewJobListResultPage(cur JobListResult, getNextPage func(context.Context, JobListResult) (JobListResult, error)) JobListResultPage {
9049	return JobListResultPage{
9050		fn:  getNextPage,
9051		jlr: cur,
9052	}
9053}
9054
9055// JobProperties properties of a job.
9056type JobProperties struct {
9057	// Description - User-defined description of the job.
9058	Description *string `json:"description,omitempty"`
9059	// Version - READ-ONLY; The job version number.
9060	Version *int32 `json:"version,omitempty"`
9061	// Schedule - Schedule properties of the job.
9062	Schedule *JobSchedule `json:"schedule,omitempty"`
9063}
9064
9065// MarshalJSON is the custom marshaler for JobProperties.
9066func (jp JobProperties) MarshalJSON() ([]byte, error) {
9067	objectMap := make(map[string]interface{})
9068	if jp.Description != nil {
9069		objectMap["description"] = jp.Description
9070	}
9071	if jp.Schedule != nil {
9072		objectMap["schedule"] = jp.Schedule
9073	}
9074	return json.Marshal(objectMap)
9075}
9076
9077// JobSchedule scheduling properties of a job.
9078type JobSchedule struct {
9079	// StartTime - Schedule start time.
9080	StartTime *date.Time `json:"startTime,omitempty"`
9081	// EndTime - Schedule end time.
9082	EndTime *date.Time `json:"endTime,omitempty"`
9083	// Type - Schedule interval type. Possible values include: 'Once', 'Recurring'
9084	Type JobScheduleType `json:"type,omitempty"`
9085	// Enabled - Whether or not the schedule is enabled.
9086	Enabled *bool `json:"enabled,omitempty"`
9087	// Interval - Value of the schedule's recurring interval, if the schedule type is recurring. ISO8601 duration format.
9088	Interval *string `json:"interval,omitempty"`
9089}
9090
9091// JobStep a job step.
9092type JobStep struct {
9093	autorest.Response `json:"-"`
9094	// JobStepProperties - Resource properties.
9095	*JobStepProperties `json:"properties,omitempty"`
9096	// ID - READ-ONLY; Resource ID.
9097	ID *string `json:"id,omitempty"`
9098	// Name - READ-ONLY; Resource name.
9099	Name *string `json:"name,omitempty"`
9100	// Type - READ-ONLY; Resource type.
9101	Type *string `json:"type,omitempty"`
9102}
9103
9104// MarshalJSON is the custom marshaler for JobStep.
9105func (js JobStep) MarshalJSON() ([]byte, error) {
9106	objectMap := make(map[string]interface{})
9107	if js.JobStepProperties != nil {
9108		objectMap["properties"] = js.JobStepProperties
9109	}
9110	return json.Marshal(objectMap)
9111}
9112
9113// UnmarshalJSON is the custom unmarshaler for JobStep struct.
9114func (js *JobStep) UnmarshalJSON(body []byte) error {
9115	var m map[string]*json.RawMessage
9116	err := json.Unmarshal(body, &m)
9117	if err != nil {
9118		return err
9119	}
9120	for k, v := range m {
9121		switch k {
9122		case "properties":
9123			if v != nil {
9124				var jobStepProperties JobStepProperties
9125				err = json.Unmarshal(*v, &jobStepProperties)
9126				if err != nil {
9127					return err
9128				}
9129				js.JobStepProperties = &jobStepProperties
9130			}
9131		case "id":
9132			if v != nil {
9133				var ID string
9134				err = json.Unmarshal(*v, &ID)
9135				if err != nil {
9136					return err
9137				}
9138				js.ID = &ID
9139			}
9140		case "name":
9141			if v != nil {
9142				var name string
9143				err = json.Unmarshal(*v, &name)
9144				if err != nil {
9145					return err
9146				}
9147				js.Name = &name
9148			}
9149		case "type":
9150			if v != nil {
9151				var typeVar string
9152				err = json.Unmarshal(*v, &typeVar)
9153				if err != nil {
9154					return err
9155				}
9156				js.Type = &typeVar
9157			}
9158		}
9159	}
9160
9161	return nil
9162}
9163
9164// JobStepAction the action to be executed by a job step.
9165type JobStepAction struct {
9166	// Type - Type of action being executed by the job step. Possible values include: 'TSQL'
9167	Type JobStepActionType `json:"type,omitempty"`
9168	// Source - The source of the action to execute. Possible values include: 'Inline'
9169	Source JobStepActionSource `json:"source,omitempty"`
9170	// Value - The action value, for example the text of the T-SQL script to execute.
9171	Value *string `json:"value,omitempty"`
9172}
9173
9174// JobStepExecutionOptions the execution options of a job step.
9175type JobStepExecutionOptions struct {
9176	// TimeoutSeconds - Execution timeout for the job step.
9177	TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"`
9178	// RetryAttempts - Maximum number of times the job step will be reattempted if the first attempt fails.
9179	RetryAttempts *int32 `json:"retryAttempts,omitempty"`
9180	// InitialRetryIntervalSeconds - Initial delay between retries for job step execution.
9181	InitialRetryIntervalSeconds *int32 `json:"initialRetryIntervalSeconds,omitempty"`
9182	// MaximumRetryIntervalSeconds - The maximum amount of time to wait between retries for job step execution.
9183	MaximumRetryIntervalSeconds *int32 `json:"maximumRetryIntervalSeconds,omitempty"`
9184	// RetryIntervalBackoffMultiplier - The backoff multiplier for the time between retries.
9185	RetryIntervalBackoffMultiplier *float64 `json:"retryIntervalBackoffMultiplier,omitempty"`
9186}
9187
9188// JobStepListResult a list of job steps.
9189type JobStepListResult struct {
9190	autorest.Response `json:"-"`
9191	// Value - READ-ONLY; Array of results.
9192	Value *[]JobStep `json:"value,omitempty"`
9193	// NextLink - READ-ONLY; Link to retrieve next page of results.
9194	NextLink *string `json:"nextLink,omitempty"`
9195}
9196
9197// MarshalJSON is the custom marshaler for JobStepListResult.
9198func (jslr JobStepListResult) MarshalJSON() ([]byte, error) {
9199	objectMap := make(map[string]interface{})
9200	return json.Marshal(objectMap)
9201}
9202
9203// JobStepListResultIterator provides access to a complete listing of JobStep values.
9204type JobStepListResultIterator struct {
9205	i    int
9206	page JobStepListResultPage
9207}
9208
9209// NextWithContext advances to the next value.  If there was an error making
9210// the request the iterator does not advance and the error is returned.
9211func (iter *JobStepListResultIterator) NextWithContext(ctx context.Context) (err error) {
9212	if tracing.IsEnabled() {
9213		ctx = tracing.StartSpan(ctx, fqdn+"/JobStepListResultIterator.NextWithContext")
9214		defer func() {
9215			sc := -1
9216			if iter.Response().Response.Response != nil {
9217				sc = iter.Response().Response.Response.StatusCode
9218			}
9219			tracing.EndSpan(ctx, sc, err)
9220		}()
9221	}
9222	iter.i++
9223	if iter.i < len(iter.page.Values()) {
9224		return nil
9225	}
9226	err = iter.page.NextWithContext(ctx)
9227	if err != nil {
9228		iter.i--
9229		return err
9230	}
9231	iter.i = 0
9232	return nil
9233}
9234
9235// Next advances to the next value.  If there was an error making
9236// the request the iterator does not advance and the error is returned.
9237// Deprecated: Use NextWithContext() instead.
9238func (iter *JobStepListResultIterator) Next() error {
9239	return iter.NextWithContext(context.Background())
9240}
9241
9242// NotDone returns true if the enumeration should be started or is not yet complete.
9243func (iter JobStepListResultIterator) NotDone() bool {
9244	return iter.page.NotDone() && iter.i < len(iter.page.Values())
9245}
9246
9247// Response returns the raw server response from the last page request.
9248func (iter JobStepListResultIterator) Response() JobStepListResult {
9249	return iter.page.Response()
9250}
9251
9252// Value returns the current value or a zero-initialized value if the
9253// iterator has advanced beyond the end of the collection.
9254func (iter JobStepListResultIterator) Value() JobStep {
9255	if !iter.page.NotDone() {
9256		return JobStep{}
9257	}
9258	return iter.page.Values()[iter.i]
9259}
9260
9261// Creates a new instance of the JobStepListResultIterator type.
9262func NewJobStepListResultIterator(page JobStepListResultPage) JobStepListResultIterator {
9263	return JobStepListResultIterator{page: page}
9264}
9265
9266// IsEmpty returns true if the ListResult contains no values.
9267func (jslr JobStepListResult) IsEmpty() bool {
9268	return jslr.Value == nil || len(*jslr.Value) == 0
9269}
9270
9271// hasNextLink returns true if the NextLink is not empty.
9272func (jslr JobStepListResult) hasNextLink() bool {
9273	return jslr.NextLink != nil && len(*jslr.NextLink) != 0
9274}
9275
9276// jobStepListResultPreparer prepares a request to retrieve the next set of results.
9277// It returns nil if no more results exist.
9278func (jslr JobStepListResult) jobStepListResultPreparer(ctx context.Context) (*http.Request, error) {
9279	if !jslr.hasNextLink() {
9280		return nil, nil
9281	}
9282	return autorest.Prepare((&http.Request{}).WithContext(ctx),
9283		autorest.AsJSON(),
9284		autorest.AsGet(),
9285		autorest.WithBaseURL(to.String(jslr.NextLink)))
9286}
9287
9288// JobStepListResultPage contains a page of JobStep values.
9289type JobStepListResultPage struct {
9290	fn   func(context.Context, JobStepListResult) (JobStepListResult, error)
9291	jslr JobStepListResult
9292}
9293
9294// NextWithContext advances to the next page of values.  If there was an error making
9295// the request the page does not advance and the error is returned.
9296func (page *JobStepListResultPage) NextWithContext(ctx context.Context) (err error) {
9297	if tracing.IsEnabled() {
9298		ctx = tracing.StartSpan(ctx, fqdn+"/JobStepListResultPage.NextWithContext")
9299		defer func() {
9300			sc := -1
9301			if page.Response().Response.Response != nil {
9302				sc = page.Response().Response.Response.StatusCode
9303			}
9304			tracing.EndSpan(ctx, sc, err)
9305		}()
9306	}
9307	for {
9308		next, err := page.fn(ctx, page.jslr)
9309		if err != nil {
9310			return err
9311		}
9312		page.jslr = next
9313		if !next.hasNextLink() || !next.IsEmpty() {
9314			break
9315		}
9316	}
9317	return nil
9318}
9319
9320// Next advances to the next page of values.  If there was an error making
9321// the request the page does not advance and the error is returned.
9322// Deprecated: Use NextWithContext() instead.
9323func (page *JobStepListResultPage) Next() error {
9324	return page.NextWithContext(context.Background())
9325}
9326
9327// NotDone returns true if the page enumeration should be started or is not yet complete.
9328func (page JobStepListResultPage) NotDone() bool {
9329	return !page.jslr.IsEmpty()
9330}
9331
9332// Response returns the raw server response from the last page request.
9333func (page JobStepListResultPage) Response() JobStepListResult {
9334	return page.jslr
9335}
9336
9337// Values returns the slice of values for the current page or nil if there are no values.
9338func (page JobStepListResultPage) Values() []JobStep {
9339	if page.jslr.IsEmpty() {
9340		return nil
9341	}
9342	return *page.jslr.Value
9343}
9344
9345// Creates a new instance of the JobStepListResultPage type.
9346func NewJobStepListResultPage(cur JobStepListResult, getNextPage func(context.Context, JobStepListResult) (JobStepListResult, error)) JobStepListResultPage {
9347	return JobStepListResultPage{
9348		fn:   getNextPage,
9349		jslr: cur,
9350	}
9351}
9352
9353// JobStepOutput the output configuration of a job step.
9354type JobStepOutput struct {
9355	// Type - The output destination type. Possible values include: 'SQLDatabase'
9356	Type JobStepOutputType `json:"type,omitempty"`
9357	// SubscriptionID - The output destination subscription id.
9358	SubscriptionID *uuid.UUID `json:"subscriptionId,omitempty"`
9359	// ResourceGroupName - The output destination resource group.
9360	ResourceGroupName *string `json:"resourceGroupName,omitempty"`
9361	// ServerName - The output destination server name.
9362	ServerName *string `json:"serverName,omitempty"`
9363	// DatabaseName - The output destination database.
9364	DatabaseName *string `json:"databaseName,omitempty"`
9365	// SchemaName - The output destination schema.
9366	SchemaName *string `json:"schemaName,omitempty"`
9367	// TableName - The output destination table.
9368	TableName *string `json:"tableName,omitempty"`
9369	// Credential - The resource ID of the credential to use to connect to the output destination.
9370	Credential *string `json:"credential,omitempty"`
9371}
9372
9373// JobStepProperties properties of a job step.
9374type JobStepProperties struct {
9375	// 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.
9376	StepID *int32 `json:"stepId,omitempty"`
9377	// TargetGroup - The resource ID of the target group that the job step will be executed on.
9378	TargetGroup *string `json:"targetGroup,omitempty"`
9379	// Credential - The resource ID of the job credential that will be used to connect to the targets.
9380	Credential *string `json:"credential,omitempty"`
9381	// Action - The action payload of the job step.
9382	Action *JobStepAction `json:"action,omitempty"`
9383	// Output - Output destination properties of the job step.
9384	Output *JobStepOutput `json:"output,omitempty"`
9385	// ExecutionOptions - Execution options for the job step.
9386	ExecutionOptions *JobStepExecutionOptions `json:"executionOptions,omitempty"`
9387}
9388
9389// JobTarget a job target, for example a specific database or a container of databases that is evaluated
9390// during job execution.
9391type JobTarget struct {
9392	// MembershipType - Whether the target is included or excluded from the group. Possible values include: 'Include', 'Exclude'
9393	MembershipType JobTargetGroupMembershipType `json:"membershipType,omitempty"`
9394	// Type - The target type. Possible values include: 'JobTargetTypeTargetGroup', 'JobTargetTypeSQLDatabase', 'JobTargetTypeSQLElasticPool', 'JobTargetTypeSQLShardMap', 'JobTargetTypeSQLServer'
9395	Type JobTargetType `json:"type,omitempty"`
9396	// ServerName - The target server name.
9397	ServerName *string `json:"serverName,omitempty"`
9398	// DatabaseName - The target database name.
9399	DatabaseName *string `json:"databaseName,omitempty"`
9400	// ElasticPoolName - The target elastic pool name.
9401	ElasticPoolName *string `json:"elasticPoolName,omitempty"`
9402	// ShardMapName - The target shard map.
9403	ShardMapName *string `json:"shardMapName,omitempty"`
9404	// 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.
9405	RefreshCredential *string `json:"refreshCredential,omitempty"`
9406}
9407
9408// JobTargetGroup a group of job targets.
9409type JobTargetGroup struct {
9410	autorest.Response `json:"-"`
9411	// JobTargetGroupProperties - Resource properties.
9412	*JobTargetGroupProperties `json:"properties,omitempty"`
9413	// ID - READ-ONLY; Resource ID.
9414	ID *string `json:"id,omitempty"`
9415	// Name - READ-ONLY; Resource name.
9416	Name *string `json:"name,omitempty"`
9417	// Type - READ-ONLY; Resource type.
9418	Type *string `json:"type,omitempty"`
9419}
9420
9421// MarshalJSON is the custom marshaler for JobTargetGroup.
9422func (jtg JobTargetGroup) MarshalJSON() ([]byte, error) {
9423	objectMap := make(map[string]interface{})
9424	if jtg.JobTargetGroupProperties != nil {
9425		objectMap["properties"] = jtg.JobTargetGroupProperties
9426	}
9427	return json.Marshal(objectMap)
9428}
9429
9430// UnmarshalJSON is the custom unmarshaler for JobTargetGroup struct.
9431func (jtg *JobTargetGroup) UnmarshalJSON(body []byte) error {
9432	var m map[string]*json.RawMessage
9433	err := json.Unmarshal(body, &m)
9434	if err != nil {
9435		return err
9436	}
9437	for k, v := range m {
9438		switch k {
9439		case "properties":
9440			if v != nil {
9441				var jobTargetGroupProperties JobTargetGroupProperties
9442				err = json.Unmarshal(*v, &jobTargetGroupProperties)
9443				if err != nil {
9444					return err
9445				}
9446				jtg.JobTargetGroupProperties = &jobTargetGroupProperties
9447			}
9448		case "id":
9449			if v != nil {
9450				var ID string
9451				err = json.Unmarshal(*v, &ID)
9452				if err != nil {
9453					return err
9454				}
9455				jtg.ID = &ID
9456			}
9457		case "name":
9458			if v != nil {
9459				var name string
9460				err = json.Unmarshal(*v, &name)
9461				if err != nil {
9462					return err
9463				}
9464				jtg.Name = &name
9465			}
9466		case "type":
9467			if v != nil {
9468				var typeVar string
9469				err = json.Unmarshal(*v, &typeVar)
9470				if err != nil {
9471					return err
9472				}
9473				jtg.Type = &typeVar
9474			}
9475		}
9476	}
9477
9478	return nil
9479}
9480
9481// JobTargetGroupListResult a list of target groups.
9482type JobTargetGroupListResult struct {
9483	autorest.Response `json:"-"`
9484	// Value - READ-ONLY; Array of results.
9485	Value *[]JobTargetGroup `json:"value,omitempty"`
9486	// NextLink - READ-ONLY; Link to retrieve next page of results.
9487	NextLink *string `json:"nextLink,omitempty"`
9488}
9489
9490// MarshalJSON is the custom marshaler for JobTargetGroupListResult.
9491func (jtglr JobTargetGroupListResult) MarshalJSON() ([]byte, error) {
9492	objectMap := make(map[string]interface{})
9493	return json.Marshal(objectMap)
9494}
9495
9496// JobTargetGroupListResultIterator provides access to a complete listing of JobTargetGroup values.
9497type JobTargetGroupListResultIterator struct {
9498	i    int
9499	page JobTargetGroupListResultPage
9500}
9501
9502// NextWithContext advances to the next value.  If there was an error making
9503// the request the iterator does not advance and the error is returned.
9504func (iter *JobTargetGroupListResultIterator) NextWithContext(ctx context.Context) (err error) {
9505	if tracing.IsEnabled() {
9506		ctx = tracing.StartSpan(ctx, fqdn+"/JobTargetGroupListResultIterator.NextWithContext")
9507		defer func() {
9508			sc := -1
9509			if iter.Response().Response.Response != nil {
9510				sc = iter.Response().Response.Response.StatusCode
9511			}
9512			tracing.EndSpan(ctx, sc, err)
9513		}()
9514	}
9515	iter.i++
9516	if iter.i < len(iter.page.Values()) {
9517		return nil
9518	}
9519	err = iter.page.NextWithContext(ctx)
9520	if err != nil {
9521		iter.i--
9522		return err
9523	}
9524	iter.i = 0
9525	return nil
9526}
9527
9528// Next advances to the next value.  If there was an error making
9529// the request the iterator does not advance and the error is returned.
9530// Deprecated: Use NextWithContext() instead.
9531func (iter *JobTargetGroupListResultIterator) Next() error {
9532	return iter.NextWithContext(context.Background())
9533}
9534
9535// NotDone returns true if the enumeration should be started or is not yet complete.
9536func (iter JobTargetGroupListResultIterator) NotDone() bool {
9537	return iter.page.NotDone() && iter.i < len(iter.page.Values())
9538}
9539
9540// Response returns the raw server response from the last page request.
9541func (iter JobTargetGroupListResultIterator) Response() JobTargetGroupListResult {
9542	return iter.page.Response()
9543}
9544
9545// Value returns the current value or a zero-initialized value if the
9546// iterator has advanced beyond the end of the collection.
9547func (iter JobTargetGroupListResultIterator) Value() JobTargetGroup {
9548	if !iter.page.NotDone() {
9549		return JobTargetGroup{}
9550	}
9551	return iter.page.Values()[iter.i]
9552}
9553
9554// Creates a new instance of the JobTargetGroupListResultIterator type.
9555func NewJobTargetGroupListResultIterator(page JobTargetGroupListResultPage) JobTargetGroupListResultIterator {
9556	return JobTargetGroupListResultIterator{page: page}
9557}
9558
9559// IsEmpty returns true if the ListResult contains no values.
9560func (jtglr JobTargetGroupListResult) IsEmpty() bool {
9561	return jtglr.Value == nil || len(*jtglr.Value) == 0
9562}
9563
9564// hasNextLink returns true if the NextLink is not empty.
9565func (jtglr JobTargetGroupListResult) hasNextLink() bool {
9566	return jtglr.NextLink != nil && len(*jtglr.NextLink) != 0
9567}
9568
9569// jobTargetGroupListResultPreparer prepares a request to retrieve the next set of results.
9570// It returns nil if no more results exist.
9571func (jtglr JobTargetGroupListResult) jobTargetGroupListResultPreparer(ctx context.Context) (*http.Request, error) {
9572	if !jtglr.hasNextLink() {
9573		return nil, nil
9574	}
9575	return autorest.Prepare((&http.Request{}).WithContext(ctx),
9576		autorest.AsJSON(),
9577		autorest.AsGet(),
9578		autorest.WithBaseURL(to.String(jtglr.NextLink)))
9579}
9580
9581// JobTargetGroupListResultPage contains a page of JobTargetGroup values.
9582type JobTargetGroupListResultPage struct {
9583	fn    func(context.Context, JobTargetGroupListResult) (JobTargetGroupListResult, error)
9584	jtglr JobTargetGroupListResult
9585}
9586
9587// NextWithContext advances to the next page of values.  If there was an error making
9588// the request the page does not advance and the error is returned.
9589func (page *JobTargetGroupListResultPage) NextWithContext(ctx context.Context) (err error) {
9590	if tracing.IsEnabled() {
9591		ctx = tracing.StartSpan(ctx, fqdn+"/JobTargetGroupListResultPage.NextWithContext")
9592		defer func() {
9593			sc := -1
9594			if page.Response().Response.Response != nil {
9595				sc = page.Response().Response.Response.StatusCode
9596			}
9597			tracing.EndSpan(ctx, sc, err)
9598		}()
9599	}
9600	for {
9601		next, err := page.fn(ctx, page.jtglr)
9602		if err != nil {
9603			return err
9604		}
9605		page.jtglr = next
9606		if !next.hasNextLink() || !next.IsEmpty() {
9607			break
9608		}
9609	}
9610	return nil
9611}
9612
9613// Next advances to the next page of values.  If there was an error making
9614// the request the page does not advance and the error is returned.
9615// Deprecated: Use NextWithContext() instead.
9616func (page *JobTargetGroupListResultPage) Next() error {
9617	return page.NextWithContext(context.Background())
9618}
9619
9620// NotDone returns true if the page enumeration should be started or is not yet complete.
9621func (page JobTargetGroupListResultPage) NotDone() bool {
9622	return !page.jtglr.IsEmpty()
9623}
9624
9625// Response returns the raw server response from the last page request.
9626func (page JobTargetGroupListResultPage) Response() JobTargetGroupListResult {
9627	return page.jtglr
9628}
9629
9630// Values returns the slice of values for the current page or nil if there are no values.
9631func (page JobTargetGroupListResultPage) Values() []JobTargetGroup {
9632	if page.jtglr.IsEmpty() {
9633		return nil
9634	}
9635	return *page.jtglr.Value
9636}
9637
9638// Creates a new instance of the JobTargetGroupListResultPage type.
9639func NewJobTargetGroupListResultPage(cur JobTargetGroupListResult, getNextPage func(context.Context, JobTargetGroupListResult) (JobTargetGroupListResult, error)) JobTargetGroupListResultPage {
9640	return JobTargetGroupListResultPage{
9641		fn:    getNextPage,
9642		jtglr: cur,
9643	}
9644}
9645
9646// JobTargetGroupProperties properties of job target group.
9647type JobTargetGroupProperties struct {
9648	// Members - Members of the target group.
9649	Members *[]JobTarget `json:"members,omitempty"`
9650}
9651
9652// JobVersion a job version.
9653type JobVersion struct {
9654	autorest.Response `json:"-"`
9655	// ID - READ-ONLY; Resource ID.
9656	ID *string `json:"id,omitempty"`
9657	// Name - READ-ONLY; Resource name.
9658	Name *string `json:"name,omitempty"`
9659	// Type - READ-ONLY; Resource type.
9660	Type *string `json:"type,omitempty"`
9661}
9662
9663// MarshalJSON is the custom marshaler for JobVersion.
9664func (jv JobVersion) MarshalJSON() ([]byte, error) {
9665	objectMap := make(map[string]interface{})
9666	return json.Marshal(objectMap)
9667}
9668
9669// JobVersionListResult a list of job versions.
9670type JobVersionListResult struct {
9671	autorest.Response `json:"-"`
9672	// Value - READ-ONLY; Array of results.
9673	Value *[]JobVersion `json:"value,omitempty"`
9674	// NextLink - READ-ONLY; Link to retrieve next page of results.
9675	NextLink *string `json:"nextLink,omitempty"`
9676}
9677
9678// MarshalJSON is the custom marshaler for JobVersionListResult.
9679func (jvlr JobVersionListResult) MarshalJSON() ([]byte, error) {
9680	objectMap := make(map[string]interface{})
9681	return json.Marshal(objectMap)
9682}
9683
9684// JobVersionListResultIterator provides access to a complete listing of JobVersion values.
9685type JobVersionListResultIterator struct {
9686	i    int
9687	page JobVersionListResultPage
9688}
9689
9690// NextWithContext advances to the next value.  If there was an error making
9691// the request the iterator does not advance and the error is returned.
9692func (iter *JobVersionListResultIterator) NextWithContext(ctx context.Context) (err error) {
9693	if tracing.IsEnabled() {
9694		ctx = tracing.StartSpan(ctx, fqdn+"/JobVersionListResultIterator.NextWithContext")
9695		defer func() {
9696			sc := -1
9697			if iter.Response().Response.Response != nil {
9698				sc = iter.Response().Response.Response.StatusCode
9699			}
9700			tracing.EndSpan(ctx, sc, err)
9701		}()
9702	}
9703	iter.i++
9704	if iter.i < len(iter.page.Values()) {
9705		return nil
9706	}
9707	err = iter.page.NextWithContext(ctx)
9708	if err != nil {
9709		iter.i--
9710		return err
9711	}
9712	iter.i = 0
9713	return nil
9714}
9715
9716// Next advances to the next value.  If there was an error making
9717// the request the iterator does not advance and the error is returned.
9718// Deprecated: Use NextWithContext() instead.
9719func (iter *JobVersionListResultIterator) Next() error {
9720	return iter.NextWithContext(context.Background())
9721}
9722
9723// NotDone returns true if the enumeration should be started or is not yet complete.
9724func (iter JobVersionListResultIterator) NotDone() bool {
9725	return iter.page.NotDone() && iter.i < len(iter.page.Values())
9726}
9727
9728// Response returns the raw server response from the last page request.
9729func (iter JobVersionListResultIterator) Response() JobVersionListResult {
9730	return iter.page.Response()
9731}
9732
9733// Value returns the current value or a zero-initialized value if the
9734// iterator has advanced beyond the end of the collection.
9735func (iter JobVersionListResultIterator) Value() JobVersion {
9736	if !iter.page.NotDone() {
9737		return JobVersion{}
9738	}
9739	return iter.page.Values()[iter.i]
9740}
9741
9742// Creates a new instance of the JobVersionListResultIterator type.
9743func NewJobVersionListResultIterator(page JobVersionListResultPage) JobVersionListResultIterator {
9744	return JobVersionListResultIterator{page: page}
9745}
9746
9747// IsEmpty returns true if the ListResult contains no values.
9748func (jvlr JobVersionListResult) IsEmpty() bool {
9749	return jvlr.Value == nil || len(*jvlr.Value) == 0
9750}
9751
9752// hasNextLink returns true if the NextLink is not empty.
9753func (jvlr JobVersionListResult) hasNextLink() bool {
9754	return jvlr.NextLink != nil && len(*jvlr.NextLink) != 0
9755}
9756
9757// jobVersionListResultPreparer prepares a request to retrieve the next set of results.
9758// It returns nil if no more results exist.
9759func (jvlr JobVersionListResult) jobVersionListResultPreparer(ctx context.Context) (*http.Request, error) {
9760	if !jvlr.hasNextLink() {
9761		return nil, nil
9762	}
9763	return autorest.Prepare((&http.Request{}).WithContext(ctx),
9764		autorest.AsJSON(),
9765		autorest.AsGet(),
9766		autorest.WithBaseURL(to.String(jvlr.NextLink)))
9767}
9768
9769// JobVersionListResultPage contains a page of JobVersion values.
9770type JobVersionListResultPage struct {
9771	fn   func(context.Context, JobVersionListResult) (JobVersionListResult, error)
9772	jvlr JobVersionListResult
9773}
9774
9775// NextWithContext advances to the next page of values.  If there was an error making
9776// the request the page does not advance and the error is returned.
9777func (page *JobVersionListResultPage) NextWithContext(ctx context.Context) (err error) {
9778	if tracing.IsEnabled() {
9779		ctx = tracing.StartSpan(ctx, fqdn+"/JobVersionListResultPage.NextWithContext")
9780		defer func() {
9781			sc := -1
9782			if page.Response().Response.Response != nil {
9783				sc = page.Response().Response.Response.StatusCode
9784			}
9785			tracing.EndSpan(ctx, sc, err)
9786		}()
9787	}
9788	for {
9789		next, err := page.fn(ctx, page.jvlr)
9790		if err != nil {
9791			return err
9792		}
9793		page.jvlr = next
9794		if !next.hasNextLink() || !next.IsEmpty() {
9795			break
9796		}
9797	}
9798	return nil
9799}
9800
9801// Next advances to the next page of values.  If there was an error making
9802// the request the page does not advance and the error is returned.
9803// Deprecated: Use NextWithContext() instead.
9804func (page *JobVersionListResultPage) Next() error {
9805	return page.NextWithContext(context.Background())
9806}
9807
9808// NotDone returns true if the page enumeration should be started or is not yet complete.
9809func (page JobVersionListResultPage) NotDone() bool {
9810	return !page.jvlr.IsEmpty()
9811}
9812
9813// Response returns the raw server response from the last page request.
9814func (page JobVersionListResultPage) Response() JobVersionListResult {
9815	return page.jvlr
9816}
9817
9818// Values returns the slice of values for the current page or nil if there are no values.
9819func (page JobVersionListResultPage) Values() []JobVersion {
9820	if page.jvlr.IsEmpty() {
9821		return nil
9822	}
9823	return *page.jvlr.Value
9824}
9825
9826// Creates a new instance of the JobVersionListResultPage type.
9827func NewJobVersionListResultPage(cur JobVersionListResult, getNextPage func(context.Context, JobVersionListResult) (JobVersionListResult, error)) JobVersionListResultPage {
9828	return JobVersionListResultPage{
9829		fn:   getNextPage,
9830		jvlr: cur,
9831	}
9832}
9833
9834// LicenseTypeCapability the license type capability
9835type LicenseTypeCapability struct {
9836	// Name - READ-ONLY; License type identifier.
9837	Name *string `json:"name,omitempty"`
9838	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
9839	Status CapabilityStatus `json:"status,omitempty"`
9840	// Reason - The reason for the capability not being available.
9841	Reason *string `json:"reason,omitempty"`
9842}
9843
9844// MarshalJSON is the custom marshaler for LicenseTypeCapability.
9845func (ltc LicenseTypeCapability) MarshalJSON() ([]byte, error) {
9846	objectMap := make(map[string]interface{})
9847	if ltc.Reason != nil {
9848		objectMap["reason"] = ltc.Reason
9849	}
9850	return json.Marshal(objectMap)
9851}
9852
9853// LocationCapabilities the location capability.
9854type LocationCapabilities struct {
9855	autorest.Response `json:"-"`
9856	// Name - READ-ONLY; The location name.
9857	Name *string `json:"name,omitempty"`
9858	// SupportedServerVersions - READ-ONLY; The list of supported server versions.
9859	SupportedServerVersions *[]ServerVersionCapability `json:"supportedServerVersions,omitempty"`
9860	// SupportedManagedInstanceVersions - READ-ONLY; The list of supported managed instance versions.
9861	SupportedManagedInstanceVersions *[]ManagedInstanceVersionCapability `json:"supportedManagedInstanceVersions,omitempty"`
9862	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
9863	Status CapabilityStatus `json:"status,omitempty"`
9864	// Reason - The reason for the capability not being available.
9865	Reason *string `json:"reason,omitempty"`
9866}
9867
9868// MarshalJSON is the custom marshaler for LocationCapabilities.
9869func (lc LocationCapabilities) MarshalJSON() ([]byte, error) {
9870	objectMap := make(map[string]interface{})
9871	if lc.Reason != nil {
9872		objectMap["reason"] = lc.Reason
9873	}
9874	return json.Marshal(objectMap)
9875}
9876
9877// LogicalServerSecurityAlertPolicyListResult a list of the server's security alert policies.
9878type LogicalServerSecurityAlertPolicyListResult struct {
9879	autorest.Response `json:"-"`
9880	// Value - READ-ONLY; Array of results.
9881	Value *[]ServerSecurityAlertPolicy `json:"value,omitempty"`
9882	// NextLink - READ-ONLY; Link to retrieve next page of results.
9883	NextLink *string `json:"nextLink,omitempty"`
9884}
9885
9886// MarshalJSON is the custom marshaler for LogicalServerSecurityAlertPolicyListResult.
9887func (lssaplr LogicalServerSecurityAlertPolicyListResult) MarshalJSON() ([]byte, error) {
9888	objectMap := make(map[string]interface{})
9889	return json.Marshal(objectMap)
9890}
9891
9892// LogicalServerSecurityAlertPolicyListResultIterator provides access to a complete listing of
9893// ServerSecurityAlertPolicy values.
9894type LogicalServerSecurityAlertPolicyListResultIterator struct {
9895	i    int
9896	page LogicalServerSecurityAlertPolicyListResultPage
9897}
9898
9899// NextWithContext advances to the next value.  If there was an error making
9900// the request the iterator does not advance and the error is returned.
9901func (iter *LogicalServerSecurityAlertPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
9902	if tracing.IsEnabled() {
9903		ctx = tracing.StartSpan(ctx, fqdn+"/LogicalServerSecurityAlertPolicyListResultIterator.NextWithContext")
9904		defer func() {
9905			sc := -1
9906			if iter.Response().Response.Response != nil {
9907				sc = iter.Response().Response.Response.StatusCode
9908			}
9909			tracing.EndSpan(ctx, sc, err)
9910		}()
9911	}
9912	iter.i++
9913	if iter.i < len(iter.page.Values()) {
9914		return nil
9915	}
9916	err = iter.page.NextWithContext(ctx)
9917	if err != nil {
9918		iter.i--
9919		return err
9920	}
9921	iter.i = 0
9922	return nil
9923}
9924
9925// Next advances to the next value.  If there was an error making
9926// the request the iterator does not advance and the error is returned.
9927// Deprecated: Use NextWithContext() instead.
9928func (iter *LogicalServerSecurityAlertPolicyListResultIterator) Next() error {
9929	return iter.NextWithContext(context.Background())
9930}
9931
9932// NotDone returns true if the enumeration should be started or is not yet complete.
9933func (iter LogicalServerSecurityAlertPolicyListResultIterator) NotDone() bool {
9934	return iter.page.NotDone() && iter.i < len(iter.page.Values())
9935}
9936
9937// Response returns the raw server response from the last page request.
9938func (iter LogicalServerSecurityAlertPolicyListResultIterator) Response() LogicalServerSecurityAlertPolicyListResult {
9939	return iter.page.Response()
9940}
9941
9942// Value returns the current value or a zero-initialized value if the
9943// iterator has advanced beyond the end of the collection.
9944func (iter LogicalServerSecurityAlertPolicyListResultIterator) Value() ServerSecurityAlertPolicy {
9945	if !iter.page.NotDone() {
9946		return ServerSecurityAlertPolicy{}
9947	}
9948	return iter.page.Values()[iter.i]
9949}
9950
9951// Creates a new instance of the LogicalServerSecurityAlertPolicyListResultIterator type.
9952func NewLogicalServerSecurityAlertPolicyListResultIterator(page LogicalServerSecurityAlertPolicyListResultPage) LogicalServerSecurityAlertPolicyListResultIterator {
9953	return LogicalServerSecurityAlertPolicyListResultIterator{page: page}
9954}
9955
9956// IsEmpty returns true if the ListResult contains no values.
9957func (lssaplr LogicalServerSecurityAlertPolicyListResult) IsEmpty() bool {
9958	return lssaplr.Value == nil || len(*lssaplr.Value) == 0
9959}
9960
9961// hasNextLink returns true if the NextLink is not empty.
9962func (lssaplr LogicalServerSecurityAlertPolicyListResult) hasNextLink() bool {
9963	return lssaplr.NextLink != nil && len(*lssaplr.NextLink) != 0
9964}
9965
9966// logicalServerSecurityAlertPolicyListResultPreparer prepares a request to retrieve the next set of results.
9967// It returns nil if no more results exist.
9968func (lssaplr LogicalServerSecurityAlertPolicyListResult) logicalServerSecurityAlertPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
9969	if !lssaplr.hasNextLink() {
9970		return nil, nil
9971	}
9972	return autorest.Prepare((&http.Request{}).WithContext(ctx),
9973		autorest.AsJSON(),
9974		autorest.AsGet(),
9975		autorest.WithBaseURL(to.String(lssaplr.NextLink)))
9976}
9977
9978// LogicalServerSecurityAlertPolicyListResultPage contains a page of ServerSecurityAlertPolicy values.
9979type LogicalServerSecurityAlertPolicyListResultPage struct {
9980	fn      func(context.Context, LogicalServerSecurityAlertPolicyListResult) (LogicalServerSecurityAlertPolicyListResult, error)
9981	lssaplr LogicalServerSecurityAlertPolicyListResult
9982}
9983
9984// NextWithContext advances to the next page of values.  If there was an error making
9985// the request the page does not advance and the error is returned.
9986func (page *LogicalServerSecurityAlertPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
9987	if tracing.IsEnabled() {
9988		ctx = tracing.StartSpan(ctx, fqdn+"/LogicalServerSecurityAlertPolicyListResultPage.NextWithContext")
9989		defer func() {
9990			sc := -1
9991			if page.Response().Response.Response != nil {
9992				sc = page.Response().Response.Response.StatusCode
9993			}
9994			tracing.EndSpan(ctx, sc, err)
9995		}()
9996	}
9997	for {
9998		next, err := page.fn(ctx, page.lssaplr)
9999		if err != nil {
10000			return err
10001		}
10002		page.lssaplr = next
10003		if !next.hasNextLink() || !next.IsEmpty() {
10004			break
10005		}
10006	}
10007	return nil
10008}
10009
10010// Next advances to the next page of values.  If there was an error making
10011// the request the page does not advance and the error is returned.
10012// Deprecated: Use NextWithContext() instead.
10013func (page *LogicalServerSecurityAlertPolicyListResultPage) Next() error {
10014	return page.NextWithContext(context.Background())
10015}
10016
10017// NotDone returns true if the page enumeration should be started or is not yet complete.
10018func (page LogicalServerSecurityAlertPolicyListResultPage) NotDone() bool {
10019	return !page.lssaplr.IsEmpty()
10020}
10021
10022// Response returns the raw server response from the last page request.
10023func (page LogicalServerSecurityAlertPolicyListResultPage) Response() LogicalServerSecurityAlertPolicyListResult {
10024	return page.lssaplr
10025}
10026
10027// Values returns the slice of values for the current page or nil if there are no values.
10028func (page LogicalServerSecurityAlertPolicyListResultPage) Values() []ServerSecurityAlertPolicy {
10029	if page.lssaplr.IsEmpty() {
10030		return nil
10031	}
10032	return *page.lssaplr.Value
10033}
10034
10035// Creates a new instance of the LogicalServerSecurityAlertPolicyListResultPage type.
10036func NewLogicalServerSecurityAlertPolicyListResultPage(cur LogicalServerSecurityAlertPolicyListResult, getNextPage func(context.Context, LogicalServerSecurityAlertPolicyListResult) (LogicalServerSecurityAlertPolicyListResult, error)) LogicalServerSecurityAlertPolicyListResultPage {
10037	return LogicalServerSecurityAlertPolicyListResultPage{
10038		fn:      getNextPage,
10039		lssaplr: cur,
10040	}
10041}
10042
10043// LogSizeCapability the log size capability.
10044type LogSizeCapability struct {
10045	// Limit - READ-ONLY; The log size limit (see 'unit' for the units).
10046	Limit *int32 `json:"limit,omitempty"`
10047	// Unit - READ-ONLY; The units that the limit is expressed in. Possible values include: 'Megabytes', 'Gigabytes', 'Terabytes', 'Petabytes', 'Percent'
10048	Unit LogSizeUnit `json:"unit,omitempty"`
10049}
10050
10051// MarshalJSON is the custom marshaler for LogSizeCapability.
10052func (lsc LogSizeCapability) MarshalJSON() ([]byte, error) {
10053	objectMap := make(map[string]interface{})
10054	return json.Marshal(objectMap)
10055}
10056
10057// LongTermRetentionBackup a long term retention backup.
10058type LongTermRetentionBackup struct {
10059	autorest.Response `json:"-"`
10060	// LongTermRetentionBackupProperties - Resource properties.
10061	*LongTermRetentionBackupProperties `json:"properties,omitempty"`
10062	// ID - READ-ONLY; Resource ID.
10063	ID *string `json:"id,omitempty"`
10064	// Name - READ-ONLY; Resource name.
10065	Name *string `json:"name,omitempty"`
10066	// Type - READ-ONLY; Resource type.
10067	Type *string `json:"type,omitempty"`
10068}
10069
10070// MarshalJSON is the custom marshaler for LongTermRetentionBackup.
10071func (ltrb LongTermRetentionBackup) MarshalJSON() ([]byte, error) {
10072	objectMap := make(map[string]interface{})
10073	if ltrb.LongTermRetentionBackupProperties != nil {
10074		objectMap["properties"] = ltrb.LongTermRetentionBackupProperties
10075	}
10076	return json.Marshal(objectMap)
10077}
10078
10079// UnmarshalJSON is the custom unmarshaler for LongTermRetentionBackup struct.
10080func (ltrb *LongTermRetentionBackup) UnmarshalJSON(body []byte) error {
10081	var m map[string]*json.RawMessage
10082	err := json.Unmarshal(body, &m)
10083	if err != nil {
10084		return err
10085	}
10086	for k, v := range m {
10087		switch k {
10088		case "properties":
10089			if v != nil {
10090				var longTermRetentionBackupProperties LongTermRetentionBackupProperties
10091				err = json.Unmarshal(*v, &longTermRetentionBackupProperties)
10092				if err != nil {
10093					return err
10094				}
10095				ltrb.LongTermRetentionBackupProperties = &longTermRetentionBackupProperties
10096			}
10097		case "id":
10098			if v != nil {
10099				var ID string
10100				err = json.Unmarshal(*v, &ID)
10101				if err != nil {
10102					return err
10103				}
10104				ltrb.ID = &ID
10105			}
10106		case "name":
10107			if v != nil {
10108				var name string
10109				err = json.Unmarshal(*v, &name)
10110				if err != nil {
10111					return err
10112				}
10113				ltrb.Name = &name
10114			}
10115		case "type":
10116			if v != nil {
10117				var typeVar string
10118				err = json.Unmarshal(*v, &typeVar)
10119				if err != nil {
10120					return err
10121				}
10122				ltrb.Type = &typeVar
10123			}
10124		}
10125	}
10126
10127	return nil
10128}
10129
10130// LongTermRetentionBackupListResult a list of long term retention backups.
10131type LongTermRetentionBackupListResult struct {
10132	autorest.Response `json:"-"`
10133	// Value - READ-ONLY; Array of results.
10134	Value *[]LongTermRetentionBackup `json:"value,omitempty"`
10135	// NextLink - READ-ONLY; Link to retrieve next page of results.
10136	NextLink *string `json:"nextLink,omitempty"`
10137}
10138
10139// MarshalJSON is the custom marshaler for LongTermRetentionBackupListResult.
10140func (ltrblr LongTermRetentionBackupListResult) MarshalJSON() ([]byte, error) {
10141	objectMap := make(map[string]interface{})
10142	return json.Marshal(objectMap)
10143}
10144
10145// LongTermRetentionBackupListResultIterator provides access to a complete listing of
10146// LongTermRetentionBackup values.
10147type LongTermRetentionBackupListResultIterator struct {
10148	i    int
10149	page LongTermRetentionBackupListResultPage
10150}
10151
10152// NextWithContext advances to the next value.  If there was an error making
10153// the request the iterator does not advance and the error is returned.
10154func (iter *LongTermRetentionBackupListResultIterator) NextWithContext(ctx context.Context) (err error) {
10155	if tracing.IsEnabled() {
10156		ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupListResultIterator.NextWithContext")
10157		defer func() {
10158			sc := -1
10159			if iter.Response().Response.Response != nil {
10160				sc = iter.Response().Response.Response.StatusCode
10161			}
10162			tracing.EndSpan(ctx, sc, err)
10163		}()
10164	}
10165	iter.i++
10166	if iter.i < len(iter.page.Values()) {
10167		return nil
10168	}
10169	err = iter.page.NextWithContext(ctx)
10170	if err != nil {
10171		iter.i--
10172		return err
10173	}
10174	iter.i = 0
10175	return nil
10176}
10177
10178// Next advances to the next value.  If there was an error making
10179// the request the iterator does not advance and the error is returned.
10180// Deprecated: Use NextWithContext() instead.
10181func (iter *LongTermRetentionBackupListResultIterator) Next() error {
10182	return iter.NextWithContext(context.Background())
10183}
10184
10185// NotDone returns true if the enumeration should be started or is not yet complete.
10186func (iter LongTermRetentionBackupListResultIterator) NotDone() bool {
10187	return iter.page.NotDone() && iter.i < len(iter.page.Values())
10188}
10189
10190// Response returns the raw server response from the last page request.
10191func (iter LongTermRetentionBackupListResultIterator) Response() LongTermRetentionBackupListResult {
10192	return iter.page.Response()
10193}
10194
10195// Value returns the current value or a zero-initialized value if the
10196// iterator has advanced beyond the end of the collection.
10197func (iter LongTermRetentionBackupListResultIterator) Value() LongTermRetentionBackup {
10198	if !iter.page.NotDone() {
10199		return LongTermRetentionBackup{}
10200	}
10201	return iter.page.Values()[iter.i]
10202}
10203
10204// Creates a new instance of the LongTermRetentionBackupListResultIterator type.
10205func NewLongTermRetentionBackupListResultIterator(page LongTermRetentionBackupListResultPage) LongTermRetentionBackupListResultIterator {
10206	return LongTermRetentionBackupListResultIterator{page: page}
10207}
10208
10209// IsEmpty returns true if the ListResult contains no values.
10210func (ltrblr LongTermRetentionBackupListResult) IsEmpty() bool {
10211	return ltrblr.Value == nil || len(*ltrblr.Value) == 0
10212}
10213
10214// hasNextLink returns true if the NextLink is not empty.
10215func (ltrblr LongTermRetentionBackupListResult) hasNextLink() bool {
10216	return ltrblr.NextLink != nil && len(*ltrblr.NextLink) != 0
10217}
10218
10219// longTermRetentionBackupListResultPreparer prepares a request to retrieve the next set of results.
10220// It returns nil if no more results exist.
10221func (ltrblr LongTermRetentionBackupListResult) longTermRetentionBackupListResultPreparer(ctx context.Context) (*http.Request, error) {
10222	if !ltrblr.hasNextLink() {
10223		return nil, nil
10224	}
10225	return autorest.Prepare((&http.Request{}).WithContext(ctx),
10226		autorest.AsJSON(),
10227		autorest.AsGet(),
10228		autorest.WithBaseURL(to.String(ltrblr.NextLink)))
10229}
10230
10231// LongTermRetentionBackupListResultPage contains a page of LongTermRetentionBackup values.
10232type LongTermRetentionBackupListResultPage struct {
10233	fn     func(context.Context, LongTermRetentionBackupListResult) (LongTermRetentionBackupListResult, error)
10234	ltrblr LongTermRetentionBackupListResult
10235}
10236
10237// NextWithContext advances to the next page of values.  If there was an error making
10238// the request the page does not advance and the error is returned.
10239func (page *LongTermRetentionBackupListResultPage) NextWithContext(ctx context.Context) (err error) {
10240	if tracing.IsEnabled() {
10241		ctx = tracing.StartSpan(ctx, fqdn+"/LongTermRetentionBackupListResultPage.NextWithContext")
10242		defer func() {
10243			sc := -1
10244			if page.Response().Response.Response != nil {
10245				sc = page.Response().Response.Response.StatusCode
10246			}
10247			tracing.EndSpan(ctx, sc, err)
10248		}()
10249	}
10250	for {
10251		next, err := page.fn(ctx, page.ltrblr)
10252		if err != nil {
10253			return err
10254		}
10255		page.ltrblr = next
10256		if !next.hasNextLink() || !next.IsEmpty() {
10257			break
10258		}
10259	}
10260	return nil
10261}
10262
10263// Next advances to the next page of values.  If there was an error making
10264// the request the page does not advance and the error is returned.
10265// Deprecated: Use NextWithContext() instead.
10266func (page *LongTermRetentionBackupListResultPage) Next() error {
10267	return page.NextWithContext(context.Background())
10268}
10269
10270// NotDone returns true if the page enumeration should be started or is not yet complete.
10271func (page LongTermRetentionBackupListResultPage) NotDone() bool {
10272	return !page.ltrblr.IsEmpty()
10273}
10274
10275// Response returns the raw server response from the last page request.
10276func (page LongTermRetentionBackupListResultPage) Response() LongTermRetentionBackupListResult {
10277	return page.ltrblr
10278}
10279
10280// Values returns the slice of values for the current page or nil if there are no values.
10281func (page LongTermRetentionBackupListResultPage) Values() []LongTermRetentionBackup {
10282	if page.ltrblr.IsEmpty() {
10283		return nil
10284	}
10285	return *page.ltrblr.Value
10286}
10287
10288// Creates a new instance of the LongTermRetentionBackupListResultPage type.
10289func NewLongTermRetentionBackupListResultPage(cur LongTermRetentionBackupListResult, getNextPage func(context.Context, LongTermRetentionBackupListResult) (LongTermRetentionBackupListResult, error)) LongTermRetentionBackupListResultPage {
10290	return LongTermRetentionBackupListResultPage{
10291		fn:     getNextPage,
10292		ltrblr: cur,
10293	}
10294}
10295
10296// LongTermRetentionBackupProperties properties of a long term retention backup
10297type LongTermRetentionBackupProperties struct {
10298	// ServerName - READ-ONLY; The server name that the backup database belong to.
10299	ServerName *string `json:"serverName,omitempty"`
10300	// ServerCreateTime - READ-ONLY; The create time of the server.
10301	ServerCreateTime *date.Time `json:"serverCreateTime,omitempty"`
10302	// DatabaseName - READ-ONLY; The name of the database the backup belong to
10303	DatabaseName *string `json:"databaseName,omitempty"`
10304	// DatabaseDeletionTime - READ-ONLY; The delete time of the database
10305	DatabaseDeletionTime *date.Time `json:"databaseDeletionTime,omitempty"`
10306	// BackupTime - READ-ONLY; The time the backup was taken
10307	BackupTime *date.Time `json:"backupTime,omitempty"`
10308	// BackupExpirationTime - READ-ONLY; The time the long term retention backup will expire.
10309	BackupExpirationTime *date.Time `json:"backupExpirationTime,omitempty"`
10310}
10311
10312// MarshalJSON is the custom marshaler for LongTermRetentionBackupProperties.
10313func (ltrbp LongTermRetentionBackupProperties) MarshalJSON() ([]byte, error) {
10314	objectMap := make(map[string]interface{})
10315	return json.Marshal(objectMap)
10316}
10317
10318// LongTermRetentionBackupsDeleteByResourceGroupFuture an abstraction for monitoring and retrieving the
10319// results of a long-running operation.
10320type LongTermRetentionBackupsDeleteByResourceGroupFuture struct {
10321	azure.FutureAPI
10322	// Result returns the result of the asynchronous operation.
10323	// If the operation has not completed it will return an error.
10324	Result func(LongTermRetentionBackupsClient) (autorest.Response, error)
10325}
10326
10327// UnmarshalJSON is the custom unmarshaller for CreateFuture.
10328func (future *LongTermRetentionBackupsDeleteByResourceGroupFuture) UnmarshalJSON(body []byte) error {
10329	var azFuture azure.Future
10330	if err := json.Unmarshal(body, &azFuture); err != nil {
10331		return err
10332	}
10333	future.FutureAPI = &azFuture
10334	future.Result = future.result
10335	return nil
10336}
10337
10338// result is the default implementation for LongTermRetentionBackupsDeleteByResourceGroupFuture.Result.
10339func (future *LongTermRetentionBackupsDeleteByResourceGroupFuture) result(client LongTermRetentionBackupsClient) (ar autorest.Response, err error) {
10340	var done bool
10341	done, err = future.DoneWithContext(context.Background(), client)
10342	if err != nil {
10343		err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsDeleteByResourceGroupFuture", "Result", future.Response(), "Polling failure")
10344		return
10345	}
10346	if !done {
10347		ar.Response = future.Response()
10348		err = azure.NewAsyncOpIncompleteError("sql.LongTermRetentionBackupsDeleteByResourceGroupFuture")
10349		return
10350	}
10351	ar.Response = future.Response()
10352	return
10353}
10354
10355// LongTermRetentionBackupsDeleteFuture an abstraction for monitoring and retrieving the results of a
10356// long-running operation.
10357type LongTermRetentionBackupsDeleteFuture struct {
10358	azure.FutureAPI
10359	// Result returns the result of the asynchronous operation.
10360	// If the operation has not completed it will return an error.
10361	Result func(LongTermRetentionBackupsClient) (autorest.Response, error)
10362}
10363
10364// UnmarshalJSON is the custom unmarshaller for CreateFuture.
10365func (future *LongTermRetentionBackupsDeleteFuture) UnmarshalJSON(body []byte) error {
10366	var azFuture azure.Future
10367	if err := json.Unmarshal(body, &azFuture); err != nil {
10368		return err
10369	}
10370	future.FutureAPI = &azFuture
10371	future.Result = future.result
10372	return nil
10373}
10374
10375// result is the default implementation for LongTermRetentionBackupsDeleteFuture.Result.
10376func (future *LongTermRetentionBackupsDeleteFuture) result(client LongTermRetentionBackupsClient) (ar autorest.Response, err error) {
10377	var done bool
10378	done, err = future.DoneWithContext(context.Background(), client)
10379	if err != nil {
10380		err = autorest.NewErrorWithError(err, "sql.LongTermRetentionBackupsDeleteFuture", "Result", future.Response(), "Polling failure")
10381		return
10382	}
10383	if !done {
10384		ar.Response = future.Response()
10385		err = azure.NewAsyncOpIncompleteError("sql.LongTermRetentionBackupsDeleteFuture")
10386		return
10387	}
10388	ar.Response = future.Response()
10389	return
10390}
10391
10392// LongTermRetentionManagedInstanceBackupsDeleteByResourceGroupFuture an abstraction for monitoring and
10393// retrieving the results of a long-running operation.
10394type LongTermRetentionManagedInstanceBackupsDeleteByResourceGroupFuture struct {
10395	azure.FutureAPI
10396	// Result returns the result of the asynchronous operation.
10397	// If the operation has not completed it will return an error.
10398	Result func(LongTermRetentionManagedInstanceBackupsClient) (autorest.Response, error)
10399}
10400
10401// UnmarshalJSON is the custom unmarshaller for CreateFuture.
10402func (future *LongTermRetentionManagedInstanceBackupsDeleteByResourceGroupFuture) UnmarshalJSON(body []byte) error {
10403	var azFuture azure.Future
10404	if err := json.Unmarshal(body, &azFuture); err != nil {
10405		return err
10406	}
10407	future.FutureAPI = &azFuture
10408	future.Result = future.result
10409	return nil
10410}
10411
10412// result is the default implementation for LongTermRetentionManagedInstanceBackupsDeleteByResourceGroupFuture.Result.
10413func (future *LongTermRetentionManagedInstanceBackupsDeleteByResourceGroupFuture) result(client LongTermRetentionManagedInstanceBackupsClient) (ar autorest.Response, err error) {
10414	var done bool
10415	done, err = future.DoneWithContext(context.Background(), client)
10416	if err != nil {
10417		err = autorest.NewErrorWithError(err, "sql.LongTermRetentionManagedInstanceBackupsDeleteByResourceGroupFuture", "Result", future.Response(), "Polling failure")
10418		return
10419	}
10420	if !done {
10421		ar.Response = future.Response()
10422		err = azure.NewAsyncOpIncompleteError("sql.LongTermRetentionManagedInstanceBackupsDeleteByResourceGroupFuture")
10423		return
10424	}
10425	ar.Response = future.Response()
10426	return
10427}
10428
10429// LongTermRetentionManagedInstanceBackupsDeleteFuture an abstraction for monitoring and retrieving the
10430// results of a long-running operation.
10431type LongTermRetentionManagedInstanceBackupsDeleteFuture struct {
10432	azure.FutureAPI
10433	// Result returns the result of the asynchronous operation.
10434	// If the operation has not completed it will return an error.
10435	Result func(LongTermRetentionManagedInstanceBackupsClient) (autorest.Response, error)
10436}
10437
10438// UnmarshalJSON is the custom unmarshaller for CreateFuture.
10439func (future *LongTermRetentionManagedInstanceBackupsDeleteFuture) UnmarshalJSON(body []byte) error {
10440	var azFuture azure.Future
10441	if err := json.Unmarshal(body, &azFuture); err != nil {
10442		return err
10443	}
10444	future.FutureAPI = &azFuture
10445	future.Result = future.result
10446	return nil
10447}
10448
10449// result is the default implementation for LongTermRetentionManagedInstanceBackupsDeleteFuture.Result.
10450func (future *LongTermRetentionManagedInstanceBackupsDeleteFuture) result(client LongTermRetentionManagedInstanceBackupsClient) (ar autorest.Response, err error) {
10451	var done bool
10452	done, err = future.DoneWithContext(context.Background(), client)
10453	if err != nil {
10454		err = autorest.NewErrorWithError(err, "sql.LongTermRetentionManagedInstanceBackupsDeleteFuture", "Result", future.Response(), "Polling failure")
10455		return
10456	}
10457	if !done {
10458		ar.Response = future.Response()
10459		err = azure.NewAsyncOpIncompleteError("sql.LongTermRetentionManagedInstanceBackupsDeleteFuture")
10460		return
10461	}
10462	ar.Response = future.Response()
10463	return
10464}
10465
10466// LongTermRetentionPolicyProperties properties of a long term retention policy
10467type LongTermRetentionPolicyProperties struct {
10468	// WeeklyRetention - The weekly retention policy for an LTR backup in an ISO 8601 format.
10469	WeeklyRetention *string `json:"weeklyRetention,omitempty"`
10470	// MonthlyRetention - The monthly retention policy for an LTR backup in an ISO 8601 format.
10471	MonthlyRetention *string `json:"monthlyRetention,omitempty"`
10472	// YearlyRetention - The yearly retention policy for an LTR backup in an ISO 8601 format.
10473	YearlyRetention *string `json:"yearlyRetention,omitempty"`
10474	// WeekOfYear - The week of year to take the yearly backup in an ISO 8601 format.
10475	WeekOfYear *int32 `json:"weekOfYear,omitempty"`
10476}
10477
10478// ManagedBackupShortTermRetentionPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving
10479// the results of a long-running operation.
10480type ManagedBackupShortTermRetentionPoliciesCreateOrUpdateFuture struct {
10481	azure.FutureAPI
10482	// Result returns the result of the asynchronous operation.
10483	// If the operation has not completed it will return an error.
10484	Result func(ManagedBackupShortTermRetentionPoliciesClient) (ManagedBackupShortTermRetentionPolicy, error)
10485}
10486
10487// UnmarshalJSON is the custom unmarshaller for CreateFuture.
10488func (future *ManagedBackupShortTermRetentionPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
10489	var azFuture azure.Future
10490	if err := json.Unmarshal(body, &azFuture); err != nil {
10491		return err
10492	}
10493	future.FutureAPI = &azFuture
10494	future.Result = future.result
10495	return nil
10496}
10497
10498// result is the default implementation for ManagedBackupShortTermRetentionPoliciesCreateOrUpdateFuture.Result.
10499func (future *ManagedBackupShortTermRetentionPoliciesCreateOrUpdateFuture) result(client ManagedBackupShortTermRetentionPoliciesClient) (mbstrp ManagedBackupShortTermRetentionPolicy, err error) {
10500	var done bool
10501	done, err = future.DoneWithContext(context.Background(), client)
10502	if err != nil {
10503		err = autorest.NewErrorWithError(err, "sql.ManagedBackupShortTermRetentionPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
10504		return
10505	}
10506	if !done {
10507		mbstrp.Response.Response = future.Response()
10508		err = azure.NewAsyncOpIncompleteError("sql.ManagedBackupShortTermRetentionPoliciesCreateOrUpdateFuture")
10509		return
10510	}
10511	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10512	if mbstrp.Response.Response, err = future.GetResult(sender); err == nil && mbstrp.Response.Response.StatusCode != http.StatusNoContent {
10513		mbstrp, err = client.CreateOrUpdateResponder(mbstrp.Response.Response)
10514		if err != nil {
10515			err = autorest.NewErrorWithError(err, "sql.ManagedBackupShortTermRetentionPoliciesCreateOrUpdateFuture", "Result", mbstrp.Response.Response, "Failure responding to request")
10516		}
10517	}
10518	return
10519}
10520
10521// ManagedBackupShortTermRetentionPoliciesUpdateFuture an abstraction for monitoring and retrieving the
10522// results of a long-running operation.
10523type ManagedBackupShortTermRetentionPoliciesUpdateFuture struct {
10524	azure.FutureAPI
10525	// Result returns the result of the asynchronous operation.
10526	// If the operation has not completed it will return an error.
10527	Result func(ManagedBackupShortTermRetentionPoliciesClient) (ManagedBackupShortTermRetentionPolicy, error)
10528}
10529
10530// UnmarshalJSON is the custom unmarshaller for CreateFuture.
10531func (future *ManagedBackupShortTermRetentionPoliciesUpdateFuture) UnmarshalJSON(body []byte) error {
10532	var azFuture azure.Future
10533	if err := json.Unmarshal(body, &azFuture); err != nil {
10534		return err
10535	}
10536	future.FutureAPI = &azFuture
10537	future.Result = future.result
10538	return nil
10539}
10540
10541// result is the default implementation for ManagedBackupShortTermRetentionPoliciesUpdateFuture.Result.
10542func (future *ManagedBackupShortTermRetentionPoliciesUpdateFuture) result(client ManagedBackupShortTermRetentionPoliciesClient) (mbstrp ManagedBackupShortTermRetentionPolicy, err error) {
10543	var done bool
10544	done, err = future.DoneWithContext(context.Background(), client)
10545	if err != nil {
10546		err = autorest.NewErrorWithError(err, "sql.ManagedBackupShortTermRetentionPoliciesUpdateFuture", "Result", future.Response(), "Polling failure")
10547		return
10548	}
10549	if !done {
10550		mbstrp.Response.Response = future.Response()
10551		err = azure.NewAsyncOpIncompleteError("sql.ManagedBackupShortTermRetentionPoliciesUpdateFuture")
10552		return
10553	}
10554	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10555	if mbstrp.Response.Response, err = future.GetResult(sender); err == nil && mbstrp.Response.Response.StatusCode != http.StatusNoContent {
10556		mbstrp, err = client.UpdateResponder(mbstrp.Response.Response)
10557		if err != nil {
10558			err = autorest.NewErrorWithError(err, "sql.ManagedBackupShortTermRetentionPoliciesUpdateFuture", "Result", mbstrp.Response.Response, "Failure responding to request")
10559		}
10560	}
10561	return
10562}
10563
10564// ManagedBackupShortTermRetentionPolicy a short term retention policy.
10565type ManagedBackupShortTermRetentionPolicy struct {
10566	autorest.Response `json:"-"`
10567	// ManagedBackupShortTermRetentionPolicyProperties - Resource properties.
10568	*ManagedBackupShortTermRetentionPolicyProperties `json:"properties,omitempty"`
10569	// ID - READ-ONLY; Resource ID.
10570	ID *string `json:"id,omitempty"`
10571	// Name - READ-ONLY; Resource name.
10572	Name *string `json:"name,omitempty"`
10573	// Type - READ-ONLY; Resource type.
10574	Type *string `json:"type,omitempty"`
10575}
10576
10577// MarshalJSON is the custom marshaler for ManagedBackupShortTermRetentionPolicy.
10578func (mbstrp ManagedBackupShortTermRetentionPolicy) MarshalJSON() ([]byte, error) {
10579	objectMap := make(map[string]interface{})
10580	if mbstrp.ManagedBackupShortTermRetentionPolicyProperties != nil {
10581		objectMap["properties"] = mbstrp.ManagedBackupShortTermRetentionPolicyProperties
10582	}
10583	return json.Marshal(objectMap)
10584}
10585
10586// UnmarshalJSON is the custom unmarshaler for ManagedBackupShortTermRetentionPolicy struct.
10587func (mbstrp *ManagedBackupShortTermRetentionPolicy) UnmarshalJSON(body []byte) error {
10588	var m map[string]*json.RawMessage
10589	err := json.Unmarshal(body, &m)
10590	if err != nil {
10591		return err
10592	}
10593	for k, v := range m {
10594		switch k {
10595		case "properties":
10596			if v != nil {
10597				var managedBackupShortTermRetentionPolicyProperties ManagedBackupShortTermRetentionPolicyProperties
10598				err = json.Unmarshal(*v, &managedBackupShortTermRetentionPolicyProperties)
10599				if err != nil {
10600					return err
10601				}
10602				mbstrp.ManagedBackupShortTermRetentionPolicyProperties = &managedBackupShortTermRetentionPolicyProperties
10603			}
10604		case "id":
10605			if v != nil {
10606				var ID string
10607				err = json.Unmarshal(*v, &ID)
10608				if err != nil {
10609					return err
10610				}
10611				mbstrp.ID = &ID
10612			}
10613		case "name":
10614			if v != nil {
10615				var name string
10616				err = json.Unmarshal(*v, &name)
10617				if err != nil {
10618					return err
10619				}
10620				mbstrp.Name = &name
10621			}
10622		case "type":
10623			if v != nil {
10624				var typeVar string
10625				err = json.Unmarshal(*v, &typeVar)
10626				if err != nil {
10627					return err
10628				}
10629				mbstrp.Type = &typeVar
10630			}
10631		}
10632	}
10633
10634	return nil
10635}
10636
10637// ManagedBackupShortTermRetentionPolicyListResult a list of short term retention policies.
10638type ManagedBackupShortTermRetentionPolicyListResult struct {
10639	autorest.Response `json:"-"`
10640	// Value - READ-ONLY; Array of results.
10641	Value *[]ManagedBackupShortTermRetentionPolicy `json:"value,omitempty"`
10642	// NextLink - READ-ONLY; Link to retrieve next page of results.
10643	NextLink *string `json:"nextLink,omitempty"`
10644}
10645
10646// MarshalJSON is the custom marshaler for ManagedBackupShortTermRetentionPolicyListResult.
10647func (mbstrplr ManagedBackupShortTermRetentionPolicyListResult) MarshalJSON() ([]byte, error) {
10648	objectMap := make(map[string]interface{})
10649	return json.Marshal(objectMap)
10650}
10651
10652// ManagedBackupShortTermRetentionPolicyListResultIterator provides access to a complete listing of
10653// ManagedBackupShortTermRetentionPolicy values.
10654type ManagedBackupShortTermRetentionPolicyListResultIterator struct {
10655	i    int
10656	page ManagedBackupShortTermRetentionPolicyListResultPage
10657}
10658
10659// NextWithContext advances to the next value.  If there was an error making
10660// the request the iterator does not advance and the error is returned.
10661func (iter *ManagedBackupShortTermRetentionPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
10662	if tracing.IsEnabled() {
10663		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedBackupShortTermRetentionPolicyListResultIterator.NextWithContext")
10664		defer func() {
10665			sc := -1
10666			if iter.Response().Response.Response != nil {
10667				sc = iter.Response().Response.Response.StatusCode
10668			}
10669			tracing.EndSpan(ctx, sc, err)
10670		}()
10671	}
10672	iter.i++
10673	if iter.i < len(iter.page.Values()) {
10674		return nil
10675	}
10676	err = iter.page.NextWithContext(ctx)
10677	if err != nil {
10678		iter.i--
10679		return err
10680	}
10681	iter.i = 0
10682	return nil
10683}
10684
10685// Next advances to the next value.  If there was an error making
10686// the request the iterator does not advance and the error is returned.
10687// Deprecated: Use NextWithContext() instead.
10688func (iter *ManagedBackupShortTermRetentionPolicyListResultIterator) Next() error {
10689	return iter.NextWithContext(context.Background())
10690}
10691
10692// NotDone returns true if the enumeration should be started or is not yet complete.
10693func (iter ManagedBackupShortTermRetentionPolicyListResultIterator) NotDone() bool {
10694	return iter.page.NotDone() && iter.i < len(iter.page.Values())
10695}
10696
10697// Response returns the raw server response from the last page request.
10698func (iter ManagedBackupShortTermRetentionPolicyListResultIterator) Response() ManagedBackupShortTermRetentionPolicyListResult {
10699	return iter.page.Response()
10700}
10701
10702// Value returns the current value or a zero-initialized value if the
10703// iterator has advanced beyond the end of the collection.
10704func (iter ManagedBackupShortTermRetentionPolicyListResultIterator) Value() ManagedBackupShortTermRetentionPolicy {
10705	if !iter.page.NotDone() {
10706		return ManagedBackupShortTermRetentionPolicy{}
10707	}
10708	return iter.page.Values()[iter.i]
10709}
10710
10711// Creates a new instance of the ManagedBackupShortTermRetentionPolicyListResultIterator type.
10712func NewManagedBackupShortTermRetentionPolicyListResultIterator(page ManagedBackupShortTermRetentionPolicyListResultPage) ManagedBackupShortTermRetentionPolicyListResultIterator {
10713	return ManagedBackupShortTermRetentionPolicyListResultIterator{page: page}
10714}
10715
10716// IsEmpty returns true if the ListResult contains no values.
10717func (mbstrplr ManagedBackupShortTermRetentionPolicyListResult) IsEmpty() bool {
10718	return mbstrplr.Value == nil || len(*mbstrplr.Value) == 0
10719}
10720
10721// hasNextLink returns true if the NextLink is not empty.
10722func (mbstrplr ManagedBackupShortTermRetentionPolicyListResult) hasNextLink() bool {
10723	return mbstrplr.NextLink != nil && len(*mbstrplr.NextLink) != 0
10724}
10725
10726// managedBackupShortTermRetentionPolicyListResultPreparer prepares a request to retrieve the next set of results.
10727// It returns nil if no more results exist.
10728func (mbstrplr ManagedBackupShortTermRetentionPolicyListResult) managedBackupShortTermRetentionPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
10729	if !mbstrplr.hasNextLink() {
10730		return nil, nil
10731	}
10732	return autorest.Prepare((&http.Request{}).WithContext(ctx),
10733		autorest.AsJSON(),
10734		autorest.AsGet(),
10735		autorest.WithBaseURL(to.String(mbstrplr.NextLink)))
10736}
10737
10738// ManagedBackupShortTermRetentionPolicyListResultPage contains a page of
10739// ManagedBackupShortTermRetentionPolicy values.
10740type ManagedBackupShortTermRetentionPolicyListResultPage struct {
10741	fn       func(context.Context, ManagedBackupShortTermRetentionPolicyListResult) (ManagedBackupShortTermRetentionPolicyListResult, error)
10742	mbstrplr ManagedBackupShortTermRetentionPolicyListResult
10743}
10744
10745// NextWithContext advances to the next page of values.  If there was an error making
10746// the request the page does not advance and the error is returned.
10747func (page *ManagedBackupShortTermRetentionPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
10748	if tracing.IsEnabled() {
10749		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedBackupShortTermRetentionPolicyListResultPage.NextWithContext")
10750		defer func() {
10751			sc := -1
10752			if page.Response().Response.Response != nil {
10753				sc = page.Response().Response.Response.StatusCode
10754			}
10755			tracing.EndSpan(ctx, sc, err)
10756		}()
10757	}
10758	for {
10759		next, err := page.fn(ctx, page.mbstrplr)
10760		if err != nil {
10761			return err
10762		}
10763		page.mbstrplr = next
10764		if !next.hasNextLink() || !next.IsEmpty() {
10765			break
10766		}
10767	}
10768	return nil
10769}
10770
10771// Next advances to the next page of values.  If there was an error making
10772// the request the page does not advance and the error is returned.
10773// Deprecated: Use NextWithContext() instead.
10774func (page *ManagedBackupShortTermRetentionPolicyListResultPage) Next() error {
10775	return page.NextWithContext(context.Background())
10776}
10777
10778// NotDone returns true if the page enumeration should be started or is not yet complete.
10779func (page ManagedBackupShortTermRetentionPolicyListResultPage) NotDone() bool {
10780	return !page.mbstrplr.IsEmpty()
10781}
10782
10783// Response returns the raw server response from the last page request.
10784func (page ManagedBackupShortTermRetentionPolicyListResultPage) Response() ManagedBackupShortTermRetentionPolicyListResult {
10785	return page.mbstrplr
10786}
10787
10788// Values returns the slice of values for the current page or nil if there are no values.
10789func (page ManagedBackupShortTermRetentionPolicyListResultPage) Values() []ManagedBackupShortTermRetentionPolicy {
10790	if page.mbstrplr.IsEmpty() {
10791		return nil
10792	}
10793	return *page.mbstrplr.Value
10794}
10795
10796// Creates a new instance of the ManagedBackupShortTermRetentionPolicyListResultPage type.
10797func NewManagedBackupShortTermRetentionPolicyListResultPage(cur ManagedBackupShortTermRetentionPolicyListResult, getNextPage func(context.Context, ManagedBackupShortTermRetentionPolicyListResult) (ManagedBackupShortTermRetentionPolicyListResult, error)) ManagedBackupShortTermRetentionPolicyListResultPage {
10798	return ManagedBackupShortTermRetentionPolicyListResultPage{
10799		fn:       getNextPage,
10800		mbstrplr: cur,
10801	}
10802}
10803
10804// ManagedBackupShortTermRetentionPolicyProperties properties of a short term retention policy
10805type ManagedBackupShortTermRetentionPolicyProperties struct {
10806	// RetentionDays - The backup retention period in days. This is how many days Point-in-Time Restore will be supported.
10807	RetentionDays *int32 `json:"retentionDays,omitempty"`
10808}
10809
10810// ManagedDatabase a managed database resource.
10811type ManagedDatabase struct {
10812	autorest.Response `json:"-"`
10813	// ManagedDatabaseProperties - Resource properties.
10814	*ManagedDatabaseProperties `json:"properties,omitempty"`
10815	// Location - Resource location.
10816	Location *string `json:"location,omitempty"`
10817	// Tags - Resource tags.
10818	Tags map[string]*string `json:"tags"`
10819	// ID - READ-ONLY; Resource ID.
10820	ID *string `json:"id,omitempty"`
10821	// Name - READ-ONLY; Resource name.
10822	Name *string `json:"name,omitempty"`
10823	// Type - READ-ONLY; Resource type.
10824	Type *string `json:"type,omitempty"`
10825}
10826
10827// MarshalJSON is the custom marshaler for ManagedDatabase.
10828func (md ManagedDatabase) MarshalJSON() ([]byte, error) {
10829	objectMap := make(map[string]interface{})
10830	if md.ManagedDatabaseProperties != nil {
10831		objectMap["properties"] = md.ManagedDatabaseProperties
10832	}
10833	if md.Location != nil {
10834		objectMap["location"] = md.Location
10835	}
10836	if md.Tags != nil {
10837		objectMap["tags"] = md.Tags
10838	}
10839	return json.Marshal(objectMap)
10840}
10841
10842// UnmarshalJSON is the custom unmarshaler for ManagedDatabase struct.
10843func (md *ManagedDatabase) UnmarshalJSON(body []byte) error {
10844	var m map[string]*json.RawMessage
10845	err := json.Unmarshal(body, &m)
10846	if err != nil {
10847		return err
10848	}
10849	for k, v := range m {
10850		switch k {
10851		case "properties":
10852			if v != nil {
10853				var managedDatabaseProperties ManagedDatabaseProperties
10854				err = json.Unmarshal(*v, &managedDatabaseProperties)
10855				if err != nil {
10856					return err
10857				}
10858				md.ManagedDatabaseProperties = &managedDatabaseProperties
10859			}
10860		case "location":
10861			if v != nil {
10862				var location string
10863				err = json.Unmarshal(*v, &location)
10864				if err != nil {
10865					return err
10866				}
10867				md.Location = &location
10868			}
10869		case "tags":
10870			if v != nil {
10871				var tags map[string]*string
10872				err = json.Unmarshal(*v, &tags)
10873				if err != nil {
10874					return err
10875				}
10876				md.Tags = tags
10877			}
10878		case "id":
10879			if v != nil {
10880				var ID string
10881				err = json.Unmarshal(*v, &ID)
10882				if err != nil {
10883					return err
10884				}
10885				md.ID = &ID
10886			}
10887		case "name":
10888			if v != nil {
10889				var name string
10890				err = json.Unmarshal(*v, &name)
10891				if err != nil {
10892					return err
10893				}
10894				md.Name = &name
10895			}
10896		case "type":
10897			if v != nil {
10898				var typeVar string
10899				err = json.Unmarshal(*v, &typeVar)
10900				if err != nil {
10901					return err
10902				}
10903				md.Type = &typeVar
10904			}
10905		}
10906	}
10907
10908	return nil
10909}
10910
10911// ManagedDatabaseListResult a list of managed databases.
10912type ManagedDatabaseListResult struct {
10913	autorest.Response `json:"-"`
10914	// Value - READ-ONLY; Array of results.
10915	Value *[]ManagedDatabase `json:"value,omitempty"`
10916	// NextLink - READ-ONLY; Link to retrieve next page of results.
10917	NextLink *string `json:"nextLink,omitempty"`
10918}
10919
10920// MarshalJSON is the custom marshaler for ManagedDatabaseListResult.
10921func (mdlr ManagedDatabaseListResult) MarshalJSON() ([]byte, error) {
10922	objectMap := make(map[string]interface{})
10923	return json.Marshal(objectMap)
10924}
10925
10926// ManagedDatabaseListResultIterator provides access to a complete listing of ManagedDatabase values.
10927type ManagedDatabaseListResultIterator struct {
10928	i    int
10929	page ManagedDatabaseListResultPage
10930}
10931
10932// NextWithContext advances to the next value.  If there was an error making
10933// the request the iterator does not advance and the error is returned.
10934func (iter *ManagedDatabaseListResultIterator) NextWithContext(ctx context.Context) (err error) {
10935	if tracing.IsEnabled() {
10936		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseListResultIterator.NextWithContext")
10937		defer func() {
10938			sc := -1
10939			if iter.Response().Response.Response != nil {
10940				sc = iter.Response().Response.Response.StatusCode
10941			}
10942			tracing.EndSpan(ctx, sc, err)
10943		}()
10944	}
10945	iter.i++
10946	if iter.i < len(iter.page.Values()) {
10947		return nil
10948	}
10949	err = iter.page.NextWithContext(ctx)
10950	if err != nil {
10951		iter.i--
10952		return err
10953	}
10954	iter.i = 0
10955	return nil
10956}
10957
10958// Next advances to the next value.  If there was an error making
10959// the request the iterator does not advance and the error is returned.
10960// Deprecated: Use NextWithContext() instead.
10961func (iter *ManagedDatabaseListResultIterator) Next() error {
10962	return iter.NextWithContext(context.Background())
10963}
10964
10965// NotDone returns true if the enumeration should be started or is not yet complete.
10966func (iter ManagedDatabaseListResultIterator) NotDone() bool {
10967	return iter.page.NotDone() && iter.i < len(iter.page.Values())
10968}
10969
10970// Response returns the raw server response from the last page request.
10971func (iter ManagedDatabaseListResultIterator) Response() ManagedDatabaseListResult {
10972	return iter.page.Response()
10973}
10974
10975// Value returns the current value or a zero-initialized value if the
10976// iterator has advanced beyond the end of the collection.
10977func (iter ManagedDatabaseListResultIterator) Value() ManagedDatabase {
10978	if !iter.page.NotDone() {
10979		return ManagedDatabase{}
10980	}
10981	return iter.page.Values()[iter.i]
10982}
10983
10984// Creates a new instance of the ManagedDatabaseListResultIterator type.
10985func NewManagedDatabaseListResultIterator(page ManagedDatabaseListResultPage) ManagedDatabaseListResultIterator {
10986	return ManagedDatabaseListResultIterator{page: page}
10987}
10988
10989// IsEmpty returns true if the ListResult contains no values.
10990func (mdlr ManagedDatabaseListResult) IsEmpty() bool {
10991	return mdlr.Value == nil || len(*mdlr.Value) == 0
10992}
10993
10994// hasNextLink returns true if the NextLink is not empty.
10995func (mdlr ManagedDatabaseListResult) hasNextLink() bool {
10996	return mdlr.NextLink != nil && len(*mdlr.NextLink) != 0
10997}
10998
10999// managedDatabaseListResultPreparer prepares a request to retrieve the next set of results.
11000// It returns nil if no more results exist.
11001func (mdlr ManagedDatabaseListResult) managedDatabaseListResultPreparer(ctx context.Context) (*http.Request, error) {
11002	if !mdlr.hasNextLink() {
11003		return nil, nil
11004	}
11005	return autorest.Prepare((&http.Request{}).WithContext(ctx),
11006		autorest.AsJSON(),
11007		autorest.AsGet(),
11008		autorest.WithBaseURL(to.String(mdlr.NextLink)))
11009}
11010
11011// ManagedDatabaseListResultPage contains a page of ManagedDatabase values.
11012type ManagedDatabaseListResultPage struct {
11013	fn   func(context.Context, ManagedDatabaseListResult) (ManagedDatabaseListResult, error)
11014	mdlr ManagedDatabaseListResult
11015}
11016
11017// NextWithContext advances to the next page of values.  If there was an error making
11018// the request the page does not advance and the error is returned.
11019func (page *ManagedDatabaseListResultPage) NextWithContext(ctx context.Context) (err error) {
11020	if tracing.IsEnabled() {
11021		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseListResultPage.NextWithContext")
11022		defer func() {
11023			sc := -1
11024			if page.Response().Response.Response != nil {
11025				sc = page.Response().Response.Response.StatusCode
11026			}
11027			tracing.EndSpan(ctx, sc, err)
11028		}()
11029	}
11030	for {
11031		next, err := page.fn(ctx, page.mdlr)
11032		if err != nil {
11033			return err
11034		}
11035		page.mdlr = next
11036		if !next.hasNextLink() || !next.IsEmpty() {
11037			break
11038		}
11039	}
11040	return nil
11041}
11042
11043// Next advances to the next page of values.  If there was an error making
11044// the request the page does not advance and the error is returned.
11045// Deprecated: Use NextWithContext() instead.
11046func (page *ManagedDatabaseListResultPage) Next() error {
11047	return page.NextWithContext(context.Background())
11048}
11049
11050// NotDone returns true if the page enumeration should be started or is not yet complete.
11051func (page ManagedDatabaseListResultPage) NotDone() bool {
11052	return !page.mdlr.IsEmpty()
11053}
11054
11055// Response returns the raw server response from the last page request.
11056func (page ManagedDatabaseListResultPage) Response() ManagedDatabaseListResult {
11057	return page.mdlr
11058}
11059
11060// Values returns the slice of values for the current page or nil if there are no values.
11061func (page ManagedDatabaseListResultPage) Values() []ManagedDatabase {
11062	if page.mdlr.IsEmpty() {
11063		return nil
11064	}
11065	return *page.mdlr.Value
11066}
11067
11068// Creates a new instance of the ManagedDatabaseListResultPage type.
11069func NewManagedDatabaseListResultPage(cur ManagedDatabaseListResult, getNextPage func(context.Context, ManagedDatabaseListResult) (ManagedDatabaseListResult, error)) ManagedDatabaseListResultPage {
11070	return ManagedDatabaseListResultPage{
11071		fn:   getNextPage,
11072		mdlr: cur,
11073	}
11074}
11075
11076// ManagedDatabaseProperties the managed database's properties.
11077type ManagedDatabaseProperties struct {
11078	// Collation - Collation of the managed database.
11079	Collation *string `json:"collation,omitempty"`
11080	// Status - READ-ONLY; Status of the database. Possible values include: 'Online', 'Offline', 'Shutdown', 'Creating', 'Inaccessible', 'Restoring', 'Updating'
11081	Status ManagedDatabaseStatus `json:"status,omitempty"`
11082	// CreationDate - READ-ONLY; Creation date of the database.
11083	CreationDate *date.Time `json:"creationDate,omitempty"`
11084	// EarliestRestorePoint - READ-ONLY; Earliest restore point in time for point in time restore.
11085	EarliestRestorePoint *date.Time `json:"earliestRestorePoint,omitempty"`
11086	// 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.
11087	RestorePointInTime *date.Time `json:"restorePointInTime,omitempty"`
11088	// DefaultSecondaryLocation - READ-ONLY; Geo paired region.
11089	DefaultSecondaryLocation *string `json:"defaultSecondaryLocation,omitempty"`
11090	// CatalogCollation - Collation of the metadata catalog. Possible values include: 'DATABASEDEFAULT', 'SQLLatin1GeneralCP1CIAS'
11091	CatalogCollation CatalogCollationType `json:"catalogCollation,omitempty"`
11092	// 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'
11093	CreateMode ManagedDatabaseCreateMode `json:"createMode,omitempty"`
11094	// StorageContainerURI - Conditional. If createMode is RestoreExternalBackup, this value is required. Specifies the uri of the storage container where backups for this restore are stored.
11095	StorageContainerURI *string `json:"storageContainerUri,omitempty"`
11096	// SourceDatabaseID - The resource identifier of the source database associated with create operation of this database.
11097	SourceDatabaseID *string `json:"sourceDatabaseId,omitempty"`
11098	// RestorableDroppedDatabaseID - The restorable dropped database resource id to restore when creating this database.
11099	RestorableDroppedDatabaseID *string `json:"restorableDroppedDatabaseId,omitempty"`
11100	// StorageContainerSasToken - Conditional. If createMode is RestoreExternalBackup, this value is required. Specifies the storage container sas token.
11101	StorageContainerSasToken *string `json:"storageContainerSasToken,omitempty"`
11102	// FailoverGroupID - READ-ONLY; Instance Failover Group resource identifier that this managed database belongs to.
11103	FailoverGroupID *string `json:"failoverGroupId,omitempty"`
11104	// RecoverableDatabaseID - The resource identifier of the recoverable database associated with create operation of this database.
11105	RecoverableDatabaseID *string `json:"recoverableDatabaseId,omitempty"`
11106	// LongTermRetentionBackupResourceID - The name of the Long Term Retention backup to be used for restore of this managed database.
11107	LongTermRetentionBackupResourceID *string `json:"longTermRetentionBackupResourceId,omitempty"`
11108	// AutoCompleteRestore - Whether to auto complete restore of this managed database.
11109	AutoCompleteRestore *bool `json:"autoCompleteRestore,omitempty"`
11110	// LastBackupName - Last backup file name for restore of this managed database.
11111	LastBackupName *string `json:"lastBackupName,omitempty"`
11112}
11113
11114// MarshalJSON is the custom marshaler for ManagedDatabaseProperties.
11115func (mdp ManagedDatabaseProperties) MarshalJSON() ([]byte, error) {
11116	objectMap := make(map[string]interface{})
11117	if mdp.Collation != nil {
11118		objectMap["collation"] = mdp.Collation
11119	}
11120	if mdp.RestorePointInTime != nil {
11121		objectMap["restorePointInTime"] = mdp.RestorePointInTime
11122	}
11123	if mdp.CatalogCollation != "" {
11124		objectMap["catalogCollation"] = mdp.CatalogCollation
11125	}
11126	if mdp.CreateMode != "" {
11127		objectMap["createMode"] = mdp.CreateMode
11128	}
11129	if mdp.StorageContainerURI != nil {
11130		objectMap["storageContainerUri"] = mdp.StorageContainerURI
11131	}
11132	if mdp.SourceDatabaseID != nil {
11133		objectMap["sourceDatabaseId"] = mdp.SourceDatabaseID
11134	}
11135	if mdp.RestorableDroppedDatabaseID != nil {
11136		objectMap["restorableDroppedDatabaseId"] = mdp.RestorableDroppedDatabaseID
11137	}
11138	if mdp.StorageContainerSasToken != nil {
11139		objectMap["storageContainerSasToken"] = mdp.StorageContainerSasToken
11140	}
11141	if mdp.RecoverableDatabaseID != nil {
11142		objectMap["recoverableDatabaseId"] = mdp.RecoverableDatabaseID
11143	}
11144	if mdp.LongTermRetentionBackupResourceID != nil {
11145		objectMap["longTermRetentionBackupResourceId"] = mdp.LongTermRetentionBackupResourceID
11146	}
11147	if mdp.AutoCompleteRestore != nil {
11148		objectMap["autoCompleteRestore"] = mdp.AutoCompleteRestore
11149	}
11150	if mdp.LastBackupName != nil {
11151		objectMap["lastBackupName"] = mdp.LastBackupName
11152	}
11153	return json.Marshal(objectMap)
11154}
11155
11156// ManagedDatabaseRestoreDetailsProperties the managed database's restore details properties.
11157type ManagedDatabaseRestoreDetailsProperties struct {
11158	// Status - READ-ONLY; Restore status.
11159	Status *string `json:"status,omitempty"`
11160	// CurrentRestoringFileName - READ-ONLY; Current restoring file name.
11161	CurrentRestoringFileName *string `json:"currentRestoringFileName,omitempty"`
11162	// LastRestoredFileName - READ-ONLY; Last restored file name.
11163	LastRestoredFileName *string `json:"lastRestoredFileName,omitempty"`
11164	// LastRestoredFileTime - READ-ONLY; Last restored file time.
11165	LastRestoredFileTime *date.Time `json:"lastRestoredFileTime,omitempty"`
11166	// PercentCompleted - READ-ONLY; Percent completed.
11167	PercentCompleted *float64 `json:"percentCompleted,omitempty"`
11168	// UnrestorableFiles - READ-ONLY; List of unrestorable files.
11169	UnrestorableFiles *[]string `json:"unrestorableFiles,omitempty"`
11170	// NumberOfFilesDetected - READ-ONLY; Number of files detected.
11171	NumberOfFilesDetected *int64 `json:"numberOfFilesDetected,omitempty"`
11172	// LastUploadedFileName - READ-ONLY; Last uploaded file name.
11173	LastUploadedFileName *string `json:"lastUploadedFileName,omitempty"`
11174	// LastUploadedFileTime - READ-ONLY; Last uploaded file time.
11175	LastUploadedFileTime *date.Time `json:"lastUploadedFileTime,omitempty"`
11176	// BlockReason - READ-ONLY; The reason why restore is in Blocked state.
11177	BlockReason *string `json:"blockReason,omitempty"`
11178}
11179
11180// MarshalJSON is the custom marshaler for ManagedDatabaseRestoreDetailsProperties.
11181func (mdrdp ManagedDatabaseRestoreDetailsProperties) MarshalJSON() ([]byte, error) {
11182	objectMap := make(map[string]interface{})
11183	return json.Marshal(objectMap)
11184}
11185
11186// ManagedDatabaseRestoreDetailsResult a managed database restore details.
11187type ManagedDatabaseRestoreDetailsResult struct {
11188	autorest.Response `json:"-"`
11189	// ManagedDatabaseRestoreDetailsProperties - Resource properties.
11190	*ManagedDatabaseRestoreDetailsProperties `json:"properties,omitempty"`
11191	// ID - READ-ONLY; Resource ID.
11192	ID *string `json:"id,omitempty"`
11193	// Name - READ-ONLY; Resource name.
11194	Name *string `json:"name,omitempty"`
11195	// Type - READ-ONLY; Resource type.
11196	Type *string `json:"type,omitempty"`
11197}
11198
11199// MarshalJSON is the custom marshaler for ManagedDatabaseRestoreDetailsResult.
11200func (mdrdr ManagedDatabaseRestoreDetailsResult) MarshalJSON() ([]byte, error) {
11201	objectMap := make(map[string]interface{})
11202	if mdrdr.ManagedDatabaseRestoreDetailsProperties != nil {
11203		objectMap["properties"] = mdrdr.ManagedDatabaseRestoreDetailsProperties
11204	}
11205	return json.Marshal(objectMap)
11206}
11207
11208// UnmarshalJSON is the custom unmarshaler for ManagedDatabaseRestoreDetailsResult struct.
11209func (mdrdr *ManagedDatabaseRestoreDetailsResult) UnmarshalJSON(body []byte) error {
11210	var m map[string]*json.RawMessage
11211	err := json.Unmarshal(body, &m)
11212	if err != nil {
11213		return err
11214	}
11215	for k, v := range m {
11216		switch k {
11217		case "properties":
11218			if v != nil {
11219				var managedDatabaseRestoreDetailsProperties ManagedDatabaseRestoreDetailsProperties
11220				err = json.Unmarshal(*v, &managedDatabaseRestoreDetailsProperties)
11221				if err != nil {
11222					return err
11223				}
11224				mdrdr.ManagedDatabaseRestoreDetailsProperties = &managedDatabaseRestoreDetailsProperties
11225			}
11226		case "id":
11227			if v != nil {
11228				var ID string
11229				err = json.Unmarshal(*v, &ID)
11230				if err != nil {
11231					return err
11232				}
11233				mdrdr.ID = &ID
11234			}
11235		case "name":
11236			if v != nil {
11237				var name string
11238				err = json.Unmarshal(*v, &name)
11239				if err != nil {
11240					return err
11241				}
11242				mdrdr.Name = &name
11243			}
11244		case "type":
11245			if v != nil {
11246				var typeVar string
11247				err = json.Unmarshal(*v, &typeVar)
11248				if err != nil {
11249					return err
11250				}
11251				mdrdr.Type = &typeVar
11252			}
11253		}
11254	}
11255
11256	return nil
11257}
11258
11259// ManagedDatabasesCompleteRestoreFuture an abstraction for monitoring and retrieving the results of a
11260// long-running operation.
11261type ManagedDatabasesCompleteRestoreFuture struct {
11262	azure.FutureAPI
11263	// Result returns the result of the asynchronous operation.
11264	// If the operation has not completed it will return an error.
11265	Result func(ManagedDatabasesClient) (autorest.Response, error)
11266}
11267
11268// UnmarshalJSON is the custom unmarshaller for CreateFuture.
11269func (future *ManagedDatabasesCompleteRestoreFuture) UnmarshalJSON(body []byte) error {
11270	var azFuture azure.Future
11271	if err := json.Unmarshal(body, &azFuture); err != nil {
11272		return err
11273	}
11274	future.FutureAPI = &azFuture
11275	future.Result = future.result
11276	return nil
11277}
11278
11279// result is the default implementation for ManagedDatabasesCompleteRestoreFuture.Result.
11280func (future *ManagedDatabasesCompleteRestoreFuture) result(client ManagedDatabasesClient) (ar autorest.Response, err error) {
11281	var done bool
11282	done, err = future.DoneWithContext(context.Background(), client)
11283	if err != nil {
11284		err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesCompleteRestoreFuture", "Result", future.Response(), "Polling failure")
11285		return
11286	}
11287	if !done {
11288		ar.Response = future.Response()
11289		err = azure.NewAsyncOpIncompleteError("sql.ManagedDatabasesCompleteRestoreFuture")
11290		return
11291	}
11292	ar.Response = future.Response()
11293	return
11294}
11295
11296// ManagedDatabasesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
11297// long-running operation.
11298type ManagedDatabasesCreateOrUpdateFuture struct {
11299	azure.FutureAPI
11300	// Result returns the result of the asynchronous operation.
11301	// If the operation has not completed it will return an error.
11302	Result func(ManagedDatabasesClient) (ManagedDatabase, error)
11303}
11304
11305// UnmarshalJSON is the custom unmarshaller for CreateFuture.
11306func (future *ManagedDatabasesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
11307	var azFuture azure.Future
11308	if err := json.Unmarshal(body, &azFuture); err != nil {
11309		return err
11310	}
11311	future.FutureAPI = &azFuture
11312	future.Result = future.result
11313	return nil
11314}
11315
11316// result is the default implementation for ManagedDatabasesCreateOrUpdateFuture.Result.
11317func (future *ManagedDatabasesCreateOrUpdateFuture) result(client ManagedDatabasesClient) (md ManagedDatabase, err error) {
11318	var done bool
11319	done, err = future.DoneWithContext(context.Background(), client)
11320	if err != nil {
11321		err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
11322		return
11323	}
11324	if !done {
11325		md.Response.Response = future.Response()
11326		err = azure.NewAsyncOpIncompleteError("sql.ManagedDatabasesCreateOrUpdateFuture")
11327		return
11328	}
11329	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11330	if md.Response.Response, err = future.GetResult(sender); err == nil && md.Response.Response.StatusCode != http.StatusNoContent {
11331		md, err = client.CreateOrUpdateResponder(md.Response.Response)
11332		if err != nil {
11333			err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesCreateOrUpdateFuture", "Result", md.Response.Response, "Failure responding to request")
11334		}
11335	}
11336	return
11337}
11338
11339// ManagedDatabasesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
11340// operation.
11341type ManagedDatabasesDeleteFuture struct {
11342	azure.FutureAPI
11343	// Result returns the result of the asynchronous operation.
11344	// If the operation has not completed it will return an error.
11345	Result func(ManagedDatabasesClient) (autorest.Response, error)
11346}
11347
11348// UnmarshalJSON is the custom unmarshaller for CreateFuture.
11349func (future *ManagedDatabasesDeleteFuture) UnmarshalJSON(body []byte) error {
11350	var azFuture azure.Future
11351	if err := json.Unmarshal(body, &azFuture); err != nil {
11352		return err
11353	}
11354	future.FutureAPI = &azFuture
11355	future.Result = future.result
11356	return nil
11357}
11358
11359// result is the default implementation for ManagedDatabasesDeleteFuture.Result.
11360func (future *ManagedDatabasesDeleteFuture) result(client ManagedDatabasesClient) (ar autorest.Response, err error) {
11361	var done bool
11362	done, err = future.DoneWithContext(context.Background(), client)
11363	if err != nil {
11364		err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesDeleteFuture", "Result", future.Response(), "Polling failure")
11365		return
11366	}
11367	if !done {
11368		ar.Response = future.Response()
11369		err = azure.NewAsyncOpIncompleteError("sql.ManagedDatabasesDeleteFuture")
11370		return
11371	}
11372	ar.Response = future.Response()
11373	return
11374}
11375
11376// ManagedDatabaseSecurityAlertPolicy a managed database security alert policy.
11377type ManagedDatabaseSecurityAlertPolicy struct {
11378	autorest.Response `json:"-"`
11379	// SecurityAlertPolicyProperties - Resource properties.
11380	*SecurityAlertPolicyProperties `json:"properties,omitempty"`
11381	// ID - READ-ONLY; Resource ID.
11382	ID *string `json:"id,omitempty"`
11383	// Name - READ-ONLY; Resource name.
11384	Name *string `json:"name,omitempty"`
11385	// Type - READ-ONLY; Resource type.
11386	Type *string `json:"type,omitempty"`
11387}
11388
11389// MarshalJSON is the custom marshaler for ManagedDatabaseSecurityAlertPolicy.
11390func (mdsap ManagedDatabaseSecurityAlertPolicy) MarshalJSON() ([]byte, error) {
11391	objectMap := make(map[string]interface{})
11392	if mdsap.SecurityAlertPolicyProperties != nil {
11393		objectMap["properties"] = mdsap.SecurityAlertPolicyProperties
11394	}
11395	return json.Marshal(objectMap)
11396}
11397
11398// UnmarshalJSON is the custom unmarshaler for ManagedDatabaseSecurityAlertPolicy struct.
11399func (mdsap *ManagedDatabaseSecurityAlertPolicy) UnmarshalJSON(body []byte) error {
11400	var m map[string]*json.RawMessage
11401	err := json.Unmarshal(body, &m)
11402	if err != nil {
11403		return err
11404	}
11405	for k, v := range m {
11406		switch k {
11407		case "properties":
11408			if v != nil {
11409				var securityAlertPolicyProperties SecurityAlertPolicyProperties
11410				err = json.Unmarshal(*v, &securityAlertPolicyProperties)
11411				if err != nil {
11412					return err
11413				}
11414				mdsap.SecurityAlertPolicyProperties = &securityAlertPolicyProperties
11415			}
11416		case "id":
11417			if v != nil {
11418				var ID string
11419				err = json.Unmarshal(*v, &ID)
11420				if err != nil {
11421					return err
11422				}
11423				mdsap.ID = &ID
11424			}
11425		case "name":
11426			if v != nil {
11427				var name string
11428				err = json.Unmarshal(*v, &name)
11429				if err != nil {
11430					return err
11431				}
11432				mdsap.Name = &name
11433			}
11434		case "type":
11435			if v != nil {
11436				var typeVar string
11437				err = json.Unmarshal(*v, &typeVar)
11438				if err != nil {
11439					return err
11440				}
11441				mdsap.Type = &typeVar
11442			}
11443		}
11444	}
11445
11446	return nil
11447}
11448
11449// ManagedDatabaseSecurityAlertPolicyListResult a list of the managed database's security alert policies.
11450type ManagedDatabaseSecurityAlertPolicyListResult struct {
11451	autorest.Response `json:"-"`
11452	// Value - READ-ONLY; Array of results.
11453	Value *[]ManagedDatabaseSecurityAlertPolicy `json:"value,omitempty"`
11454	// NextLink - READ-ONLY; Link to retrieve next page of results.
11455	NextLink *string `json:"nextLink,omitempty"`
11456}
11457
11458// MarshalJSON is the custom marshaler for ManagedDatabaseSecurityAlertPolicyListResult.
11459func (mdsaplr ManagedDatabaseSecurityAlertPolicyListResult) MarshalJSON() ([]byte, error) {
11460	objectMap := make(map[string]interface{})
11461	return json.Marshal(objectMap)
11462}
11463
11464// ManagedDatabaseSecurityAlertPolicyListResultIterator provides access to a complete listing of
11465// ManagedDatabaseSecurityAlertPolicy values.
11466type ManagedDatabaseSecurityAlertPolicyListResultIterator struct {
11467	i    int
11468	page ManagedDatabaseSecurityAlertPolicyListResultPage
11469}
11470
11471// NextWithContext advances to the next value.  If there was an error making
11472// the request the iterator does not advance and the error is returned.
11473func (iter *ManagedDatabaseSecurityAlertPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
11474	if tracing.IsEnabled() {
11475		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseSecurityAlertPolicyListResultIterator.NextWithContext")
11476		defer func() {
11477			sc := -1
11478			if iter.Response().Response.Response != nil {
11479				sc = iter.Response().Response.Response.StatusCode
11480			}
11481			tracing.EndSpan(ctx, sc, err)
11482		}()
11483	}
11484	iter.i++
11485	if iter.i < len(iter.page.Values()) {
11486		return nil
11487	}
11488	err = iter.page.NextWithContext(ctx)
11489	if err != nil {
11490		iter.i--
11491		return err
11492	}
11493	iter.i = 0
11494	return nil
11495}
11496
11497// Next advances to the next value.  If there was an error making
11498// the request the iterator does not advance and the error is returned.
11499// Deprecated: Use NextWithContext() instead.
11500func (iter *ManagedDatabaseSecurityAlertPolicyListResultIterator) Next() error {
11501	return iter.NextWithContext(context.Background())
11502}
11503
11504// NotDone returns true if the enumeration should be started or is not yet complete.
11505func (iter ManagedDatabaseSecurityAlertPolicyListResultIterator) NotDone() bool {
11506	return iter.page.NotDone() && iter.i < len(iter.page.Values())
11507}
11508
11509// Response returns the raw server response from the last page request.
11510func (iter ManagedDatabaseSecurityAlertPolicyListResultIterator) Response() ManagedDatabaseSecurityAlertPolicyListResult {
11511	return iter.page.Response()
11512}
11513
11514// Value returns the current value or a zero-initialized value if the
11515// iterator has advanced beyond the end of the collection.
11516func (iter ManagedDatabaseSecurityAlertPolicyListResultIterator) Value() ManagedDatabaseSecurityAlertPolicy {
11517	if !iter.page.NotDone() {
11518		return ManagedDatabaseSecurityAlertPolicy{}
11519	}
11520	return iter.page.Values()[iter.i]
11521}
11522
11523// Creates a new instance of the ManagedDatabaseSecurityAlertPolicyListResultIterator type.
11524func NewManagedDatabaseSecurityAlertPolicyListResultIterator(page ManagedDatabaseSecurityAlertPolicyListResultPage) ManagedDatabaseSecurityAlertPolicyListResultIterator {
11525	return ManagedDatabaseSecurityAlertPolicyListResultIterator{page: page}
11526}
11527
11528// IsEmpty returns true if the ListResult contains no values.
11529func (mdsaplr ManagedDatabaseSecurityAlertPolicyListResult) IsEmpty() bool {
11530	return mdsaplr.Value == nil || len(*mdsaplr.Value) == 0
11531}
11532
11533// hasNextLink returns true if the NextLink is not empty.
11534func (mdsaplr ManagedDatabaseSecurityAlertPolicyListResult) hasNextLink() bool {
11535	return mdsaplr.NextLink != nil && len(*mdsaplr.NextLink) != 0
11536}
11537
11538// managedDatabaseSecurityAlertPolicyListResultPreparer prepares a request to retrieve the next set of results.
11539// It returns nil if no more results exist.
11540func (mdsaplr ManagedDatabaseSecurityAlertPolicyListResult) managedDatabaseSecurityAlertPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
11541	if !mdsaplr.hasNextLink() {
11542		return nil, nil
11543	}
11544	return autorest.Prepare((&http.Request{}).WithContext(ctx),
11545		autorest.AsJSON(),
11546		autorest.AsGet(),
11547		autorest.WithBaseURL(to.String(mdsaplr.NextLink)))
11548}
11549
11550// ManagedDatabaseSecurityAlertPolicyListResultPage contains a page of ManagedDatabaseSecurityAlertPolicy
11551// values.
11552type ManagedDatabaseSecurityAlertPolicyListResultPage struct {
11553	fn      func(context.Context, ManagedDatabaseSecurityAlertPolicyListResult) (ManagedDatabaseSecurityAlertPolicyListResult, error)
11554	mdsaplr ManagedDatabaseSecurityAlertPolicyListResult
11555}
11556
11557// NextWithContext advances to the next page of values.  If there was an error making
11558// the request the page does not advance and the error is returned.
11559func (page *ManagedDatabaseSecurityAlertPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
11560	if tracing.IsEnabled() {
11561		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedDatabaseSecurityAlertPolicyListResultPage.NextWithContext")
11562		defer func() {
11563			sc := -1
11564			if page.Response().Response.Response != nil {
11565				sc = page.Response().Response.Response.StatusCode
11566			}
11567			tracing.EndSpan(ctx, sc, err)
11568		}()
11569	}
11570	for {
11571		next, err := page.fn(ctx, page.mdsaplr)
11572		if err != nil {
11573			return err
11574		}
11575		page.mdsaplr = next
11576		if !next.hasNextLink() || !next.IsEmpty() {
11577			break
11578		}
11579	}
11580	return nil
11581}
11582
11583// Next advances to the next page of values.  If there was an error making
11584// the request the page does not advance and the error is returned.
11585// Deprecated: Use NextWithContext() instead.
11586func (page *ManagedDatabaseSecurityAlertPolicyListResultPage) Next() error {
11587	return page.NextWithContext(context.Background())
11588}
11589
11590// NotDone returns true if the page enumeration should be started or is not yet complete.
11591func (page ManagedDatabaseSecurityAlertPolicyListResultPage) NotDone() bool {
11592	return !page.mdsaplr.IsEmpty()
11593}
11594
11595// Response returns the raw server response from the last page request.
11596func (page ManagedDatabaseSecurityAlertPolicyListResultPage) Response() ManagedDatabaseSecurityAlertPolicyListResult {
11597	return page.mdsaplr
11598}
11599
11600// Values returns the slice of values for the current page or nil if there are no values.
11601func (page ManagedDatabaseSecurityAlertPolicyListResultPage) Values() []ManagedDatabaseSecurityAlertPolicy {
11602	if page.mdsaplr.IsEmpty() {
11603		return nil
11604	}
11605	return *page.mdsaplr.Value
11606}
11607
11608// Creates a new instance of the ManagedDatabaseSecurityAlertPolicyListResultPage type.
11609func NewManagedDatabaseSecurityAlertPolicyListResultPage(cur ManagedDatabaseSecurityAlertPolicyListResult, getNextPage func(context.Context, ManagedDatabaseSecurityAlertPolicyListResult) (ManagedDatabaseSecurityAlertPolicyListResult, error)) ManagedDatabaseSecurityAlertPolicyListResultPage {
11610	return ManagedDatabaseSecurityAlertPolicyListResultPage{
11611		fn:      getNextPage,
11612		mdsaplr: cur,
11613	}
11614}
11615
11616// ManagedDatabasesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
11617// operation.
11618type ManagedDatabasesUpdateFuture struct {
11619	azure.FutureAPI
11620	// Result returns the result of the asynchronous operation.
11621	// If the operation has not completed it will return an error.
11622	Result func(ManagedDatabasesClient) (ManagedDatabase, error)
11623}
11624
11625// UnmarshalJSON is the custom unmarshaller for CreateFuture.
11626func (future *ManagedDatabasesUpdateFuture) UnmarshalJSON(body []byte) error {
11627	var azFuture azure.Future
11628	if err := json.Unmarshal(body, &azFuture); err != nil {
11629		return err
11630	}
11631	future.FutureAPI = &azFuture
11632	future.Result = future.result
11633	return nil
11634}
11635
11636// result is the default implementation for ManagedDatabasesUpdateFuture.Result.
11637func (future *ManagedDatabasesUpdateFuture) result(client ManagedDatabasesClient) (md ManagedDatabase, err error) {
11638	var done bool
11639	done, err = future.DoneWithContext(context.Background(), client)
11640	if err != nil {
11641		err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesUpdateFuture", "Result", future.Response(), "Polling failure")
11642		return
11643	}
11644	if !done {
11645		md.Response.Response = future.Response()
11646		err = azure.NewAsyncOpIncompleteError("sql.ManagedDatabasesUpdateFuture")
11647		return
11648	}
11649	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11650	if md.Response.Response, err = future.GetResult(sender); err == nil && md.Response.Response.StatusCode != http.StatusNoContent {
11651		md, err = client.UpdateResponder(md.Response.Response)
11652		if err != nil {
11653			err = autorest.NewErrorWithError(err, "sql.ManagedDatabasesUpdateFuture", "Result", md.Response.Response, "Failure responding to request")
11654		}
11655	}
11656	return
11657}
11658
11659// ManagedDatabaseUpdate an managed database update.
11660type ManagedDatabaseUpdate struct {
11661	// ManagedDatabaseProperties - Resource properties.
11662	*ManagedDatabaseProperties `json:"properties,omitempty"`
11663	// Tags - Resource tags.
11664	Tags map[string]*string `json:"tags"`
11665}
11666
11667// MarshalJSON is the custom marshaler for ManagedDatabaseUpdate.
11668func (mdu ManagedDatabaseUpdate) MarshalJSON() ([]byte, error) {
11669	objectMap := make(map[string]interface{})
11670	if mdu.ManagedDatabaseProperties != nil {
11671		objectMap["properties"] = mdu.ManagedDatabaseProperties
11672	}
11673	if mdu.Tags != nil {
11674		objectMap["tags"] = mdu.Tags
11675	}
11676	return json.Marshal(objectMap)
11677}
11678
11679// UnmarshalJSON is the custom unmarshaler for ManagedDatabaseUpdate struct.
11680func (mdu *ManagedDatabaseUpdate) UnmarshalJSON(body []byte) error {
11681	var m map[string]*json.RawMessage
11682	err := json.Unmarshal(body, &m)
11683	if err != nil {
11684		return err
11685	}
11686	for k, v := range m {
11687		switch k {
11688		case "properties":
11689			if v != nil {
11690				var managedDatabaseProperties ManagedDatabaseProperties
11691				err = json.Unmarshal(*v, &managedDatabaseProperties)
11692				if err != nil {
11693					return err
11694				}
11695				mdu.ManagedDatabaseProperties = &managedDatabaseProperties
11696			}
11697		case "tags":
11698			if v != nil {
11699				var tags map[string]*string
11700				err = json.Unmarshal(*v, &tags)
11701				if err != nil {
11702					return err
11703				}
11704				mdu.Tags = tags
11705			}
11706		}
11707	}
11708
11709	return nil
11710}
11711
11712// ManagedDatabaseVulnerabilityAssessmentScansInitiateScanFuture an abstraction for monitoring and
11713// retrieving the results of a long-running operation.
11714type ManagedDatabaseVulnerabilityAssessmentScansInitiateScanFuture struct {
11715	azure.FutureAPI
11716	// Result returns the result of the asynchronous operation.
11717	// If the operation has not completed it will return an error.
11718	Result func(ManagedDatabaseVulnerabilityAssessmentScansClient) (autorest.Response, error)
11719}
11720
11721// UnmarshalJSON is the custom unmarshaller for CreateFuture.
11722func (future *ManagedDatabaseVulnerabilityAssessmentScansInitiateScanFuture) UnmarshalJSON(body []byte) error {
11723	var azFuture azure.Future
11724	if err := json.Unmarshal(body, &azFuture); err != nil {
11725		return err
11726	}
11727	future.FutureAPI = &azFuture
11728	future.Result = future.result
11729	return nil
11730}
11731
11732// result is the default implementation for ManagedDatabaseVulnerabilityAssessmentScansInitiateScanFuture.Result.
11733func (future *ManagedDatabaseVulnerabilityAssessmentScansInitiateScanFuture) result(client ManagedDatabaseVulnerabilityAssessmentScansClient) (ar autorest.Response, err error) {
11734	var done bool
11735	done, err = future.DoneWithContext(context.Background(), client)
11736	if err != nil {
11737		err = autorest.NewErrorWithError(err, "sql.ManagedDatabaseVulnerabilityAssessmentScansInitiateScanFuture", "Result", future.Response(), "Polling failure")
11738		return
11739	}
11740	if !done {
11741		ar.Response = future.Response()
11742		err = azure.NewAsyncOpIncompleteError("sql.ManagedDatabaseVulnerabilityAssessmentScansInitiateScanFuture")
11743		return
11744	}
11745	ar.Response = future.Response()
11746	return
11747}
11748
11749// ManagedInstance an Azure SQL managed instance.
11750type ManagedInstance struct {
11751	autorest.Response `json:"-"`
11752	// Identity - The Azure Active Directory identity of the managed instance.
11753	Identity *ResourceIdentity `json:"identity,omitempty"`
11754	// Sku - Managed instance SKU. Allowed values for sku.name: GP_Gen4, GP_Gen5, BC_Gen4, BC_Gen5
11755	Sku *Sku `json:"sku,omitempty"`
11756	// ManagedInstanceProperties - Resource properties.
11757	*ManagedInstanceProperties `json:"properties,omitempty"`
11758	// Location - Resource location.
11759	Location *string `json:"location,omitempty"`
11760	// Tags - Resource tags.
11761	Tags map[string]*string `json:"tags"`
11762	// ID - READ-ONLY; Resource ID.
11763	ID *string `json:"id,omitempty"`
11764	// Name - READ-ONLY; Resource name.
11765	Name *string `json:"name,omitempty"`
11766	// Type - READ-ONLY; Resource type.
11767	Type *string `json:"type,omitempty"`
11768}
11769
11770// MarshalJSON is the custom marshaler for ManagedInstance.
11771func (mi ManagedInstance) MarshalJSON() ([]byte, error) {
11772	objectMap := make(map[string]interface{})
11773	if mi.Identity != nil {
11774		objectMap["identity"] = mi.Identity
11775	}
11776	if mi.Sku != nil {
11777		objectMap["sku"] = mi.Sku
11778	}
11779	if mi.ManagedInstanceProperties != nil {
11780		objectMap["properties"] = mi.ManagedInstanceProperties
11781	}
11782	if mi.Location != nil {
11783		objectMap["location"] = mi.Location
11784	}
11785	if mi.Tags != nil {
11786		objectMap["tags"] = mi.Tags
11787	}
11788	return json.Marshal(objectMap)
11789}
11790
11791// UnmarshalJSON is the custom unmarshaler for ManagedInstance struct.
11792func (mi *ManagedInstance) UnmarshalJSON(body []byte) error {
11793	var m map[string]*json.RawMessage
11794	err := json.Unmarshal(body, &m)
11795	if err != nil {
11796		return err
11797	}
11798	for k, v := range m {
11799		switch k {
11800		case "identity":
11801			if v != nil {
11802				var identity ResourceIdentity
11803				err = json.Unmarshal(*v, &identity)
11804				if err != nil {
11805					return err
11806				}
11807				mi.Identity = &identity
11808			}
11809		case "sku":
11810			if v != nil {
11811				var sku Sku
11812				err = json.Unmarshal(*v, &sku)
11813				if err != nil {
11814					return err
11815				}
11816				mi.Sku = &sku
11817			}
11818		case "properties":
11819			if v != nil {
11820				var managedInstanceProperties ManagedInstanceProperties
11821				err = json.Unmarshal(*v, &managedInstanceProperties)
11822				if err != nil {
11823					return err
11824				}
11825				mi.ManagedInstanceProperties = &managedInstanceProperties
11826			}
11827		case "location":
11828			if v != nil {
11829				var location string
11830				err = json.Unmarshal(*v, &location)
11831				if err != nil {
11832					return err
11833				}
11834				mi.Location = &location
11835			}
11836		case "tags":
11837			if v != nil {
11838				var tags map[string]*string
11839				err = json.Unmarshal(*v, &tags)
11840				if err != nil {
11841					return err
11842				}
11843				mi.Tags = tags
11844			}
11845		case "id":
11846			if v != nil {
11847				var ID string
11848				err = json.Unmarshal(*v, &ID)
11849				if err != nil {
11850					return err
11851				}
11852				mi.ID = &ID
11853			}
11854		case "name":
11855			if v != nil {
11856				var name string
11857				err = json.Unmarshal(*v, &name)
11858				if err != nil {
11859					return err
11860				}
11861				mi.Name = &name
11862			}
11863		case "type":
11864			if v != nil {
11865				var typeVar string
11866				err = json.Unmarshal(*v, &typeVar)
11867				if err != nil {
11868					return err
11869				}
11870				mi.Type = &typeVar
11871			}
11872		}
11873	}
11874
11875	return nil
11876}
11877
11878// ManagedInstanceAdministrator an Azure SQL managed instance administrator.
11879type ManagedInstanceAdministrator struct {
11880	autorest.Response `json:"-"`
11881	// ManagedInstanceAdministratorProperties - Resource properties.
11882	*ManagedInstanceAdministratorProperties `json:"properties,omitempty"`
11883	// ID - READ-ONLY; Resource ID.
11884	ID *string `json:"id,omitempty"`
11885	// Name - READ-ONLY; Resource name.
11886	Name *string `json:"name,omitempty"`
11887	// Type - READ-ONLY; Resource type.
11888	Type *string `json:"type,omitempty"`
11889}
11890
11891// MarshalJSON is the custom marshaler for ManagedInstanceAdministrator.
11892func (mia ManagedInstanceAdministrator) MarshalJSON() ([]byte, error) {
11893	objectMap := make(map[string]interface{})
11894	if mia.ManagedInstanceAdministratorProperties != nil {
11895		objectMap["properties"] = mia.ManagedInstanceAdministratorProperties
11896	}
11897	return json.Marshal(objectMap)
11898}
11899
11900// UnmarshalJSON is the custom unmarshaler for ManagedInstanceAdministrator struct.
11901func (mia *ManagedInstanceAdministrator) UnmarshalJSON(body []byte) error {
11902	var m map[string]*json.RawMessage
11903	err := json.Unmarshal(body, &m)
11904	if err != nil {
11905		return err
11906	}
11907	for k, v := range m {
11908		switch k {
11909		case "properties":
11910			if v != nil {
11911				var managedInstanceAdministratorProperties ManagedInstanceAdministratorProperties
11912				err = json.Unmarshal(*v, &managedInstanceAdministratorProperties)
11913				if err != nil {
11914					return err
11915				}
11916				mia.ManagedInstanceAdministratorProperties = &managedInstanceAdministratorProperties
11917			}
11918		case "id":
11919			if v != nil {
11920				var ID string
11921				err = json.Unmarshal(*v, &ID)
11922				if err != nil {
11923					return err
11924				}
11925				mia.ID = &ID
11926			}
11927		case "name":
11928			if v != nil {
11929				var name string
11930				err = json.Unmarshal(*v, &name)
11931				if err != nil {
11932					return err
11933				}
11934				mia.Name = &name
11935			}
11936		case "type":
11937			if v != nil {
11938				var typeVar string
11939				err = json.Unmarshal(*v, &typeVar)
11940				if err != nil {
11941					return err
11942				}
11943				mia.Type = &typeVar
11944			}
11945		}
11946	}
11947
11948	return nil
11949}
11950
11951// ManagedInstanceAdministratorListResult a list of managed instance administrators.
11952type ManagedInstanceAdministratorListResult struct {
11953	autorest.Response `json:"-"`
11954	// Value - READ-ONLY; Array of results.
11955	Value *[]ManagedInstanceAdministrator `json:"value,omitempty"`
11956	// NextLink - READ-ONLY; Link to retrieve next page of results.
11957	NextLink *string `json:"nextLink,omitempty"`
11958}
11959
11960// MarshalJSON is the custom marshaler for ManagedInstanceAdministratorListResult.
11961func (mialr ManagedInstanceAdministratorListResult) MarshalJSON() ([]byte, error) {
11962	objectMap := make(map[string]interface{})
11963	return json.Marshal(objectMap)
11964}
11965
11966// ManagedInstanceAdministratorListResultIterator provides access to a complete listing of
11967// ManagedInstanceAdministrator values.
11968type ManagedInstanceAdministratorListResultIterator struct {
11969	i    int
11970	page ManagedInstanceAdministratorListResultPage
11971}
11972
11973// NextWithContext advances to the next value.  If there was an error making
11974// the request the iterator does not advance and the error is returned.
11975func (iter *ManagedInstanceAdministratorListResultIterator) NextWithContext(ctx context.Context) (err error) {
11976	if tracing.IsEnabled() {
11977		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceAdministratorListResultIterator.NextWithContext")
11978		defer func() {
11979			sc := -1
11980			if iter.Response().Response.Response != nil {
11981				sc = iter.Response().Response.Response.StatusCode
11982			}
11983			tracing.EndSpan(ctx, sc, err)
11984		}()
11985	}
11986	iter.i++
11987	if iter.i < len(iter.page.Values()) {
11988		return nil
11989	}
11990	err = iter.page.NextWithContext(ctx)
11991	if err != nil {
11992		iter.i--
11993		return err
11994	}
11995	iter.i = 0
11996	return nil
11997}
11998
11999// Next advances to the next value.  If there was an error making
12000// the request the iterator does not advance and the error is returned.
12001// Deprecated: Use NextWithContext() instead.
12002func (iter *ManagedInstanceAdministratorListResultIterator) Next() error {
12003	return iter.NextWithContext(context.Background())
12004}
12005
12006// NotDone returns true if the enumeration should be started or is not yet complete.
12007func (iter ManagedInstanceAdministratorListResultIterator) NotDone() bool {
12008	return iter.page.NotDone() && iter.i < len(iter.page.Values())
12009}
12010
12011// Response returns the raw server response from the last page request.
12012func (iter ManagedInstanceAdministratorListResultIterator) Response() ManagedInstanceAdministratorListResult {
12013	return iter.page.Response()
12014}
12015
12016// Value returns the current value or a zero-initialized value if the
12017// iterator has advanced beyond the end of the collection.
12018func (iter ManagedInstanceAdministratorListResultIterator) Value() ManagedInstanceAdministrator {
12019	if !iter.page.NotDone() {
12020		return ManagedInstanceAdministrator{}
12021	}
12022	return iter.page.Values()[iter.i]
12023}
12024
12025// Creates a new instance of the ManagedInstanceAdministratorListResultIterator type.
12026func NewManagedInstanceAdministratorListResultIterator(page ManagedInstanceAdministratorListResultPage) ManagedInstanceAdministratorListResultIterator {
12027	return ManagedInstanceAdministratorListResultIterator{page: page}
12028}
12029
12030// IsEmpty returns true if the ListResult contains no values.
12031func (mialr ManagedInstanceAdministratorListResult) IsEmpty() bool {
12032	return mialr.Value == nil || len(*mialr.Value) == 0
12033}
12034
12035// hasNextLink returns true if the NextLink is not empty.
12036func (mialr ManagedInstanceAdministratorListResult) hasNextLink() bool {
12037	return mialr.NextLink != nil && len(*mialr.NextLink) != 0
12038}
12039
12040// managedInstanceAdministratorListResultPreparer prepares a request to retrieve the next set of results.
12041// It returns nil if no more results exist.
12042func (mialr ManagedInstanceAdministratorListResult) managedInstanceAdministratorListResultPreparer(ctx context.Context) (*http.Request, error) {
12043	if !mialr.hasNextLink() {
12044		return nil, nil
12045	}
12046	return autorest.Prepare((&http.Request{}).WithContext(ctx),
12047		autorest.AsJSON(),
12048		autorest.AsGet(),
12049		autorest.WithBaseURL(to.String(mialr.NextLink)))
12050}
12051
12052// ManagedInstanceAdministratorListResultPage contains a page of ManagedInstanceAdministrator values.
12053type ManagedInstanceAdministratorListResultPage struct {
12054	fn    func(context.Context, ManagedInstanceAdministratorListResult) (ManagedInstanceAdministratorListResult, error)
12055	mialr ManagedInstanceAdministratorListResult
12056}
12057
12058// NextWithContext advances to the next page of values.  If there was an error making
12059// the request the page does not advance and the error is returned.
12060func (page *ManagedInstanceAdministratorListResultPage) NextWithContext(ctx context.Context) (err error) {
12061	if tracing.IsEnabled() {
12062		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceAdministratorListResultPage.NextWithContext")
12063		defer func() {
12064			sc := -1
12065			if page.Response().Response.Response != nil {
12066				sc = page.Response().Response.Response.StatusCode
12067			}
12068			tracing.EndSpan(ctx, sc, err)
12069		}()
12070	}
12071	for {
12072		next, err := page.fn(ctx, page.mialr)
12073		if err != nil {
12074			return err
12075		}
12076		page.mialr = next
12077		if !next.hasNextLink() || !next.IsEmpty() {
12078			break
12079		}
12080	}
12081	return nil
12082}
12083
12084// Next advances to the next page of values.  If there was an error making
12085// the request the page does not advance and the error is returned.
12086// Deprecated: Use NextWithContext() instead.
12087func (page *ManagedInstanceAdministratorListResultPage) Next() error {
12088	return page.NextWithContext(context.Background())
12089}
12090
12091// NotDone returns true if the page enumeration should be started or is not yet complete.
12092func (page ManagedInstanceAdministratorListResultPage) NotDone() bool {
12093	return !page.mialr.IsEmpty()
12094}
12095
12096// Response returns the raw server response from the last page request.
12097func (page ManagedInstanceAdministratorListResultPage) Response() ManagedInstanceAdministratorListResult {
12098	return page.mialr
12099}
12100
12101// Values returns the slice of values for the current page or nil if there are no values.
12102func (page ManagedInstanceAdministratorListResultPage) Values() []ManagedInstanceAdministrator {
12103	if page.mialr.IsEmpty() {
12104		return nil
12105	}
12106	return *page.mialr.Value
12107}
12108
12109// Creates a new instance of the ManagedInstanceAdministratorListResultPage type.
12110func NewManagedInstanceAdministratorListResultPage(cur ManagedInstanceAdministratorListResult, getNextPage func(context.Context, ManagedInstanceAdministratorListResult) (ManagedInstanceAdministratorListResult, error)) ManagedInstanceAdministratorListResultPage {
12111	return ManagedInstanceAdministratorListResultPage{
12112		fn:    getNextPage,
12113		mialr: cur,
12114	}
12115}
12116
12117// ManagedInstanceAdministratorProperties the properties of a managed instance administrator.
12118type ManagedInstanceAdministratorProperties struct {
12119	// AdministratorType - Type of the managed instance administrator.
12120	AdministratorType *string `json:"administratorType,omitempty"`
12121	// Login - Login name of the managed instance administrator.
12122	Login *string `json:"login,omitempty"`
12123	// Sid - SID (object ID) of the managed instance administrator.
12124	Sid *uuid.UUID `json:"sid,omitempty"`
12125	// TenantID - Tenant ID of the managed instance administrator.
12126	TenantID *uuid.UUID `json:"tenantId,omitempty"`
12127}
12128
12129// ManagedInstanceAdministratorsCreateOrUpdateFuture an abstraction for monitoring and retrieving the
12130// results of a long-running operation.
12131type ManagedInstanceAdministratorsCreateOrUpdateFuture struct {
12132	azure.FutureAPI
12133	// Result returns the result of the asynchronous operation.
12134	// If the operation has not completed it will return an error.
12135	Result func(ManagedInstanceAdministratorsClient) (ManagedInstanceAdministrator, error)
12136}
12137
12138// UnmarshalJSON is the custom unmarshaller for CreateFuture.
12139func (future *ManagedInstanceAdministratorsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
12140	var azFuture azure.Future
12141	if err := json.Unmarshal(body, &azFuture); err != nil {
12142		return err
12143	}
12144	future.FutureAPI = &azFuture
12145	future.Result = future.result
12146	return nil
12147}
12148
12149// result is the default implementation for ManagedInstanceAdministratorsCreateOrUpdateFuture.Result.
12150func (future *ManagedInstanceAdministratorsCreateOrUpdateFuture) result(client ManagedInstanceAdministratorsClient) (mia ManagedInstanceAdministrator, err error) {
12151	var done bool
12152	done, err = future.DoneWithContext(context.Background(), client)
12153	if err != nil {
12154		err = autorest.NewErrorWithError(err, "sql.ManagedInstanceAdministratorsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
12155		return
12156	}
12157	if !done {
12158		mia.Response.Response = future.Response()
12159		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstanceAdministratorsCreateOrUpdateFuture")
12160		return
12161	}
12162	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12163	if mia.Response.Response, err = future.GetResult(sender); err == nil && mia.Response.Response.StatusCode != http.StatusNoContent {
12164		mia, err = client.CreateOrUpdateResponder(mia.Response.Response)
12165		if err != nil {
12166			err = autorest.NewErrorWithError(err, "sql.ManagedInstanceAdministratorsCreateOrUpdateFuture", "Result", mia.Response.Response, "Failure responding to request")
12167		}
12168	}
12169	return
12170}
12171
12172// ManagedInstanceAdministratorsDeleteFuture an abstraction for monitoring and retrieving the results of a
12173// long-running operation.
12174type ManagedInstanceAdministratorsDeleteFuture struct {
12175	azure.FutureAPI
12176	// Result returns the result of the asynchronous operation.
12177	// If the operation has not completed it will return an error.
12178	Result func(ManagedInstanceAdministratorsClient) (autorest.Response, error)
12179}
12180
12181// UnmarshalJSON is the custom unmarshaller for CreateFuture.
12182func (future *ManagedInstanceAdministratorsDeleteFuture) UnmarshalJSON(body []byte) error {
12183	var azFuture azure.Future
12184	if err := json.Unmarshal(body, &azFuture); err != nil {
12185		return err
12186	}
12187	future.FutureAPI = &azFuture
12188	future.Result = future.result
12189	return nil
12190}
12191
12192// result is the default implementation for ManagedInstanceAdministratorsDeleteFuture.Result.
12193func (future *ManagedInstanceAdministratorsDeleteFuture) result(client ManagedInstanceAdministratorsClient) (ar autorest.Response, err error) {
12194	var done bool
12195	done, err = future.DoneWithContext(context.Background(), client)
12196	if err != nil {
12197		err = autorest.NewErrorWithError(err, "sql.ManagedInstanceAdministratorsDeleteFuture", "Result", future.Response(), "Polling failure")
12198		return
12199	}
12200	if !done {
12201		ar.Response = future.Response()
12202		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstanceAdministratorsDeleteFuture")
12203		return
12204	}
12205	ar.Response = future.Response()
12206	return
12207}
12208
12209// ManagedInstanceAzureADOnlyAuthentication azure Active Directory only authentication.
12210type ManagedInstanceAzureADOnlyAuthentication struct {
12211	autorest.Response `json:"-"`
12212	// ManagedInstanceAzureADOnlyAuthProperties - Resource properties.
12213	*ManagedInstanceAzureADOnlyAuthProperties `json:"properties,omitempty"`
12214	// ID - READ-ONLY; Resource ID.
12215	ID *string `json:"id,omitempty"`
12216	// Name - READ-ONLY; Resource name.
12217	Name *string `json:"name,omitempty"`
12218	// Type - READ-ONLY; Resource type.
12219	Type *string `json:"type,omitempty"`
12220}
12221
12222// MarshalJSON is the custom marshaler for ManagedInstanceAzureADOnlyAuthentication.
12223func (miaaoa ManagedInstanceAzureADOnlyAuthentication) MarshalJSON() ([]byte, error) {
12224	objectMap := make(map[string]interface{})
12225	if miaaoa.ManagedInstanceAzureADOnlyAuthProperties != nil {
12226		objectMap["properties"] = miaaoa.ManagedInstanceAzureADOnlyAuthProperties
12227	}
12228	return json.Marshal(objectMap)
12229}
12230
12231// UnmarshalJSON is the custom unmarshaler for ManagedInstanceAzureADOnlyAuthentication struct.
12232func (miaaoa *ManagedInstanceAzureADOnlyAuthentication) UnmarshalJSON(body []byte) error {
12233	var m map[string]*json.RawMessage
12234	err := json.Unmarshal(body, &m)
12235	if err != nil {
12236		return err
12237	}
12238	for k, v := range m {
12239		switch k {
12240		case "properties":
12241			if v != nil {
12242				var managedInstanceAzureADOnlyAuthProperties ManagedInstanceAzureADOnlyAuthProperties
12243				err = json.Unmarshal(*v, &managedInstanceAzureADOnlyAuthProperties)
12244				if err != nil {
12245					return err
12246				}
12247				miaaoa.ManagedInstanceAzureADOnlyAuthProperties = &managedInstanceAzureADOnlyAuthProperties
12248			}
12249		case "id":
12250			if v != nil {
12251				var ID string
12252				err = json.Unmarshal(*v, &ID)
12253				if err != nil {
12254					return err
12255				}
12256				miaaoa.ID = &ID
12257			}
12258		case "name":
12259			if v != nil {
12260				var name string
12261				err = json.Unmarshal(*v, &name)
12262				if err != nil {
12263					return err
12264				}
12265				miaaoa.Name = &name
12266			}
12267		case "type":
12268			if v != nil {
12269				var typeVar string
12270				err = json.Unmarshal(*v, &typeVar)
12271				if err != nil {
12272					return err
12273				}
12274				miaaoa.Type = &typeVar
12275			}
12276		}
12277	}
12278
12279	return nil
12280}
12281
12282// ManagedInstanceAzureADOnlyAuthenticationsCreateOrUpdateFuture an abstraction for monitoring and
12283// retrieving the results of a long-running operation.
12284type ManagedInstanceAzureADOnlyAuthenticationsCreateOrUpdateFuture struct {
12285	azure.FutureAPI
12286	// Result returns the result of the asynchronous operation.
12287	// If the operation has not completed it will return an error.
12288	Result func(ManagedInstanceAzureADOnlyAuthenticationsClient) (ManagedInstanceAzureADOnlyAuthentication, error)
12289}
12290
12291// UnmarshalJSON is the custom unmarshaller for CreateFuture.
12292func (future *ManagedInstanceAzureADOnlyAuthenticationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
12293	var azFuture azure.Future
12294	if err := json.Unmarshal(body, &azFuture); err != nil {
12295		return err
12296	}
12297	future.FutureAPI = &azFuture
12298	future.Result = future.result
12299	return nil
12300}
12301
12302// result is the default implementation for ManagedInstanceAzureADOnlyAuthenticationsCreateOrUpdateFuture.Result.
12303func (future *ManagedInstanceAzureADOnlyAuthenticationsCreateOrUpdateFuture) result(client ManagedInstanceAzureADOnlyAuthenticationsClient) (miaaoa ManagedInstanceAzureADOnlyAuthentication, err error) {
12304	var done bool
12305	done, err = future.DoneWithContext(context.Background(), client)
12306	if err != nil {
12307		err = autorest.NewErrorWithError(err, "sql.ManagedInstanceAzureADOnlyAuthenticationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
12308		return
12309	}
12310	if !done {
12311		miaaoa.Response.Response = future.Response()
12312		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstanceAzureADOnlyAuthenticationsCreateOrUpdateFuture")
12313		return
12314	}
12315	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12316	if miaaoa.Response.Response, err = future.GetResult(sender); err == nil && miaaoa.Response.Response.StatusCode != http.StatusNoContent {
12317		miaaoa, err = client.CreateOrUpdateResponder(miaaoa.Response.Response)
12318		if err != nil {
12319			err = autorest.NewErrorWithError(err, "sql.ManagedInstanceAzureADOnlyAuthenticationsCreateOrUpdateFuture", "Result", miaaoa.Response.Response, "Failure responding to request")
12320		}
12321	}
12322	return
12323}
12324
12325// ManagedInstanceAzureADOnlyAuthenticationsDeleteFuture an abstraction for monitoring and retrieving the
12326// results of a long-running operation.
12327type ManagedInstanceAzureADOnlyAuthenticationsDeleteFuture struct {
12328	azure.FutureAPI
12329	// Result returns the result of the asynchronous operation.
12330	// If the operation has not completed it will return an error.
12331	Result func(ManagedInstanceAzureADOnlyAuthenticationsClient) (autorest.Response, error)
12332}
12333
12334// UnmarshalJSON is the custom unmarshaller for CreateFuture.
12335func (future *ManagedInstanceAzureADOnlyAuthenticationsDeleteFuture) UnmarshalJSON(body []byte) error {
12336	var azFuture azure.Future
12337	if err := json.Unmarshal(body, &azFuture); err != nil {
12338		return err
12339	}
12340	future.FutureAPI = &azFuture
12341	future.Result = future.result
12342	return nil
12343}
12344
12345// result is the default implementation for ManagedInstanceAzureADOnlyAuthenticationsDeleteFuture.Result.
12346func (future *ManagedInstanceAzureADOnlyAuthenticationsDeleteFuture) result(client ManagedInstanceAzureADOnlyAuthenticationsClient) (ar autorest.Response, err error) {
12347	var done bool
12348	done, err = future.DoneWithContext(context.Background(), client)
12349	if err != nil {
12350		err = autorest.NewErrorWithError(err, "sql.ManagedInstanceAzureADOnlyAuthenticationsDeleteFuture", "Result", future.Response(), "Polling failure")
12351		return
12352	}
12353	if !done {
12354		ar.Response = future.Response()
12355		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstanceAzureADOnlyAuthenticationsDeleteFuture")
12356		return
12357	}
12358	ar.Response = future.Response()
12359	return
12360}
12361
12362// ManagedInstanceAzureADOnlyAuthListResult a list of active directory only authentications.
12363type ManagedInstanceAzureADOnlyAuthListResult struct {
12364	autorest.Response `json:"-"`
12365	// Value - READ-ONLY; Array of results.
12366	Value *[]ManagedInstanceAzureADOnlyAuthentication `json:"value,omitempty"`
12367	// NextLink - READ-ONLY; Link to retrieve next page of results.
12368	NextLink *string `json:"nextLink,omitempty"`
12369}
12370
12371// MarshalJSON is the custom marshaler for ManagedInstanceAzureADOnlyAuthListResult.
12372func (miaaoalr ManagedInstanceAzureADOnlyAuthListResult) MarshalJSON() ([]byte, error) {
12373	objectMap := make(map[string]interface{})
12374	return json.Marshal(objectMap)
12375}
12376
12377// ManagedInstanceAzureADOnlyAuthListResultIterator provides access to a complete listing of
12378// ManagedInstanceAzureADOnlyAuthentication values.
12379type ManagedInstanceAzureADOnlyAuthListResultIterator struct {
12380	i    int
12381	page ManagedInstanceAzureADOnlyAuthListResultPage
12382}
12383
12384// NextWithContext advances to the next value.  If there was an error making
12385// the request the iterator does not advance and the error is returned.
12386func (iter *ManagedInstanceAzureADOnlyAuthListResultIterator) NextWithContext(ctx context.Context) (err error) {
12387	if tracing.IsEnabled() {
12388		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceAzureADOnlyAuthListResultIterator.NextWithContext")
12389		defer func() {
12390			sc := -1
12391			if iter.Response().Response.Response != nil {
12392				sc = iter.Response().Response.Response.StatusCode
12393			}
12394			tracing.EndSpan(ctx, sc, err)
12395		}()
12396	}
12397	iter.i++
12398	if iter.i < len(iter.page.Values()) {
12399		return nil
12400	}
12401	err = iter.page.NextWithContext(ctx)
12402	if err != nil {
12403		iter.i--
12404		return err
12405	}
12406	iter.i = 0
12407	return nil
12408}
12409
12410// Next advances to the next value.  If there was an error making
12411// the request the iterator does not advance and the error is returned.
12412// Deprecated: Use NextWithContext() instead.
12413func (iter *ManagedInstanceAzureADOnlyAuthListResultIterator) Next() error {
12414	return iter.NextWithContext(context.Background())
12415}
12416
12417// NotDone returns true if the enumeration should be started or is not yet complete.
12418func (iter ManagedInstanceAzureADOnlyAuthListResultIterator) NotDone() bool {
12419	return iter.page.NotDone() && iter.i < len(iter.page.Values())
12420}
12421
12422// Response returns the raw server response from the last page request.
12423func (iter ManagedInstanceAzureADOnlyAuthListResultIterator) Response() ManagedInstanceAzureADOnlyAuthListResult {
12424	return iter.page.Response()
12425}
12426
12427// Value returns the current value or a zero-initialized value if the
12428// iterator has advanced beyond the end of the collection.
12429func (iter ManagedInstanceAzureADOnlyAuthListResultIterator) Value() ManagedInstanceAzureADOnlyAuthentication {
12430	if !iter.page.NotDone() {
12431		return ManagedInstanceAzureADOnlyAuthentication{}
12432	}
12433	return iter.page.Values()[iter.i]
12434}
12435
12436// Creates a new instance of the ManagedInstanceAzureADOnlyAuthListResultIterator type.
12437func NewManagedInstanceAzureADOnlyAuthListResultIterator(page ManagedInstanceAzureADOnlyAuthListResultPage) ManagedInstanceAzureADOnlyAuthListResultIterator {
12438	return ManagedInstanceAzureADOnlyAuthListResultIterator{page: page}
12439}
12440
12441// IsEmpty returns true if the ListResult contains no values.
12442func (miaaoalr ManagedInstanceAzureADOnlyAuthListResult) IsEmpty() bool {
12443	return miaaoalr.Value == nil || len(*miaaoalr.Value) == 0
12444}
12445
12446// hasNextLink returns true if the NextLink is not empty.
12447func (miaaoalr ManagedInstanceAzureADOnlyAuthListResult) hasNextLink() bool {
12448	return miaaoalr.NextLink != nil && len(*miaaoalr.NextLink) != 0
12449}
12450
12451// managedInstanceAzureADOnlyAuthListResultPreparer prepares a request to retrieve the next set of results.
12452// It returns nil if no more results exist.
12453func (miaaoalr ManagedInstanceAzureADOnlyAuthListResult) managedInstanceAzureADOnlyAuthListResultPreparer(ctx context.Context) (*http.Request, error) {
12454	if !miaaoalr.hasNextLink() {
12455		return nil, nil
12456	}
12457	return autorest.Prepare((&http.Request{}).WithContext(ctx),
12458		autorest.AsJSON(),
12459		autorest.AsGet(),
12460		autorest.WithBaseURL(to.String(miaaoalr.NextLink)))
12461}
12462
12463// ManagedInstanceAzureADOnlyAuthListResultPage contains a page of ManagedInstanceAzureADOnlyAuthentication
12464// values.
12465type ManagedInstanceAzureADOnlyAuthListResultPage struct {
12466	fn       func(context.Context, ManagedInstanceAzureADOnlyAuthListResult) (ManagedInstanceAzureADOnlyAuthListResult, error)
12467	miaaoalr ManagedInstanceAzureADOnlyAuthListResult
12468}
12469
12470// NextWithContext advances to the next page of values.  If there was an error making
12471// the request the page does not advance and the error is returned.
12472func (page *ManagedInstanceAzureADOnlyAuthListResultPage) NextWithContext(ctx context.Context) (err error) {
12473	if tracing.IsEnabled() {
12474		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceAzureADOnlyAuthListResultPage.NextWithContext")
12475		defer func() {
12476			sc := -1
12477			if page.Response().Response.Response != nil {
12478				sc = page.Response().Response.Response.StatusCode
12479			}
12480			tracing.EndSpan(ctx, sc, err)
12481		}()
12482	}
12483	for {
12484		next, err := page.fn(ctx, page.miaaoalr)
12485		if err != nil {
12486			return err
12487		}
12488		page.miaaoalr = next
12489		if !next.hasNextLink() || !next.IsEmpty() {
12490			break
12491		}
12492	}
12493	return nil
12494}
12495
12496// Next advances to the next page of values.  If there was an error making
12497// the request the page does not advance and the error is returned.
12498// Deprecated: Use NextWithContext() instead.
12499func (page *ManagedInstanceAzureADOnlyAuthListResultPage) Next() error {
12500	return page.NextWithContext(context.Background())
12501}
12502
12503// NotDone returns true if the page enumeration should be started or is not yet complete.
12504func (page ManagedInstanceAzureADOnlyAuthListResultPage) NotDone() bool {
12505	return !page.miaaoalr.IsEmpty()
12506}
12507
12508// Response returns the raw server response from the last page request.
12509func (page ManagedInstanceAzureADOnlyAuthListResultPage) Response() ManagedInstanceAzureADOnlyAuthListResult {
12510	return page.miaaoalr
12511}
12512
12513// Values returns the slice of values for the current page or nil if there are no values.
12514func (page ManagedInstanceAzureADOnlyAuthListResultPage) Values() []ManagedInstanceAzureADOnlyAuthentication {
12515	if page.miaaoalr.IsEmpty() {
12516		return nil
12517	}
12518	return *page.miaaoalr.Value
12519}
12520
12521// Creates a new instance of the ManagedInstanceAzureADOnlyAuthListResultPage type.
12522func NewManagedInstanceAzureADOnlyAuthListResultPage(cur ManagedInstanceAzureADOnlyAuthListResult, getNextPage func(context.Context, ManagedInstanceAzureADOnlyAuthListResult) (ManagedInstanceAzureADOnlyAuthListResult, error)) ManagedInstanceAzureADOnlyAuthListResultPage {
12523	return ManagedInstanceAzureADOnlyAuthListResultPage{
12524		fn:       getNextPage,
12525		miaaoalr: cur,
12526	}
12527}
12528
12529// ManagedInstanceAzureADOnlyAuthProperties properties of a active directory only authentication for
12530// Managed Instance.
12531type ManagedInstanceAzureADOnlyAuthProperties struct {
12532	// AzureADOnlyAuthentication - Azure Active Directory only Authentication enabled.
12533	AzureADOnlyAuthentication *bool `json:"azureADOnlyAuthentication,omitempty"`
12534}
12535
12536// ManagedInstanceEditionCapability the managed server capability
12537type ManagedInstanceEditionCapability struct {
12538	// Name - READ-ONLY; The managed server version name.
12539	Name *string `json:"name,omitempty"`
12540	// SupportedFamilies - READ-ONLY; The supported families.
12541	SupportedFamilies *[]ManagedInstanceFamilyCapability `json:"supportedFamilies,omitempty"`
12542	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
12543	Status CapabilityStatus `json:"status,omitempty"`
12544	// Reason - The reason for the capability not being available.
12545	Reason *string `json:"reason,omitempty"`
12546}
12547
12548// MarshalJSON is the custom marshaler for ManagedInstanceEditionCapability.
12549func (miec ManagedInstanceEditionCapability) MarshalJSON() ([]byte, error) {
12550	objectMap := make(map[string]interface{})
12551	if miec.Reason != nil {
12552		objectMap["reason"] = miec.Reason
12553	}
12554	return json.Marshal(objectMap)
12555}
12556
12557// ManagedInstanceEncryptionProtector the managed instance encryption protector.
12558type ManagedInstanceEncryptionProtector struct {
12559	autorest.Response `json:"-"`
12560	// Kind - READ-ONLY; Kind of encryption protector. This is metadata used for the Azure portal experience.
12561	Kind *string `json:"kind,omitempty"`
12562	// ManagedInstanceEncryptionProtectorProperties - Resource properties.
12563	*ManagedInstanceEncryptionProtectorProperties `json:"properties,omitempty"`
12564	// ID - READ-ONLY; Resource ID.
12565	ID *string `json:"id,omitempty"`
12566	// Name - READ-ONLY; Resource name.
12567	Name *string `json:"name,omitempty"`
12568	// Type - READ-ONLY; Resource type.
12569	Type *string `json:"type,omitempty"`
12570}
12571
12572// MarshalJSON is the custom marshaler for ManagedInstanceEncryptionProtector.
12573func (miep ManagedInstanceEncryptionProtector) MarshalJSON() ([]byte, error) {
12574	objectMap := make(map[string]interface{})
12575	if miep.ManagedInstanceEncryptionProtectorProperties != nil {
12576		objectMap["properties"] = miep.ManagedInstanceEncryptionProtectorProperties
12577	}
12578	return json.Marshal(objectMap)
12579}
12580
12581// UnmarshalJSON is the custom unmarshaler for ManagedInstanceEncryptionProtector struct.
12582func (miep *ManagedInstanceEncryptionProtector) UnmarshalJSON(body []byte) error {
12583	var m map[string]*json.RawMessage
12584	err := json.Unmarshal(body, &m)
12585	if err != nil {
12586		return err
12587	}
12588	for k, v := range m {
12589		switch k {
12590		case "kind":
12591			if v != nil {
12592				var kind string
12593				err = json.Unmarshal(*v, &kind)
12594				if err != nil {
12595					return err
12596				}
12597				miep.Kind = &kind
12598			}
12599		case "properties":
12600			if v != nil {
12601				var managedInstanceEncryptionProtectorProperties ManagedInstanceEncryptionProtectorProperties
12602				err = json.Unmarshal(*v, &managedInstanceEncryptionProtectorProperties)
12603				if err != nil {
12604					return err
12605				}
12606				miep.ManagedInstanceEncryptionProtectorProperties = &managedInstanceEncryptionProtectorProperties
12607			}
12608		case "id":
12609			if v != nil {
12610				var ID string
12611				err = json.Unmarshal(*v, &ID)
12612				if err != nil {
12613					return err
12614				}
12615				miep.ID = &ID
12616			}
12617		case "name":
12618			if v != nil {
12619				var name string
12620				err = json.Unmarshal(*v, &name)
12621				if err != nil {
12622					return err
12623				}
12624				miep.Name = &name
12625			}
12626		case "type":
12627			if v != nil {
12628				var typeVar string
12629				err = json.Unmarshal(*v, &typeVar)
12630				if err != nil {
12631					return err
12632				}
12633				miep.Type = &typeVar
12634			}
12635		}
12636	}
12637
12638	return nil
12639}
12640
12641// ManagedInstanceEncryptionProtectorListResult a list of managed instance encryption protectors.
12642type ManagedInstanceEncryptionProtectorListResult struct {
12643	autorest.Response `json:"-"`
12644	// Value - READ-ONLY; Array of results.
12645	Value *[]ManagedInstanceEncryptionProtector `json:"value,omitempty"`
12646	// NextLink - READ-ONLY; Link to retrieve next page of results.
12647	NextLink *string `json:"nextLink,omitempty"`
12648}
12649
12650// MarshalJSON is the custom marshaler for ManagedInstanceEncryptionProtectorListResult.
12651func (mieplr ManagedInstanceEncryptionProtectorListResult) MarshalJSON() ([]byte, error) {
12652	objectMap := make(map[string]interface{})
12653	return json.Marshal(objectMap)
12654}
12655
12656// ManagedInstanceEncryptionProtectorListResultIterator provides access to a complete listing of
12657// ManagedInstanceEncryptionProtector values.
12658type ManagedInstanceEncryptionProtectorListResultIterator struct {
12659	i    int
12660	page ManagedInstanceEncryptionProtectorListResultPage
12661}
12662
12663// NextWithContext advances to the next value.  If there was an error making
12664// the request the iterator does not advance and the error is returned.
12665func (iter *ManagedInstanceEncryptionProtectorListResultIterator) NextWithContext(ctx context.Context) (err error) {
12666	if tracing.IsEnabled() {
12667		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceEncryptionProtectorListResultIterator.NextWithContext")
12668		defer func() {
12669			sc := -1
12670			if iter.Response().Response.Response != nil {
12671				sc = iter.Response().Response.Response.StatusCode
12672			}
12673			tracing.EndSpan(ctx, sc, err)
12674		}()
12675	}
12676	iter.i++
12677	if iter.i < len(iter.page.Values()) {
12678		return nil
12679	}
12680	err = iter.page.NextWithContext(ctx)
12681	if err != nil {
12682		iter.i--
12683		return err
12684	}
12685	iter.i = 0
12686	return nil
12687}
12688
12689// Next advances to the next value.  If there was an error making
12690// the request the iterator does not advance and the error is returned.
12691// Deprecated: Use NextWithContext() instead.
12692func (iter *ManagedInstanceEncryptionProtectorListResultIterator) Next() error {
12693	return iter.NextWithContext(context.Background())
12694}
12695
12696// NotDone returns true if the enumeration should be started or is not yet complete.
12697func (iter ManagedInstanceEncryptionProtectorListResultIterator) NotDone() bool {
12698	return iter.page.NotDone() && iter.i < len(iter.page.Values())
12699}
12700
12701// Response returns the raw server response from the last page request.
12702func (iter ManagedInstanceEncryptionProtectorListResultIterator) Response() ManagedInstanceEncryptionProtectorListResult {
12703	return iter.page.Response()
12704}
12705
12706// Value returns the current value or a zero-initialized value if the
12707// iterator has advanced beyond the end of the collection.
12708func (iter ManagedInstanceEncryptionProtectorListResultIterator) Value() ManagedInstanceEncryptionProtector {
12709	if !iter.page.NotDone() {
12710		return ManagedInstanceEncryptionProtector{}
12711	}
12712	return iter.page.Values()[iter.i]
12713}
12714
12715// Creates a new instance of the ManagedInstanceEncryptionProtectorListResultIterator type.
12716func NewManagedInstanceEncryptionProtectorListResultIterator(page ManagedInstanceEncryptionProtectorListResultPage) ManagedInstanceEncryptionProtectorListResultIterator {
12717	return ManagedInstanceEncryptionProtectorListResultIterator{page: page}
12718}
12719
12720// IsEmpty returns true if the ListResult contains no values.
12721func (mieplr ManagedInstanceEncryptionProtectorListResult) IsEmpty() bool {
12722	return mieplr.Value == nil || len(*mieplr.Value) == 0
12723}
12724
12725// hasNextLink returns true if the NextLink is not empty.
12726func (mieplr ManagedInstanceEncryptionProtectorListResult) hasNextLink() bool {
12727	return mieplr.NextLink != nil && len(*mieplr.NextLink) != 0
12728}
12729
12730// managedInstanceEncryptionProtectorListResultPreparer prepares a request to retrieve the next set of results.
12731// It returns nil if no more results exist.
12732func (mieplr ManagedInstanceEncryptionProtectorListResult) managedInstanceEncryptionProtectorListResultPreparer(ctx context.Context) (*http.Request, error) {
12733	if !mieplr.hasNextLink() {
12734		return nil, nil
12735	}
12736	return autorest.Prepare((&http.Request{}).WithContext(ctx),
12737		autorest.AsJSON(),
12738		autorest.AsGet(),
12739		autorest.WithBaseURL(to.String(mieplr.NextLink)))
12740}
12741
12742// ManagedInstanceEncryptionProtectorListResultPage contains a page of ManagedInstanceEncryptionProtector
12743// values.
12744type ManagedInstanceEncryptionProtectorListResultPage struct {
12745	fn     func(context.Context, ManagedInstanceEncryptionProtectorListResult) (ManagedInstanceEncryptionProtectorListResult, error)
12746	mieplr ManagedInstanceEncryptionProtectorListResult
12747}
12748
12749// NextWithContext advances to the next page of values.  If there was an error making
12750// the request the page does not advance and the error is returned.
12751func (page *ManagedInstanceEncryptionProtectorListResultPage) NextWithContext(ctx context.Context) (err error) {
12752	if tracing.IsEnabled() {
12753		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceEncryptionProtectorListResultPage.NextWithContext")
12754		defer func() {
12755			sc := -1
12756			if page.Response().Response.Response != nil {
12757				sc = page.Response().Response.Response.StatusCode
12758			}
12759			tracing.EndSpan(ctx, sc, err)
12760		}()
12761	}
12762	for {
12763		next, err := page.fn(ctx, page.mieplr)
12764		if err != nil {
12765			return err
12766		}
12767		page.mieplr = next
12768		if !next.hasNextLink() || !next.IsEmpty() {
12769			break
12770		}
12771	}
12772	return nil
12773}
12774
12775// Next advances to the next page of values.  If there was an error making
12776// the request the page does not advance and the error is returned.
12777// Deprecated: Use NextWithContext() instead.
12778func (page *ManagedInstanceEncryptionProtectorListResultPage) Next() error {
12779	return page.NextWithContext(context.Background())
12780}
12781
12782// NotDone returns true if the page enumeration should be started or is not yet complete.
12783func (page ManagedInstanceEncryptionProtectorListResultPage) NotDone() bool {
12784	return !page.mieplr.IsEmpty()
12785}
12786
12787// Response returns the raw server response from the last page request.
12788func (page ManagedInstanceEncryptionProtectorListResultPage) Response() ManagedInstanceEncryptionProtectorListResult {
12789	return page.mieplr
12790}
12791
12792// Values returns the slice of values for the current page or nil if there are no values.
12793func (page ManagedInstanceEncryptionProtectorListResultPage) Values() []ManagedInstanceEncryptionProtector {
12794	if page.mieplr.IsEmpty() {
12795		return nil
12796	}
12797	return *page.mieplr.Value
12798}
12799
12800// Creates a new instance of the ManagedInstanceEncryptionProtectorListResultPage type.
12801func NewManagedInstanceEncryptionProtectorListResultPage(cur ManagedInstanceEncryptionProtectorListResult, getNextPage func(context.Context, ManagedInstanceEncryptionProtectorListResult) (ManagedInstanceEncryptionProtectorListResult, error)) ManagedInstanceEncryptionProtectorListResultPage {
12802	return ManagedInstanceEncryptionProtectorListResultPage{
12803		fn:     getNextPage,
12804		mieplr: cur,
12805	}
12806}
12807
12808// ManagedInstanceEncryptionProtectorProperties properties for an encryption protector execution.
12809type ManagedInstanceEncryptionProtectorProperties struct {
12810	// ServerKeyName - The name of the managed instance key.
12811	ServerKeyName *string `json:"serverKeyName,omitempty"`
12812	// ServerKeyType - The encryption protector type like 'ServiceManaged', 'AzureKeyVault'. Possible values include: 'ServiceManaged', 'AzureKeyVault'
12813	ServerKeyType ServerKeyType `json:"serverKeyType,omitempty"`
12814	// URI - READ-ONLY; The URI of the server key.
12815	URI *string `json:"uri,omitempty"`
12816	// Thumbprint - READ-ONLY; Thumbprint of the server key.
12817	Thumbprint *string `json:"thumbprint,omitempty"`
12818}
12819
12820// MarshalJSON is the custom marshaler for ManagedInstanceEncryptionProtectorProperties.
12821func (miepp ManagedInstanceEncryptionProtectorProperties) MarshalJSON() ([]byte, error) {
12822	objectMap := make(map[string]interface{})
12823	if miepp.ServerKeyName != nil {
12824		objectMap["serverKeyName"] = miepp.ServerKeyName
12825	}
12826	if miepp.ServerKeyType != "" {
12827		objectMap["serverKeyType"] = miepp.ServerKeyType
12828	}
12829	return json.Marshal(objectMap)
12830}
12831
12832// ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture an abstraction for monitoring and retrieving the
12833// results of a long-running operation.
12834type ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture struct {
12835	azure.FutureAPI
12836	// Result returns the result of the asynchronous operation.
12837	// If the operation has not completed it will return an error.
12838	Result func(ManagedInstanceEncryptionProtectorsClient) (ManagedInstanceEncryptionProtector, error)
12839}
12840
12841// UnmarshalJSON is the custom unmarshaller for CreateFuture.
12842func (future *ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
12843	var azFuture azure.Future
12844	if err := json.Unmarshal(body, &azFuture); err != nil {
12845		return err
12846	}
12847	future.FutureAPI = &azFuture
12848	future.Result = future.result
12849	return nil
12850}
12851
12852// result is the default implementation for ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture.Result.
12853func (future *ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture) result(client ManagedInstanceEncryptionProtectorsClient) (miep ManagedInstanceEncryptionProtector, err error) {
12854	var done bool
12855	done, err = future.DoneWithContext(context.Background(), client)
12856	if err != nil {
12857		err = autorest.NewErrorWithError(err, "sql.ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
12858		return
12859	}
12860	if !done {
12861		miep.Response.Response = future.Response()
12862		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture")
12863		return
12864	}
12865	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12866	if miep.Response.Response, err = future.GetResult(sender); err == nil && miep.Response.Response.StatusCode != http.StatusNoContent {
12867		miep, err = client.CreateOrUpdateResponder(miep.Response.Response)
12868		if err != nil {
12869			err = autorest.NewErrorWithError(err, "sql.ManagedInstanceEncryptionProtectorsCreateOrUpdateFuture", "Result", miep.Response.Response, "Failure responding to request")
12870		}
12871	}
12872	return
12873}
12874
12875// ManagedInstanceEncryptionProtectorsRevalidateFuture an abstraction for monitoring and retrieving the
12876// results of a long-running operation.
12877type ManagedInstanceEncryptionProtectorsRevalidateFuture struct {
12878	azure.FutureAPI
12879	// Result returns the result of the asynchronous operation.
12880	// If the operation has not completed it will return an error.
12881	Result func(ManagedInstanceEncryptionProtectorsClient) (autorest.Response, error)
12882}
12883
12884// UnmarshalJSON is the custom unmarshaller for CreateFuture.
12885func (future *ManagedInstanceEncryptionProtectorsRevalidateFuture) UnmarshalJSON(body []byte) error {
12886	var azFuture azure.Future
12887	if err := json.Unmarshal(body, &azFuture); err != nil {
12888		return err
12889	}
12890	future.FutureAPI = &azFuture
12891	future.Result = future.result
12892	return nil
12893}
12894
12895// result is the default implementation for ManagedInstanceEncryptionProtectorsRevalidateFuture.Result.
12896func (future *ManagedInstanceEncryptionProtectorsRevalidateFuture) result(client ManagedInstanceEncryptionProtectorsClient) (ar autorest.Response, err error) {
12897	var done bool
12898	done, err = future.DoneWithContext(context.Background(), client)
12899	if err != nil {
12900		err = autorest.NewErrorWithError(err, "sql.ManagedInstanceEncryptionProtectorsRevalidateFuture", "Result", future.Response(), "Polling failure")
12901		return
12902	}
12903	if !done {
12904		ar.Response = future.Response()
12905		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstanceEncryptionProtectorsRevalidateFuture")
12906		return
12907	}
12908	ar.Response = future.Response()
12909	return
12910}
12911
12912// ManagedInstanceFamilyCapability the managed server family capability.
12913type ManagedInstanceFamilyCapability struct {
12914	// Name - READ-ONLY; Family name.
12915	Name *string `json:"name,omitempty"`
12916	// Sku - READ-ONLY; SKU name.
12917	Sku *string `json:"sku,omitempty"`
12918	// SupportedLicenseTypes - READ-ONLY; List of supported license types.
12919	SupportedLicenseTypes *[]LicenseTypeCapability `json:"supportedLicenseTypes,omitempty"`
12920	// SupportedVcoresValues - READ-ONLY; List of supported virtual cores values.
12921	SupportedVcoresValues *[]ManagedInstanceVcoresCapability `json:"supportedVcoresValues,omitempty"`
12922	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
12923	Status CapabilityStatus `json:"status,omitempty"`
12924	// Reason - The reason for the capability not being available.
12925	Reason *string `json:"reason,omitempty"`
12926}
12927
12928// MarshalJSON is the custom marshaler for ManagedInstanceFamilyCapability.
12929func (mifc ManagedInstanceFamilyCapability) MarshalJSON() ([]byte, error) {
12930	objectMap := make(map[string]interface{})
12931	if mifc.Reason != nil {
12932		objectMap["reason"] = mifc.Reason
12933	}
12934	return json.Marshal(objectMap)
12935}
12936
12937// ManagedInstanceKey a managed instance key.
12938type ManagedInstanceKey struct {
12939	autorest.Response `json:"-"`
12940	// Kind - READ-ONLY; Kind of encryption protector. This is metadata used for the Azure portal experience.
12941	Kind *string `json:"kind,omitempty"`
12942	// ManagedInstanceKeyProperties - Resource properties.
12943	*ManagedInstanceKeyProperties `json:"properties,omitempty"`
12944	// ID - READ-ONLY; Resource ID.
12945	ID *string `json:"id,omitempty"`
12946	// Name - READ-ONLY; Resource name.
12947	Name *string `json:"name,omitempty"`
12948	// Type - READ-ONLY; Resource type.
12949	Type *string `json:"type,omitempty"`
12950}
12951
12952// MarshalJSON is the custom marshaler for ManagedInstanceKey.
12953func (mik ManagedInstanceKey) MarshalJSON() ([]byte, error) {
12954	objectMap := make(map[string]interface{})
12955	if mik.ManagedInstanceKeyProperties != nil {
12956		objectMap["properties"] = mik.ManagedInstanceKeyProperties
12957	}
12958	return json.Marshal(objectMap)
12959}
12960
12961// UnmarshalJSON is the custom unmarshaler for ManagedInstanceKey struct.
12962func (mik *ManagedInstanceKey) UnmarshalJSON(body []byte) error {
12963	var m map[string]*json.RawMessage
12964	err := json.Unmarshal(body, &m)
12965	if err != nil {
12966		return err
12967	}
12968	for k, v := range m {
12969		switch k {
12970		case "kind":
12971			if v != nil {
12972				var kind string
12973				err = json.Unmarshal(*v, &kind)
12974				if err != nil {
12975					return err
12976				}
12977				mik.Kind = &kind
12978			}
12979		case "properties":
12980			if v != nil {
12981				var managedInstanceKeyProperties ManagedInstanceKeyProperties
12982				err = json.Unmarshal(*v, &managedInstanceKeyProperties)
12983				if err != nil {
12984					return err
12985				}
12986				mik.ManagedInstanceKeyProperties = &managedInstanceKeyProperties
12987			}
12988		case "id":
12989			if v != nil {
12990				var ID string
12991				err = json.Unmarshal(*v, &ID)
12992				if err != nil {
12993					return err
12994				}
12995				mik.ID = &ID
12996			}
12997		case "name":
12998			if v != nil {
12999				var name string
13000				err = json.Unmarshal(*v, &name)
13001				if err != nil {
13002					return err
13003				}
13004				mik.Name = &name
13005			}
13006		case "type":
13007			if v != nil {
13008				var typeVar string
13009				err = json.Unmarshal(*v, &typeVar)
13010				if err != nil {
13011					return err
13012				}
13013				mik.Type = &typeVar
13014			}
13015		}
13016	}
13017
13018	return nil
13019}
13020
13021// ManagedInstanceKeyListResult a list of managed instance keys.
13022type ManagedInstanceKeyListResult struct {
13023	autorest.Response `json:"-"`
13024	// Value - READ-ONLY; Array of results.
13025	Value *[]ManagedInstanceKey `json:"value,omitempty"`
13026	// NextLink - READ-ONLY; Link to retrieve next page of results.
13027	NextLink *string `json:"nextLink,omitempty"`
13028}
13029
13030// MarshalJSON is the custom marshaler for ManagedInstanceKeyListResult.
13031func (miklr ManagedInstanceKeyListResult) MarshalJSON() ([]byte, error) {
13032	objectMap := make(map[string]interface{})
13033	return json.Marshal(objectMap)
13034}
13035
13036// ManagedInstanceKeyListResultIterator provides access to a complete listing of ManagedInstanceKey values.
13037type ManagedInstanceKeyListResultIterator struct {
13038	i    int
13039	page ManagedInstanceKeyListResultPage
13040}
13041
13042// NextWithContext advances to the next value.  If there was an error making
13043// the request the iterator does not advance and the error is returned.
13044func (iter *ManagedInstanceKeyListResultIterator) NextWithContext(ctx context.Context) (err error) {
13045	if tracing.IsEnabled() {
13046		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceKeyListResultIterator.NextWithContext")
13047		defer func() {
13048			sc := -1
13049			if iter.Response().Response.Response != nil {
13050				sc = iter.Response().Response.Response.StatusCode
13051			}
13052			tracing.EndSpan(ctx, sc, err)
13053		}()
13054	}
13055	iter.i++
13056	if iter.i < len(iter.page.Values()) {
13057		return nil
13058	}
13059	err = iter.page.NextWithContext(ctx)
13060	if err != nil {
13061		iter.i--
13062		return err
13063	}
13064	iter.i = 0
13065	return nil
13066}
13067
13068// Next advances to the next value.  If there was an error making
13069// the request the iterator does not advance and the error is returned.
13070// Deprecated: Use NextWithContext() instead.
13071func (iter *ManagedInstanceKeyListResultIterator) Next() error {
13072	return iter.NextWithContext(context.Background())
13073}
13074
13075// NotDone returns true if the enumeration should be started or is not yet complete.
13076func (iter ManagedInstanceKeyListResultIterator) NotDone() bool {
13077	return iter.page.NotDone() && iter.i < len(iter.page.Values())
13078}
13079
13080// Response returns the raw server response from the last page request.
13081func (iter ManagedInstanceKeyListResultIterator) Response() ManagedInstanceKeyListResult {
13082	return iter.page.Response()
13083}
13084
13085// Value returns the current value or a zero-initialized value if the
13086// iterator has advanced beyond the end of the collection.
13087func (iter ManagedInstanceKeyListResultIterator) Value() ManagedInstanceKey {
13088	if !iter.page.NotDone() {
13089		return ManagedInstanceKey{}
13090	}
13091	return iter.page.Values()[iter.i]
13092}
13093
13094// Creates a new instance of the ManagedInstanceKeyListResultIterator type.
13095func NewManagedInstanceKeyListResultIterator(page ManagedInstanceKeyListResultPage) ManagedInstanceKeyListResultIterator {
13096	return ManagedInstanceKeyListResultIterator{page: page}
13097}
13098
13099// IsEmpty returns true if the ListResult contains no values.
13100func (miklr ManagedInstanceKeyListResult) IsEmpty() bool {
13101	return miklr.Value == nil || len(*miklr.Value) == 0
13102}
13103
13104// hasNextLink returns true if the NextLink is not empty.
13105func (miklr ManagedInstanceKeyListResult) hasNextLink() bool {
13106	return miklr.NextLink != nil && len(*miklr.NextLink) != 0
13107}
13108
13109// managedInstanceKeyListResultPreparer prepares a request to retrieve the next set of results.
13110// It returns nil if no more results exist.
13111func (miklr ManagedInstanceKeyListResult) managedInstanceKeyListResultPreparer(ctx context.Context) (*http.Request, error) {
13112	if !miklr.hasNextLink() {
13113		return nil, nil
13114	}
13115	return autorest.Prepare((&http.Request{}).WithContext(ctx),
13116		autorest.AsJSON(),
13117		autorest.AsGet(),
13118		autorest.WithBaseURL(to.String(miklr.NextLink)))
13119}
13120
13121// ManagedInstanceKeyListResultPage contains a page of ManagedInstanceKey values.
13122type ManagedInstanceKeyListResultPage struct {
13123	fn    func(context.Context, ManagedInstanceKeyListResult) (ManagedInstanceKeyListResult, error)
13124	miklr ManagedInstanceKeyListResult
13125}
13126
13127// NextWithContext advances to the next page of values.  If there was an error making
13128// the request the page does not advance and the error is returned.
13129func (page *ManagedInstanceKeyListResultPage) NextWithContext(ctx context.Context) (err error) {
13130	if tracing.IsEnabled() {
13131		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceKeyListResultPage.NextWithContext")
13132		defer func() {
13133			sc := -1
13134			if page.Response().Response.Response != nil {
13135				sc = page.Response().Response.Response.StatusCode
13136			}
13137			tracing.EndSpan(ctx, sc, err)
13138		}()
13139	}
13140	for {
13141		next, err := page.fn(ctx, page.miklr)
13142		if err != nil {
13143			return err
13144		}
13145		page.miklr = next
13146		if !next.hasNextLink() || !next.IsEmpty() {
13147			break
13148		}
13149	}
13150	return nil
13151}
13152
13153// Next advances to the next page of values.  If there was an error making
13154// the request the page does not advance and the error is returned.
13155// Deprecated: Use NextWithContext() instead.
13156func (page *ManagedInstanceKeyListResultPage) Next() error {
13157	return page.NextWithContext(context.Background())
13158}
13159
13160// NotDone returns true if the page enumeration should be started or is not yet complete.
13161func (page ManagedInstanceKeyListResultPage) NotDone() bool {
13162	return !page.miklr.IsEmpty()
13163}
13164
13165// Response returns the raw server response from the last page request.
13166func (page ManagedInstanceKeyListResultPage) Response() ManagedInstanceKeyListResult {
13167	return page.miklr
13168}
13169
13170// Values returns the slice of values for the current page or nil if there are no values.
13171func (page ManagedInstanceKeyListResultPage) Values() []ManagedInstanceKey {
13172	if page.miklr.IsEmpty() {
13173		return nil
13174	}
13175	return *page.miklr.Value
13176}
13177
13178// Creates a new instance of the ManagedInstanceKeyListResultPage type.
13179func NewManagedInstanceKeyListResultPage(cur ManagedInstanceKeyListResult, getNextPage func(context.Context, ManagedInstanceKeyListResult) (ManagedInstanceKeyListResult, error)) ManagedInstanceKeyListResultPage {
13180	return ManagedInstanceKeyListResultPage{
13181		fn:    getNextPage,
13182		miklr: cur,
13183	}
13184}
13185
13186// ManagedInstanceKeyProperties properties for a key execution.
13187type ManagedInstanceKeyProperties struct {
13188	// ServerKeyType - The key type like 'ServiceManaged', 'AzureKeyVault'. Possible values include: 'ServiceManaged', 'AzureKeyVault'
13189	ServerKeyType ServerKeyType `json:"serverKeyType,omitempty"`
13190	// URI - The URI of the key. If the ServerKeyType is AzureKeyVault, then the URI is required.
13191	URI *string `json:"uri,omitempty"`
13192	// Thumbprint - READ-ONLY; Thumbprint of the key.
13193	Thumbprint *string `json:"thumbprint,omitempty"`
13194	// CreationDate - READ-ONLY; The key creation date.
13195	CreationDate *date.Time `json:"creationDate,omitempty"`
13196}
13197
13198// MarshalJSON is the custom marshaler for ManagedInstanceKeyProperties.
13199func (mikp ManagedInstanceKeyProperties) MarshalJSON() ([]byte, error) {
13200	objectMap := make(map[string]interface{})
13201	if mikp.ServerKeyType != "" {
13202		objectMap["serverKeyType"] = mikp.ServerKeyType
13203	}
13204	if mikp.URI != nil {
13205		objectMap["uri"] = mikp.URI
13206	}
13207	return json.Marshal(objectMap)
13208}
13209
13210// ManagedInstanceKeysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
13211// long-running operation.
13212type ManagedInstanceKeysCreateOrUpdateFuture struct {
13213	azure.FutureAPI
13214	// Result returns the result of the asynchronous operation.
13215	// If the operation has not completed it will return an error.
13216	Result func(ManagedInstanceKeysClient) (ManagedInstanceKey, error)
13217}
13218
13219// UnmarshalJSON is the custom unmarshaller for CreateFuture.
13220func (future *ManagedInstanceKeysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
13221	var azFuture azure.Future
13222	if err := json.Unmarshal(body, &azFuture); err != nil {
13223		return err
13224	}
13225	future.FutureAPI = &azFuture
13226	future.Result = future.result
13227	return nil
13228}
13229
13230// result is the default implementation for ManagedInstanceKeysCreateOrUpdateFuture.Result.
13231func (future *ManagedInstanceKeysCreateOrUpdateFuture) result(client ManagedInstanceKeysClient) (mik ManagedInstanceKey, err error) {
13232	var done bool
13233	done, err = future.DoneWithContext(context.Background(), client)
13234	if err != nil {
13235		err = autorest.NewErrorWithError(err, "sql.ManagedInstanceKeysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
13236		return
13237	}
13238	if !done {
13239		mik.Response.Response = future.Response()
13240		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstanceKeysCreateOrUpdateFuture")
13241		return
13242	}
13243	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13244	if mik.Response.Response, err = future.GetResult(sender); err == nil && mik.Response.Response.StatusCode != http.StatusNoContent {
13245		mik, err = client.CreateOrUpdateResponder(mik.Response.Response)
13246		if err != nil {
13247			err = autorest.NewErrorWithError(err, "sql.ManagedInstanceKeysCreateOrUpdateFuture", "Result", mik.Response.Response, "Failure responding to request")
13248		}
13249	}
13250	return
13251}
13252
13253// ManagedInstanceKeysDeleteFuture an abstraction for monitoring and retrieving the results of a
13254// long-running operation.
13255type ManagedInstanceKeysDeleteFuture struct {
13256	azure.FutureAPI
13257	// Result returns the result of the asynchronous operation.
13258	// If the operation has not completed it will return an error.
13259	Result func(ManagedInstanceKeysClient) (autorest.Response, error)
13260}
13261
13262// UnmarshalJSON is the custom unmarshaller for CreateFuture.
13263func (future *ManagedInstanceKeysDeleteFuture) UnmarshalJSON(body []byte) error {
13264	var azFuture azure.Future
13265	if err := json.Unmarshal(body, &azFuture); err != nil {
13266		return err
13267	}
13268	future.FutureAPI = &azFuture
13269	future.Result = future.result
13270	return nil
13271}
13272
13273// result is the default implementation for ManagedInstanceKeysDeleteFuture.Result.
13274func (future *ManagedInstanceKeysDeleteFuture) result(client ManagedInstanceKeysClient) (ar autorest.Response, err error) {
13275	var done bool
13276	done, err = future.DoneWithContext(context.Background(), client)
13277	if err != nil {
13278		err = autorest.NewErrorWithError(err, "sql.ManagedInstanceKeysDeleteFuture", "Result", future.Response(), "Polling failure")
13279		return
13280	}
13281	if !done {
13282		ar.Response = future.Response()
13283		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstanceKeysDeleteFuture")
13284		return
13285	}
13286	ar.Response = future.Response()
13287	return
13288}
13289
13290// ManagedInstanceListResult a list of managed instances.
13291type ManagedInstanceListResult struct {
13292	autorest.Response `json:"-"`
13293	// Value - READ-ONLY; Array of results.
13294	Value *[]ManagedInstance `json:"value,omitempty"`
13295	// NextLink - READ-ONLY; Link to retrieve next page of results.
13296	NextLink *string `json:"nextLink,omitempty"`
13297}
13298
13299// MarshalJSON is the custom marshaler for ManagedInstanceListResult.
13300func (milr ManagedInstanceListResult) MarshalJSON() ([]byte, error) {
13301	objectMap := make(map[string]interface{})
13302	return json.Marshal(objectMap)
13303}
13304
13305// ManagedInstanceListResultIterator provides access to a complete listing of ManagedInstance values.
13306type ManagedInstanceListResultIterator struct {
13307	i    int
13308	page ManagedInstanceListResultPage
13309}
13310
13311// NextWithContext advances to the next value.  If there was an error making
13312// the request the iterator does not advance and the error is returned.
13313func (iter *ManagedInstanceListResultIterator) NextWithContext(ctx context.Context) (err error) {
13314	if tracing.IsEnabled() {
13315		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceListResultIterator.NextWithContext")
13316		defer func() {
13317			sc := -1
13318			if iter.Response().Response.Response != nil {
13319				sc = iter.Response().Response.Response.StatusCode
13320			}
13321			tracing.EndSpan(ctx, sc, err)
13322		}()
13323	}
13324	iter.i++
13325	if iter.i < len(iter.page.Values()) {
13326		return nil
13327	}
13328	err = iter.page.NextWithContext(ctx)
13329	if err != nil {
13330		iter.i--
13331		return err
13332	}
13333	iter.i = 0
13334	return nil
13335}
13336
13337// Next advances to the next value.  If there was an error making
13338// the request the iterator does not advance and the error is returned.
13339// Deprecated: Use NextWithContext() instead.
13340func (iter *ManagedInstanceListResultIterator) Next() error {
13341	return iter.NextWithContext(context.Background())
13342}
13343
13344// NotDone returns true if the enumeration should be started or is not yet complete.
13345func (iter ManagedInstanceListResultIterator) NotDone() bool {
13346	return iter.page.NotDone() && iter.i < len(iter.page.Values())
13347}
13348
13349// Response returns the raw server response from the last page request.
13350func (iter ManagedInstanceListResultIterator) Response() ManagedInstanceListResult {
13351	return iter.page.Response()
13352}
13353
13354// Value returns the current value or a zero-initialized value if the
13355// iterator has advanced beyond the end of the collection.
13356func (iter ManagedInstanceListResultIterator) Value() ManagedInstance {
13357	if !iter.page.NotDone() {
13358		return ManagedInstance{}
13359	}
13360	return iter.page.Values()[iter.i]
13361}
13362
13363// Creates a new instance of the ManagedInstanceListResultIterator type.
13364func NewManagedInstanceListResultIterator(page ManagedInstanceListResultPage) ManagedInstanceListResultIterator {
13365	return ManagedInstanceListResultIterator{page: page}
13366}
13367
13368// IsEmpty returns true if the ListResult contains no values.
13369func (milr ManagedInstanceListResult) IsEmpty() bool {
13370	return milr.Value == nil || len(*milr.Value) == 0
13371}
13372
13373// hasNextLink returns true if the NextLink is not empty.
13374func (milr ManagedInstanceListResult) hasNextLink() bool {
13375	return milr.NextLink != nil && len(*milr.NextLink) != 0
13376}
13377
13378// managedInstanceListResultPreparer prepares a request to retrieve the next set of results.
13379// It returns nil if no more results exist.
13380func (milr ManagedInstanceListResult) managedInstanceListResultPreparer(ctx context.Context) (*http.Request, error) {
13381	if !milr.hasNextLink() {
13382		return nil, nil
13383	}
13384	return autorest.Prepare((&http.Request{}).WithContext(ctx),
13385		autorest.AsJSON(),
13386		autorest.AsGet(),
13387		autorest.WithBaseURL(to.String(milr.NextLink)))
13388}
13389
13390// ManagedInstanceListResultPage contains a page of ManagedInstance values.
13391type ManagedInstanceListResultPage struct {
13392	fn   func(context.Context, ManagedInstanceListResult) (ManagedInstanceListResult, error)
13393	milr ManagedInstanceListResult
13394}
13395
13396// NextWithContext advances to the next page of values.  If there was an error making
13397// the request the page does not advance and the error is returned.
13398func (page *ManagedInstanceListResultPage) NextWithContext(ctx context.Context) (err error) {
13399	if tracing.IsEnabled() {
13400		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceListResultPage.NextWithContext")
13401		defer func() {
13402			sc := -1
13403			if page.Response().Response.Response != nil {
13404				sc = page.Response().Response.Response.StatusCode
13405			}
13406			tracing.EndSpan(ctx, sc, err)
13407		}()
13408	}
13409	for {
13410		next, err := page.fn(ctx, page.milr)
13411		if err != nil {
13412			return err
13413		}
13414		page.milr = next
13415		if !next.hasNextLink() || !next.IsEmpty() {
13416			break
13417		}
13418	}
13419	return nil
13420}
13421
13422// Next advances to the next page of values.  If there was an error making
13423// the request the page does not advance and the error is returned.
13424// Deprecated: Use NextWithContext() instead.
13425func (page *ManagedInstanceListResultPage) Next() error {
13426	return page.NextWithContext(context.Background())
13427}
13428
13429// NotDone returns true if the page enumeration should be started or is not yet complete.
13430func (page ManagedInstanceListResultPage) NotDone() bool {
13431	return !page.milr.IsEmpty()
13432}
13433
13434// Response returns the raw server response from the last page request.
13435func (page ManagedInstanceListResultPage) Response() ManagedInstanceListResult {
13436	return page.milr
13437}
13438
13439// Values returns the slice of values for the current page or nil if there are no values.
13440func (page ManagedInstanceListResultPage) Values() []ManagedInstance {
13441	if page.milr.IsEmpty() {
13442		return nil
13443	}
13444	return *page.milr.Value
13445}
13446
13447// Creates a new instance of the ManagedInstanceListResultPage type.
13448func NewManagedInstanceListResultPage(cur ManagedInstanceListResult, getNextPage func(context.Context, ManagedInstanceListResult) (ManagedInstanceListResult, error)) ManagedInstanceListResultPage {
13449	return ManagedInstanceListResultPage{
13450		fn:   getNextPage,
13451		milr: cur,
13452	}
13453}
13454
13455// ManagedInstanceLongTermRetentionBackup a long term retention backup for a managed database.
13456type ManagedInstanceLongTermRetentionBackup struct {
13457	autorest.Response `json:"-"`
13458	// ManagedInstanceLongTermRetentionBackupProperties - Resource properties.
13459	*ManagedInstanceLongTermRetentionBackupProperties `json:"properties,omitempty"`
13460	// ID - READ-ONLY; Resource ID.
13461	ID *string `json:"id,omitempty"`
13462	// Name - READ-ONLY; Resource name.
13463	Name *string `json:"name,omitempty"`
13464	// Type - READ-ONLY; Resource type.
13465	Type *string `json:"type,omitempty"`
13466}
13467
13468// MarshalJSON is the custom marshaler for ManagedInstanceLongTermRetentionBackup.
13469func (miltrb ManagedInstanceLongTermRetentionBackup) MarshalJSON() ([]byte, error) {
13470	objectMap := make(map[string]interface{})
13471	if miltrb.ManagedInstanceLongTermRetentionBackupProperties != nil {
13472		objectMap["properties"] = miltrb.ManagedInstanceLongTermRetentionBackupProperties
13473	}
13474	return json.Marshal(objectMap)
13475}
13476
13477// UnmarshalJSON is the custom unmarshaler for ManagedInstanceLongTermRetentionBackup struct.
13478func (miltrb *ManagedInstanceLongTermRetentionBackup) UnmarshalJSON(body []byte) error {
13479	var m map[string]*json.RawMessage
13480	err := json.Unmarshal(body, &m)
13481	if err != nil {
13482		return err
13483	}
13484	for k, v := range m {
13485		switch k {
13486		case "properties":
13487			if v != nil {
13488				var managedInstanceLongTermRetentionBackupProperties ManagedInstanceLongTermRetentionBackupProperties
13489				err = json.Unmarshal(*v, &managedInstanceLongTermRetentionBackupProperties)
13490				if err != nil {
13491					return err
13492				}
13493				miltrb.ManagedInstanceLongTermRetentionBackupProperties = &managedInstanceLongTermRetentionBackupProperties
13494			}
13495		case "id":
13496			if v != nil {
13497				var ID string
13498				err = json.Unmarshal(*v, &ID)
13499				if err != nil {
13500					return err
13501				}
13502				miltrb.ID = &ID
13503			}
13504		case "name":
13505			if v != nil {
13506				var name string
13507				err = json.Unmarshal(*v, &name)
13508				if err != nil {
13509					return err
13510				}
13511				miltrb.Name = &name
13512			}
13513		case "type":
13514			if v != nil {
13515				var typeVar string
13516				err = json.Unmarshal(*v, &typeVar)
13517				if err != nil {
13518					return err
13519				}
13520				miltrb.Type = &typeVar
13521			}
13522		}
13523	}
13524
13525	return nil
13526}
13527
13528// ManagedInstanceLongTermRetentionBackupListResult a list of long term retention backups for managed
13529// database(s).
13530type ManagedInstanceLongTermRetentionBackupListResult struct {
13531	autorest.Response `json:"-"`
13532	// Value - READ-ONLY; Array of results.
13533	Value *[]ManagedInstanceLongTermRetentionBackup `json:"value,omitempty"`
13534	// NextLink - READ-ONLY; Link to retrieve next page of results.
13535	NextLink *string `json:"nextLink,omitempty"`
13536}
13537
13538// MarshalJSON is the custom marshaler for ManagedInstanceLongTermRetentionBackupListResult.
13539func (miltrblr ManagedInstanceLongTermRetentionBackupListResult) MarshalJSON() ([]byte, error) {
13540	objectMap := make(map[string]interface{})
13541	return json.Marshal(objectMap)
13542}
13543
13544// ManagedInstanceLongTermRetentionBackupListResultIterator provides access to a complete listing of
13545// ManagedInstanceLongTermRetentionBackup values.
13546type ManagedInstanceLongTermRetentionBackupListResultIterator struct {
13547	i    int
13548	page ManagedInstanceLongTermRetentionBackupListResultPage
13549}
13550
13551// NextWithContext advances to the next value.  If there was an error making
13552// the request the iterator does not advance and the error is returned.
13553func (iter *ManagedInstanceLongTermRetentionBackupListResultIterator) NextWithContext(ctx context.Context) (err error) {
13554	if tracing.IsEnabled() {
13555		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceLongTermRetentionBackupListResultIterator.NextWithContext")
13556		defer func() {
13557			sc := -1
13558			if iter.Response().Response.Response != nil {
13559				sc = iter.Response().Response.Response.StatusCode
13560			}
13561			tracing.EndSpan(ctx, sc, err)
13562		}()
13563	}
13564	iter.i++
13565	if iter.i < len(iter.page.Values()) {
13566		return nil
13567	}
13568	err = iter.page.NextWithContext(ctx)
13569	if err != nil {
13570		iter.i--
13571		return err
13572	}
13573	iter.i = 0
13574	return nil
13575}
13576
13577// Next advances to the next value.  If there was an error making
13578// the request the iterator does not advance and the error is returned.
13579// Deprecated: Use NextWithContext() instead.
13580func (iter *ManagedInstanceLongTermRetentionBackupListResultIterator) Next() error {
13581	return iter.NextWithContext(context.Background())
13582}
13583
13584// NotDone returns true if the enumeration should be started or is not yet complete.
13585func (iter ManagedInstanceLongTermRetentionBackupListResultIterator) NotDone() bool {
13586	return iter.page.NotDone() && iter.i < len(iter.page.Values())
13587}
13588
13589// Response returns the raw server response from the last page request.
13590func (iter ManagedInstanceLongTermRetentionBackupListResultIterator) Response() ManagedInstanceLongTermRetentionBackupListResult {
13591	return iter.page.Response()
13592}
13593
13594// Value returns the current value or a zero-initialized value if the
13595// iterator has advanced beyond the end of the collection.
13596func (iter ManagedInstanceLongTermRetentionBackupListResultIterator) Value() ManagedInstanceLongTermRetentionBackup {
13597	if !iter.page.NotDone() {
13598		return ManagedInstanceLongTermRetentionBackup{}
13599	}
13600	return iter.page.Values()[iter.i]
13601}
13602
13603// Creates a new instance of the ManagedInstanceLongTermRetentionBackupListResultIterator type.
13604func NewManagedInstanceLongTermRetentionBackupListResultIterator(page ManagedInstanceLongTermRetentionBackupListResultPage) ManagedInstanceLongTermRetentionBackupListResultIterator {
13605	return ManagedInstanceLongTermRetentionBackupListResultIterator{page: page}
13606}
13607
13608// IsEmpty returns true if the ListResult contains no values.
13609func (miltrblr ManagedInstanceLongTermRetentionBackupListResult) IsEmpty() bool {
13610	return miltrblr.Value == nil || len(*miltrblr.Value) == 0
13611}
13612
13613// hasNextLink returns true if the NextLink is not empty.
13614func (miltrblr ManagedInstanceLongTermRetentionBackupListResult) hasNextLink() bool {
13615	return miltrblr.NextLink != nil && len(*miltrblr.NextLink) != 0
13616}
13617
13618// managedInstanceLongTermRetentionBackupListResultPreparer prepares a request to retrieve the next set of results.
13619// It returns nil if no more results exist.
13620func (miltrblr ManagedInstanceLongTermRetentionBackupListResult) managedInstanceLongTermRetentionBackupListResultPreparer(ctx context.Context) (*http.Request, error) {
13621	if !miltrblr.hasNextLink() {
13622		return nil, nil
13623	}
13624	return autorest.Prepare((&http.Request{}).WithContext(ctx),
13625		autorest.AsJSON(),
13626		autorest.AsGet(),
13627		autorest.WithBaseURL(to.String(miltrblr.NextLink)))
13628}
13629
13630// ManagedInstanceLongTermRetentionBackupListResultPage contains a page of
13631// ManagedInstanceLongTermRetentionBackup values.
13632type ManagedInstanceLongTermRetentionBackupListResultPage struct {
13633	fn       func(context.Context, ManagedInstanceLongTermRetentionBackupListResult) (ManagedInstanceLongTermRetentionBackupListResult, error)
13634	miltrblr ManagedInstanceLongTermRetentionBackupListResult
13635}
13636
13637// NextWithContext advances to the next page of values.  If there was an error making
13638// the request the page does not advance and the error is returned.
13639func (page *ManagedInstanceLongTermRetentionBackupListResultPage) NextWithContext(ctx context.Context) (err error) {
13640	if tracing.IsEnabled() {
13641		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceLongTermRetentionBackupListResultPage.NextWithContext")
13642		defer func() {
13643			sc := -1
13644			if page.Response().Response.Response != nil {
13645				sc = page.Response().Response.Response.StatusCode
13646			}
13647			tracing.EndSpan(ctx, sc, err)
13648		}()
13649	}
13650	for {
13651		next, err := page.fn(ctx, page.miltrblr)
13652		if err != nil {
13653			return err
13654		}
13655		page.miltrblr = next
13656		if !next.hasNextLink() || !next.IsEmpty() {
13657			break
13658		}
13659	}
13660	return nil
13661}
13662
13663// Next advances to the next page of values.  If there was an error making
13664// the request the page does not advance and the error is returned.
13665// Deprecated: Use NextWithContext() instead.
13666func (page *ManagedInstanceLongTermRetentionBackupListResultPage) Next() error {
13667	return page.NextWithContext(context.Background())
13668}
13669
13670// NotDone returns true if the page enumeration should be started or is not yet complete.
13671func (page ManagedInstanceLongTermRetentionBackupListResultPage) NotDone() bool {
13672	return !page.miltrblr.IsEmpty()
13673}
13674
13675// Response returns the raw server response from the last page request.
13676func (page ManagedInstanceLongTermRetentionBackupListResultPage) Response() ManagedInstanceLongTermRetentionBackupListResult {
13677	return page.miltrblr
13678}
13679
13680// Values returns the slice of values for the current page or nil if there are no values.
13681func (page ManagedInstanceLongTermRetentionBackupListResultPage) Values() []ManagedInstanceLongTermRetentionBackup {
13682	if page.miltrblr.IsEmpty() {
13683		return nil
13684	}
13685	return *page.miltrblr.Value
13686}
13687
13688// Creates a new instance of the ManagedInstanceLongTermRetentionBackupListResultPage type.
13689func NewManagedInstanceLongTermRetentionBackupListResultPage(cur ManagedInstanceLongTermRetentionBackupListResult, getNextPage func(context.Context, ManagedInstanceLongTermRetentionBackupListResult) (ManagedInstanceLongTermRetentionBackupListResult, error)) ManagedInstanceLongTermRetentionBackupListResultPage {
13690	return ManagedInstanceLongTermRetentionBackupListResultPage{
13691		fn:       getNextPage,
13692		miltrblr: cur,
13693	}
13694}
13695
13696// ManagedInstanceLongTermRetentionBackupProperties properties of a long term retention backup
13697type ManagedInstanceLongTermRetentionBackupProperties struct {
13698	// ManagedInstanceName - READ-ONLY; The managed instance that the backup database belongs to.
13699	ManagedInstanceName *string `json:"managedInstanceName,omitempty"`
13700	// ManagedInstanceCreateTime - READ-ONLY; The create time of the instance.
13701	ManagedInstanceCreateTime *date.Time `json:"managedInstanceCreateTime,omitempty"`
13702	// DatabaseName - READ-ONLY; The name of the database the backup belong to
13703	DatabaseName *string `json:"databaseName,omitempty"`
13704	// DatabaseDeletionTime - READ-ONLY; The delete time of the database
13705	DatabaseDeletionTime *date.Time `json:"databaseDeletionTime,omitempty"`
13706	// BackupTime - READ-ONLY; The time the backup was taken
13707	BackupTime *date.Time `json:"backupTime,omitempty"`
13708	// BackupExpirationTime - READ-ONLY; The time the long term retention backup will expire.
13709	BackupExpirationTime *date.Time `json:"backupExpirationTime,omitempty"`
13710}
13711
13712// MarshalJSON is the custom marshaler for ManagedInstanceLongTermRetentionBackupProperties.
13713func (miltrbp ManagedInstanceLongTermRetentionBackupProperties) MarshalJSON() ([]byte, error) {
13714	objectMap := make(map[string]interface{})
13715	return json.Marshal(objectMap)
13716}
13717
13718// ManagedInstanceLongTermRetentionPoliciesCreateOrUpdateFuture an abstraction for monitoring and
13719// retrieving the results of a long-running operation.
13720type ManagedInstanceLongTermRetentionPoliciesCreateOrUpdateFuture struct {
13721	azure.FutureAPI
13722	// Result returns the result of the asynchronous operation.
13723	// If the operation has not completed it will return an error.
13724	Result func(ManagedInstanceLongTermRetentionPoliciesClient) (ManagedInstanceLongTermRetentionPolicy, error)
13725}
13726
13727// UnmarshalJSON is the custom unmarshaller for CreateFuture.
13728func (future *ManagedInstanceLongTermRetentionPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
13729	var azFuture azure.Future
13730	if err := json.Unmarshal(body, &azFuture); err != nil {
13731		return err
13732	}
13733	future.FutureAPI = &azFuture
13734	future.Result = future.result
13735	return nil
13736}
13737
13738// result is the default implementation for ManagedInstanceLongTermRetentionPoliciesCreateOrUpdateFuture.Result.
13739func (future *ManagedInstanceLongTermRetentionPoliciesCreateOrUpdateFuture) result(client ManagedInstanceLongTermRetentionPoliciesClient) (miltrp ManagedInstanceLongTermRetentionPolicy, err error) {
13740	var done bool
13741	done, err = future.DoneWithContext(context.Background(), client)
13742	if err != nil {
13743		err = autorest.NewErrorWithError(err, "sql.ManagedInstanceLongTermRetentionPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
13744		return
13745	}
13746	if !done {
13747		miltrp.Response.Response = future.Response()
13748		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstanceLongTermRetentionPoliciesCreateOrUpdateFuture")
13749		return
13750	}
13751	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13752	if miltrp.Response.Response, err = future.GetResult(sender); err == nil && miltrp.Response.Response.StatusCode != http.StatusNoContent {
13753		miltrp, err = client.CreateOrUpdateResponder(miltrp.Response.Response)
13754		if err != nil {
13755			err = autorest.NewErrorWithError(err, "sql.ManagedInstanceLongTermRetentionPoliciesCreateOrUpdateFuture", "Result", miltrp.Response.Response, "Failure responding to request")
13756		}
13757	}
13758	return
13759}
13760
13761// ManagedInstanceLongTermRetentionPolicy a long term retention policy.
13762type ManagedInstanceLongTermRetentionPolicy struct {
13763	autorest.Response `json:"-"`
13764	// BaseLongTermRetentionPolicyProperties - Resource properties.
13765	*BaseLongTermRetentionPolicyProperties `json:"properties,omitempty"`
13766	// ID - READ-ONLY; Resource ID.
13767	ID *string `json:"id,omitempty"`
13768	// Name - READ-ONLY; Resource name.
13769	Name *string `json:"name,omitempty"`
13770	// Type - READ-ONLY; Resource type.
13771	Type *string `json:"type,omitempty"`
13772}
13773
13774// MarshalJSON is the custom marshaler for ManagedInstanceLongTermRetentionPolicy.
13775func (miltrp ManagedInstanceLongTermRetentionPolicy) MarshalJSON() ([]byte, error) {
13776	objectMap := make(map[string]interface{})
13777	if miltrp.BaseLongTermRetentionPolicyProperties != nil {
13778		objectMap["properties"] = miltrp.BaseLongTermRetentionPolicyProperties
13779	}
13780	return json.Marshal(objectMap)
13781}
13782
13783// UnmarshalJSON is the custom unmarshaler for ManagedInstanceLongTermRetentionPolicy struct.
13784func (miltrp *ManagedInstanceLongTermRetentionPolicy) UnmarshalJSON(body []byte) error {
13785	var m map[string]*json.RawMessage
13786	err := json.Unmarshal(body, &m)
13787	if err != nil {
13788		return err
13789	}
13790	for k, v := range m {
13791		switch k {
13792		case "properties":
13793			if v != nil {
13794				var baseLongTermRetentionPolicyProperties BaseLongTermRetentionPolicyProperties
13795				err = json.Unmarshal(*v, &baseLongTermRetentionPolicyProperties)
13796				if err != nil {
13797					return err
13798				}
13799				miltrp.BaseLongTermRetentionPolicyProperties = &baseLongTermRetentionPolicyProperties
13800			}
13801		case "id":
13802			if v != nil {
13803				var ID string
13804				err = json.Unmarshal(*v, &ID)
13805				if err != nil {
13806					return err
13807				}
13808				miltrp.ID = &ID
13809			}
13810		case "name":
13811			if v != nil {
13812				var name string
13813				err = json.Unmarshal(*v, &name)
13814				if err != nil {
13815					return err
13816				}
13817				miltrp.Name = &name
13818			}
13819		case "type":
13820			if v != nil {
13821				var typeVar string
13822				err = json.Unmarshal(*v, &typeVar)
13823				if err != nil {
13824					return err
13825				}
13826				miltrp.Type = &typeVar
13827			}
13828		}
13829	}
13830
13831	return nil
13832}
13833
13834// ManagedInstanceLongTermRetentionPolicyListResult a list of long term retention policies.
13835type ManagedInstanceLongTermRetentionPolicyListResult struct {
13836	autorest.Response `json:"-"`
13837	// Value - READ-ONLY; Array of results.
13838	Value *[]ManagedInstanceLongTermRetentionPolicy `json:"value,omitempty"`
13839	// NextLink - READ-ONLY; Link to retrieve next page of results.
13840	NextLink *string `json:"nextLink,omitempty"`
13841}
13842
13843// MarshalJSON is the custom marshaler for ManagedInstanceLongTermRetentionPolicyListResult.
13844func (miltrplr ManagedInstanceLongTermRetentionPolicyListResult) MarshalJSON() ([]byte, error) {
13845	objectMap := make(map[string]interface{})
13846	return json.Marshal(objectMap)
13847}
13848
13849// ManagedInstanceLongTermRetentionPolicyListResultIterator provides access to a complete listing of
13850// ManagedInstanceLongTermRetentionPolicy values.
13851type ManagedInstanceLongTermRetentionPolicyListResultIterator struct {
13852	i    int
13853	page ManagedInstanceLongTermRetentionPolicyListResultPage
13854}
13855
13856// NextWithContext advances to the next value.  If there was an error making
13857// the request the iterator does not advance and the error is returned.
13858func (iter *ManagedInstanceLongTermRetentionPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
13859	if tracing.IsEnabled() {
13860		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceLongTermRetentionPolicyListResultIterator.NextWithContext")
13861		defer func() {
13862			sc := -1
13863			if iter.Response().Response.Response != nil {
13864				sc = iter.Response().Response.Response.StatusCode
13865			}
13866			tracing.EndSpan(ctx, sc, err)
13867		}()
13868	}
13869	iter.i++
13870	if iter.i < len(iter.page.Values()) {
13871		return nil
13872	}
13873	err = iter.page.NextWithContext(ctx)
13874	if err != nil {
13875		iter.i--
13876		return err
13877	}
13878	iter.i = 0
13879	return nil
13880}
13881
13882// Next advances to the next value.  If there was an error making
13883// the request the iterator does not advance and the error is returned.
13884// Deprecated: Use NextWithContext() instead.
13885func (iter *ManagedInstanceLongTermRetentionPolicyListResultIterator) Next() error {
13886	return iter.NextWithContext(context.Background())
13887}
13888
13889// NotDone returns true if the enumeration should be started or is not yet complete.
13890func (iter ManagedInstanceLongTermRetentionPolicyListResultIterator) NotDone() bool {
13891	return iter.page.NotDone() && iter.i < len(iter.page.Values())
13892}
13893
13894// Response returns the raw server response from the last page request.
13895func (iter ManagedInstanceLongTermRetentionPolicyListResultIterator) Response() ManagedInstanceLongTermRetentionPolicyListResult {
13896	return iter.page.Response()
13897}
13898
13899// Value returns the current value or a zero-initialized value if the
13900// iterator has advanced beyond the end of the collection.
13901func (iter ManagedInstanceLongTermRetentionPolicyListResultIterator) Value() ManagedInstanceLongTermRetentionPolicy {
13902	if !iter.page.NotDone() {
13903		return ManagedInstanceLongTermRetentionPolicy{}
13904	}
13905	return iter.page.Values()[iter.i]
13906}
13907
13908// Creates a new instance of the ManagedInstanceLongTermRetentionPolicyListResultIterator type.
13909func NewManagedInstanceLongTermRetentionPolicyListResultIterator(page ManagedInstanceLongTermRetentionPolicyListResultPage) ManagedInstanceLongTermRetentionPolicyListResultIterator {
13910	return ManagedInstanceLongTermRetentionPolicyListResultIterator{page: page}
13911}
13912
13913// IsEmpty returns true if the ListResult contains no values.
13914func (miltrplr ManagedInstanceLongTermRetentionPolicyListResult) IsEmpty() bool {
13915	return miltrplr.Value == nil || len(*miltrplr.Value) == 0
13916}
13917
13918// hasNextLink returns true if the NextLink is not empty.
13919func (miltrplr ManagedInstanceLongTermRetentionPolicyListResult) hasNextLink() bool {
13920	return miltrplr.NextLink != nil && len(*miltrplr.NextLink) != 0
13921}
13922
13923// managedInstanceLongTermRetentionPolicyListResultPreparer prepares a request to retrieve the next set of results.
13924// It returns nil if no more results exist.
13925func (miltrplr ManagedInstanceLongTermRetentionPolicyListResult) managedInstanceLongTermRetentionPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
13926	if !miltrplr.hasNextLink() {
13927		return nil, nil
13928	}
13929	return autorest.Prepare((&http.Request{}).WithContext(ctx),
13930		autorest.AsJSON(),
13931		autorest.AsGet(),
13932		autorest.WithBaseURL(to.String(miltrplr.NextLink)))
13933}
13934
13935// ManagedInstanceLongTermRetentionPolicyListResultPage contains a page of
13936// ManagedInstanceLongTermRetentionPolicy values.
13937type ManagedInstanceLongTermRetentionPolicyListResultPage struct {
13938	fn       func(context.Context, ManagedInstanceLongTermRetentionPolicyListResult) (ManagedInstanceLongTermRetentionPolicyListResult, error)
13939	miltrplr ManagedInstanceLongTermRetentionPolicyListResult
13940}
13941
13942// NextWithContext advances to the next page of values.  If there was an error making
13943// the request the page does not advance and the error is returned.
13944func (page *ManagedInstanceLongTermRetentionPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
13945	if tracing.IsEnabled() {
13946		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceLongTermRetentionPolicyListResultPage.NextWithContext")
13947		defer func() {
13948			sc := -1
13949			if page.Response().Response.Response != nil {
13950				sc = page.Response().Response.Response.StatusCode
13951			}
13952			tracing.EndSpan(ctx, sc, err)
13953		}()
13954	}
13955	for {
13956		next, err := page.fn(ctx, page.miltrplr)
13957		if err != nil {
13958			return err
13959		}
13960		page.miltrplr = next
13961		if !next.hasNextLink() || !next.IsEmpty() {
13962			break
13963		}
13964	}
13965	return nil
13966}
13967
13968// Next advances to the next page of values.  If there was an error making
13969// the request the page does not advance and the error is returned.
13970// Deprecated: Use NextWithContext() instead.
13971func (page *ManagedInstanceLongTermRetentionPolicyListResultPage) Next() error {
13972	return page.NextWithContext(context.Background())
13973}
13974
13975// NotDone returns true if the page enumeration should be started or is not yet complete.
13976func (page ManagedInstanceLongTermRetentionPolicyListResultPage) NotDone() bool {
13977	return !page.miltrplr.IsEmpty()
13978}
13979
13980// Response returns the raw server response from the last page request.
13981func (page ManagedInstanceLongTermRetentionPolicyListResultPage) Response() ManagedInstanceLongTermRetentionPolicyListResult {
13982	return page.miltrplr
13983}
13984
13985// Values returns the slice of values for the current page or nil if there are no values.
13986func (page ManagedInstanceLongTermRetentionPolicyListResultPage) Values() []ManagedInstanceLongTermRetentionPolicy {
13987	if page.miltrplr.IsEmpty() {
13988		return nil
13989	}
13990	return *page.miltrplr.Value
13991}
13992
13993// Creates a new instance of the ManagedInstanceLongTermRetentionPolicyListResultPage type.
13994func NewManagedInstanceLongTermRetentionPolicyListResultPage(cur ManagedInstanceLongTermRetentionPolicyListResult, getNextPage func(context.Context, ManagedInstanceLongTermRetentionPolicyListResult) (ManagedInstanceLongTermRetentionPolicyListResult, error)) ManagedInstanceLongTermRetentionPolicyListResultPage {
13995	return ManagedInstanceLongTermRetentionPolicyListResultPage{
13996		fn:       getNextPage,
13997		miltrplr: cur,
13998	}
13999}
14000
14001// ManagedInstanceOperation a managed instance operation.
14002type ManagedInstanceOperation struct {
14003	autorest.Response `json:"-"`
14004	// ManagedInstanceOperationProperties - Resource properties.
14005	*ManagedInstanceOperationProperties `json:"properties,omitempty"`
14006	// ID - READ-ONLY; Resource ID.
14007	ID *string `json:"id,omitempty"`
14008	// Name - READ-ONLY; Resource name.
14009	Name *string `json:"name,omitempty"`
14010	// Type - READ-ONLY; Resource type.
14011	Type *string `json:"type,omitempty"`
14012}
14013
14014// MarshalJSON is the custom marshaler for ManagedInstanceOperation.
14015func (mio ManagedInstanceOperation) MarshalJSON() ([]byte, error) {
14016	objectMap := make(map[string]interface{})
14017	if mio.ManagedInstanceOperationProperties != nil {
14018		objectMap["properties"] = mio.ManagedInstanceOperationProperties
14019	}
14020	return json.Marshal(objectMap)
14021}
14022
14023// UnmarshalJSON is the custom unmarshaler for ManagedInstanceOperation struct.
14024func (mio *ManagedInstanceOperation) UnmarshalJSON(body []byte) error {
14025	var m map[string]*json.RawMessage
14026	err := json.Unmarshal(body, &m)
14027	if err != nil {
14028		return err
14029	}
14030	for k, v := range m {
14031		switch k {
14032		case "properties":
14033			if v != nil {
14034				var managedInstanceOperationProperties ManagedInstanceOperationProperties
14035				err = json.Unmarshal(*v, &managedInstanceOperationProperties)
14036				if err != nil {
14037					return err
14038				}
14039				mio.ManagedInstanceOperationProperties = &managedInstanceOperationProperties
14040			}
14041		case "id":
14042			if v != nil {
14043				var ID string
14044				err = json.Unmarshal(*v, &ID)
14045				if err != nil {
14046					return err
14047				}
14048				mio.ID = &ID
14049			}
14050		case "name":
14051			if v != nil {
14052				var name string
14053				err = json.Unmarshal(*v, &name)
14054				if err != nil {
14055					return err
14056				}
14057				mio.Name = &name
14058			}
14059		case "type":
14060			if v != nil {
14061				var typeVar string
14062				err = json.Unmarshal(*v, &typeVar)
14063				if err != nil {
14064					return err
14065				}
14066				mio.Type = &typeVar
14067			}
14068		}
14069	}
14070
14071	return nil
14072}
14073
14074// ManagedInstanceOperationListResult the response to a list managed instance operations request
14075type ManagedInstanceOperationListResult struct {
14076	autorest.Response `json:"-"`
14077	// Value - READ-ONLY; Array of results.
14078	Value *[]ManagedInstanceOperation `json:"value,omitempty"`
14079	// NextLink - READ-ONLY; Link to retrieve next page of results.
14080	NextLink *string `json:"nextLink,omitempty"`
14081}
14082
14083// MarshalJSON is the custom marshaler for ManagedInstanceOperationListResult.
14084func (miolr ManagedInstanceOperationListResult) MarshalJSON() ([]byte, error) {
14085	objectMap := make(map[string]interface{})
14086	return json.Marshal(objectMap)
14087}
14088
14089// ManagedInstanceOperationListResultIterator provides access to a complete listing of
14090// ManagedInstanceOperation values.
14091type ManagedInstanceOperationListResultIterator struct {
14092	i    int
14093	page ManagedInstanceOperationListResultPage
14094}
14095
14096// NextWithContext advances to the next value.  If there was an error making
14097// the request the iterator does not advance and the error is returned.
14098func (iter *ManagedInstanceOperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
14099	if tracing.IsEnabled() {
14100		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceOperationListResultIterator.NextWithContext")
14101		defer func() {
14102			sc := -1
14103			if iter.Response().Response.Response != nil {
14104				sc = iter.Response().Response.Response.StatusCode
14105			}
14106			tracing.EndSpan(ctx, sc, err)
14107		}()
14108	}
14109	iter.i++
14110	if iter.i < len(iter.page.Values()) {
14111		return nil
14112	}
14113	err = iter.page.NextWithContext(ctx)
14114	if err != nil {
14115		iter.i--
14116		return err
14117	}
14118	iter.i = 0
14119	return nil
14120}
14121
14122// Next advances to the next value.  If there was an error making
14123// the request the iterator does not advance and the error is returned.
14124// Deprecated: Use NextWithContext() instead.
14125func (iter *ManagedInstanceOperationListResultIterator) Next() error {
14126	return iter.NextWithContext(context.Background())
14127}
14128
14129// NotDone returns true if the enumeration should be started or is not yet complete.
14130func (iter ManagedInstanceOperationListResultIterator) NotDone() bool {
14131	return iter.page.NotDone() && iter.i < len(iter.page.Values())
14132}
14133
14134// Response returns the raw server response from the last page request.
14135func (iter ManagedInstanceOperationListResultIterator) Response() ManagedInstanceOperationListResult {
14136	return iter.page.Response()
14137}
14138
14139// Value returns the current value or a zero-initialized value if the
14140// iterator has advanced beyond the end of the collection.
14141func (iter ManagedInstanceOperationListResultIterator) Value() ManagedInstanceOperation {
14142	if !iter.page.NotDone() {
14143		return ManagedInstanceOperation{}
14144	}
14145	return iter.page.Values()[iter.i]
14146}
14147
14148// Creates a new instance of the ManagedInstanceOperationListResultIterator type.
14149func NewManagedInstanceOperationListResultIterator(page ManagedInstanceOperationListResultPage) ManagedInstanceOperationListResultIterator {
14150	return ManagedInstanceOperationListResultIterator{page: page}
14151}
14152
14153// IsEmpty returns true if the ListResult contains no values.
14154func (miolr ManagedInstanceOperationListResult) IsEmpty() bool {
14155	return miolr.Value == nil || len(*miolr.Value) == 0
14156}
14157
14158// hasNextLink returns true if the NextLink is not empty.
14159func (miolr ManagedInstanceOperationListResult) hasNextLink() bool {
14160	return miolr.NextLink != nil && len(*miolr.NextLink) != 0
14161}
14162
14163// managedInstanceOperationListResultPreparer prepares a request to retrieve the next set of results.
14164// It returns nil if no more results exist.
14165func (miolr ManagedInstanceOperationListResult) managedInstanceOperationListResultPreparer(ctx context.Context) (*http.Request, error) {
14166	if !miolr.hasNextLink() {
14167		return nil, nil
14168	}
14169	return autorest.Prepare((&http.Request{}).WithContext(ctx),
14170		autorest.AsJSON(),
14171		autorest.AsGet(),
14172		autorest.WithBaseURL(to.String(miolr.NextLink)))
14173}
14174
14175// ManagedInstanceOperationListResultPage contains a page of ManagedInstanceOperation values.
14176type ManagedInstanceOperationListResultPage struct {
14177	fn    func(context.Context, ManagedInstanceOperationListResult) (ManagedInstanceOperationListResult, error)
14178	miolr ManagedInstanceOperationListResult
14179}
14180
14181// NextWithContext advances to the next page of values.  If there was an error making
14182// the request the page does not advance and the error is returned.
14183func (page *ManagedInstanceOperationListResultPage) NextWithContext(ctx context.Context) (err error) {
14184	if tracing.IsEnabled() {
14185		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceOperationListResultPage.NextWithContext")
14186		defer func() {
14187			sc := -1
14188			if page.Response().Response.Response != nil {
14189				sc = page.Response().Response.Response.StatusCode
14190			}
14191			tracing.EndSpan(ctx, sc, err)
14192		}()
14193	}
14194	for {
14195		next, err := page.fn(ctx, page.miolr)
14196		if err != nil {
14197			return err
14198		}
14199		page.miolr = next
14200		if !next.hasNextLink() || !next.IsEmpty() {
14201			break
14202		}
14203	}
14204	return nil
14205}
14206
14207// Next advances to the next page of values.  If there was an error making
14208// the request the page does not advance and the error is returned.
14209// Deprecated: Use NextWithContext() instead.
14210func (page *ManagedInstanceOperationListResultPage) Next() error {
14211	return page.NextWithContext(context.Background())
14212}
14213
14214// NotDone returns true if the page enumeration should be started or is not yet complete.
14215func (page ManagedInstanceOperationListResultPage) NotDone() bool {
14216	return !page.miolr.IsEmpty()
14217}
14218
14219// Response returns the raw server response from the last page request.
14220func (page ManagedInstanceOperationListResultPage) Response() ManagedInstanceOperationListResult {
14221	return page.miolr
14222}
14223
14224// Values returns the slice of values for the current page or nil if there are no values.
14225func (page ManagedInstanceOperationListResultPage) Values() []ManagedInstanceOperation {
14226	if page.miolr.IsEmpty() {
14227		return nil
14228	}
14229	return *page.miolr.Value
14230}
14231
14232// Creates a new instance of the ManagedInstanceOperationListResultPage type.
14233func NewManagedInstanceOperationListResultPage(cur ManagedInstanceOperationListResult, getNextPage func(context.Context, ManagedInstanceOperationListResult) (ManagedInstanceOperationListResult, error)) ManagedInstanceOperationListResultPage {
14234	return ManagedInstanceOperationListResultPage{
14235		fn:    getNextPage,
14236		miolr: cur,
14237	}
14238}
14239
14240// ManagedInstanceOperationParametersPair the parameters of a managed instance operation.
14241type ManagedInstanceOperationParametersPair struct {
14242	// CurrentParameters - READ-ONLY; The current parameters.
14243	CurrentParameters *UpsertManagedServerOperationParameters `json:"currentParameters,omitempty"`
14244	// RequestedParameters - READ-ONLY; The requested parameters.
14245	RequestedParameters *UpsertManagedServerOperationParameters `json:"requestedParameters,omitempty"`
14246}
14247
14248// MarshalJSON is the custom marshaler for ManagedInstanceOperationParametersPair.
14249func (miopp ManagedInstanceOperationParametersPair) MarshalJSON() ([]byte, error) {
14250	objectMap := make(map[string]interface{})
14251	return json.Marshal(objectMap)
14252}
14253
14254// ManagedInstanceOperationProperties the properties of a managed instance operation.
14255type ManagedInstanceOperationProperties struct {
14256	// ManagedInstanceName - READ-ONLY; The name of the managed instance the operation is being performed on.
14257	ManagedInstanceName *string `json:"managedInstanceName,omitempty"`
14258	// Operation - READ-ONLY; The name of operation.
14259	Operation *string `json:"operation,omitempty"`
14260	// OperationFriendlyName - READ-ONLY; The friendly name of operation.
14261	OperationFriendlyName *string `json:"operationFriendlyName,omitempty"`
14262	// PercentComplete - READ-ONLY; The percentage of the operation completed.
14263	PercentComplete *int32 `json:"percentComplete,omitempty"`
14264	// StartTime - READ-ONLY; The operation start time.
14265	StartTime *date.Time `json:"startTime,omitempty"`
14266	// State - READ-ONLY; The operation state. Possible values include: 'ManagementOperationStatePending', 'ManagementOperationStateInProgress', 'ManagementOperationStateSucceeded', 'ManagementOperationStateFailed', 'ManagementOperationStateCancelInProgress', 'ManagementOperationStateCancelled'
14267	State ManagementOperationState `json:"state,omitempty"`
14268	// ErrorCode - READ-ONLY; The operation error code.
14269	ErrorCode *int32 `json:"errorCode,omitempty"`
14270	// ErrorDescription - READ-ONLY; The operation error description.
14271	ErrorDescription *string `json:"errorDescription,omitempty"`
14272	// ErrorSeverity - READ-ONLY; The operation error severity.
14273	ErrorSeverity *int32 `json:"errorSeverity,omitempty"`
14274	// IsUserError - READ-ONLY; Whether or not the error is a user error.
14275	IsUserError *bool `json:"isUserError,omitempty"`
14276	// EstimatedCompletionTime - READ-ONLY; The estimated completion time of the operation.
14277	EstimatedCompletionTime *date.Time `json:"estimatedCompletionTime,omitempty"`
14278	// Description - READ-ONLY; The operation description.
14279	Description *string `json:"description,omitempty"`
14280	// IsCancellable - READ-ONLY; Whether the operation can be cancelled.
14281	IsCancellable *bool `json:"isCancellable,omitempty"`
14282	// OperationParameters - READ-ONLY; The operation parameters.
14283	OperationParameters *ManagedInstanceOperationParametersPair `json:"operationParameters,omitempty"`
14284	// OperationSteps - READ-ONLY; The operation steps.
14285	OperationSteps *ManagedInstanceOperationSteps `json:"operationSteps,omitempty"`
14286}
14287
14288// MarshalJSON is the custom marshaler for ManagedInstanceOperationProperties.
14289func (miop ManagedInstanceOperationProperties) MarshalJSON() ([]byte, error) {
14290	objectMap := make(map[string]interface{})
14291	return json.Marshal(objectMap)
14292}
14293
14294// ManagedInstanceOperationSteps the steps of a managed instance operation.
14295type ManagedInstanceOperationSteps struct {
14296	// TotalSteps - READ-ONLY; The total number of operation steps.
14297	TotalSteps *string `json:"totalSteps,omitempty"`
14298	// CurrentStep - READ-ONLY; The number of current operation steps.
14299	CurrentStep *int32 `json:"currentStep,omitempty"`
14300	// StepsList - READ-ONLY; The operation steps list.
14301	StepsList *[]UpsertManagedServerOperationStep `json:"stepsList,omitempty"`
14302}
14303
14304// MarshalJSON is the custom marshaler for ManagedInstanceOperationSteps.
14305func (mios ManagedInstanceOperationSteps) MarshalJSON() ([]byte, error) {
14306	objectMap := make(map[string]interface{})
14307	return json.Marshal(objectMap)
14308}
14309
14310// ManagedInstancePairInfo pairs of Managed Instances in the failover group.
14311type ManagedInstancePairInfo struct {
14312	// PrimaryManagedInstanceID - Id of Primary Managed Instance in pair.
14313	PrimaryManagedInstanceID *string `json:"primaryManagedInstanceId,omitempty"`
14314	// PartnerManagedInstanceID - Id of Partner Managed Instance in pair.
14315	PartnerManagedInstanceID *string `json:"partnerManagedInstanceId,omitempty"`
14316}
14317
14318// ManagedInstancePrivateLinkServiceConnectionStateProperty ...
14319type ManagedInstancePrivateLinkServiceConnectionStateProperty struct {
14320	// Status - The private link service connection status.
14321	Status *string `json:"status,omitempty"`
14322	// Description - The private link service connection description.
14323	Description *string `json:"description,omitempty"`
14324	// ActionsRequired - READ-ONLY; The private link service connection description.
14325	ActionsRequired *string `json:"actionsRequired,omitempty"`
14326}
14327
14328// MarshalJSON is the custom marshaler for ManagedInstancePrivateLinkServiceConnectionStateProperty.
14329func (miplscsp ManagedInstancePrivateLinkServiceConnectionStateProperty) MarshalJSON() ([]byte, error) {
14330	objectMap := make(map[string]interface{})
14331	if miplscsp.Status != nil {
14332		objectMap["status"] = miplscsp.Status
14333	}
14334	if miplscsp.Description != nil {
14335		objectMap["description"] = miplscsp.Description
14336	}
14337	return json.Marshal(objectMap)
14338}
14339
14340// ManagedInstanceProperties the properties of a managed instance.
14341type ManagedInstanceProperties struct {
14342	// ProvisioningState - READ-ONLY; Possible values include: 'ProvisioningState1Creating', 'ProvisioningState1Deleting', 'ProvisioningState1Updating', 'ProvisioningState1Unknown', 'ProvisioningState1Succeeded', 'ProvisioningState1Failed'
14343	ProvisioningState ProvisioningState1 `json:"provisioningState,omitempty"`
14344	// ManagedInstanceCreateMode - Specifies the mode of database creation.
14345	//
14346	// Default: Regular instance creation.
14347	//
14348	// 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'
14349	ManagedInstanceCreateMode ManagedServerCreateMode `json:"managedInstanceCreateMode,omitempty"`
14350	// FullyQualifiedDomainName - READ-ONLY; The fully qualified domain name of the managed instance.
14351	FullyQualifiedDomainName *string `json:"fullyQualifiedDomainName,omitempty"`
14352	// AdministratorLogin - Administrator username for the managed instance. Can only be specified when the managed instance is being created (and is required for creation).
14353	AdministratorLogin *string `json:"administratorLogin,omitempty"`
14354	// AdministratorLoginPassword - The administrator login password (required for managed instance creation).
14355	AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"`
14356	// SubnetID - Subnet resource ID for the managed instance.
14357	SubnetID *string `json:"subnetId,omitempty"`
14358	// State - READ-ONLY; The state of the managed instance.
14359	State *string `json:"state,omitempty"`
14360	// 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'
14361	LicenseType ManagedInstanceLicenseType `json:"licenseType,omitempty"`
14362	// VCores - The number of vCores. Allowed values: 8, 16, 24, 32, 40, 64, 80.
14363	VCores *int32 `json:"vCores,omitempty"`
14364	// StorageSizeInGB - Storage size in GB. Minimum value: 32. Maximum value: 8192. Increments of 32 GB allowed only.
14365	StorageSizeInGB *int32 `json:"storageSizeInGB,omitempty"`
14366	// Collation - Collation of the managed instance.
14367	Collation *string `json:"collation,omitempty"`
14368	// DNSZone - READ-ONLY; The Dns Zone that the managed instance is in.
14369	DNSZone *string `json:"dnsZone,omitempty"`
14370	// DNSZonePartner - The resource id of another managed instance whose DNS zone this managed instance will share after creation.
14371	DNSZonePartner *string `json:"dnsZonePartner,omitempty"`
14372	// PublicDataEndpointEnabled - Whether or not the public data endpoint is enabled.
14373	PublicDataEndpointEnabled *bool `json:"publicDataEndpointEnabled,omitempty"`
14374	// SourceManagedInstanceID - The resource identifier of the source managed instance associated with create operation of this instance.
14375	SourceManagedInstanceID *string `json:"sourceManagedInstanceId,omitempty"`
14376	// RestorePointInTime - Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database.
14377	RestorePointInTime *date.Time `json:"restorePointInTime,omitempty"`
14378	// ProxyOverride - Connection type used for connecting to the instance. Possible values include: 'ManagedInstanceProxyOverrideProxy', 'ManagedInstanceProxyOverrideRedirect', 'ManagedInstanceProxyOverrideDefault'
14379	ProxyOverride ManagedInstanceProxyOverride `json:"proxyOverride,omitempty"`
14380	// TimezoneID - Id of the timezone. Allowed values are timezones supported by Windows.
14381	// Windows keeps details on supported timezones, including the id, in registry under
14382	// KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones.
14383	// You can get those registry values via SQL Server by querying SELECT name AS timezone_id FROM sys.time_zone_info.
14384	// List of Ids can also be obtained by executing [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell.
14385	// An example of valid timezone id is "Pacific Standard Time" or "W. Europe Standard Time".
14386	TimezoneID *string `json:"timezoneId,omitempty"`
14387	// InstancePoolID - The Id of the instance pool this managed server belongs to.
14388	InstancePoolID *string `json:"instancePoolId,omitempty"`
14389	// MaintenanceConfigurationID - Specifies maintenance configuration id to apply to this managed instance.
14390	MaintenanceConfigurationID *string `json:"maintenanceConfigurationId,omitempty"`
14391	// MinimalTLSVersion - Minimal TLS version. Allowed values: 'None', '1.0', '1.1', '1.2'
14392	MinimalTLSVersion *string `json:"minimalTlsVersion,omitempty"`
14393	// 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: 'GRS', 'LRS', 'ZRS'
14394	StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"`
14395}
14396
14397// MarshalJSON is the custom marshaler for ManagedInstanceProperties.
14398func (mip ManagedInstanceProperties) MarshalJSON() ([]byte, error) {
14399	objectMap := make(map[string]interface{})
14400	if mip.ManagedInstanceCreateMode != "" {
14401		objectMap["managedInstanceCreateMode"] = mip.ManagedInstanceCreateMode
14402	}
14403	if mip.AdministratorLogin != nil {
14404		objectMap["administratorLogin"] = mip.AdministratorLogin
14405	}
14406	if mip.AdministratorLoginPassword != nil {
14407		objectMap["administratorLoginPassword"] = mip.AdministratorLoginPassword
14408	}
14409	if mip.SubnetID != nil {
14410		objectMap["subnetId"] = mip.SubnetID
14411	}
14412	if mip.LicenseType != "" {
14413		objectMap["licenseType"] = mip.LicenseType
14414	}
14415	if mip.VCores != nil {
14416		objectMap["vCores"] = mip.VCores
14417	}
14418	if mip.StorageSizeInGB != nil {
14419		objectMap["storageSizeInGB"] = mip.StorageSizeInGB
14420	}
14421	if mip.Collation != nil {
14422		objectMap["collation"] = mip.Collation
14423	}
14424	if mip.DNSZonePartner != nil {
14425		objectMap["dnsZonePartner"] = mip.DNSZonePartner
14426	}
14427	if mip.PublicDataEndpointEnabled != nil {
14428		objectMap["publicDataEndpointEnabled"] = mip.PublicDataEndpointEnabled
14429	}
14430	if mip.SourceManagedInstanceID != nil {
14431		objectMap["sourceManagedInstanceId"] = mip.SourceManagedInstanceID
14432	}
14433	if mip.RestorePointInTime != nil {
14434		objectMap["restorePointInTime"] = mip.RestorePointInTime
14435	}
14436	if mip.ProxyOverride != "" {
14437		objectMap["proxyOverride"] = mip.ProxyOverride
14438	}
14439	if mip.TimezoneID != nil {
14440		objectMap["timezoneId"] = mip.TimezoneID
14441	}
14442	if mip.InstancePoolID != nil {
14443		objectMap["instancePoolId"] = mip.InstancePoolID
14444	}
14445	if mip.MaintenanceConfigurationID != nil {
14446		objectMap["maintenanceConfigurationId"] = mip.MaintenanceConfigurationID
14447	}
14448	if mip.MinimalTLSVersion != nil {
14449		objectMap["minimalTlsVersion"] = mip.MinimalTLSVersion
14450	}
14451	if mip.StorageAccountType != "" {
14452		objectMap["storageAccountType"] = mip.StorageAccountType
14453	}
14454	return json.Marshal(objectMap)
14455}
14456
14457// ManagedInstancesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
14458// long-running operation.
14459type ManagedInstancesCreateOrUpdateFuture struct {
14460	azure.FutureAPI
14461	// Result returns the result of the asynchronous operation.
14462	// If the operation has not completed it will return an error.
14463	Result func(ManagedInstancesClient) (ManagedInstance, error)
14464}
14465
14466// UnmarshalJSON is the custom unmarshaller for CreateFuture.
14467func (future *ManagedInstancesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
14468	var azFuture azure.Future
14469	if err := json.Unmarshal(body, &azFuture); err != nil {
14470		return err
14471	}
14472	future.FutureAPI = &azFuture
14473	future.Result = future.result
14474	return nil
14475}
14476
14477// result is the default implementation for ManagedInstancesCreateOrUpdateFuture.Result.
14478func (future *ManagedInstancesCreateOrUpdateFuture) result(client ManagedInstancesClient) (mi ManagedInstance, err error) {
14479	var done bool
14480	done, err = future.DoneWithContext(context.Background(), client)
14481	if err != nil {
14482		err = autorest.NewErrorWithError(err, "sql.ManagedInstancesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
14483		return
14484	}
14485	if !done {
14486		mi.Response.Response = future.Response()
14487		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstancesCreateOrUpdateFuture")
14488		return
14489	}
14490	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
14491	if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent {
14492		mi, err = client.CreateOrUpdateResponder(mi.Response.Response)
14493		if err != nil {
14494			err = autorest.NewErrorWithError(err, "sql.ManagedInstancesCreateOrUpdateFuture", "Result", mi.Response.Response, "Failure responding to request")
14495		}
14496	}
14497	return
14498}
14499
14500// ManagedInstancesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
14501// operation.
14502type ManagedInstancesDeleteFuture struct {
14503	azure.FutureAPI
14504	// Result returns the result of the asynchronous operation.
14505	// If the operation has not completed it will return an error.
14506	Result func(ManagedInstancesClient) (autorest.Response, error)
14507}
14508
14509// UnmarshalJSON is the custom unmarshaller for CreateFuture.
14510func (future *ManagedInstancesDeleteFuture) UnmarshalJSON(body []byte) error {
14511	var azFuture azure.Future
14512	if err := json.Unmarshal(body, &azFuture); err != nil {
14513		return err
14514	}
14515	future.FutureAPI = &azFuture
14516	future.Result = future.result
14517	return nil
14518}
14519
14520// result is the default implementation for ManagedInstancesDeleteFuture.Result.
14521func (future *ManagedInstancesDeleteFuture) result(client ManagedInstancesClient) (ar autorest.Response, err error) {
14522	var done bool
14523	done, err = future.DoneWithContext(context.Background(), client)
14524	if err != nil {
14525		err = autorest.NewErrorWithError(err, "sql.ManagedInstancesDeleteFuture", "Result", future.Response(), "Polling failure")
14526		return
14527	}
14528	if !done {
14529		ar.Response = future.Response()
14530		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstancesDeleteFuture")
14531		return
14532	}
14533	ar.Response = future.Response()
14534	return
14535}
14536
14537// ManagedInstancesFailoverFuture an abstraction for monitoring and retrieving the results of a
14538// long-running operation.
14539type ManagedInstancesFailoverFuture struct {
14540	azure.FutureAPI
14541	// Result returns the result of the asynchronous operation.
14542	// If the operation has not completed it will return an error.
14543	Result func(ManagedInstancesClient) (autorest.Response, error)
14544}
14545
14546// UnmarshalJSON is the custom unmarshaller for CreateFuture.
14547func (future *ManagedInstancesFailoverFuture) UnmarshalJSON(body []byte) error {
14548	var azFuture azure.Future
14549	if err := json.Unmarshal(body, &azFuture); err != nil {
14550		return err
14551	}
14552	future.FutureAPI = &azFuture
14553	future.Result = future.result
14554	return nil
14555}
14556
14557// result is the default implementation for ManagedInstancesFailoverFuture.Result.
14558func (future *ManagedInstancesFailoverFuture) result(client ManagedInstancesClient) (ar autorest.Response, err error) {
14559	var done bool
14560	done, err = future.DoneWithContext(context.Background(), client)
14561	if err != nil {
14562		err = autorest.NewErrorWithError(err, "sql.ManagedInstancesFailoverFuture", "Result", future.Response(), "Polling failure")
14563		return
14564	}
14565	if !done {
14566		ar.Response = future.Response()
14567		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstancesFailoverFuture")
14568		return
14569	}
14570	ar.Response = future.Response()
14571	return
14572}
14573
14574// ManagedInstancesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
14575// operation.
14576type ManagedInstancesUpdateFuture struct {
14577	azure.FutureAPI
14578	// Result returns the result of the asynchronous operation.
14579	// If the operation has not completed it will return an error.
14580	Result func(ManagedInstancesClient) (ManagedInstance, error)
14581}
14582
14583// UnmarshalJSON is the custom unmarshaller for CreateFuture.
14584func (future *ManagedInstancesUpdateFuture) UnmarshalJSON(body []byte) error {
14585	var azFuture azure.Future
14586	if err := json.Unmarshal(body, &azFuture); err != nil {
14587		return err
14588	}
14589	future.FutureAPI = &azFuture
14590	future.Result = future.result
14591	return nil
14592}
14593
14594// result is the default implementation for ManagedInstancesUpdateFuture.Result.
14595func (future *ManagedInstancesUpdateFuture) result(client ManagedInstancesClient) (mi ManagedInstance, err error) {
14596	var done bool
14597	done, err = future.DoneWithContext(context.Background(), client)
14598	if err != nil {
14599		err = autorest.NewErrorWithError(err, "sql.ManagedInstancesUpdateFuture", "Result", future.Response(), "Polling failure")
14600		return
14601	}
14602	if !done {
14603		mi.Response.Response = future.Response()
14604		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstancesUpdateFuture")
14605		return
14606	}
14607	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
14608	if mi.Response.Response, err = future.GetResult(sender); err == nil && mi.Response.Response.StatusCode != http.StatusNoContent {
14609		mi, err = client.UpdateResponder(mi.Response.Response)
14610		if err != nil {
14611			err = autorest.NewErrorWithError(err, "sql.ManagedInstancesUpdateFuture", "Result", mi.Response.Response, "Failure responding to request")
14612		}
14613	}
14614	return
14615}
14616
14617// ManagedInstanceTdeCertificatesCreateFuture an abstraction for monitoring and retrieving the results of a
14618// long-running operation.
14619type ManagedInstanceTdeCertificatesCreateFuture struct {
14620	azure.FutureAPI
14621	// Result returns the result of the asynchronous operation.
14622	// If the operation has not completed it will return an error.
14623	Result func(ManagedInstanceTdeCertificatesClient) (autorest.Response, error)
14624}
14625
14626// UnmarshalJSON is the custom unmarshaller for CreateFuture.
14627func (future *ManagedInstanceTdeCertificatesCreateFuture) UnmarshalJSON(body []byte) error {
14628	var azFuture azure.Future
14629	if err := json.Unmarshal(body, &azFuture); err != nil {
14630		return err
14631	}
14632	future.FutureAPI = &azFuture
14633	future.Result = future.result
14634	return nil
14635}
14636
14637// result is the default implementation for ManagedInstanceTdeCertificatesCreateFuture.Result.
14638func (future *ManagedInstanceTdeCertificatesCreateFuture) result(client ManagedInstanceTdeCertificatesClient) (ar autorest.Response, err error) {
14639	var done bool
14640	done, err = future.DoneWithContext(context.Background(), client)
14641	if err != nil {
14642		err = autorest.NewErrorWithError(err, "sql.ManagedInstanceTdeCertificatesCreateFuture", "Result", future.Response(), "Polling failure")
14643		return
14644	}
14645	if !done {
14646		ar.Response = future.Response()
14647		err = azure.NewAsyncOpIncompleteError("sql.ManagedInstanceTdeCertificatesCreateFuture")
14648		return
14649	}
14650	ar.Response = future.Response()
14651	return
14652}
14653
14654// ManagedInstanceUpdate an update request for an Azure SQL Database managed instance.
14655type ManagedInstanceUpdate struct {
14656	// Sku - Managed instance sku
14657	Sku *Sku `json:"sku,omitempty"`
14658	// ManagedInstanceProperties - Resource properties.
14659	*ManagedInstanceProperties `json:"properties,omitempty"`
14660	// Tags - Resource tags.
14661	Tags map[string]*string `json:"tags"`
14662}
14663
14664// MarshalJSON is the custom marshaler for ManagedInstanceUpdate.
14665func (miu ManagedInstanceUpdate) MarshalJSON() ([]byte, error) {
14666	objectMap := make(map[string]interface{})
14667	if miu.Sku != nil {
14668		objectMap["sku"] = miu.Sku
14669	}
14670	if miu.ManagedInstanceProperties != nil {
14671		objectMap["properties"] = miu.ManagedInstanceProperties
14672	}
14673	if miu.Tags != nil {
14674		objectMap["tags"] = miu.Tags
14675	}
14676	return json.Marshal(objectMap)
14677}
14678
14679// UnmarshalJSON is the custom unmarshaler for ManagedInstanceUpdate struct.
14680func (miu *ManagedInstanceUpdate) UnmarshalJSON(body []byte) error {
14681	var m map[string]*json.RawMessage
14682	err := json.Unmarshal(body, &m)
14683	if err != nil {
14684		return err
14685	}
14686	for k, v := range m {
14687		switch k {
14688		case "sku":
14689			if v != nil {
14690				var sku Sku
14691				err = json.Unmarshal(*v, &sku)
14692				if err != nil {
14693					return err
14694				}
14695				miu.Sku = &sku
14696			}
14697		case "properties":
14698			if v != nil {
14699				var managedInstanceProperties ManagedInstanceProperties
14700				err = json.Unmarshal(*v, &managedInstanceProperties)
14701				if err != nil {
14702					return err
14703				}
14704				miu.ManagedInstanceProperties = &managedInstanceProperties
14705			}
14706		case "tags":
14707			if v != nil {
14708				var tags map[string]*string
14709				err = json.Unmarshal(*v, &tags)
14710				if err != nil {
14711					return err
14712				}
14713				miu.Tags = tags
14714			}
14715		}
14716	}
14717
14718	return nil
14719}
14720
14721// ManagedInstanceVcoresCapability the managed instance virtual cores capability.
14722type ManagedInstanceVcoresCapability struct {
14723	// Name - READ-ONLY; The virtual cores identifier.
14724	Name *string `json:"name,omitempty"`
14725	// Value - READ-ONLY; The virtual cores value.
14726	Value *int32 `json:"value,omitempty"`
14727	// IncludedMaxSize - READ-ONLY; Included size.
14728	IncludedMaxSize *MaxSizeCapability `json:"includedMaxSize,omitempty"`
14729	// SupportedStorageSizes - READ-ONLY; Storage size ranges.
14730	SupportedStorageSizes *[]MaxSizeRangeCapability `json:"supportedStorageSizes,omitempty"`
14731	// InstancePoolSupported - READ-ONLY; True if this service objective is supported for managed instances in an instance pool.
14732	InstancePoolSupported *bool `json:"instancePoolSupported,omitempty"`
14733	// StandaloneSupported - READ-ONLY; True if this service objective is supported for standalone managed instances.
14734	StandaloneSupported *bool `json:"standaloneSupported,omitempty"`
14735	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
14736	Status CapabilityStatus `json:"status,omitempty"`
14737	// Reason - The reason for the capability not being available.
14738	Reason *string `json:"reason,omitempty"`
14739}
14740
14741// MarshalJSON is the custom marshaler for ManagedInstanceVcoresCapability.
14742func (mivc ManagedInstanceVcoresCapability) MarshalJSON() ([]byte, error) {
14743	objectMap := make(map[string]interface{})
14744	if mivc.Reason != nil {
14745		objectMap["reason"] = mivc.Reason
14746	}
14747	return json.Marshal(objectMap)
14748}
14749
14750// ManagedInstanceVersionCapability the managed instance capability
14751type ManagedInstanceVersionCapability struct {
14752	// Name - READ-ONLY; The server version name.
14753	Name *string `json:"name,omitempty"`
14754	// SupportedEditions - READ-ONLY; The list of supported managed instance editions.
14755	SupportedEditions *[]ManagedInstanceEditionCapability `json:"supportedEditions,omitempty"`
14756	// SupportedInstancePoolEditions - READ-ONLY; The list of supported instance pool editions.
14757	SupportedInstancePoolEditions *[]InstancePoolEditionCapability `json:"supportedInstancePoolEditions,omitempty"`
14758	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
14759	Status CapabilityStatus `json:"status,omitempty"`
14760	// Reason - The reason for the capability not being available.
14761	Reason *string `json:"reason,omitempty"`
14762}
14763
14764// MarshalJSON is the custom marshaler for ManagedInstanceVersionCapability.
14765func (mivc ManagedInstanceVersionCapability) MarshalJSON() ([]byte, error) {
14766	objectMap := make(map[string]interface{})
14767	if mivc.Reason != nil {
14768		objectMap["reason"] = mivc.Reason
14769	}
14770	return json.Marshal(objectMap)
14771}
14772
14773// ManagedInstanceVulnerabilityAssessment a managed instance vulnerability assessment.
14774type ManagedInstanceVulnerabilityAssessment struct {
14775	autorest.Response `json:"-"`
14776	// ManagedInstanceVulnerabilityAssessmentProperties - Resource properties.
14777	*ManagedInstanceVulnerabilityAssessmentProperties `json:"properties,omitempty"`
14778	// ID - READ-ONLY; Resource ID.
14779	ID *string `json:"id,omitempty"`
14780	// Name - READ-ONLY; Resource name.
14781	Name *string `json:"name,omitempty"`
14782	// Type - READ-ONLY; Resource type.
14783	Type *string `json:"type,omitempty"`
14784}
14785
14786// MarshalJSON is the custom marshaler for ManagedInstanceVulnerabilityAssessment.
14787func (miva ManagedInstanceVulnerabilityAssessment) MarshalJSON() ([]byte, error) {
14788	objectMap := make(map[string]interface{})
14789	if miva.ManagedInstanceVulnerabilityAssessmentProperties != nil {
14790		objectMap["properties"] = miva.ManagedInstanceVulnerabilityAssessmentProperties
14791	}
14792	return json.Marshal(objectMap)
14793}
14794
14795// UnmarshalJSON is the custom unmarshaler for ManagedInstanceVulnerabilityAssessment struct.
14796func (miva *ManagedInstanceVulnerabilityAssessment) UnmarshalJSON(body []byte) error {
14797	var m map[string]*json.RawMessage
14798	err := json.Unmarshal(body, &m)
14799	if err != nil {
14800		return err
14801	}
14802	for k, v := range m {
14803		switch k {
14804		case "properties":
14805			if v != nil {
14806				var managedInstanceVulnerabilityAssessmentProperties ManagedInstanceVulnerabilityAssessmentProperties
14807				err = json.Unmarshal(*v, &managedInstanceVulnerabilityAssessmentProperties)
14808				if err != nil {
14809					return err
14810				}
14811				miva.ManagedInstanceVulnerabilityAssessmentProperties = &managedInstanceVulnerabilityAssessmentProperties
14812			}
14813		case "id":
14814			if v != nil {
14815				var ID string
14816				err = json.Unmarshal(*v, &ID)
14817				if err != nil {
14818					return err
14819				}
14820				miva.ID = &ID
14821			}
14822		case "name":
14823			if v != nil {
14824				var name string
14825				err = json.Unmarshal(*v, &name)
14826				if err != nil {
14827					return err
14828				}
14829				miva.Name = &name
14830			}
14831		case "type":
14832			if v != nil {
14833				var typeVar string
14834				err = json.Unmarshal(*v, &typeVar)
14835				if err != nil {
14836					return err
14837				}
14838				miva.Type = &typeVar
14839			}
14840		}
14841	}
14842
14843	return nil
14844}
14845
14846// ManagedInstanceVulnerabilityAssessmentListResult a list of the ManagedInstance's vulnerability
14847// assessments.
14848type ManagedInstanceVulnerabilityAssessmentListResult struct {
14849	autorest.Response `json:"-"`
14850	// Value - READ-ONLY; Array of results.
14851	Value *[]ManagedInstanceVulnerabilityAssessment `json:"value,omitempty"`
14852	// NextLink - READ-ONLY; Link to retrieve next page of results.
14853	NextLink *string `json:"nextLink,omitempty"`
14854}
14855
14856// MarshalJSON is the custom marshaler for ManagedInstanceVulnerabilityAssessmentListResult.
14857func (mivalr ManagedInstanceVulnerabilityAssessmentListResult) MarshalJSON() ([]byte, error) {
14858	objectMap := make(map[string]interface{})
14859	return json.Marshal(objectMap)
14860}
14861
14862// ManagedInstanceVulnerabilityAssessmentListResultIterator provides access to a complete listing of
14863// ManagedInstanceVulnerabilityAssessment values.
14864type ManagedInstanceVulnerabilityAssessmentListResultIterator struct {
14865	i    int
14866	page ManagedInstanceVulnerabilityAssessmentListResultPage
14867}
14868
14869// NextWithContext advances to the next value.  If there was an error making
14870// the request the iterator does not advance and the error is returned.
14871func (iter *ManagedInstanceVulnerabilityAssessmentListResultIterator) NextWithContext(ctx context.Context) (err error) {
14872	if tracing.IsEnabled() {
14873		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceVulnerabilityAssessmentListResultIterator.NextWithContext")
14874		defer func() {
14875			sc := -1
14876			if iter.Response().Response.Response != nil {
14877				sc = iter.Response().Response.Response.StatusCode
14878			}
14879			tracing.EndSpan(ctx, sc, err)
14880		}()
14881	}
14882	iter.i++
14883	if iter.i < len(iter.page.Values()) {
14884		return nil
14885	}
14886	err = iter.page.NextWithContext(ctx)
14887	if err != nil {
14888		iter.i--
14889		return err
14890	}
14891	iter.i = 0
14892	return nil
14893}
14894
14895// Next advances to the next value.  If there was an error making
14896// the request the iterator does not advance and the error is returned.
14897// Deprecated: Use NextWithContext() instead.
14898func (iter *ManagedInstanceVulnerabilityAssessmentListResultIterator) Next() error {
14899	return iter.NextWithContext(context.Background())
14900}
14901
14902// NotDone returns true if the enumeration should be started or is not yet complete.
14903func (iter ManagedInstanceVulnerabilityAssessmentListResultIterator) NotDone() bool {
14904	return iter.page.NotDone() && iter.i < len(iter.page.Values())
14905}
14906
14907// Response returns the raw server response from the last page request.
14908func (iter ManagedInstanceVulnerabilityAssessmentListResultIterator) Response() ManagedInstanceVulnerabilityAssessmentListResult {
14909	return iter.page.Response()
14910}
14911
14912// Value returns the current value or a zero-initialized value if the
14913// iterator has advanced beyond the end of the collection.
14914func (iter ManagedInstanceVulnerabilityAssessmentListResultIterator) Value() ManagedInstanceVulnerabilityAssessment {
14915	if !iter.page.NotDone() {
14916		return ManagedInstanceVulnerabilityAssessment{}
14917	}
14918	return iter.page.Values()[iter.i]
14919}
14920
14921// Creates a new instance of the ManagedInstanceVulnerabilityAssessmentListResultIterator type.
14922func NewManagedInstanceVulnerabilityAssessmentListResultIterator(page ManagedInstanceVulnerabilityAssessmentListResultPage) ManagedInstanceVulnerabilityAssessmentListResultIterator {
14923	return ManagedInstanceVulnerabilityAssessmentListResultIterator{page: page}
14924}
14925
14926// IsEmpty returns true if the ListResult contains no values.
14927func (mivalr ManagedInstanceVulnerabilityAssessmentListResult) IsEmpty() bool {
14928	return mivalr.Value == nil || len(*mivalr.Value) == 0
14929}
14930
14931// hasNextLink returns true if the NextLink is not empty.
14932func (mivalr ManagedInstanceVulnerabilityAssessmentListResult) hasNextLink() bool {
14933	return mivalr.NextLink != nil && len(*mivalr.NextLink) != 0
14934}
14935
14936// managedInstanceVulnerabilityAssessmentListResultPreparer prepares a request to retrieve the next set of results.
14937// It returns nil if no more results exist.
14938func (mivalr ManagedInstanceVulnerabilityAssessmentListResult) managedInstanceVulnerabilityAssessmentListResultPreparer(ctx context.Context) (*http.Request, error) {
14939	if !mivalr.hasNextLink() {
14940		return nil, nil
14941	}
14942	return autorest.Prepare((&http.Request{}).WithContext(ctx),
14943		autorest.AsJSON(),
14944		autorest.AsGet(),
14945		autorest.WithBaseURL(to.String(mivalr.NextLink)))
14946}
14947
14948// ManagedInstanceVulnerabilityAssessmentListResultPage contains a page of
14949// ManagedInstanceVulnerabilityAssessment values.
14950type ManagedInstanceVulnerabilityAssessmentListResultPage struct {
14951	fn     func(context.Context, ManagedInstanceVulnerabilityAssessmentListResult) (ManagedInstanceVulnerabilityAssessmentListResult, error)
14952	mivalr ManagedInstanceVulnerabilityAssessmentListResult
14953}
14954
14955// NextWithContext advances to the next page of values.  If there was an error making
14956// the request the page does not advance and the error is returned.
14957func (page *ManagedInstanceVulnerabilityAssessmentListResultPage) NextWithContext(ctx context.Context) (err error) {
14958	if tracing.IsEnabled() {
14959		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedInstanceVulnerabilityAssessmentListResultPage.NextWithContext")
14960		defer func() {
14961			sc := -1
14962			if page.Response().Response.Response != nil {
14963				sc = page.Response().Response.Response.StatusCode
14964			}
14965			tracing.EndSpan(ctx, sc, err)
14966		}()
14967	}
14968	for {
14969		next, err := page.fn(ctx, page.mivalr)
14970		if err != nil {
14971			return err
14972		}
14973		page.mivalr = next
14974		if !next.hasNextLink() || !next.IsEmpty() {
14975			break
14976		}
14977	}
14978	return nil
14979}
14980
14981// Next advances to the next page of values.  If there was an error making
14982// the request the page does not advance and the error is returned.
14983// Deprecated: Use NextWithContext() instead.
14984func (page *ManagedInstanceVulnerabilityAssessmentListResultPage) Next() error {
14985	return page.NextWithContext(context.Background())
14986}
14987
14988// NotDone returns true if the page enumeration should be started or is not yet complete.
14989func (page ManagedInstanceVulnerabilityAssessmentListResultPage) NotDone() bool {
14990	return !page.mivalr.IsEmpty()
14991}
14992
14993// Response returns the raw server response from the last page request.
14994func (page ManagedInstanceVulnerabilityAssessmentListResultPage) Response() ManagedInstanceVulnerabilityAssessmentListResult {
14995	return page.mivalr
14996}
14997
14998// Values returns the slice of values for the current page or nil if there are no values.
14999func (page ManagedInstanceVulnerabilityAssessmentListResultPage) Values() []ManagedInstanceVulnerabilityAssessment {
15000	if page.mivalr.IsEmpty() {
15001		return nil
15002	}
15003	return *page.mivalr.Value
15004}
15005
15006// Creates a new instance of the ManagedInstanceVulnerabilityAssessmentListResultPage type.
15007func NewManagedInstanceVulnerabilityAssessmentListResultPage(cur ManagedInstanceVulnerabilityAssessmentListResult, getNextPage func(context.Context, ManagedInstanceVulnerabilityAssessmentListResult) (ManagedInstanceVulnerabilityAssessmentListResult, error)) ManagedInstanceVulnerabilityAssessmentListResultPage {
15008	return ManagedInstanceVulnerabilityAssessmentListResultPage{
15009		fn:     getNextPage,
15010		mivalr: cur,
15011	}
15012}
15013
15014// ManagedInstanceVulnerabilityAssessmentProperties properties of a managed instance vulnerability
15015// assessment.
15016type ManagedInstanceVulnerabilityAssessmentProperties struct {
15017	// StorageContainerPath - A blob storage container path to hold the scan results (e.g. https://myStorage.blob.core.windows.net/VaScans/).
15018	StorageContainerPath *string `json:"storageContainerPath,omitempty"`
15019	// StorageContainerSasKey - A shared access signature (SAS Key) that has read and write access to the blob container specified in 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't specified, StorageContainerSasKey is required.
15020	StorageContainerSasKey *string `json:"storageContainerSasKey,omitempty"`
15021	// StorageAccountAccessKey - Specifies the identifier key of the storage account for vulnerability assessment scan results. If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is required.
15022	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
15023	// RecurringScans - The recurring scans settings
15024	RecurringScans *VulnerabilityAssessmentRecurringScansProperties `json:"recurringScans,omitempty"`
15025}
15026
15027// ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCreateOrUpdateFuture an abstraction for
15028// monitoring and retrieving the results of a long-running operation.
15029type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCreateOrUpdateFuture struct {
15030	azure.FutureAPI
15031	// Result returns the result of the asynchronous operation.
15032	// If the operation has not completed it will return an error.
15033	Result func(ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) (ManagedBackupShortTermRetentionPolicy, error)
15034}
15035
15036// UnmarshalJSON is the custom unmarshaller for CreateFuture.
15037func (future *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
15038	var azFuture azure.Future
15039	if err := json.Unmarshal(body, &azFuture); err != nil {
15040		return err
15041	}
15042	future.FutureAPI = &azFuture
15043	future.Result = future.result
15044	return nil
15045}
15046
15047// result is the default implementation for ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCreateOrUpdateFuture.Result.
15048func (future *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCreateOrUpdateFuture) result(client ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) (mbstrp ManagedBackupShortTermRetentionPolicy, err error) {
15049	var done bool
15050	done, err = future.DoneWithContext(context.Background(), client)
15051	if err != nil {
15052		err = autorest.NewErrorWithError(err, "sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
15053		return
15054	}
15055	if !done {
15056		mbstrp.Response.Response = future.Response()
15057		err = azure.NewAsyncOpIncompleteError("sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCreateOrUpdateFuture")
15058		return
15059	}
15060	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15061	if mbstrp.Response.Response, err = future.GetResult(sender); err == nil && mbstrp.Response.Response.StatusCode != http.StatusNoContent {
15062		mbstrp, err = client.CreateOrUpdateResponder(mbstrp.Response.Response)
15063		if err != nil {
15064			err = autorest.NewErrorWithError(err, "sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCreateOrUpdateFuture", "Result", mbstrp.Response.Response, "Failure responding to request")
15065		}
15066	}
15067	return
15068}
15069
15070// ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesUpdateFuture an abstraction for
15071// monitoring and retrieving the results of a long-running operation.
15072type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesUpdateFuture struct {
15073	azure.FutureAPI
15074	// Result returns the result of the asynchronous operation.
15075	// If the operation has not completed it will return an error.
15076	Result func(ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) (ManagedBackupShortTermRetentionPolicy, error)
15077}
15078
15079// UnmarshalJSON is the custom unmarshaller for CreateFuture.
15080func (future *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesUpdateFuture) UnmarshalJSON(body []byte) error {
15081	var azFuture azure.Future
15082	if err := json.Unmarshal(body, &azFuture); err != nil {
15083		return err
15084	}
15085	future.FutureAPI = &azFuture
15086	future.Result = future.result
15087	return nil
15088}
15089
15090// result is the default implementation for ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesUpdateFuture.Result.
15091func (future *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesUpdateFuture) result(client ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) (mbstrp ManagedBackupShortTermRetentionPolicy, err error) {
15092	var done bool
15093	done, err = future.DoneWithContext(context.Background(), client)
15094	if err != nil {
15095		err = autorest.NewErrorWithError(err, "sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesUpdateFuture", "Result", future.Response(), "Polling failure")
15096		return
15097	}
15098	if !done {
15099		mbstrp.Response.Response = future.Response()
15100		err = azure.NewAsyncOpIncompleteError("sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesUpdateFuture")
15101		return
15102	}
15103	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15104	if mbstrp.Response.Response, err = future.GetResult(sender); err == nil && mbstrp.Response.Response.StatusCode != http.StatusNoContent {
15105		mbstrp, err = client.UpdateResponder(mbstrp.Response.Response)
15106		if err != nil {
15107			err = autorest.NewErrorWithError(err, "sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesUpdateFuture", "Result", mbstrp.Response.Response, "Failure responding to request")
15108		}
15109	}
15110	return
15111}
15112
15113// ManagedServerSecurityAlertPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the
15114// results of a long-running operation.
15115type ManagedServerSecurityAlertPoliciesCreateOrUpdateFuture struct {
15116	azure.FutureAPI
15117	// Result returns the result of the asynchronous operation.
15118	// If the operation has not completed it will return an error.
15119	Result func(ManagedServerSecurityAlertPoliciesClient) (ManagedServerSecurityAlertPolicy, error)
15120}
15121
15122// UnmarshalJSON is the custom unmarshaller for CreateFuture.
15123func (future *ManagedServerSecurityAlertPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
15124	var azFuture azure.Future
15125	if err := json.Unmarshal(body, &azFuture); err != nil {
15126		return err
15127	}
15128	future.FutureAPI = &azFuture
15129	future.Result = future.result
15130	return nil
15131}
15132
15133// result is the default implementation for ManagedServerSecurityAlertPoliciesCreateOrUpdateFuture.Result.
15134func (future *ManagedServerSecurityAlertPoliciesCreateOrUpdateFuture) result(client ManagedServerSecurityAlertPoliciesClient) (mssap ManagedServerSecurityAlertPolicy, err error) {
15135	var done bool
15136	done, err = future.DoneWithContext(context.Background(), client)
15137	if err != nil {
15138		err = autorest.NewErrorWithError(err, "sql.ManagedServerSecurityAlertPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
15139		return
15140	}
15141	if !done {
15142		mssap.Response.Response = future.Response()
15143		err = azure.NewAsyncOpIncompleteError("sql.ManagedServerSecurityAlertPoliciesCreateOrUpdateFuture")
15144		return
15145	}
15146	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15147	if mssap.Response.Response, err = future.GetResult(sender); err == nil && mssap.Response.Response.StatusCode != http.StatusNoContent {
15148		mssap, err = client.CreateOrUpdateResponder(mssap.Response.Response)
15149		if err != nil {
15150			err = autorest.NewErrorWithError(err, "sql.ManagedServerSecurityAlertPoliciesCreateOrUpdateFuture", "Result", mssap.Response.Response, "Failure responding to request")
15151		}
15152	}
15153	return
15154}
15155
15156// ManagedServerSecurityAlertPolicy a managed server security alert policy.
15157type ManagedServerSecurityAlertPolicy struct {
15158	autorest.Response `json:"-"`
15159	// SecurityAlertPolicyProperties - Resource properties.
15160	*SecurityAlertPolicyProperties `json:"properties,omitempty"`
15161	// ID - READ-ONLY; Resource ID.
15162	ID *string `json:"id,omitempty"`
15163	// Name - READ-ONLY; Resource name.
15164	Name *string `json:"name,omitempty"`
15165	// Type - READ-ONLY; Resource type.
15166	Type *string `json:"type,omitempty"`
15167}
15168
15169// MarshalJSON is the custom marshaler for ManagedServerSecurityAlertPolicy.
15170func (mssap ManagedServerSecurityAlertPolicy) MarshalJSON() ([]byte, error) {
15171	objectMap := make(map[string]interface{})
15172	if mssap.SecurityAlertPolicyProperties != nil {
15173		objectMap["properties"] = mssap.SecurityAlertPolicyProperties
15174	}
15175	return json.Marshal(objectMap)
15176}
15177
15178// UnmarshalJSON is the custom unmarshaler for ManagedServerSecurityAlertPolicy struct.
15179func (mssap *ManagedServerSecurityAlertPolicy) UnmarshalJSON(body []byte) error {
15180	var m map[string]*json.RawMessage
15181	err := json.Unmarshal(body, &m)
15182	if err != nil {
15183		return err
15184	}
15185	for k, v := range m {
15186		switch k {
15187		case "properties":
15188			if v != nil {
15189				var securityAlertPolicyProperties SecurityAlertPolicyProperties
15190				err = json.Unmarshal(*v, &securityAlertPolicyProperties)
15191				if err != nil {
15192					return err
15193				}
15194				mssap.SecurityAlertPolicyProperties = &securityAlertPolicyProperties
15195			}
15196		case "id":
15197			if v != nil {
15198				var ID string
15199				err = json.Unmarshal(*v, &ID)
15200				if err != nil {
15201					return err
15202				}
15203				mssap.ID = &ID
15204			}
15205		case "name":
15206			if v != nil {
15207				var name string
15208				err = json.Unmarshal(*v, &name)
15209				if err != nil {
15210					return err
15211				}
15212				mssap.Name = &name
15213			}
15214		case "type":
15215			if v != nil {
15216				var typeVar string
15217				err = json.Unmarshal(*v, &typeVar)
15218				if err != nil {
15219					return err
15220				}
15221				mssap.Type = &typeVar
15222			}
15223		}
15224	}
15225
15226	return nil
15227}
15228
15229// ManagedServerSecurityAlertPolicyListResult a list of the managed Server's security alert policies.
15230type ManagedServerSecurityAlertPolicyListResult struct {
15231	autorest.Response `json:"-"`
15232	// Value - READ-ONLY; Array of results.
15233	Value *[]ManagedServerSecurityAlertPolicy `json:"value,omitempty"`
15234	// NextLink - READ-ONLY; Link to retrieve next page of results.
15235	NextLink *string `json:"nextLink,omitempty"`
15236}
15237
15238// MarshalJSON is the custom marshaler for ManagedServerSecurityAlertPolicyListResult.
15239func (mssaplr ManagedServerSecurityAlertPolicyListResult) MarshalJSON() ([]byte, error) {
15240	objectMap := make(map[string]interface{})
15241	return json.Marshal(objectMap)
15242}
15243
15244// ManagedServerSecurityAlertPolicyListResultIterator provides access to a complete listing of
15245// ManagedServerSecurityAlertPolicy values.
15246type ManagedServerSecurityAlertPolicyListResultIterator struct {
15247	i    int
15248	page ManagedServerSecurityAlertPolicyListResultPage
15249}
15250
15251// NextWithContext advances to the next value.  If there was an error making
15252// the request the iterator does not advance and the error is returned.
15253func (iter *ManagedServerSecurityAlertPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
15254	if tracing.IsEnabled() {
15255		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedServerSecurityAlertPolicyListResultIterator.NextWithContext")
15256		defer func() {
15257			sc := -1
15258			if iter.Response().Response.Response != nil {
15259				sc = iter.Response().Response.Response.StatusCode
15260			}
15261			tracing.EndSpan(ctx, sc, err)
15262		}()
15263	}
15264	iter.i++
15265	if iter.i < len(iter.page.Values()) {
15266		return nil
15267	}
15268	err = iter.page.NextWithContext(ctx)
15269	if err != nil {
15270		iter.i--
15271		return err
15272	}
15273	iter.i = 0
15274	return nil
15275}
15276
15277// Next advances to the next value.  If there was an error making
15278// the request the iterator does not advance and the error is returned.
15279// Deprecated: Use NextWithContext() instead.
15280func (iter *ManagedServerSecurityAlertPolicyListResultIterator) Next() error {
15281	return iter.NextWithContext(context.Background())
15282}
15283
15284// NotDone returns true if the enumeration should be started or is not yet complete.
15285func (iter ManagedServerSecurityAlertPolicyListResultIterator) NotDone() bool {
15286	return iter.page.NotDone() && iter.i < len(iter.page.Values())
15287}
15288
15289// Response returns the raw server response from the last page request.
15290func (iter ManagedServerSecurityAlertPolicyListResultIterator) Response() ManagedServerSecurityAlertPolicyListResult {
15291	return iter.page.Response()
15292}
15293
15294// Value returns the current value or a zero-initialized value if the
15295// iterator has advanced beyond the end of the collection.
15296func (iter ManagedServerSecurityAlertPolicyListResultIterator) Value() ManagedServerSecurityAlertPolicy {
15297	if !iter.page.NotDone() {
15298		return ManagedServerSecurityAlertPolicy{}
15299	}
15300	return iter.page.Values()[iter.i]
15301}
15302
15303// Creates a new instance of the ManagedServerSecurityAlertPolicyListResultIterator type.
15304func NewManagedServerSecurityAlertPolicyListResultIterator(page ManagedServerSecurityAlertPolicyListResultPage) ManagedServerSecurityAlertPolicyListResultIterator {
15305	return ManagedServerSecurityAlertPolicyListResultIterator{page: page}
15306}
15307
15308// IsEmpty returns true if the ListResult contains no values.
15309func (mssaplr ManagedServerSecurityAlertPolicyListResult) IsEmpty() bool {
15310	return mssaplr.Value == nil || len(*mssaplr.Value) == 0
15311}
15312
15313// hasNextLink returns true if the NextLink is not empty.
15314func (mssaplr ManagedServerSecurityAlertPolicyListResult) hasNextLink() bool {
15315	return mssaplr.NextLink != nil && len(*mssaplr.NextLink) != 0
15316}
15317
15318// managedServerSecurityAlertPolicyListResultPreparer prepares a request to retrieve the next set of results.
15319// It returns nil if no more results exist.
15320func (mssaplr ManagedServerSecurityAlertPolicyListResult) managedServerSecurityAlertPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
15321	if !mssaplr.hasNextLink() {
15322		return nil, nil
15323	}
15324	return autorest.Prepare((&http.Request{}).WithContext(ctx),
15325		autorest.AsJSON(),
15326		autorest.AsGet(),
15327		autorest.WithBaseURL(to.String(mssaplr.NextLink)))
15328}
15329
15330// ManagedServerSecurityAlertPolicyListResultPage contains a page of ManagedServerSecurityAlertPolicy
15331// values.
15332type ManagedServerSecurityAlertPolicyListResultPage struct {
15333	fn      func(context.Context, ManagedServerSecurityAlertPolicyListResult) (ManagedServerSecurityAlertPolicyListResult, error)
15334	mssaplr ManagedServerSecurityAlertPolicyListResult
15335}
15336
15337// NextWithContext advances to the next page of values.  If there was an error making
15338// the request the page does not advance and the error is returned.
15339func (page *ManagedServerSecurityAlertPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
15340	if tracing.IsEnabled() {
15341		ctx = tracing.StartSpan(ctx, fqdn+"/ManagedServerSecurityAlertPolicyListResultPage.NextWithContext")
15342		defer func() {
15343			sc := -1
15344			if page.Response().Response.Response != nil {
15345				sc = page.Response().Response.Response.StatusCode
15346			}
15347			tracing.EndSpan(ctx, sc, err)
15348		}()
15349	}
15350	for {
15351		next, err := page.fn(ctx, page.mssaplr)
15352		if err != nil {
15353			return err
15354		}
15355		page.mssaplr = next
15356		if !next.hasNextLink() || !next.IsEmpty() {
15357			break
15358		}
15359	}
15360	return nil
15361}
15362
15363// Next advances to the next page of values.  If there was an error making
15364// the request the page does not advance and the error is returned.
15365// Deprecated: Use NextWithContext() instead.
15366func (page *ManagedServerSecurityAlertPolicyListResultPage) Next() error {
15367	return page.NextWithContext(context.Background())
15368}
15369
15370// NotDone returns true if the page enumeration should be started or is not yet complete.
15371func (page ManagedServerSecurityAlertPolicyListResultPage) NotDone() bool {
15372	return !page.mssaplr.IsEmpty()
15373}
15374
15375// Response returns the raw server response from the last page request.
15376func (page ManagedServerSecurityAlertPolicyListResultPage) Response() ManagedServerSecurityAlertPolicyListResult {
15377	return page.mssaplr
15378}
15379
15380// Values returns the slice of values for the current page or nil if there are no values.
15381func (page ManagedServerSecurityAlertPolicyListResultPage) Values() []ManagedServerSecurityAlertPolicy {
15382	if page.mssaplr.IsEmpty() {
15383		return nil
15384	}
15385	return *page.mssaplr.Value
15386}
15387
15388// Creates a new instance of the ManagedServerSecurityAlertPolicyListResultPage type.
15389func NewManagedServerSecurityAlertPolicyListResultPage(cur ManagedServerSecurityAlertPolicyListResult, getNextPage func(context.Context, ManagedServerSecurityAlertPolicyListResult) (ManagedServerSecurityAlertPolicyListResult, error)) ManagedServerSecurityAlertPolicyListResultPage {
15390	return ManagedServerSecurityAlertPolicyListResultPage{
15391		fn:      getNextPage,
15392		mssaplr: cur,
15393	}
15394}
15395
15396// MaxSizeCapability the maximum size capability.
15397type MaxSizeCapability struct {
15398	// Limit - READ-ONLY; The maximum size limit (see 'unit' for the units).
15399	Limit *int32 `json:"limit,omitempty"`
15400	// Unit - READ-ONLY; The units that the limit is expressed in. Possible values include: 'MaxSizeUnitMegabytes', 'MaxSizeUnitGigabytes', 'MaxSizeUnitTerabytes', 'MaxSizeUnitPetabytes'
15401	Unit MaxSizeUnit `json:"unit,omitempty"`
15402}
15403
15404// MarshalJSON is the custom marshaler for MaxSizeCapability.
15405func (msc MaxSizeCapability) MarshalJSON() ([]byte, error) {
15406	objectMap := make(map[string]interface{})
15407	return json.Marshal(objectMap)
15408}
15409
15410// MaxSizeRangeCapability the maximum size range capability.
15411type MaxSizeRangeCapability struct {
15412	// MinValue - READ-ONLY; Minimum value.
15413	MinValue *MaxSizeCapability `json:"minValue,omitempty"`
15414	// MaxValue - READ-ONLY; Maximum value.
15415	MaxValue *MaxSizeCapability `json:"maxValue,omitempty"`
15416	// ScaleSize - READ-ONLY; Scale/step size for discrete values between the minimum value and the maximum value.
15417	ScaleSize *MaxSizeCapability `json:"scaleSize,omitempty"`
15418	// LogSize - READ-ONLY; Size of transaction log.
15419	LogSize *LogSizeCapability `json:"logSize,omitempty"`
15420	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
15421	Status CapabilityStatus `json:"status,omitempty"`
15422	// Reason - The reason for the capability not being available.
15423	Reason *string `json:"reason,omitempty"`
15424}
15425
15426// MarshalJSON is the custom marshaler for MaxSizeRangeCapability.
15427func (msrc MaxSizeRangeCapability) MarshalJSON() ([]byte, error) {
15428	objectMap := make(map[string]interface{})
15429	if msrc.Reason != nil {
15430		objectMap["reason"] = msrc.Reason
15431	}
15432	return json.Marshal(objectMap)
15433}
15434
15435// Metric database metrics.
15436type Metric struct {
15437	// StartTime - READ-ONLY; The start time for the metric (ISO-8601 format).
15438	StartTime *date.Time `json:"startTime,omitempty"`
15439	// EndTime - READ-ONLY; The end time for the metric (ISO-8601 format).
15440	EndTime *date.Time `json:"endTime,omitempty"`
15441	// TimeGrain - READ-ONLY; The time step to be used to summarize the metric values.
15442	TimeGrain *string `json:"timeGrain,omitempty"`
15443	// Unit - READ-ONLY; The unit of the metric. Possible values include: 'UnitTypeCount', 'UnitTypeBytes', 'UnitTypeSeconds', 'UnitTypePercent', 'UnitTypeCountPerSecond', 'UnitTypeBytesPerSecond'
15444	Unit UnitType `json:"unit,omitempty"`
15445	// Name - READ-ONLY; The name information for the metric.
15446	Name *MetricName `json:"name,omitempty"`
15447	// MetricValues - READ-ONLY; The metric values for the specified time window and timestep.
15448	MetricValues *[]MetricValue `json:"metricValues,omitempty"`
15449}
15450
15451// MarshalJSON is the custom marshaler for Metric.
15452func (mVar Metric) MarshalJSON() ([]byte, error) {
15453	objectMap := make(map[string]interface{})
15454	return json.Marshal(objectMap)
15455}
15456
15457// MetricAvailability a metric availability value.
15458type MetricAvailability struct {
15459	// Retention - READ-ONLY; The length of retention for the database metric.
15460	Retention *string `json:"retention,omitempty"`
15461	// TimeGrain - READ-ONLY; The granularity of the database metric.
15462	TimeGrain *string `json:"timeGrain,omitempty"`
15463}
15464
15465// MarshalJSON is the custom marshaler for MetricAvailability.
15466func (ma MetricAvailability) MarshalJSON() ([]byte, error) {
15467	objectMap := make(map[string]interface{})
15468	return json.Marshal(objectMap)
15469}
15470
15471// MetricDefinition a database metric definition.
15472type MetricDefinition struct {
15473	// Name - READ-ONLY; The name information for the metric.
15474	Name *MetricName `json:"name,omitempty"`
15475	// PrimaryAggregationType - READ-ONLY; The primary aggregation type defining how metric values are displayed. Possible values include: 'None', 'Average', 'Count', 'Minimum', 'Maximum', 'Total'
15476	PrimaryAggregationType PrimaryAggregationType `json:"primaryAggregationType,omitempty"`
15477	// ResourceURI - READ-ONLY; The resource uri of the database.
15478	ResourceURI *string `json:"resourceUri,omitempty"`
15479	// Unit - READ-ONLY; The unit of the metric. Possible values include: 'UnitDefinitionTypeCount', 'UnitDefinitionTypeBytes', 'UnitDefinitionTypeSeconds', 'UnitDefinitionTypePercent', 'UnitDefinitionTypeCountPerSecond', 'UnitDefinitionTypeBytesPerSecond'
15480	Unit UnitDefinitionType `json:"unit,omitempty"`
15481	// MetricAvailabilities - READ-ONLY; The list of database metric availabilities for the metric.
15482	MetricAvailabilities *[]MetricAvailability `json:"metricAvailabilities,omitempty"`
15483}
15484
15485// MarshalJSON is the custom marshaler for MetricDefinition.
15486func (md MetricDefinition) MarshalJSON() ([]byte, error) {
15487	objectMap := make(map[string]interface{})
15488	return json.Marshal(objectMap)
15489}
15490
15491// MetricDefinitionListResult the response to a list database metric definitions request.
15492type MetricDefinitionListResult struct {
15493	autorest.Response `json:"-"`
15494	// Value - The list of metric definitions for the database.
15495	Value *[]MetricDefinition `json:"value,omitempty"`
15496}
15497
15498// MetricListResult the response to a list database metrics request.
15499type MetricListResult struct {
15500	autorest.Response `json:"-"`
15501	// Value - The list of metrics for the database.
15502	Value *[]Metric `json:"value,omitempty"`
15503}
15504
15505// MetricName a database metric name.
15506type MetricName struct {
15507	// Value - READ-ONLY; The name of the database metric.
15508	Value *string `json:"value,omitempty"`
15509	// LocalizedValue - READ-ONLY; The friendly name of the database metric.
15510	LocalizedValue *string `json:"localizedValue,omitempty"`
15511}
15512
15513// MarshalJSON is the custom marshaler for MetricName.
15514func (mn MetricName) MarshalJSON() ([]byte, error) {
15515	objectMap := make(map[string]interface{})
15516	return json.Marshal(objectMap)
15517}
15518
15519// MetricValue represents database metrics.
15520type MetricValue struct {
15521	// Count - READ-ONLY; The number of values for the metric.
15522	Count *float64 `json:"count,omitempty"`
15523	// Average - READ-ONLY; The average value of the metric.
15524	Average *float64 `json:"average,omitempty"`
15525	// Maximum - READ-ONLY; The max value of the metric.
15526	Maximum *float64 `json:"maximum,omitempty"`
15527	// Minimum - READ-ONLY; The min value of the metric.
15528	Minimum *float64 `json:"minimum,omitempty"`
15529	// Timestamp - READ-ONLY; The metric timestamp (ISO-8601 format).
15530	Timestamp *date.Time `json:"timestamp,omitempty"`
15531	// Total - READ-ONLY; The total value of the metric.
15532	Total *float64 `json:"total,omitempty"`
15533}
15534
15535// MarshalJSON is the custom marshaler for MetricValue.
15536func (mv MetricValue) MarshalJSON() ([]byte, error) {
15537	objectMap := make(map[string]interface{})
15538	return json.Marshal(objectMap)
15539}
15540
15541// MinCapacityCapability the min capacity capability
15542type MinCapacityCapability struct {
15543	// Value - READ-ONLY; Min capacity value
15544	Value *float64 `json:"value,omitempty"`
15545	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
15546	Status CapabilityStatus `json:"status,omitempty"`
15547	// Reason - The reason for the capability not being available.
15548	Reason *string `json:"reason,omitempty"`
15549}
15550
15551// MarshalJSON is the custom marshaler for MinCapacityCapability.
15552func (mcc MinCapacityCapability) MarshalJSON() ([]byte, error) {
15553	objectMap := make(map[string]interface{})
15554	if mcc.Reason != nil {
15555		objectMap["reason"] = mcc.Reason
15556	}
15557	return json.Marshal(objectMap)
15558}
15559
15560// Name ARM Usage Name
15561type Name struct {
15562	// Value - Usage name value
15563	Value *string `json:"value,omitempty"`
15564	// LocalizedValue - Usage name localized value.
15565	LocalizedValue *string `json:"localizedValue,omitempty"`
15566}
15567
15568// NetworkIsolationSettings contains the ARM resources for which to create private endpoint connection.
15569type NetworkIsolationSettings struct {
15570	// 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.
15571	StorageAccountResourceID *string `json:"storageAccountResourceId,omitempty"`
15572	// 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.
15573	SQLServerResourceID *string `json:"sqlServerResourceId,omitempty"`
15574}
15575
15576// Operation SQL REST API operation definition.
15577type Operation struct {
15578	// Name - READ-ONLY; The name of the operation being performed on this particular object.
15579	Name *string `json:"name,omitempty"`
15580	// Display - READ-ONLY; The localized display information for this particular operation / action.
15581	Display *OperationDisplay `json:"display,omitempty"`
15582	// Origin - READ-ONLY; The intended executor of the operation. Possible values include: 'User', 'System'
15583	Origin OperationOrigin `json:"origin,omitempty"`
15584	// Properties - READ-ONLY; Additional descriptions for the operation.
15585	Properties map[string]interface{} `json:"properties"`
15586}
15587
15588// MarshalJSON is the custom marshaler for Operation.
15589func (o Operation) MarshalJSON() ([]byte, error) {
15590	objectMap := make(map[string]interface{})
15591	return json.Marshal(objectMap)
15592}
15593
15594// OperationDisplay display metadata associated with the operation.
15595type OperationDisplay struct {
15596	// Provider - READ-ONLY; The localized friendly form of the resource provider name.
15597	Provider *string `json:"provider,omitempty"`
15598	// Resource - READ-ONLY; The localized friendly form of the resource type related to this action/operation.
15599	Resource *string `json:"resource,omitempty"`
15600	// Operation - READ-ONLY; The localized friendly name for the operation.
15601	Operation *string `json:"operation,omitempty"`
15602	// Description - READ-ONLY; The localized friendly description for the operation.
15603	Description *string `json:"description,omitempty"`
15604}
15605
15606// MarshalJSON is the custom marshaler for OperationDisplay.
15607func (od OperationDisplay) MarshalJSON() ([]byte, error) {
15608	objectMap := make(map[string]interface{})
15609	return json.Marshal(objectMap)
15610}
15611
15612// OperationImpact the impact of an operation, both in absolute and relative terms.
15613type OperationImpact struct {
15614	// Name - READ-ONLY; The name of the impact dimension.
15615	Name *string `json:"name,omitempty"`
15616	// Unit - READ-ONLY; The unit in which estimated impact to dimension is measured.
15617	Unit *string `json:"unit,omitempty"`
15618	// ChangeValueAbsolute - READ-ONLY; The absolute impact to dimension.
15619	ChangeValueAbsolute *float64 `json:"changeValueAbsolute,omitempty"`
15620	// ChangeValueRelative - READ-ONLY; The relative impact to dimension (null if not applicable)
15621	ChangeValueRelative *float64 `json:"changeValueRelative,omitempty"`
15622}
15623
15624// MarshalJSON is the custom marshaler for OperationImpact.
15625func (oi OperationImpact) MarshalJSON() ([]byte, error) {
15626	objectMap := make(map[string]interface{})
15627	return json.Marshal(objectMap)
15628}
15629
15630// OperationListResult result of the request to list SQL operations.
15631type OperationListResult struct {
15632	autorest.Response `json:"-"`
15633	// Value - READ-ONLY; Array of results.
15634	Value *[]Operation `json:"value,omitempty"`
15635	// NextLink - READ-ONLY; Link to retrieve next page of results.
15636	NextLink *string `json:"nextLink,omitempty"`
15637}
15638
15639// MarshalJSON is the custom marshaler for OperationListResult.
15640func (olr OperationListResult) MarshalJSON() ([]byte, error) {
15641	objectMap := make(map[string]interface{})
15642	return json.Marshal(objectMap)
15643}
15644
15645// OperationListResultIterator provides access to a complete listing of Operation values.
15646type OperationListResultIterator struct {
15647	i    int
15648	page OperationListResultPage
15649}
15650
15651// NextWithContext advances to the next value.  If there was an error making
15652// the request the iterator does not advance and the error is returned.
15653func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
15654	if tracing.IsEnabled() {
15655		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext")
15656		defer func() {
15657			sc := -1
15658			if iter.Response().Response.Response != nil {
15659				sc = iter.Response().Response.Response.StatusCode
15660			}
15661			tracing.EndSpan(ctx, sc, err)
15662		}()
15663	}
15664	iter.i++
15665	if iter.i < len(iter.page.Values()) {
15666		return nil
15667	}
15668	err = iter.page.NextWithContext(ctx)
15669	if err != nil {
15670		iter.i--
15671		return err
15672	}
15673	iter.i = 0
15674	return nil
15675}
15676
15677// Next advances to the next value.  If there was an error making
15678// the request the iterator does not advance and the error is returned.
15679// Deprecated: Use NextWithContext() instead.
15680func (iter *OperationListResultIterator) Next() error {
15681	return iter.NextWithContext(context.Background())
15682}
15683
15684// NotDone returns true if the enumeration should be started or is not yet complete.
15685func (iter OperationListResultIterator) NotDone() bool {
15686	return iter.page.NotDone() && iter.i < len(iter.page.Values())
15687}
15688
15689// Response returns the raw server response from the last page request.
15690func (iter OperationListResultIterator) Response() OperationListResult {
15691	return iter.page.Response()
15692}
15693
15694// Value returns the current value or a zero-initialized value if the
15695// iterator has advanced beyond the end of the collection.
15696func (iter OperationListResultIterator) Value() Operation {
15697	if !iter.page.NotDone() {
15698		return Operation{}
15699	}
15700	return iter.page.Values()[iter.i]
15701}
15702
15703// Creates a new instance of the OperationListResultIterator type.
15704func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
15705	return OperationListResultIterator{page: page}
15706}
15707
15708// IsEmpty returns true if the ListResult contains no values.
15709func (olr OperationListResult) IsEmpty() bool {
15710	return olr.Value == nil || len(*olr.Value) == 0
15711}
15712
15713// hasNextLink returns true if the NextLink is not empty.
15714func (olr OperationListResult) hasNextLink() bool {
15715	return olr.NextLink != nil && len(*olr.NextLink) != 0
15716}
15717
15718// operationListResultPreparer prepares a request to retrieve the next set of results.
15719// It returns nil if no more results exist.
15720func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) {
15721	if !olr.hasNextLink() {
15722		return nil, nil
15723	}
15724	return autorest.Prepare((&http.Request{}).WithContext(ctx),
15725		autorest.AsJSON(),
15726		autorest.AsGet(),
15727		autorest.WithBaseURL(to.String(olr.NextLink)))
15728}
15729
15730// OperationListResultPage contains a page of Operation values.
15731type OperationListResultPage struct {
15732	fn  func(context.Context, OperationListResult) (OperationListResult, error)
15733	olr OperationListResult
15734}
15735
15736// NextWithContext advances to the next page of values.  If there was an error making
15737// the request the page does not advance and the error is returned.
15738func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) {
15739	if tracing.IsEnabled() {
15740		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext")
15741		defer func() {
15742			sc := -1
15743			if page.Response().Response.Response != nil {
15744				sc = page.Response().Response.Response.StatusCode
15745			}
15746			tracing.EndSpan(ctx, sc, err)
15747		}()
15748	}
15749	for {
15750		next, err := page.fn(ctx, page.olr)
15751		if err != nil {
15752			return err
15753		}
15754		page.olr = next
15755		if !next.hasNextLink() || !next.IsEmpty() {
15756			break
15757		}
15758	}
15759	return nil
15760}
15761
15762// Next advances to the next page of values.  If there was an error making
15763// the request the page does not advance and the error is returned.
15764// Deprecated: Use NextWithContext() instead.
15765func (page *OperationListResultPage) Next() error {
15766	return page.NextWithContext(context.Background())
15767}
15768
15769// NotDone returns true if the page enumeration should be started or is not yet complete.
15770func (page OperationListResultPage) NotDone() bool {
15771	return !page.olr.IsEmpty()
15772}
15773
15774// Response returns the raw server response from the last page request.
15775func (page OperationListResultPage) Response() OperationListResult {
15776	return page.olr
15777}
15778
15779// Values returns the slice of values for the current page or nil if there are no values.
15780func (page OperationListResultPage) Values() []Operation {
15781	if page.olr.IsEmpty() {
15782		return nil
15783	}
15784	return *page.olr.Value
15785}
15786
15787// Creates a new instance of the OperationListResultPage type.
15788func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage {
15789	return OperationListResultPage{
15790		fn:  getNextPage,
15791		olr: cur,
15792	}
15793}
15794
15795// PartnerInfo partner server information for the failover group.
15796type PartnerInfo struct {
15797	// ID - Resource identifier of the partner server.
15798	ID *string `json:"id,omitempty"`
15799	// Location - READ-ONLY; Geo location of the partner server.
15800	Location *string `json:"location,omitempty"`
15801	// ReplicationRole - READ-ONLY; Replication role of the partner server. Possible values include: 'Primary', 'Secondary'
15802	ReplicationRole FailoverGroupReplicationRole `json:"replicationRole,omitempty"`
15803}
15804
15805// MarshalJSON is the custom marshaler for PartnerInfo.
15806func (pi PartnerInfo) MarshalJSON() ([]byte, error) {
15807	objectMap := make(map[string]interface{})
15808	if pi.ID != nil {
15809		objectMap["id"] = pi.ID
15810	}
15811	return json.Marshal(objectMap)
15812}
15813
15814// PartnerRegionInfo partner region information for the failover group.
15815type PartnerRegionInfo struct {
15816	// Location - Geo location of the partner managed instances.
15817	Location *string `json:"location,omitempty"`
15818	// ReplicationRole - READ-ONLY; Replication role of the partner managed instances. Possible values include: 'InstanceFailoverGroupReplicationRolePrimary', 'InstanceFailoverGroupReplicationRoleSecondary'
15819	ReplicationRole InstanceFailoverGroupReplicationRole `json:"replicationRole,omitempty"`
15820}
15821
15822// MarshalJSON is the custom marshaler for PartnerRegionInfo.
15823func (pri PartnerRegionInfo) MarshalJSON() ([]byte, error) {
15824	objectMap := make(map[string]interface{})
15825	if pri.Location != nil {
15826		objectMap["location"] = pri.Location
15827	}
15828	return json.Marshal(objectMap)
15829}
15830
15831// PerformanceLevelCapability the performance level capability.
15832type PerformanceLevelCapability struct {
15833	// Value - READ-ONLY; Performance level value.
15834	Value *float64 `json:"value,omitempty"`
15835	// Unit - READ-ONLY; Unit type used to measure performance level. Possible values include: 'DTU', 'VCores'
15836	Unit PerformanceLevelUnit `json:"unit,omitempty"`
15837}
15838
15839// MarshalJSON is the custom marshaler for PerformanceLevelCapability.
15840func (plc PerformanceLevelCapability) MarshalJSON() ([]byte, error) {
15841	objectMap := make(map[string]interface{})
15842	return json.Marshal(objectMap)
15843}
15844
15845// PrivateEndpointConnection a private endpoint connection
15846type PrivateEndpointConnection struct {
15847	autorest.Response `json:"-"`
15848	// PrivateEndpointConnectionProperties - Resource properties.
15849	*PrivateEndpointConnectionProperties `json:"properties,omitempty"`
15850	// ID - READ-ONLY; Resource ID.
15851	ID *string `json:"id,omitempty"`
15852	// Name - READ-ONLY; Resource name.
15853	Name *string `json:"name,omitempty"`
15854	// Type - READ-ONLY; Resource type.
15855	Type *string `json:"type,omitempty"`
15856}
15857
15858// MarshalJSON is the custom marshaler for PrivateEndpointConnection.
15859func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) {
15860	objectMap := make(map[string]interface{})
15861	if pec.PrivateEndpointConnectionProperties != nil {
15862		objectMap["properties"] = pec.PrivateEndpointConnectionProperties
15863	}
15864	return json.Marshal(objectMap)
15865}
15866
15867// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct.
15868func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error {
15869	var m map[string]*json.RawMessage
15870	err := json.Unmarshal(body, &m)
15871	if err != nil {
15872		return err
15873	}
15874	for k, v := range m {
15875		switch k {
15876		case "properties":
15877			if v != nil {
15878				var privateEndpointConnectionProperties PrivateEndpointConnectionProperties
15879				err = json.Unmarshal(*v, &privateEndpointConnectionProperties)
15880				if err != nil {
15881					return err
15882				}
15883				pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties
15884			}
15885		case "id":
15886			if v != nil {
15887				var ID string
15888				err = json.Unmarshal(*v, &ID)
15889				if err != nil {
15890					return err
15891				}
15892				pec.ID = &ID
15893			}
15894		case "name":
15895			if v != nil {
15896				var name string
15897				err = json.Unmarshal(*v, &name)
15898				if err != nil {
15899					return err
15900				}
15901				pec.Name = &name
15902			}
15903		case "type":
15904			if v != nil {
15905				var typeVar string
15906				err = json.Unmarshal(*v, &typeVar)
15907				if err != nil {
15908					return err
15909				}
15910				pec.Type = &typeVar
15911			}
15912		}
15913	}
15914
15915	return nil
15916}
15917
15918// PrivateEndpointConnectionListResult a list of private endpoint connections.
15919type PrivateEndpointConnectionListResult struct {
15920	autorest.Response `json:"-"`
15921	// Value - READ-ONLY; Array of results.
15922	Value *[]PrivateEndpointConnection `json:"value,omitempty"`
15923	// NextLink - READ-ONLY; Link to retrieve next page of results.
15924	NextLink *string `json:"nextLink,omitempty"`
15925}
15926
15927// MarshalJSON is the custom marshaler for PrivateEndpointConnectionListResult.
15928func (peclr PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) {
15929	objectMap := make(map[string]interface{})
15930	return json.Marshal(objectMap)
15931}
15932
15933// PrivateEndpointConnectionListResultIterator provides access to a complete listing of
15934// PrivateEndpointConnection values.
15935type PrivateEndpointConnectionListResultIterator struct {
15936	i    int
15937	page PrivateEndpointConnectionListResultPage
15938}
15939
15940// NextWithContext advances to the next value.  If there was an error making
15941// the request the iterator does not advance and the error is returned.
15942func (iter *PrivateEndpointConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) {
15943	if tracing.IsEnabled() {
15944		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultIterator.NextWithContext")
15945		defer func() {
15946			sc := -1
15947			if iter.Response().Response.Response != nil {
15948				sc = iter.Response().Response.Response.StatusCode
15949			}
15950			tracing.EndSpan(ctx, sc, err)
15951		}()
15952	}
15953	iter.i++
15954	if iter.i < len(iter.page.Values()) {
15955		return nil
15956	}
15957	err = iter.page.NextWithContext(ctx)
15958	if err != nil {
15959		iter.i--
15960		return err
15961	}
15962	iter.i = 0
15963	return nil
15964}
15965
15966// Next advances to the next value.  If there was an error making
15967// the request the iterator does not advance and the error is returned.
15968// Deprecated: Use NextWithContext() instead.
15969func (iter *PrivateEndpointConnectionListResultIterator) Next() error {
15970	return iter.NextWithContext(context.Background())
15971}
15972
15973// NotDone returns true if the enumeration should be started or is not yet complete.
15974func (iter PrivateEndpointConnectionListResultIterator) NotDone() bool {
15975	return iter.page.NotDone() && iter.i < len(iter.page.Values())
15976}
15977
15978// Response returns the raw server response from the last page request.
15979func (iter PrivateEndpointConnectionListResultIterator) Response() PrivateEndpointConnectionListResult {
15980	return iter.page.Response()
15981}
15982
15983// Value returns the current value or a zero-initialized value if the
15984// iterator has advanced beyond the end of the collection.
15985func (iter PrivateEndpointConnectionListResultIterator) Value() PrivateEndpointConnection {
15986	if !iter.page.NotDone() {
15987		return PrivateEndpointConnection{}
15988	}
15989	return iter.page.Values()[iter.i]
15990}
15991
15992// Creates a new instance of the PrivateEndpointConnectionListResultIterator type.
15993func NewPrivateEndpointConnectionListResultIterator(page PrivateEndpointConnectionListResultPage) PrivateEndpointConnectionListResultIterator {
15994	return PrivateEndpointConnectionListResultIterator{page: page}
15995}
15996
15997// IsEmpty returns true if the ListResult contains no values.
15998func (peclr PrivateEndpointConnectionListResult) IsEmpty() bool {
15999	return peclr.Value == nil || len(*peclr.Value) == 0
16000}
16001
16002// hasNextLink returns true if the NextLink is not empty.
16003func (peclr PrivateEndpointConnectionListResult) hasNextLink() bool {
16004	return peclr.NextLink != nil && len(*peclr.NextLink) != 0
16005}
16006
16007// privateEndpointConnectionListResultPreparer prepares a request to retrieve the next set of results.
16008// It returns nil if no more results exist.
16009func (peclr PrivateEndpointConnectionListResult) privateEndpointConnectionListResultPreparer(ctx context.Context) (*http.Request, error) {
16010	if !peclr.hasNextLink() {
16011		return nil, nil
16012	}
16013	return autorest.Prepare((&http.Request{}).WithContext(ctx),
16014		autorest.AsJSON(),
16015		autorest.AsGet(),
16016		autorest.WithBaseURL(to.String(peclr.NextLink)))
16017}
16018
16019// PrivateEndpointConnectionListResultPage contains a page of PrivateEndpointConnection values.
16020type PrivateEndpointConnectionListResultPage struct {
16021	fn    func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error)
16022	peclr PrivateEndpointConnectionListResult
16023}
16024
16025// NextWithContext advances to the next page of values.  If there was an error making
16026// the request the page does not advance and the error is returned.
16027func (page *PrivateEndpointConnectionListResultPage) NextWithContext(ctx context.Context) (err error) {
16028	if tracing.IsEnabled() {
16029		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultPage.NextWithContext")
16030		defer func() {
16031			sc := -1
16032			if page.Response().Response.Response != nil {
16033				sc = page.Response().Response.Response.StatusCode
16034			}
16035			tracing.EndSpan(ctx, sc, err)
16036		}()
16037	}
16038	for {
16039		next, err := page.fn(ctx, page.peclr)
16040		if err != nil {
16041			return err
16042		}
16043		page.peclr = next
16044		if !next.hasNextLink() || !next.IsEmpty() {
16045			break
16046		}
16047	}
16048	return nil
16049}
16050
16051// Next advances to the next page of values.  If there was an error making
16052// the request the page does not advance and the error is returned.
16053// Deprecated: Use NextWithContext() instead.
16054func (page *PrivateEndpointConnectionListResultPage) Next() error {
16055	return page.NextWithContext(context.Background())
16056}
16057
16058// NotDone returns true if the page enumeration should be started or is not yet complete.
16059func (page PrivateEndpointConnectionListResultPage) NotDone() bool {
16060	return !page.peclr.IsEmpty()
16061}
16062
16063// Response returns the raw server response from the last page request.
16064func (page PrivateEndpointConnectionListResultPage) Response() PrivateEndpointConnectionListResult {
16065	return page.peclr
16066}
16067
16068// Values returns the slice of values for the current page or nil if there are no values.
16069func (page PrivateEndpointConnectionListResultPage) Values() []PrivateEndpointConnection {
16070	if page.peclr.IsEmpty() {
16071		return nil
16072	}
16073	return *page.peclr.Value
16074}
16075
16076// Creates a new instance of the PrivateEndpointConnectionListResultPage type.
16077func NewPrivateEndpointConnectionListResultPage(cur PrivateEndpointConnectionListResult, getNextPage func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error)) PrivateEndpointConnectionListResultPage {
16078	return PrivateEndpointConnectionListResultPage{
16079		fn:    getNextPage,
16080		peclr: cur,
16081	}
16082}
16083
16084// PrivateEndpointConnectionProperties properties of a private endpoint connection.
16085type PrivateEndpointConnectionProperties struct {
16086	// PrivateEndpoint - Private endpoint which the connection belongs to.
16087	PrivateEndpoint *PrivateEndpointProperty `json:"privateEndpoint,omitempty"`
16088	// PrivateLinkServiceConnectionState - Connection state of the private endpoint connection.
16089	PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionStateProperty `json:"privateLinkServiceConnectionState,omitempty"`
16090	// ProvisioningState - READ-ONLY; State of the private endpoint connection. Possible values include: 'PrivateEndpointProvisioningStateApproving', 'PrivateEndpointProvisioningStateReady', 'PrivateEndpointProvisioningStateDropping', 'PrivateEndpointProvisioningStateFailed', 'PrivateEndpointProvisioningStateRejecting'
16091	ProvisioningState PrivateEndpointProvisioningState `json:"provisioningState,omitempty"`
16092}
16093
16094// MarshalJSON is the custom marshaler for PrivateEndpointConnectionProperties.
16095func (pecp PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) {
16096	objectMap := make(map[string]interface{})
16097	if pecp.PrivateEndpoint != nil {
16098		objectMap["privateEndpoint"] = pecp.PrivateEndpoint
16099	}
16100	if pecp.PrivateLinkServiceConnectionState != nil {
16101		objectMap["privateLinkServiceConnectionState"] = pecp.PrivateLinkServiceConnectionState
16102	}
16103	return json.Marshal(objectMap)
16104}
16105
16106// PrivateEndpointConnectionRequestStatus contains the private endpoint connection requests status.
16107type PrivateEndpointConnectionRequestStatus struct {
16108	// PrivateLinkServiceID - READ-ONLY; Resource id for which the private endpoint is created.
16109	PrivateLinkServiceID *string `json:"privateLinkServiceId,omitempty"`
16110	// PrivateEndpointConnectionName - READ-ONLY; The connection name for the private endpoint.
16111	PrivateEndpointConnectionName *string `json:"privateEndpointConnectionName,omitempty"`
16112	// Status - READ-ONLY; Status of this private endpoint connection.
16113	Status *string `json:"status,omitempty"`
16114}
16115
16116// MarshalJSON is the custom marshaler for PrivateEndpointConnectionRequestStatus.
16117func (pecrs PrivateEndpointConnectionRequestStatus) MarshalJSON() ([]byte, error) {
16118	objectMap := make(map[string]interface{})
16119	return json.Marshal(objectMap)
16120}
16121
16122// PrivateEndpointConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results
16123// of a long-running operation.
16124type PrivateEndpointConnectionsCreateOrUpdateFuture struct {
16125	azure.FutureAPI
16126	// Result returns the result of the asynchronous operation.
16127	// If the operation has not completed it will return an error.
16128	Result func(PrivateEndpointConnectionsClient) (PrivateEndpointConnection, error)
16129}
16130
16131// UnmarshalJSON is the custom unmarshaller for CreateFuture.
16132func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
16133	var azFuture azure.Future
16134	if err := json.Unmarshal(body, &azFuture); err != nil {
16135		return err
16136	}
16137	future.FutureAPI = &azFuture
16138	future.Result = future.result
16139	return nil
16140}
16141
16142// result is the default implementation for PrivateEndpointConnectionsCreateOrUpdateFuture.Result.
16143func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) result(client PrivateEndpointConnectionsClient) (pec PrivateEndpointConnection, err error) {
16144	var done bool
16145	done, err = future.DoneWithContext(context.Background(), client)
16146	if err != nil {
16147		err = autorest.NewErrorWithError(err, "sql.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
16148		return
16149	}
16150	if !done {
16151		pec.Response.Response = future.Response()
16152		err = azure.NewAsyncOpIncompleteError("sql.PrivateEndpointConnectionsCreateOrUpdateFuture")
16153		return
16154	}
16155	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
16156	if pec.Response.Response, err = future.GetResult(sender); err == nil && pec.Response.Response.StatusCode != http.StatusNoContent {
16157		pec, err = client.CreateOrUpdateResponder(pec.Response.Response)
16158		if err != nil {
16159			err = autorest.NewErrorWithError(err, "sql.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", pec.Response.Response, "Failure responding to request")
16160		}
16161	}
16162	return
16163}
16164
16165// PrivateEndpointConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a
16166// long-running operation.
16167type PrivateEndpointConnectionsDeleteFuture struct {
16168	azure.FutureAPI
16169	// Result returns the result of the asynchronous operation.
16170	// If the operation has not completed it will return an error.
16171	Result func(PrivateEndpointConnectionsClient) (autorest.Response, error)
16172}
16173
16174// UnmarshalJSON is the custom unmarshaller for CreateFuture.
16175func (future *PrivateEndpointConnectionsDeleteFuture) UnmarshalJSON(body []byte) error {
16176	var azFuture azure.Future
16177	if err := json.Unmarshal(body, &azFuture); err != nil {
16178		return err
16179	}
16180	future.FutureAPI = &azFuture
16181	future.Result = future.result
16182	return nil
16183}
16184
16185// result is the default implementation for PrivateEndpointConnectionsDeleteFuture.Result.
16186func (future *PrivateEndpointConnectionsDeleteFuture) result(client PrivateEndpointConnectionsClient) (ar autorest.Response, err error) {
16187	var done bool
16188	done, err = future.DoneWithContext(context.Background(), client)
16189	if err != nil {
16190		err = autorest.NewErrorWithError(err, "sql.PrivateEndpointConnectionsDeleteFuture", "Result", future.Response(), "Polling failure")
16191		return
16192	}
16193	if !done {
16194		ar.Response = future.Response()
16195		err = azure.NewAsyncOpIncompleteError("sql.PrivateEndpointConnectionsDeleteFuture")
16196		return
16197	}
16198	ar.Response = future.Response()
16199	return
16200}
16201
16202// PrivateEndpointProperty ...
16203type PrivateEndpointProperty struct {
16204	// ID - Resource id of the private endpoint.
16205	ID *string `json:"id,omitempty"`
16206}
16207
16208// PrivateLinkResource a private link resource
16209type PrivateLinkResource struct {
16210	autorest.Response `json:"-"`
16211	// Properties - READ-ONLY; The private link resource group id.
16212	Properties *PrivateLinkResourceProperties `json:"properties,omitempty"`
16213	// ID - READ-ONLY; Resource ID.
16214	ID *string `json:"id,omitempty"`
16215	// Name - READ-ONLY; Resource name.
16216	Name *string `json:"name,omitempty"`
16217	// Type - READ-ONLY; Resource type.
16218	Type *string `json:"type,omitempty"`
16219}
16220
16221// MarshalJSON is the custom marshaler for PrivateLinkResource.
16222func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) {
16223	objectMap := make(map[string]interface{})
16224	return json.Marshal(objectMap)
16225}
16226
16227// PrivateLinkResourceListResult a list of private link resources
16228type PrivateLinkResourceListResult struct {
16229	autorest.Response `json:"-"`
16230	// Value - READ-ONLY; Array of results.
16231	Value *[]PrivateLinkResource `json:"value,omitempty"`
16232	// NextLink - READ-ONLY; Link to retrieve next page of results.
16233	NextLink *string `json:"nextLink,omitempty"`
16234}
16235
16236// MarshalJSON is the custom marshaler for PrivateLinkResourceListResult.
16237func (plrlr PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) {
16238	objectMap := make(map[string]interface{})
16239	return json.Marshal(objectMap)
16240}
16241
16242// PrivateLinkResourceListResultIterator provides access to a complete listing of PrivateLinkResource
16243// values.
16244type PrivateLinkResourceListResultIterator struct {
16245	i    int
16246	page PrivateLinkResourceListResultPage
16247}
16248
16249// NextWithContext advances to the next value.  If there was an error making
16250// the request the iterator does not advance and the error is returned.
16251func (iter *PrivateLinkResourceListResultIterator) NextWithContext(ctx context.Context) (err error) {
16252	if tracing.IsEnabled() {
16253		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourceListResultIterator.NextWithContext")
16254		defer func() {
16255			sc := -1
16256			if iter.Response().Response.Response != nil {
16257				sc = iter.Response().Response.Response.StatusCode
16258			}
16259			tracing.EndSpan(ctx, sc, err)
16260		}()
16261	}
16262	iter.i++
16263	if iter.i < len(iter.page.Values()) {
16264		return nil
16265	}
16266	err = iter.page.NextWithContext(ctx)
16267	if err != nil {
16268		iter.i--
16269		return err
16270	}
16271	iter.i = 0
16272	return nil
16273}
16274
16275// Next advances to the next value.  If there was an error making
16276// the request the iterator does not advance and the error is returned.
16277// Deprecated: Use NextWithContext() instead.
16278func (iter *PrivateLinkResourceListResultIterator) Next() error {
16279	return iter.NextWithContext(context.Background())
16280}
16281
16282// NotDone returns true if the enumeration should be started or is not yet complete.
16283func (iter PrivateLinkResourceListResultIterator) NotDone() bool {
16284	return iter.page.NotDone() && iter.i < len(iter.page.Values())
16285}
16286
16287// Response returns the raw server response from the last page request.
16288func (iter PrivateLinkResourceListResultIterator) Response() PrivateLinkResourceListResult {
16289	return iter.page.Response()
16290}
16291
16292// Value returns the current value or a zero-initialized value if the
16293// iterator has advanced beyond the end of the collection.
16294func (iter PrivateLinkResourceListResultIterator) Value() PrivateLinkResource {
16295	if !iter.page.NotDone() {
16296		return PrivateLinkResource{}
16297	}
16298	return iter.page.Values()[iter.i]
16299}
16300
16301// Creates a new instance of the PrivateLinkResourceListResultIterator type.
16302func NewPrivateLinkResourceListResultIterator(page PrivateLinkResourceListResultPage) PrivateLinkResourceListResultIterator {
16303	return PrivateLinkResourceListResultIterator{page: page}
16304}
16305
16306// IsEmpty returns true if the ListResult contains no values.
16307func (plrlr PrivateLinkResourceListResult) IsEmpty() bool {
16308	return plrlr.Value == nil || len(*plrlr.Value) == 0
16309}
16310
16311// hasNextLink returns true if the NextLink is not empty.
16312func (plrlr PrivateLinkResourceListResult) hasNextLink() bool {
16313	return plrlr.NextLink != nil && len(*plrlr.NextLink) != 0
16314}
16315
16316// privateLinkResourceListResultPreparer prepares a request to retrieve the next set of results.
16317// It returns nil if no more results exist.
16318func (plrlr PrivateLinkResourceListResult) privateLinkResourceListResultPreparer(ctx context.Context) (*http.Request, error) {
16319	if !plrlr.hasNextLink() {
16320		return nil, nil
16321	}
16322	return autorest.Prepare((&http.Request{}).WithContext(ctx),
16323		autorest.AsJSON(),
16324		autorest.AsGet(),
16325		autorest.WithBaseURL(to.String(plrlr.NextLink)))
16326}
16327
16328// PrivateLinkResourceListResultPage contains a page of PrivateLinkResource values.
16329type PrivateLinkResourceListResultPage struct {
16330	fn    func(context.Context, PrivateLinkResourceListResult) (PrivateLinkResourceListResult, error)
16331	plrlr PrivateLinkResourceListResult
16332}
16333
16334// NextWithContext advances to the next page of values.  If there was an error making
16335// the request the page does not advance and the error is returned.
16336func (page *PrivateLinkResourceListResultPage) NextWithContext(ctx context.Context) (err error) {
16337	if tracing.IsEnabled() {
16338		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourceListResultPage.NextWithContext")
16339		defer func() {
16340			sc := -1
16341			if page.Response().Response.Response != nil {
16342				sc = page.Response().Response.Response.StatusCode
16343			}
16344			tracing.EndSpan(ctx, sc, err)
16345		}()
16346	}
16347	for {
16348		next, err := page.fn(ctx, page.plrlr)
16349		if err != nil {
16350			return err
16351		}
16352		page.plrlr = next
16353		if !next.hasNextLink() || !next.IsEmpty() {
16354			break
16355		}
16356	}
16357	return nil
16358}
16359
16360// Next advances to the next page of values.  If there was an error making
16361// the request the page does not advance and the error is returned.
16362// Deprecated: Use NextWithContext() instead.
16363func (page *PrivateLinkResourceListResultPage) Next() error {
16364	return page.NextWithContext(context.Background())
16365}
16366
16367// NotDone returns true if the page enumeration should be started or is not yet complete.
16368func (page PrivateLinkResourceListResultPage) NotDone() bool {
16369	return !page.plrlr.IsEmpty()
16370}
16371
16372// Response returns the raw server response from the last page request.
16373func (page PrivateLinkResourceListResultPage) Response() PrivateLinkResourceListResult {
16374	return page.plrlr
16375}
16376
16377// Values returns the slice of values for the current page or nil if there are no values.
16378func (page PrivateLinkResourceListResultPage) Values() []PrivateLinkResource {
16379	if page.plrlr.IsEmpty() {
16380		return nil
16381	}
16382	return *page.plrlr.Value
16383}
16384
16385// Creates a new instance of the PrivateLinkResourceListResultPage type.
16386func NewPrivateLinkResourceListResultPage(cur PrivateLinkResourceListResult, getNextPage func(context.Context, PrivateLinkResourceListResult) (PrivateLinkResourceListResult, error)) PrivateLinkResourceListResultPage {
16387	return PrivateLinkResourceListResultPage{
16388		fn:    getNextPage,
16389		plrlr: cur,
16390	}
16391}
16392
16393// PrivateLinkResourceProperties properties of a private link resource.
16394type PrivateLinkResourceProperties struct {
16395	// GroupID - READ-ONLY; The private link resource group id.
16396	GroupID *string `json:"groupId,omitempty"`
16397	// RequiredMembers - READ-ONLY; The private link resource required member names.
16398	RequiredMembers *[]string `json:"requiredMembers,omitempty"`
16399}
16400
16401// MarshalJSON is the custom marshaler for PrivateLinkResourceProperties.
16402func (plrp PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) {
16403	objectMap := make(map[string]interface{})
16404	return json.Marshal(objectMap)
16405}
16406
16407// PrivateLinkServiceConnectionStateProperty ...
16408type PrivateLinkServiceConnectionStateProperty struct {
16409	// Status - The private link service connection status. Possible values include: 'Approved', 'Pending', 'Rejected', 'Disconnected'
16410	Status PrivateLinkServiceConnectionStateStatus `json:"status,omitempty"`
16411	// Description - The private link service connection description.
16412	Description *string `json:"description,omitempty"`
16413	// ActionsRequired - READ-ONLY; The actions required for private link service connection. Possible values include: 'PrivateLinkServiceConnectionStateActionsRequireNone'
16414	ActionsRequired PrivateLinkServiceConnectionStateActionsRequire `json:"actionsRequired,omitempty"`
16415}
16416
16417// MarshalJSON is the custom marshaler for PrivateLinkServiceConnectionStateProperty.
16418func (plscsp PrivateLinkServiceConnectionStateProperty) MarshalJSON() ([]byte, error) {
16419	objectMap := make(map[string]interface{})
16420	if plscsp.Status != "" {
16421		objectMap["status"] = plscsp.Status
16422	}
16423	if plscsp.Description != nil {
16424		objectMap["description"] = plscsp.Description
16425	}
16426	return json.Marshal(objectMap)
16427}
16428
16429// ProxyResource ARM proxy resource.
16430type ProxyResource struct {
16431	// ID - READ-ONLY; Resource ID.
16432	ID *string `json:"id,omitempty"`
16433	// Name - READ-ONLY; Resource name.
16434	Name *string `json:"name,omitempty"`
16435	// Type - READ-ONLY; Resource type.
16436	Type *string `json:"type,omitempty"`
16437}
16438
16439// MarshalJSON is the custom marshaler for ProxyResource.
16440func (pr ProxyResource) MarshalJSON() ([]byte, error) {
16441	objectMap := make(map[string]interface{})
16442	return json.Marshal(objectMap)
16443}
16444
16445// ReadScaleCapability the read scale capability.
16446type ReadScaleCapability struct {
16447	// MaxNumberOfReplicas - READ-ONLY; The maximum number of read scale replicas.
16448	MaxNumberOfReplicas *int32 `json:"maxNumberOfReplicas,omitempty"`
16449	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
16450	Status CapabilityStatus `json:"status,omitempty"`
16451	// Reason - The reason for the capability not being available.
16452	Reason *string `json:"reason,omitempty"`
16453}
16454
16455// MarshalJSON is the custom marshaler for ReadScaleCapability.
16456func (rsc ReadScaleCapability) MarshalJSON() ([]byte, error) {
16457	objectMap := make(map[string]interface{})
16458	if rsc.Reason != nil {
16459		objectMap["reason"] = rsc.Reason
16460	}
16461	return json.Marshal(objectMap)
16462}
16463
16464// RecommendedElasticPool represents a recommended elastic pool.
16465type RecommendedElasticPool struct {
16466	autorest.Response `json:"-"`
16467	// RecommendedElasticPoolProperties - The properties representing the resource.
16468	*RecommendedElasticPoolProperties `json:"properties,omitempty"`
16469	// ID - READ-ONLY; Resource ID.
16470	ID *string `json:"id,omitempty"`
16471	// Name - READ-ONLY; Resource name.
16472	Name *string `json:"name,omitempty"`
16473	// Type - READ-ONLY; Resource type.
16474	Type *string `json:"type,omitempty"`
16475}
16476
16477// MarshalJSON is the custom marshaler for RecommendedElasticPool.
16478func (rep RecommendedElasticPool) MarshalJSON() ([]byte, error) {
16479	objectMap := make(map[string]interface{})
16480	if rep.RecommendedElasticPoolProperties != nil {
16481		objectMap["properties"] = rep.RecommendedElasticPoolProperties
16482	}
16483	return json.Marshal(objectMap)
16484}
16485
16486// UnmarshalJSON is the custom unmarshaler for RecommendedElasticPool struct.
16487func (rep *RecommendedElasticPool) UnmarshalJSON(body []byte) error {
16488	var m map[string]*json.RawMessage
16489	err := json.Unmarshal(body, &m)
16490	if err != nil {
16491		return err
16492	}
16493	for k, v := range m {
16494		switch k {
16495		case "properties":
16496			if v != nil {
16497				var recommendedElasticPoolProperties RecommendedElasticPoolProperties
16498				err = json.Unmarshal(*v, &recommendedElasticPoolProperties)
16499				if err != nil {
16500					return err
16501				}
16502				rep.RecommendedElasticPoolProperties = &recommendedElasticPoolProperties
16503			}
16504		case "id":
16505			if v != nil {
16506				var ID string
16507				err = json.Unmarshal(*v, &ID)
16508				if err != nil {
16509					return err
16510				}
16511				rep.ID = &ID
16512			}
16513		case "name":
16514			if v != nil {
16515				var name string
16516				err = json.Unmarshal(*v, &name)
16517				if err != nil {
16518					return err
16519				}
16520				rep.Name = &name
16521			}
16522		case "type":
16523			if v != nil {
16524				var typeVar string
16525				err = json.Unmarshal(*v, &typeVar)
16526				if err != nil {
16527					return err
16528				}
16529				rep.Type = &typeVar
16530			}
16531		}
16532	}
16533
16534	return nil
16535}
16536
16537// RecommendedElasticPoolListMetricsResult represents the response to a list recommended elastic pool
16538// metrics request.
16539type RecommendedElasticPoolListMetricsResult struct {
16540	autorest.Response `json:"-"`
16541	// Value - The list of recommended elastic pools metrics.
16542	Value *[]RecommendedElasticPoolMetric `json:"value,omitempty"`
16543}
16544
16545// RecommendedElasticPoolListResult represents the response to a list recommended elastic pool request.
16546type RecommendedElasticPoolListResult struct {
16547	autorest.Response `json:"-"`
16548	// Value - The list of recommended elastic pools hosted in the server.
16549	Value *[]RecommendedElasticPool `json:"value,omitempty"`
16550}
16551
16552// RecommendedElasticPoolMetric represents recommended elastic pool metric.
16553type RecommendedElasticPoolMetric struct {
16554	// DateTime - The time of metric (ISO8601 format).
16555	DateTime *date.Time `json:"dateTime,omitempty"`
16556	// Dtu - Gets or sets the DTUs (Database Transaction Units). See https://azure.microsoft.com/documentation/articles/sql-database-what-is-a-dtu/
16557	Dtu *float64 `json:"dtu,omitempty"`
16558	// SizeGB - Gets or sets size in gigabytes.
16559	SizeGB *float64 `json:"sizeGB,omitempty"`
16560}
16561
16562// RecommendedElasticPoolProperties represents the properties of a recommended elastic pool.
16563type RecommendedElasticPoolProperties struct {
16564	// DatabaseEdition - READ-ONLY; The edition of the recommended elastic pool. The ElasticPoolEdition enumeration contains all the valid editions. Possible values include: 'Basic', 'Standard', 'Premium', 'GeneralPurpose', 'BusinessCritical'
16565	DatabaseEdition ElasticPoolEdition `json:"databaseEdition,omitempty"`
16566	// Dtu - The DTU for the recommended elastic pool.
16567	Dtu *float64 `json:"dtu,omitempty"`
16568	// DatabaseDtuMin - The minimum DTU for the database.
16569	DatabaseDtuMin *float64 `json:"databaseDtuMin,omitempty"`
16570	// DatabaseDtuMax - The maximum DTU for the database.
16571	DatabaseDtuMax *float64 `json:"databaseDtuMax,omitempty"`
16572	// StorageMB - Gets storage size in megabytes.
16573	StorageMB *float64 `json:"storageMB,omitempty"`
16574	// ObservationPeriodStart - READ-ONLY; The observation period start (ISO8601 format).
16575	ObservationPeriodStart *date.Time `json:"observationPeriodStart,omitempty"`
16576	// ObservationPeriodEnd - READ-ONLY; The observation period start (ISO8601 format).
16577	ObservationPeriodEnd *date.Time `json:"observationPeriodEnd,omitempty"`
16578	// MaxObservedDtu - READ-ONLY; Gets maximum observed DTU.
16579	MaxObservedDtu *float64 `json:"maxObservedDtu,omitempty"`
16580	// MaxObservedStorageMB - READ-ONLY; Gets maximum observed storage in megabytes.
16581	MaxObservedStorageMB *float64 `json:"maxObservedStorageMB,omitempty"`
16582	// Databases - READ-ONLY; The list of databases in this pool. Expanded property
16583	Databases *[]TrackedResource `json:"databases,omitempty"`
16584	// Metrics - READ-ONLY; The list of databases housed in the server. Expanded property
16585	Metrics *[]RecommendedElasticPoolMetric `json:"metrics,omitempty"`
16586}
16587
16588// MarshalJSON is the custom marshaler for RecommendedElasticPoolProperties.
16589func (repp RecommendedElasticPoolProperties) MarshalJSON() ([]byte, error) {
16590	objectMap := make(map[string]interface{})
16591	if repp.Dtu != nil {
16592		objectMap["dtu"] = repp.Dtu
16593	}
16594	if repp.DatabaseDtuMin != nil {
16595		objectMap["databaseDtuMin"] = repp.DatabaseDtuMin
16596	}
16597	if repp.DatabaseDtuMax != nil {
16598		objectMap["databaseDtuMax"] = repp.DatabaseDtuMax
16599	}
16600	if repp.StorageMB != nil {
16601		objectMap["storageMB"] = repp.StorageMB
16602	}
16603	return json.Marshal(objectMap)
16604}
16605
16606// RecommendedIndex represents a database recommended index.
16607type RecommendedIndex struct {
16608	// RecommendedIndexProperties - READ-ONLY; The properties representing the resource.
16609	*RecommendedIndexProperties `json:"properties,omitempty"`
16610	// ID - READ-ONLY; Resource ID.
16611	ID *string `json:"id,omitempty"`
16612	// Name - READ-ONLY; Resource name.
16613	Name *string `json:"name,omitempty"`
16614	// Type - READ-ONLY; Resource type.
16615	Type *string `json:"type,omitempty"`
16616}
16617
16618// MarshalJSON is the custom marshaler for RecommendedIndex.
16619func (ri RecommendedIndex) MarshalJSON() ([]byte, error) {
16620	objectMap := make(map[string]interface{})
16621	return json.Marshal(objectMap)
16622}
16623
16624// UnmarshalJSON is the custom unmarshaler for RecommendedIndex struct.
16625func (ri *RecommendedIndex) UnmarshalJSON(body []byte) error {
16626	var m map[string]*json.RawMessage
16627	err := json.Unmarshal(body, &m)
16628	if err != nil {
16629		return err
16630	}
16631	for k, v := range m {
16632		switch k {
16633		case "properties":
16634			if v != nil {
16635				var recommendedIndexProperties RecommendedIndexProperties
16636				err = json.Unmarshal(*v, &recommendedIndexProperties)
16637				if err != nil {
16638					return err
16639				}
16640				ri.RecommendedIndexProperties = &recommendedIndexProperties
16641			}
16642		case "id":
16643			if v != nil {
16644				var ID string
16645				err = json.Unmarshal(*v, &ID)
16646				if err != nil {
16647					return err
16648				}
16649				ri.ID = &ID
16650			}
16651		case "name":
16652			if v != nil {
16653				var name string
16654				err = json.Unmarshal(*v, &name)
16655				if err != nil {
16656					return err
16657				}
16658				ri.Name = &name
16659			}
16660		case "type":
16661			if v != nil {
16662				var typeVar string
16663				err = json.Unmarshal(*v, &typeVar)
16664				if err != nil {
16665					return err
16666				}
16667				ri.Type = &typeVar
16668			}
16669		}
16670	}
16671
16672	return nil
16673}
16674
16675// RecommendedIndexProperties represents the properties of a database recommended index.
16676type RecommendedIndexProperties struct {
16677	// Action - READ-ONLY; The proposed index action. You can create a missing index, drop an unused index, or rebuild an existing index to improve its performance. Possible values include: 'Create', 'Drop', 'Rebuild'
16678	Action RecommendedIndexAction `json:"action,omitempty"`
16679	// State - READ-ONLY; The current recommendation state. Possible values include: 'RecommendedIndexStateActive', 'RecommendedIndexStatePending', 'RecommendedIndexStateExecuting', 'RecommendedIndexStateVerifying', 'RecommendedIndexStatePendingRevert', 'RecommendedIndexStateReverting', 'RecommendedIndexStateReverted', 'RecommendedIndexStateIgnored', 'RecommendedIndexStateExpired', 'RecommendedIndexStateBlocked', 'RecommendedIndexStateSuccess'
16680	State RecommendedIndexState `json:"state,omitempty"`
16681	// Created - READ-ONLY; The UTC datetime showing when this resource was created (ISO8601 format).
16682	Created *date.Time `json:"created,omitempty"`
16683	// LastModified - READ-ONLY; The UTC datetime of when was this resource last changed (ISO8601 format).
16684	LastModified *date.Time `json:"lastModified,omitempty"`
16685	// IndexType - READ-ONLY; The type of index (CLUSTERED, NONCLUSTERED, COLUMNSTORE, CLUSTERED COLUMNSTORE). Possible values include: 'CLUSTERED', 'NONCLUSTERED', 'COLUMNSTORE', 'CLUSTEREDCOLUMNSTORE'
16686	IndexType RecommendedIndexType `json:"indexType,omitempty"`
16687	// Schema - READ-ONLY; The schema where table to build index over resides
16688	Schema *string `json:"schema,omitempty"`
16689	// Table - READ-ONLY; The table on which to build index.
16690	Table *string `json:"table,omitempty"`
16691	// Columns - READ-ONLY; Columns over which to build index
16692	Columns *[]string `json:"columns,omitempty"`
16693	// IncludedColumns - READ-ONLY; The list of column names to be included in the index
16694	IncludedColumns *[]string `json:"includedColumns,omitempty"`
16695	// IndexScript - READ-ONLY; The full build index script
16696	IndexScript *string `json:"indexScript,omitempty"`
16697	// EstimatedImpact - READ-ONLY; The estimated impact of doing recommended index action.
16698	EstimatedImpact *[]OperationImpact `json:"estimatedImpact,omitempty"`
16699	// ReportedImpact - READ-ONLY; The values reported after index action is complete.
16700	ReportedImpact *[]OperationImpact `json:"reportedImpact,omitempty"`
16701}
16702
16703// MarshalJSON is the custom marshaler for RecommendedIndexProperties.
16704func (rip RecommendedIndexProperties) MarshalJSON() ([]byte, error) {
16705	objectMap := make(map[string]interface{})
16706	return json.Marshal(objectMap)
16707}
16708
16709// RecoverableDatabase a recoverable database
16710type RecoverableDatabase struct {
16711	autorest.Response `json:"-"`
16712	// RecoverableDatabaseProperties - The properties of a recoverable database
16713	*RecoverableDatabaseProperties `json:"properties,omitempty"`
16714	// ID - READ-ONLY; Resource ID.
16715	ID *string `json:"id,omitempty"`
16716	// Name - READ-ONLY; Resource name.
16717	Name *string `json:"name,omitempty"`
16718	// Type - READ-ONLY; Resource type.
16719	Type *string `json:"type,omitempty"`
16720}
16721
16722// MarshalJSON is the custom marshaler for RecoverableDatabase.
16723func (rd RecoverableDatabase) MarshalJSON() ([]byte, error) {
16724	objectMap := make(map[string]interface{})
16725	if rd.RecoverableDatabaseProperties != nil {
16726		objectMap["properties"] = rd.RecoverableDatabaseProperties
16727	}
16728	return json.Marshal(objectMap)
16729}
16730
16731// UnmarshalJSON is the custom unmarshaler for RecoverableDatabase struct.
16732func (rd *RecoverableDatabase) UnmarshalJSON(body []byte) error {
16733	var m map[string]*json.RawMessage
16734	err := json.Unmarshal(body, &m)
16735	if err != nil {
16736		return err
16737	}
16738	for k, v := range m {
16739		switch k {
16740		case "properties":
16741			if v != nil {
16742				var recoverableDatabaseProperties RecoverableDatabaseProperties
16743				err = json.Unmarshal(*v, &recoverableDatabaseProperties)
16744				if err != nil {
16745					return err
16746				}
16747				rd.RecoverableDatabaseProperties = &recoverableDatabaseProperties
16748			}
16749		case "id":
16750			if v != nil {
16751				var ID string
16752				err = json.Unmarshal(*v, &ID)
16753				if err != nil {
16754					return err
16755				}
16756				rd.ID = &ID
16757			}
16758		case "name":
16759			if v != nil {
16760				var name string
16761				err = json.Unmarshal(*v, &name)
16762				if err != nil {
16763					return err
16764				}
16765				rd.Name = &name
16766			}
16767		case "type":
16768			if v != nil {
16769				var typeVar string
16770				err = json.Unmarshal(*v, &typeVar)
16771				if err != nil {
16772					return err
16773				}
16774				rd.Type = &typeVar
16775			}
16776		}
16777	}
16778
16779	return nil
16780}
16781
16782// RecoverableDatabaseListResult the response to a list recoverable databases request
16783type RecoverableDatabaseListResult struct {
16784	autorest.Response `json:"-"`
16785	// Value - A list of recoverable databases
16786	Value *[]RecoverableDatabase `json:"value,omitempty"`
16787}
16788
16789// RecoverableDatabaseProperties the properties of a recoverable database
16790type RecoverableDatabaseProperties struct {
16791	// Edition - READ-ONLY; The edition of the database
16792	Edition *string `json:"edition,omitempty"`
16793	// ServiceLevelObjective - READ-ONLY; The service level objective name of the database
16794	ServiceLevelObjective *string `json:"serviceLevelObjective,omitempty"`
16795	// ElasticPoolName - READ-ONLY; The elastic pool name of the database
16796	ElasticPoolName *string `json:"elasticPoolName,omitempty"`
16797	// LastAvailableBackupDate - READ-ONLY; The last available backup date of the database (ISO8601 format)
16798	LastAvailableBackupDate *date.Time `json:"lastAvailableBackupDate,omitempty"`
16799}
16800
16801// MarshalJSON is the custom marshaler for RecoverableDatabaseProperties.
16802func (rdp RecoverableDatabaseProperties) MarshalJSON() ([]byte, error) {
16803	objectMap := make(map[string]interface{})
16804	return json.Marshal(objectMap)
16805}
16806
16807// RecoverableManagedDatabase a recoverable managed database resource.
16808type RecoverableManagedDatabase struct {
16809	autorest.Response `json:"-"`
16810	// RecoverableManagedDatabaseProperties - Resource properties.
16811	*RecoverableManagedDatabaseProperties `json:"properties,omitempty"`
16812	// ID - READ-ONLY; Resource ID.
16813	ID *string `json:"id,omitempty"`
16814	// Name - READ-ONLY; Resource name.
16815	Name *string `json:"name,omitempty"`
16816	// Type - READ-ONLY; Resource type.
16817	Type *string `json:"type,omitempty"`
16818}
16819
16820// MarshalJSON is the custom marshaler for RecoverableManagedDatabase.
16821func (rmd RecoverableManagedDatabase) MarshalJSON() ([]byte, error) {
16822	objectMap := make(map[string]interface{})
16823	if rmd.RecoverableManagedDatabaseProperties != nil {
16824		objectMap["properties"] = rmd.RecoverableManagedDatabaseProperties
16825	}
16826	return json.Marshal(objectMap)
16827}
16828
16829// UnmarshalJSON is the custom unmarshaler for RecoverableManagedDatabase struct.
16830func (rmd *RecoverableManagedDatabase) UnmarshalJSON(body []byte) error {
16831	var m map[string]*json.RawMessage
16832	err := json.Unmarshal(body, &m)
16833	if err != nil {
16834		return err
16835	}
16836	for k, v := range m {
16837		switch k {
16838		case "properties":
16839			if v != nil {
16840				var recoverableManagedDatabaseProperties RecoverableManagedDatabaseProperties
16841				err = json.Unmarshal(*v, &recoverableManagedDatabaseProperties)
16842				if err != nil {
16843					return err
16844				}
16845				rmd.RecoverableManagedDatabaseProperties = &recoverableManagedDatabaseProperties
16846			}
16847		case "id":
16848			if v != nil {
16849				var ID string
16850				err = json.Unmarshal(*v, &ID)
16851				if err != nil {
16852					return err
16853				}
16854				rmd.ID = &ID
16855			}
16856		case "name":
16857			if v != nil {
16858				var name string
16859				err = json.Unmarshal(*v, &name)
16860				if err != nil {
16861					return err
16862				}
16863				rmd.Name = &name
16864			}
16865		case "type":
16866			if v != nil {
16867				var typeVar string
16868				err = json.Unmarshal(*v, &typeVar)
16869				if err != nil {
16870					return err
16871				}
16872				rmd.Type = &typeVar
16873			}
16874		}
16875	}
16876
16877	return nil
16878}
16879
16880// RecoverableManagedDatabaseListResult a list of recoverable managed databases.
16881type RecoverableManagedDatabaseListResult struct {
16882	autorest.Response `json:"-"`
16883	// Value - READ-ONLY; Array of results.
16884	Value *[]RecoverableManagedDatabase `json:"value,omitempty"`
16885	// NextLink - READ-ONLY; Link to retrieve next page of results.
16886	NextLink *string `json:"nextLink,omitempty"`
16887}
16888
16889// MarshalJSON is the custom marshaler for RecoverableManagedDatabaseListResult.
16890func (rmdlr RecoverableManagedDatabaseListResult) MarshalJSON() ([]byte, error) {
16891	objectMap := make(map[string]interface{})
16892	return json.Marshal(objectMap)
16893}
16894
16895// RecoverableManagedDatabaseListResultIterator provides access to a complete listing of
16896// RecoverableManagedDatabase values.
16897type RecoverableManagedDatabaseListResultIterator struct {
16898	i    int
16899	page RecoverableManagedDatabaseListResultPage
16900}
16901
16902// NextWithContext advances to the next value.  If there was an error making
16903// the request the iterator does not advance and the error is returned.
16904func (iter *RecoverableManagedDatabaseListResultIterator) NextWithContext(ctx context.Context) (err error) {
16905	if tracing.IsEnabled() {
16906		ctx = tracing.StartSpan(ctx, fqdn+"/RecoverableManagedDatabaseListResultIterator.NextWithContext")
16907		defer func() {
16908			sc := -1
16909			if iter.Response().Response.Response != nil {
16910				sc = iter.Response().Response.Response.StatusCode
16911			}
16912			tracing.EndSpan(ctx, sc, err)
16913		}()
16914	}
16915	iter.i++
16916	if iter.i < len(iter.page.Values()) {
16917		return nil
16918	}
16919	err = iter.page.NextWithContext(ctx)
16920	if err != nil {
16921		iter.i--
16922		return err
16923	}
16924	iter.i = 0
16925	return nil
16926}
16927
16928// Next advances to the next value.  If there was an error making
16929// the request the iterator does not advance and the error is returned.
16930// Deprecated: Use NextWithContext() instead.
16931func (iter *RecoverableManagedDatabaseListResultIterator) Next() error {
16932	return iter.NextWithContext(context.Background())
16933}
16934
16935// NotDone returns true if the enumeration should be started or is not yet complete.
16936func (iter RecoverableManagedDatabaseListResultIterator) NotDone() bool {
16937	return iter.page.NotDone() && iter.i < len(iter.page.Values())
16938}
16939
16940// Response returns the raw server response from the last page request.
16941func (iter RecoverableManagedDatabaseListResultIterator) Response() RecoverableManagedDatabaseListResult {
16942	return iter.page.Response()
16943}
16944
16945// Value returns the current value or a zero-initialized value if the
16946// iterator has advanced beyond the end of the collection.
16947func (iter RecoverableManagedDatabaseListResultIterator) Value() RecoverableManagedDatabase {
16948	if !iter.page.NotDone() {
16949		return RecoverableManagedDatabase{}
16950	}
16951	return iter.page.Values()[iter.i]
16952}
16953
16954// Creates a new instance of the RecoverableManagedDatabaseListResultIterator type.
16955func NewRecoverableManagedDatabaseListResultIterator(page RecoverableManagedDatabaseListResultPage) RecoverableManagedDatabaseListResultIterator {
16956	return RecoverableManagedDatabaseListResultIterator{page: page}
16957}
16958
16959// IsEmpty returns true if the ListResult contains no values.
16960func (rmdlr RecoverableManagedDatabaseListResult) IsEmpty() bool {
16961	return rmdlr.Value == nil || len(*rmdlr.Value) == 0
16962}
16963
16964// hasNextLink returns true if the NextLink is not empty.
16965func (rmdlr RecoverableManagedDatabaseListResult) hasNextLink() bool {
16966	return rmdlr.NextLink != nil && len(*rmdlr.NextLink) != 0
16967}
16968
16969// recoverableManagedDatabaseListResultPreparer prepares a request to retrieve the next set of results.
16970// It returns nil if no more results exist.
16971func (rmdlr RecoverableManagedDatabaseListResult) recoverableManagedDatabaseListResultPreparer(ctx context.Context) (*http.Request, error) {
16972	if !rmdlr.hasNextLink() {
16973		return nil, nil
16974	}
16975	return autorest.Prepare((&http.Request{}).WithContext(ctx),
16976		autorest.AsJSON(),
16977		autorest.AsGet(),
16978		autorest.WithBaseURL(to.String(rmdlr.NextLink)))
16979}
16980
16981// RecoverableManagedDatabaseListResultPage contains a page of RecoverableManagedDatabase values.
16982type RecoverableManagedDatabaseListResultPage struct {
16983	fn    func(context.Context, RecoverableManagedDatabaseListResult) (RecoverableManagedDatabaseListResult, error)
16984	rmdlr RecoverableManagedDatabaseListResult
16985}
16986
16987// NextWithContext advances to the next page of values.  If there was an error making
16988// the request the page does not advance and the error is returned.
16989func (page *RecoverableManagedDatabaseListResultPage) NextWithContext(ctx context.Context) (err error) {
16990	if tracing.IsEnabled() {
16991		ctx = tracing.StartSpan(ctx, fqdn+"/RecoverableManagedDatabaseListResultPage.NextWithContext")
16992		defer func() {
16993			sc := -1
16994			if page.Response().Response.Response != nil {
16995				sc = page.Response().Response.Response.StatusCode
16996			}
16997			tracing.EndSpan(ctx, sc, err)
16998		}()
16999	}
17000	for {
17001		next, err := page.fn(ctx, page.rmdlr)
17002		if err != nil {
17003			return err
17004		}
17005		page.rmdlr = next
17006		if !next.hasNextLink() || !next.IsEmpty() {
17007			break
17008		}
17009	}
17010	return nil
17011}
17012
17013// Next advances to the next page of values.  If there was an error making
17014// the request the page does not advance and the error is returned.
17015// Deprecated: Use NextWithContext() instead.
17016func (page *RecoverableManagedDatabaseListResultPage) Next() error {
17017	return page.NextWithContext(context.Background())
17018}
17019
17020// NotDone returns true if the page enumeration should be started or is not yet complete.
17021func (page RecoverableManagedDatabaseListResultPage) NotDone() bool {
17022	return !page.rmdlr.IsEmpty()
17023}
17024
17025// Response returns the raw server response from the last page request.
17026func (page RecoverableManagedDatabaseListResultPage) Response() RecoverableManagedDatabaseListResult {
17027	return page.rmdlr
17028}
17029
17030// Values returns the slice of values for the current page or nil if there are no values.
17031func (page RecoverableManagedDatabaseListResultPage) Values() []RecoverableManagedDatabase {
17032	if page.rmdlr.IsEmpty() {
17033		return nil
17034	}
17035	return *page.rmdlr.Value
17036}
17037
17038// Creates a new instance of the RecoverableManagedDatabaseListResultPage type.
17039func NewRecoverableManagedDatabaseListResultPage(cur RecoverableManagedDatabaseListResult, getNextPage func(context.Context, RecoverableManagedDatabaseListResult) (RecoverableManagedDatabaseListResult, error)) RecoverableManagedDatabaseListResultPage {
17040	return RecoverableManagedDatabaseListResultPage{
17041		fn:    getNextPage,
17042		rmdlr: cur,
17043	}
17044}
17045
17046// RecoverableManagedDatabaseProperties the recoverable managed database's properties.
17047type RecoverableManagedDatabaseProperties struct {
17048	// LastAvailableBackupDate - READ-ONLY; The last available backup date.
17049	LastAvailableBackupDate *string `json:"lastAvailableBackupDate,omitempty"`
17050}
17051
17052// MarshalJSON is the custom marshaler for RecoverableManagedDatabaseProperties.
17053func (rmdp RecoverableManagedDatabaseProperties) MarshalJSON() ([]byte, error) {
17054	objectMap := make(map[string]interface{})
17055	return json.Marshal(objectMap)
17056}
17057
17058// ReplicationLink represents a database replication link.
17059type ReplicationLink struct {
17060	autorest.Response `json:"-"`
17061	// Location - READ-ONLY; Location of the server that contains this firewall rule.
17062	Location *string `json:"location,omitempty"`
17063	// ReplicationLinkProperties - The properties representing the resource.
17064	*ReplicationLinkProperties `json:"properties,omitempty"`
17065	// ID - READ-ONLY; Resource ID.
17066	ID *string `json:"id,omitempty"`
17067	// Name - READ-ONLY; Resource name.
17068	Name *string `json:"name,omitempty"`
17069	// Type - READ-ONLY; Resource type.
17070	Type *string `json:"type,omitempty"`
17071}
17072
17073// MarshalJSON is the custom marshaler for ReplicationLink.
17074func (rl ReplicationLink) MarshalJSON() ([]byte, error) {
17075	objectMap := make(map[string]interface{})
17076	if rl.ReplicationLinkProperties != nil {
17077		objectMap["properties"] = rl.ReplicationLinkProperties
17078	}
17079	return json.Marshal(objectMap)
17080}
17081
17082// UnmarshalJSON is the custom unmarshaler for ReplicationLink struct.
17083func (rl *ReplicationLink) UnmarshalJSON(body []byte) error {
17084	var m map[string]*json.RawMessage
17085	err := json.Unmarshal(body, &m)
17086	if err != nil {
17087		return err
17088	}
17089	for k, v := range m {
17090		switch k {
17091		case "location":
17092			if v != nil {
17093				var location string
17094				err = json.Unmarshal(*v, &location)
17095				if err != nil {
17096					return err
17097				}
17098				rl.Location = &location
17099			}
17100		case "properties":
17101			if v != nil {
17102				var replicationLinkProperties ReplicationLinkProperties
17103				err = json.Unmarshal(*v, &replicationLinkProperties)
17104				if err != nil {
17105					return err
17106				}
17107				rl.ReplicationLinkProperties = &replicationLinkProperties
17108			}
17109		case "id":
17110			if v != nil {
17111				var ID string
17112				err = json.Unmarshal(*v, &ID)
17113				if err != nil {
17114					return err
17115				}
17116				rl.ID = &ID
17117			}
17118		case "name":
17119			if v != nil {
17120				var name string
17121				err = json.Unmarshal(*v, &name)
17122				if err != nil {
17123					return err
17124				}
17125				rl.Name = &name
17126			}
17127		case "type":
17128			if v != nil {
17129				var typeVar string
17130				err = json.Unmarshal(*v, &typeVar)
17131				if err != nil {
17132					return err
17133				}
17134				rl.Type = &typeVar
17135			}
17136		}
17137	}
17138
17139	return nil
17140}
17141
17142// ReplicationLinkListResult represents the response to a List database replication link request.
17143type ReplicationLinkListResult struct {
17144	autorest.Response `json:"-"`
17145	// Value - The list of database replication links housed in the database.
17146	Value *[]ReplicationLink `json:"value,omitempty"`
17147}
17148
17149// ReplicationLinkProperties represents the properties of a database replication link.
17150type ReplicationLinkProperties struct {
17151	// IsTerminationAllowed - READ-ONLY; Legacy value indicating whether termination is allowed.  Currently always returns true.
17152	IsTerminationAllowed *bool `json:"isTerminationAllowed,omitempty"`
17153	// ReplicationMode - READ-ONLY; Replication mode of this replication link.
17154	ReplicationMode *string `json:"replicationMode,omitempty"`
17155	// PartnerServer - READ-ONLY; The name of the server hosting the partner database.
17156	PartnerServer *string `json:"partnerServer,omitempty"`
17157	// PartnerDatabase - READ-ONLY; The name of the partner database.
17158	PartnerDatabase *string `json:"partnerDatabase,omitempty"`
17159	// PartnerLocation - READ-ONLY; The Azure Region of the partner database.
17160	PartnerLocation *string `json:"partnerLocation,omitempty"`
17161	// Role - READ-ONLY; The role of the database in the replication link. Possible values include: 'ReplicationRolePrimary', 'ReplicationRoleSecondary', 'ReplicationRoleNonReadableSecondary', 'ReplicationRoleSource', 'ReplicationRoleCopy'
17162	Role ReplicationRole `json:"role,omitempty"`
17163	// PartnerRole - READ-ONLY; The role of the partner database in the replication link. Possible values include: 'ReplicationRolePrimary', 'ReplicationRoleSecondary', 'ReplicationRoleNonReadableSecondary', 'ReplicationRoleSource', 'ReplicationRoleCopy'
17164	PartnerRole ReplicationRole `json:"partnerRole,omitempty"`
17165	// StartTime - READ-ONLY; The start time for the replication link.
17166	StartTime *date.Time `json:"startTime,omitempty"`
17167	// PercentComplete - READ-ONLY; The percentage of seeding complete for the replication link.
17168	PercentComplete *int32 `json:"percentComplete,omitempty"`
17169	// ReplicationState - READ-ONLY; The replication state for the replication link. Possible values include: 'PENDING', 'SEEDING', 'CATCHUP', 'SUSPENDED'
17170	ReplicationState ReplicationState `json:"replicationState,omitempty"`
17171}
17172
17173// MarshalJSON is the custom marshaler for ReplicationLinkProperties.
17174func (rlp ReplicationLinkProperties) MarshalJSON() ([]byte, error) {
17175	objectMap := make(map[string]interface{})
17176	return json.Marshal(objectMap)
17177}
17178
17179// ReplicationLinksFailoverAllowDataLossFuture an abstraction for monitoring and retrieving the results of
17180// a long-running operation.
17181type ReplicationLinksFailoverAllowDataLossFuture struct {
17182	azure.FutureAPI
17183	// Result returns the result of the asynchronous operation.
17184	// If the operation has not completed it will return an error.
17185	Result func(ReplicationLinksClient) (autorest.Response, error)
17186}
17187
17188// UnmarshalJSON is the custom unmarshaller for CreateFuture.
17189func (future *ReplicationLinksFailoverAllowDataLossFuture) UnmarshalJSON(body []byte) error {
17190	var azFuture azure.Future
17191	if err := json.Unmarshal(body, &azFuture); err != nil {
17192		return err
17193	}
17194	future.FutureAPI = &azFuture
17195	future.Result = future.result
17196	return nil
17197}
17198
17199// result is the default implementation for ReplicationLinksFailoverAllowDataLossFuture.Result.
17200func (future *ReplicationLinksFailoverAllowDataLossFuture) result(client ReplicationLinksClient) (ar autorest.Response, err error) {
17201	var done bool
17202	done, err = future.DoneWithContext(context.Background(), client)
17203	if err != nil {
17204		err = autorest.NewErrorWithError(err, "sql.ReplicationLinksFailoverAllowDataLossFuture", "Result", future.Response(), "Polling failure")
17205		return
17206	}
17207	if !done {
17208		ar.Response = future.Response()
17209		err = azure.NewAsyncOpIncompleteError("sql.ReplicationLinksFailoverAllowDataLossFuture")
17210		return
17211	}
17212	ar.Response = future.Response()
17213	return
17214}
17215
17216// ReplicationLinksFailoverFuture an abstraction for monitoring and retrieving the results of a
17217// long-running operation.
17218type ReplicationLinksFailoverFuture struct {
17219	azure.FutureAPI
17220	// Result returns the result of the asynchronous operation.
17221	// If the operation has not completed it will return an error.
17222	Result func(ReplicationLinksClient) (autorest.Response, error)
17223}
17224
17225// UnmarshalJSON is the custom unmarshaller for CreateFuture.
17226func (future *ReplicationLinksFailoverFuture) UnmarshalJSON(body []byte) error {
17227	var azFuture azure.Future
17228	if err := json.Unmarshal(body, &azFuture); err != nil {
17229		return err
17230	}
17231	future.FutureAPI = &azFuture
17232	future.Result = future.result
17233	return nil
17234}
17235
17236// result is the default implementation for ReplicationLinksFailoverFuture.Result.
17237func (future *ReplicationLinksFailoverFuture) result(client ReplicationLinksClient) (ar autorest.Response, err error) {
17238	var done bool
17239	done, err = future.DoneWithContext(context.Background(), client)
17240	if err != nil {
17241		err = autorest.NewErrorWithError(err, "sql.ReplicationLinksFailoverFuture", "Result", future.Response(), "Polling failure")
17242		return
17243	}
17244	if !done {
17245		ar.Response = future.Response()
17246		err = azure.NewAsyncOpIncompleteError("sql.ReplicationLinksFailoverFuture")
17247		return
17248	}
17249	ar.Response = future.Response()
17250	return
17251}
17252
17253// ReplicationLinksUnlinkFuture an abstraction for monitoring and retrieving the results of a long-running
17254// operation.
17255type ReplicationLinksUnlinkFuture struct {
17256	azure.FutureAPI
17257	// Result returns the result of the asynchronous operation.
17258	// If the operation has not completed it will return an error.
17259	Result func(ReplicationLinksClient) (autorest.Response, error)
17260}
17261
17262// UnmarshalJSON is the custom unmarshaller for CreateFuture.
17263func (future *ReplicationLinksUnlinkFuture) UnmarshalJSON(body []byte) error {
17264	var azFuture azure.Future
17265	if err := json.Unmarshal(body, &azFuture); err != nil {
17266		return err
17267	}
17268	future.FutureAPI = &azFuture
17269	future.Result = future.result
17270	return nil
17271}
17272
17273// result is the default implementation for ReplicationLinksUnlinkFuture.Result.
17274func (future *ReplicationLinksUnlinkFuture) result(client ReplicationLinksClient) (ar autorest.Response, err error) {
17275	var done bool
17276	done, err = future.DoneWithContext(context.Background(), client)
17277	if err != nil {
17278		err = autorest.NewErrorWithError(err, "sql.ReplicationLinksUnlinkFuture", "Result", future.Response(), "Polling failure")
17279		return
17280	}
17281	if !done {
17282		ar.Response = future.Response()
17283		err = azure.NewAsyncOpIncompleteError("sql.ReplicationLinksUnlinkFuture")
17284		return
17285	}
17286	ar.Response = future.Response()
17287	return
17288}
17289
17290// Resource ARM resource.
17291type Resource struct {
17292	// ID - READ-ONLY; Resource ID.
17293	ID *string `json:"id,omitempty"`
17294	// Name - READ-ONLY; Resource name.
17295	Name *string `json:"name,omitempty"`
17296	// Type - READ-ONLY; Resource type.
17297	Type *string `json:"type,omitempty"`
17298}
17299
17300// MarshalJSON is the custom marshaler for Resource.
17301func (r Resource) MarshalJSON() ([]byte, error) {
17302	objectMap := make(map[string]interface{})
17303	return json.Marshal(objectMap)
17304}
17305
17306// ResourceIdentity azure Active Directory identity configuration for a resource.
17307type ResourceIdentity struct {
17308	// PrincipalID - READ-ONLY; The Azure Active Directory principal id.
17309	PrincipalID *uuid.UUID `json:"principalId,omitempty"`
17310	// Type - The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal for the resource. Possible values include: 'SystemAssigned'
17311	Type IdentityType `json:"type,omitempty"`
17312	// TenantID - READ-ONLY; The Azure Active Directory tenant id.
17313	TenantID *uuid.UUID `json:"tenantId,omitempty"`
17314}
17315
17316// MarshalJSON is the custom marshaler for ResourceIdentity.
17317func (ri ResourceIdentity) MarshalJSON() ([]byte, error) {
17318	objectMap := make(map[string]interface{})
17319	if ri.Type != "" {
17320		objectMap["type"] = ri.Type
17321	}
17322	return json.Marshal(objectMap)
17323}
17324
17325// ResourceMoveDefinition contains the information necessary to perform a resource move (rename).
17326type ResourceMoveDefinition struct {
17327	// ID - The target ID for the resource
17328	ID *string `json:"id,omitempty"`
17329}
17330
17331// RestorableDroppedDatabase a restorable dropped database
17332type RestorableDroppedDatabase struct {
17333	autorest.Response `json:"-"`
17334	// Location - READ-ONLY; The geo-location where the resource lives
17335	Location *string `json:"location,omitempty"`
17336	// RestorableDroppedDatabaseProperties - The properties of a restorable dropped database
17337	*RestorableDroppedDatabaseProperties `json:"properties,omitempty"`
17338	// ID - READ-ONLY; Resource ID.
17339	ID *string `json:"id,omitempty"`
17340	// Name - READ-ONLY; Resource name.
17341	Name *string `json:"name,omitempty"`
17342	// Type - READ-ONLY; Resource type.
17343	Type *string `json:"type,omitempty"`
17344}
17345
17346// MarshalJSON is the custom marshaler for RestorableDroppedDatabase.
17347func (rdd RestorableDroppedDatabase) MarshalJSON() ([]byte, error) {
17348	objectMap := make(map[string]interface{})
17349	if rdd.RestorableDroppedDatabaseProperties != nil {
17350		objectMap["properties"] = rdd.RestorableDroppedDatabaseProperties
17351	}
17352	return json.Marshal(objectMap)
17353}
17354
17355// UnmarshalJSON is the custom unmarshaler for RestorableDroppedDatabase struct.
17356func (rdd *RestorableDroppedDatabase) UnmarshalJSON(body []byte) error {
17357	var m map[string]*json.RawMessage
17358	err := json.Unmarshal(body, &m)
17359	if err != nil {
17360		return err
17361	}
17362	for k, v := range m {
17363		switch k {
17364		case "location":
17365			if v != nil {
17366				var location string
17367				err = json.Unmarshal(*v, &location)
17368				if err != nil {
17369					return err
17370				}
17371				rdd.Location = &location
17372			}
17373		case "properties":
17374			if v != nil {
17375				var restorableDroppedDatabaseProperties RestorableDroppedDatabaseProperties
17376				err = json.Unmarshal(*v, &restorableDroppedDatabaseProperties)
17377				if err != nil {
17378					return err
17379				}
17380				rdd.RestorableDroppedDatabaseProperties = &restorableDroppedDatabaseProperties
17381			}
17382		case "id":
17383			if v != nil {
17384				var ID string
17385				err = json.Unmarshal(*v, &ID)
17386				if err != nil {
17387					return err
17388				}
17389				rdd.ID = &ID
17390			}
17391		case "name":
17392			if v != nil {
17393				var name string
17394				err = json.Unmarshal(*v, &name)
17395				if err != nil {
17396					return err
17397				}
17398				rdd.Name = &name
17399			}
17400		case "type":
17401			if v != nil {
17402				var typeVar string
17403				err = json.Unmarshal(*v, &typeVar)
17404				if err != nil {
17405					return err
17406				}
17407				rdd.Type = &typeVar
17408			}
17409		}
17410	}
17411
17412	return nil
17413}
17414
17415// RestorableDroppedDatabaseListResult the response to a list restorable dropped databases request
17416type RestorableDroppedDatabaseListResult struct {
17417	autorest.Response `json:"-"`
17418	// Value - A list of restorable dropped databases
17419	Value *[]RestorableDroppedDatabase `json:"value,omitempty"`
17420}
17421
17422// RestorableDroppedDatabaseProperties the properties of a restorable dropped database
17423type RestorableDroppedDatabaseProperties struct {
17424	// DatabaseName - READ-ONLY; The name of the database
17425	DatabaseName *string `json:"databaseName,omitempty"`
17426	// Edition - READ-ONLY; The edition of the database
17427	Edition *string `json:"edition,omitempty"`
17428	// MaxSizeBytes - READ-ONLY; The max size in bytes of the database
17429	MaxSizeBytes *string `json:"maxSizeBytes,omitempty"`
17430	// ServiceLevelObjective - READ-ONLY; The service level objective name of the database
17431	ServiceLevelObjective *string `json:"serviceLevelObjective,omitempty"`
17432	// ElasticPoolName - READ-ONLY; The elastic pool name of the database
17433	ElasticPoolName *string `json:"elasticPoolName,omitempty"`
17434	// CreationDate - READ-ONLY; The creation date of the database (ISO8601 format)
17435	CreationDate *date.Time `json:"creationDate,omitempty"`
17436	// DeletionDate - READ-ONLY; The deletion date of the database (ISO8601 format)
17437	DeletionDate *date.Time `json:"deletionDate,omitempty"`
17438	// EarliestRestoreDate - READ-ONLY; The earliest restore date of the database (ISO8601 format)
17439	EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"`
17440}
17441
17442// MarshalJSON is the custom marshaler for RestorableDroppedDatabaseProperties.
17443func (rddp RestorableDroppedDatabaseProperties) MarshalJSON() ([]byte, error) {
17444	objectMap := make(map[string]interface{})
17445	return json.Marshal(objectMap)
17446}
17447
17448// RestorableDroppedManagedDatabase a restorable dropped managed database resource.
17449type RestorableDroppedManagedDatabase struct {
17450	autorest.Response `json:"-"`
17451	// RestorableDroppedManagedDatabaseProperties - Resource properties.
17452	*RestorableDroppedManagedDatabaseProperties `json:"properties,omitempty"`
17453	// Location - Resource location.
17454	Location *string `json:"location,omitempty"`
17455	// Tags - Resource tags.
17456	Tags map[string]*string `json:"tags"`
17457	// ID - READ-ONLY; Resource ID.
17458	ID *string `json:"id,omitempty"`
17459	// Name - READ-ONLY; Resource name.
17460	Name *string `json:"name,omitempty"`
17461	// Type - READ-ONLY; Resource type.
17462	Type *string `json:"type,omitempty"`
17463}
17464
17465// MarshalJSON is the custom marshaler for RestorableDroppedManagedDatabase.
17466func (rdmd RestorableDroppedManagedDatabase) MarshalJSON() ([]byte, error) {
17467	objectMap := make(map[string]interface{})
17468	if rdmd.RestorableDroppedManagedDatabaseProperties != nil {
17469		objectMap["properties"] = rdmd.RestorableDroppedManagedDatabaseProperties
17470	}
17471	if rdmd.Location != nil {
17472		objectMap["location"] = rdmd.Location
17473	}
17474	if rdmd.Tags != nil {
17475		objectMap["tags"] = rdmd.Tags
17476	}
17477	return json.Marshal(objectMap)
17478}
17479
17480// UnmarshalJSON is the custom unmarshaler for RestorableDroppedManagedDatabase struct.
17481func (rdmd *RestorableDroppedManagedDatabase) UnmarshalJSON(body []byte) error {
17482	var m map[string]*json.RawMessage
17483	err := json.Unmarshal(body, &m)
17484	if err != nil {
17485		return err
17486	}
17487	for k, v := range m {
17488		switch k {
17489		case "properties":
17490			if v != nil {
17491				var restorableDroppedManagedDatabaseProperties RestorableDroppedManagedDatabaseProperties
17492				err = json.Unmarshal(*v, &restorableDroppedManagedDatabaseProperties)
17493				if err != nil {
17494					return err
17495				}
17496				rdmd.RestorableDroppedManagedDatabaseProperties = &restorableDroppedManagedDatabaseProperties
17497			}
17498		case "location":
17499			if v != nil {
17500				var location string
17501				err = json.Unmarshal(*v, &location)
17502				if err != nil {
17503					return err
17504				}
17505				rdmd.Location = &location
17506			}
17507		case "tags":
17508			if v != nil {
17509				var tags map[string]*string
17510				err = json.Unmarshal(*v, &tags)
17511				if err != nil {
17512					return err
17513				}
17514				rdmd.Tags = tags
17515			}
17516		case "id":
17517			if v != nil {
17518				var ID string
17519				err = json.Unmarshal(*v, &ID)
17520				if err != nil {
17521					return err
17522				}
17523				rdmd.ID = &ID
17524			}
17525		case "name":
17526			if v != nil {
17527				var name string
17528				err = json.Unmarshal(*v, &name)
17529				if err != nil {
17530					return err
17531				}
17532				rdmd.Name = &name
17533			}
17534		case "type":
17535			if v != nil {
17536				var typeVar string
17537				err = json.Unmarshal(*v, &typeVar)
17538				if err != nil {
17539					return err
17540				}
17541				rdmd.Type = &typeVar
17542			}
17543		}
17544	}
17545
17546	return nil
17547}
17548
17549// RestorableDroppedManagedDatabaseListResult a list of restorable dropped managed databases.
17550type RestorableDroppedManagedDatabaseListResult struct {
17551	autorest.Response `json:"-"`
17552	// Value - READ-ONLY; Array of results.
17553	Value *[]RestorableDroppedManagedDatabase `json:"value,omitempty"`
17554	// NextLink - READ-ONLY; Link to retrieve next page of results.
17555	NextLink *string `json:"nextLink,omitempty"`
17556}
17557
17558// MarshalJSON is the custom marshaler for RestorableDroppedManagedDatabaseListResult.
17559func (rdmdlr RestorableDroppedManagedDatabaseListResult) MarshalJSON() ([]byte, error) {
17560	objectMap := make(map[string]interface{})
17561	return json.Marshal(objectMap)
17562}
17563
17564// RestorableDroppedManagedDatabaseListResultIterator provides access to a complete listing of
17565// RestorableDroppedManagedDatabase values.
17566type RestorableDroppedManagedDatabaseListResultIterator struct {
17567	i    int
17568	page RestorableDroppedManagedDatabaseListResultPage
17569}
17570
17571// NextWithContext advances to the next value.  If there was an error making
17572// the request the iterator does not advance and the error is returned.
17573func (iter *RestorableDroppedManagedDatabaseListResultIterator) NextWithContext(ctx context.Context) (err error) {
17574	if tracing.IsEnabled() {
17575		ctx = tracing.StartSpan(ctx, fqdn+"/RestorableDroppedManagedDatabaseListResultIterator.NextWithContext")
17576		defer func() {
17577			sc := -1
17578			if iter.Response().Response.Response != nil {
17579				sc = iter.Response().Response.Response.StatusCode
17580			}
17581			tracing.EndSpan(ctx, sc, err)
17582		}()
17583	}
17584	iter.i++
17585	if iter.i < len(iter.page.Values()) {
17586		return nil
17587	}
17588	err = iter.page.NextWithContext(ctx)
17589	if err != nil {
17590		iter.i--
17591		return err
17592	}
17593	iter.i = 0
17594	return nil
17595}
17596
17597// Next advances to the next value.  If there was an error making
17598// the request the iterator does not advance and the error is returned.
17599// Deprecated: Use NextWithContext() instead.
17600func (iter *RestorableDroppedManagedDatabaseListResultIterator) Next() error {
17601	return iter.NextWithContext(context.Background())
17602}
17603
17604// NotDone returns true if the enumeration should be started or is not yet complete.
17605func (iter RestorableDroppedManagedDatabaseListResultIterator) NotDone() bool {
17606	return iter.page.NotDone() && iter.i < len(iter.page.Values())
17607}
17608
17609// Response returns the raw server response from the last page request.
17610func (iter RestorableDroppedManagedDatabaseListResultIterator) Response() RestorableDroppedManagedDatabaseListResult {
17611	return iter.page.Response()
17612}
17613
17614// Value returns the current value or a zero-initialized value if the
17615// iterator has advanced beyond the end of the collection.
17616func (iter RestorableDroppedManagedDatabaseListResultIterator) Value() RestorableDroppedManagedDatabase {
17617	if !iter.page.NotDone() {
17618		return RestorableDroppedManagedDatabase{}
17619	}
17620	return iter.page.Values()[iter.i]
17621}
17622
17623// Creates a new instance of the RestorableDroppedManagedDatabaseListResultIterator type.
17624func NewRestorableDroppedManagedDatabaseListResultIterator(page RestorableDroppedManagedDatabaseListResultPage) RestorableDroppedManagedDatabaseListResultIterator {
17625	return RestorableDroppedManagedDatabaseListResultIterator{page: page}
17626}
17627
17628// IsEmpty returns true if the ListResult contains no values.
17629func (rdmdlr RestorableDroppedManagedDatabaseListResult) IsEmpty() bool {
17630	return rdmdlr.Value == nil || len(*rdmdlr.Value) == 0
17631}
17632
17633// hasNextLink returns true if the NextLink is not empty.
17634func (rdmdlr RestorableDroppedManagedDatabaseListResult) hasNextLink() bool {
17635	return rdmdlr.NextLink != nil && len(*rdmdlr.NextLink) != 0
17636}
17637
17638// restorableDroppedManagedDatabaseListResultPreparer prepares a request to retrieve the next set of results.
17639// It returns nil if no more results exist.
17640func (rdmdlr RestorableDroppedManagedDatabaseListResult) restorableDroppedManagedDatabaseListResultPreparer(ctx context.Context) (*http.Request, error) {
17641	if !rdmdlr.hasNextLink() {
17642		return nil, nil
17643	}
17644	return autorest.Prepare((&http.Request{}).WithContext(ctx),
17645		autorest.AsJSON(),
17646		autorest.AsGet(),
17647		autorest.WithBaseURL(to.String(rdmdlr.NextLink)))
17648}
17649
17650// RestorableDroppedManagedDatabaseListResultPage contains a page of RestorableDroppedManagedDatabase
17651// values.
17652type RestorableDroppedManagedDatabaseListResultPage struct {
17653	fn     func(context.Context, RestorableDroppedManagedDatabaseListResult) (RestorableDroppedManagedDatabaseListResult, error)
17654	rdmdlr RestorableDroppedManagedDatabaseListResult
17655}
17656
17657// NextWithContext advances to the next page of values.  If there was an error making
17658// the request the page does not advance and the error is returned.
17659func (page *RestorableDroppedManagedDatabaseListResultPage) NextWithContext(ctx context.Context) (err error) {
17660	if tracing.IsEnabled() {
17661		ctx = tracing.StartSpan(ctx, fqdn+"/RestorableDroppedManagedDatabaseListResultPage.NextWithContext")
17662		defer func() {
17663			sc := -1
17664			if page.Response().Response.Response != nil {
17665				sc = page.Response().Response.Response.StatusCode
17666			}
17667			tracing.EndSpan(ctx, sc, err)
17668		}()
17669	}
17670	for {
17671		next, err := page.fn(ctx, page.rdmdlr)
17672		if err != nil {
17673			return err
17674		}
17675		page.rdmdlr = next
17676		if !next.hasNextLink() || !next.IsEmpty() {
17677			break
17678		}
17679	}
17680	return nil
17681}
17682
17683// Next advances to the next page of values.  If there was an error making
17684// the request the page does not advance and the error is returned.
17685// Deprecated: Use NextWithContext() instead.
17686func (page *RestorableDroppedManagedDatabaseListResultPage) Next() error {
17687	return page.NextWithContext(context.Background())
17688}
17689
17690// NotDone returns true if the page enumeration should be started or is not yet complete.
17691func (page RestorableDroppedManagedDatabaseListResultPage) NotDone() bool {
17692	return !page.rdmdlr.IsEmpty()
17693}
17694
17695// Response returns the raw server response from the last page request.
17696func (page RestorableDroppedManagedDatabaseListResultPage) Response() RestorableDroppedManagedDatabaseListResult {
17697	return page.rdmdlr
17698}
17699
17700// Values returns the slice of values for the current page or nil if there are no values.
17701func (page RestorableDroppedManagedDatabaseListResultPage) Values() []RestorableDroppedManagedDatabase {
17702	if page.rdmdlr.IsEmpty() {
17703		return nil
17704	}
17705	return *page.rdmdlr.Value
17706}
17707
17708// Creates a new instance of the RestorableDroppedManagedDatabaseListResultPage type.
17709func NewRestorableDroppedManagedDatabaseListResultPage(cur RestorableDroppedManagedDatabaseListResult, getNextPage func(context.Context, RestorableDroppedManagedDatabaseListResult) (RestorableDroppedManagedDatabaseListResult, error)) RestorableDroppedManagedDatabaseListResultPage {
17710	return RestorableDroppedManagedDatabaseListResultPage{
17711		fn:     getNextPage,
17712		rdmdlr: cur,
17713	}
17714}
17715
17716// RestorableDroppedManagedDatabaseProperties the restorable dropped managed database's properties.
17717type RestorableDroppedManagedDatabaseProperties struct {
17718	// DatabaseName - READ-ONLY; The name of the database.
17719	DatabaseName *string `json:"databaseName,omitempty"`
17720	// CreationDate - READ-ONLY; The creation date of the database (ISO8601 format).
17721	CreationDate *date.Time `json:"creationDate,omitempty"`
17722	// DeletionDate - READ-ONLY; The deletion date of the database (ISO8601 format).
17723	DeletionDate *date.Time `json:"deletionDate,omitempty"`
17724	// EarliestRestoreDate - READ-ONLY; The earliest restore date of the database (ISO8601 format).
17725	EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"`
17726}
17727
17728// MarshalJSON is the custom marshaler for RestorableDroppedManagedDatabaseProperties.
17729func (rdmdp RestorableDroppedManagedDatabaseProperties) MarshalJSON() ([]byte, error) {
17730	objectMap := make(map[string]interface{})
17731	return json.Marshal(objectMap)
17732}
17733
17734// RestorePoint database restore points.
17735type RestorePoint struct {
17736	autorest.Response `json:"-"`
17737	// Location - READ-ONLY; Resource location.
17738	Location *string `json:"location,omitempty"`
17739	// RestorePointProperties - Resource properties.
17740	*RestorePointProperties `json:"properties,omitempty"`
17741	// ID - READ-ONLY; Resource ID.
17742	ID *string `json:"id,omitempty"`
17743	// Name - READ-ONLY; Resource name.
17744	Name *string `json:"name,omitempty"`
17745	// Type - READ-ONLY; Resource type.
17746	Type *string `json:"type,omitempty"`
17747}
17748
17749// MarshalJSON is the custom marshaler for RestorePoint.
17750func (rp RestorePoint) MarshalJSON() ([]byte, error) {
17751	objectMap := make(map[string]interface{})
17752	if rp.RestorePointProperties != nil {
17753		objectMap["properties"] = rp.RestorePointProperties
17754	}
17755	return json.Marshal(objectMap)
17756}
17757
17758// UnmarshalJSON is the custom unmarshaler for RestorePoint struct.
17759func (rp *RestorePoint) UnmarshalJSON(body []byte) error {
17760	var m map[string]*json.RawMessage
17761	err := json.Unmarshal(body, &m)
17762	if err != nil {
17763		return err
17764	}
17765	for k, v := range m {
17766		switch k {
17767		case "location":
17768			if v != nil {
17769				var location string
17770				err = json.Unmarshal(*v, &location)
17771				if err != nil {
17772					return err
17773				}
17774				rp.Location = &location
17775			}
17776		case "properties":
17777			if v != nil {
17778				var restorePointProperties RestorePointProperties
17779				err = json.Unmarshal(*v, &restorePointProperties)
17780				if err != nil {
17781					return err
17782				}
17783				rp.RestorePointProperties = &restorePointProperties
17784			}
17785		case "id":
17786			if v != nil {
17787				var ID string
17788				err = json.Unmarshal(*v, &ID)
17789				if err != nil {
17790					return err
17791				}
17792				rp.ID = &ID
17793			}
17794		case "name":
17795			if v != nil {
17796				var name string
17797				err = json.Unmarshal(*v, &name)
17798				if err != nil {
17799					return err
17800				}
17801				rp.Name = &name
17802			}
17803		case "type":
17804			if v != nil {
17805				var typeVar string
17806				err = json.Unmarshal(*v, &typeVar)
17807				if err != nil {
17808					return err
17809				}
17810				rp.Type = &typeVar
17811			}
17812		}
17813	}
17814
17815	return nil
17816}
17817
17818// RestorePointListResult a list of long term retention backups.
17819type RestorePointListResult struct {
17820	autorest.Response `json:"-"`
17821	// Value - READ-ONLY; Array of results.
17822	Value *[]RestorePoint `json:"value,omitempty"`
17823	// NextLink - READ-ONLY; Link to retrieve next page of results.
17824	NextLink *string `json:"nextLink,omitempty"`
17825}
17826
17827// MarshalJSON is the custom marshaler for RestorePointListResult.
17828func (rplr RestorePointListResult) MarshalJSON() ([]byte, error) {
17829	objectMap := make(map[string]interface{})
17830	return json.Marshal(objectMap)
17831}
17832
17833// RestorePointProperties properties of a database restore point
17834type RestorePointProperties struct {
17835	// RestorePointType - READ-ONLY; The type of restore point. Possible values include: 'CONTINUOUS', 'DISCRETE'
17836	RestorePointType RestorePointType `json:"restorePointType,omitempty"`
17837	// EarliestRestoreDate - READ-ONLY; The earliest time to which this database can be restored
17838	EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"`
17839	// RestorePointCreationDate - READ-ONLY; The time the backup was taken
17840	RestorePointCreationDate *date.Time `json:"restorePointCreationDate,omitempty"`
17841	// RestorePointLabel - READ-ONLY; The label of restore point for backup request by user
17842	RestorePointLabel *string `json:"restorePointLabel,omitempty"`
17843}
17844
17845// MarshalJSON is the custom marshaler for RestorePointProperties.
17846func (rpp RestorePointProperties) MarshalJSON() ([]byte, error) {
17847	objectMap := make(map[string]interface{})
17848	return json.Marshal(objectMap)
17849}
17850
17851// RestorePointsCreateFuture an abstraction for monitoring and retrieving the results of a long-running
17852// operation.
17853type RestorePointsCreateFuture struct {
17854	azure.FutureAPI
17855	// Result returns the result of the asynchronous operation.
17856	// If the operation has not completed it will return an error.
17857	Result func(RestorePointsClient) (RestorePoint, error)
17858}
17859
17860// UnmarshalJSON is the custom unmarshaller for CreateFuture.
17861func (future *RestorePointsCreateFuture) UnmarshalJSON(body []byte) error {
17862	var azFuture azure.Future
17863	if err := json.Unmarshal(body, &azFuture); err != nil {
17864		return err
17865	}
17866	future.FutureAPI = &azFuture
17867	future.Result = future.result
17868	return nil
17869}
17870
17871// result is the default implementation for RestorePointsCreateFuture.Result.
17872func (future *RestorePointsCreateFuture) result(client RestorePointsClient) (rp RestorePoint, err error) {
17873	var done bool
17874	done, err = future.DoneWithContext(context.Background(), client)
17875	if err != nil {
17876		err = autorest.NewErrorWithError(err, "sql.RestorePointsCreateFuture", "Result", future.Response(), "Polling failure")
17877		return
17878	}
17879	if !done {
17880		rp.Response.Response = future.Response()
17881		err = azure.NewAsyncOpIncompleteError("sql.RestorePointsCreateFuture")
17882		return
17883	}
17884	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
17885	if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent {
17886		rp, err = client.CreateResponder(rp.Response.Response)
17887		if err != nil {
17888			err = autorest.NewErrorWithError(err, "sql.RestorePointsCreateFuture", "Result", rp.Response.Response, "Failure responding to request")
17889		}
17890	}
17891	return
17892}
17893
17894// SecurityAlertPolicyProperties properties of a security alert policy.
17895type SecurityAlertPolicyProperties struct {
17896	// 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'
17897	State SecurityAlertPolicyState `json:"state,omitempty"`
17898	// DisabledAlerts - Specifies an array of alerts that are disabled. Allowed values are: Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action
17899	DisabledAlerts *[]string `json:"disabledAlerts,omitempty"`
17900	// EmailAddresses - Specifies an array of e-mail addresses to which the alert is sent.
17901	EmailAddresses *[]string `json:"emailAddresses,omitempty"`
17902	// EmailAccountAdmins - Specifies that the alert is sent to the account administrators.
17903	EmailAccountAdmins *bool `json:"emailAccountAdmins,omitempty"`
17904	// StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs.
17905	StorageEndpoint *string `json:"storageEndpoint,omitempty"`
17906	// StorageAccountAccessKey - Specifies the identifier key of the Threat Detection audit storage account.
17907	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
17908	// RetentionDays - Specifies the number of days to keep in the Threat Detection audit logs.
17909	RetentionDays *int32 `json:"retentionDays,omitempty"`
17910	// CreationTime - READ-ONLY; Specifies the UTC creation time of the policy.
17911	CreationTime *date.Time `json:"creationTime,omitempty"`
17912}
17913
17914// MarshalJSON is the custom marshaler for SecurityAlertPolicyProperties.
17915func (sapp SecurityAlertPolicyProperties) MarshalJSON() ([]byte, error) {
17916	objectMap := make(map[string]interface{})
17917	if sapp.State != "" {
17918		objectMap["state"] = sapp.State
17919	}
17920	if sapp.DisabledAlerts != nil {
17921		objectMap["disabledAlerts"] = sapp.DisabledAlerts
17922	}
17923	if sapp.EmailAddresses != nil {
17924		objectMap["emailAddresses"] = sapp.EmailAddresses
17925	}
17926	if sapp.EmailAccountAdmins != nil {
17927		objectMap["emailAccountAdmins"] = sapp.EmailAccountAdmins
17928	}
17929	if sapp.StorageEndpoint != nil {
17930		objectMap["storageEndpoint"] = sapp.StorageEndpoint
17931	}
17932	if sapp.StorageAccountAccessKey != nil {
17933		objectMap["storageAccountAccessKey"] = sapp.StorageAccountAccessKey
17934	}
17935	if sapp.RetentionDays != nil {
17936		objectMap["retentionDays"] = sapp.RetentionDays
17937	}
17938	return json.Marshal(objectMap)
17939}
17940
17941// SensitivityLabel a sensitivity label.
17942type SensitivityLabel struct {
17943	autorest.Response `json:"-"`
17944	// SensitivityLabelProperties - Resource properties.
17945	*SensitivityLabelProperties `json:"properties,omitempty"`
17946	// ID - READ-ONLY; Resource ID.
17947	ID *string `json:"id,omitempty"`
17948	// Name - READ-ONLY; Resource name.
17949	Name *string `json:"name,omitempty"`
17950	// Type - READ-ONLY; Resource type.
17951	Type *string `json:"type,omitempty"`
17952}
17953
17954// MarshalJSON is the custom marshaler for SensitivityLabel.
17955func (sl SensitivityLabel) MarshalJSON() ([]byte, error) {
17956	objectMap := make(map[string]interface{})
17957	if sl.SensitivityLabelProperties != nil {
17958		objectMap["properties"] = sl.SensitivityLabelProperties
17959	}
17960	return json.Marshal(objectMap)
17961}
17962
17963// UnmarshalJSON is the custom unmarshaler for SensitivityLabel struct.
17964func (sl *SensitivityLabel) UnmarshalJSON(body []byte) error {
17965	var m map[string]*json.RawMessage
17966	err := json.Unmarshal(body, &m)
17967	if err != nil {
17968		return err
17969	}
17970	for k, v := range m {
17971		switch k {
17972		case "properties":
17973			if v != nil {
17974				var sensitivityLabelProperties SensitivityLabelProperties
17975				err = json.Unmarshal(*v, &sensitivityLabelProperties)
17976				if err != nil {
17977					return err
17978				}
17979				sl.SensitivityLabelProperties = &sensitivityLabelProperties
17980			}
17981		case "id":
17982			if v != nil {
17983				var ID string
17984				err = json.Unmarshal(*v, &ID)
17985				if err != nil {
17986					return err
17987				}
17988				sl.ID = &ID
17989			}
17990		case "name":
17991			if v != nil {
17992				var name string
17993				err = json.Unmarshal(*v, &name)
17994				if err != nil {
17995					return err
17996				}
17997				sl.Name = &name
17998			}
17999		case "type":
18000			if v != nil {
18001				var typeVar string
18002				err = json.Unmarshal(*v, &typeVar)
18003				if err != nil {
18004					return err
18005				}
18006				sl.Type = &typeVar
18007			}
18008		}
18009	}
18010
18011	return nil
18012}
18013
18014// SensitivityLabelListResult a list of sensitivity labels.
18015type SensitivityLabelListResult struct {
18016	autorest.Response `json:"-"`
18017	// Value - READ-ONLY; Array of results.
18018	Value *[]SensitivityLabel `json:"value,omitempty"`
18019	// NextLink - READ-ONLY; Link to retrieve next page of results.
18020	NextLink *string `json:"nextLink,omitempty"`
18021}
18022
18023// MarshalJSON is the custom marshaler for SensitivityLabelListResult.
18024func (sllr SensitivityLabelListResult) MarshalJSON() ([]byte, error) {
18025	objectMap := make(map[string]interface{})
18026	return json.Marshal(objectMap)
18027}
18028
18029// SensitivityLabelListResultIterator provides access to a complete listing of SensitivityLabel values.
18030type SensitivityLabelListResultIterator struct {
18031	i    int
18032	page SensitivityLabelListResultPage
18033}
18034
18035// NextWithContext advances to the next value.  If there was an error making
18036// the request the iterator does not advance and the error is returned.
18037func (iter *SensitivityLabelListResultIterator) NextWithContext(ctx context.Context) (err error) {
18038	if tracing.IsEnabled() {
18039		ctx = tracing.StartSpan(ctx, fqdn+"/SensitivityLabelListResultIterator.NextWithContext")
18040		defer func() {
18041			sc := -1
18042			if iter.Response().Response.Response != nil {
18043				sc = iter.Response().Response.Response.StatusCode
18044			}
18045			tracing.EndSpan(ctx, sc, err)
18046		}()
18047	}
18048	iter.i++
18049	if iter.i < len(iter.page.Values()) {
18050		return nil
18051	}
18052	err = iter.page.NextWithContext(ctx)
18053	if err != nil {
18054		iter.i--
18055		return err
18056	}
18057	iter.i = 0
18058	return nil
18059}
18060
18061// Next advances to the next value.  If there was an error making
18062// the request the iterator does not advance and the error is returned.
18063// Deprecated: Use NextWithContext() instead.
18064func (iter *SensitivityLabelListResultIterator) Next() error {
18065	return iter.NextWithContext(context.Background())
18066}
18067
18068// NotDone returns true if the enumeration should be started or is not yet complete.
18069func (iter SensitivityLabelListResultIterator) NotDone() bool {
18070	return iter.page.NotDone() && iter.i < len(iter.page.Values())
18071}
18072
18073// Response returns the raw server response from the last page request.
18074func (iter SensitivityLabelListResultIterator) Response() SensitivityLabelListResult {
18075	return iter.page.Response()
18076}
18077
18078// Value returns the current value or a zero-initialized value if the
18079// iterator has advanced beyond the end of the collection.
18080func (iter SensitivityLabelListResultIterator) Value() SensitivityLabel {
18081	if !iter.page.NotDone() {
18082		return SensitivityLabel{}
18083	}
18084	return iter.page.Values()[iter.i]
18085}
18086
18087// Creates a new instance of the SensitivityLabelListResultIterator type.
18088func NewSensitivityLabelListResultIterator(page SensitivityLabelListResultPage) SensitivityLabelListResultIterator {
18089	return SensitivityLabelListResultIterator{page: page}
18090}
18091
18092// IsEmpty returns true if the ListResult contains no values.
18093func (sllr SensitivityLabelListResult) IsEmpty() bool {
18094	return sllr.Value == nil || len(*sllr.Value) == 0
18095}
18096
18097// hasNextLink returns true if the NextLink is not empty.
18098func (sllr SensitivityLabelListResult) hasNextLink() bool {
18099	return sllr.NextLink != nil && len(*sllr.NextLink) != 0
18100}
18101
18102// sensitivityLabelListResultPreparer prepares a request to retrieve the next set of results.
18103// It returns nil if no more results exist.
18104func (sllr SensitivityLabelListResult) sensitivityLabelListResultPreparer(ctx context.Context) (*http.Request, error) {
18105	if !sllr.hasNextLink() {
18106		return nil, nil
18107	}
18108	return autorest.Prepare((&http.Request{}).WithContext(ctx),
18109		autorest.AsJSON(),
18110		autorest.AsGet(),
18111		autorest.WithBaseURL(to.String(sllr.NextLink)))
18112}
18113
18114// SensitivityLabelListResultPage contains a page of SensitivityLabel values.
18115type SensitivityLabelListResultPage struct {
18116	fn   func(context.Context, SensitivityLabelListResult) (SensitivityLabelListResult, error)
18117	sllr SensitivityLabelListResult
18118}
18119
18120// NextWithContext advances to the next page of values.  If there was an error making
18121// the request the page does not advance and the error is returned.
18122func (page *SensitivityLabelListResultPage) NextWithContext(ctx context.Context) (err error) {
18123	if tracing.IsEnabled() {
18124		ctx = tracing.StartSpan(ctx, fqdn+"/SensitivityLabelListResultPage.NextWithContext")
18125		defer func() {
18126			sc := -1
18127			if page.Response().Response.Response != nil {
18128				sc = page.Response().Response.Response.StatusCode
18129			}
18130			tracing.EndSpan(ctx, sc, err)
18131		}()
18132	}
18133	for {
18134		next, err := page.fn(ctx, page.sllr)
18135		if err != nil {
18136			return err
18137		}
18138		page.sllr = next
18139		if !next.hasNextLink() || !next.IsEmpty() {
18140			break
18141		}
18142	}
18143	return nil
18144}
18145
18146// Next advances to the next page of values.  If there was an error making
18147// the request the page does not advance and the error is returned.
18148// Deprecated: Use NextWithContext() instead.
18149func (page *SensitivityLabelListResultPage) Next() error {
18150	return page.NextWithContext(context.Background())
18151}
18152
18153// NotDone returns true if the page enumeration should be started or is not yet complete.
18154func (page SensitivityLabelListResultPage) NotDone() bool {
18155	return !page.sllr.IsEmpty()
18156}
18157
18158// Response returns the raw server response from the last page request.
18159func (page SensitivityLabelListResultPage) Response() SensitivityLabelListResult {
18160	return page.sllr
18161}
18162
18163// Values returns the slice of values for the current page or nil if there are no values.
18164func (page SensitivityLabelListResultPage) Values() []SensitivityLabel {
18165	if page.sllr.IsEmpty() {
18166		return nil
18167	}
18168	return *page.sllr.Value
18169}
18170
18171// Creates a new instance of the SensitivityLabelListResultPage type.
18172func NewSensitivityLabelListResultPage(cur SensitivityLabelListResult, getNextPage func(context.Context, SensitivityLabelListResult) (SensitivityLabelListResult, error)) SensitivityLabelListResultPage {
18173	return SensitivityLabelListResultPage{
18174		fn:   getNextPage,
18175		sllr: cur,
18176	}
18177}
18178
18179// SensitivityLabelProperties properties of a sensitivity label.
18180type SensitivityLabelProperties struct {
18181	// LabelName - The label name.
18182	LabelName *string `json:"labelName,omitempty"`
18183	// LabelID - The label ID.
18184	LabelID *string `json:"labelId,omitempty"`
18185	// InformationType - The information type.
18186	InformationType *string `json:"informationType,omitempty"`
18187	// InformationTypeID - The information type ID.
18188	InformationTypeID *string `json:"informationTypeId,omitempty"`
18189	// 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.
18190	IsDisabled *bool `json:"isDisabled,omitempty"`
18191	// Rank - Possible values include: 'SensitivityLabelRankNone', 'SensitivityLabelRankLow', 'SensitivityLabelRankMedium', 'SensitivityLabelRankHigh', 'SensitivityLabelRankCritical'
18192	Rank SensitivityLabelRank `json:"rank,omitempty"`
18193}
18194
18195// MarshalJSON is the custom marshaler for SensitivityLabelProperties.
18196func (slp SensitivityLabelProperties) MarshalJSON() ([]byte, error) {
18197	objectMap := make(map[string]interface{})
18198	if slp.LabelName != nil {
18199		objectMap["labelName"] = slp.LabelName
18200	}
18201	if slp.LabelID != nil {
18202		objectMap["labelId"] = slp.LabelID
18203	}
18204	if slp.InformationType != nil {
18205		objectMap["informationType"] = slp.InformationType
18206	}
18207	if slp.InformationTypeID != nil {
18208		objectMap["informationTypeId"] = slp.InformationTypeID
18209	}
18210	if slp.Rank != "" {
18211		objectMap["rank"] = slp.Rank
18212	}
18213	return json.Marshal(objectMap)
18214}
18215
18216// Server an Azure SQL Database server.
18217type Server struct {
18218	autorest.Response `json:"-"`
18219	// Identity - The Azure Active Directory identity of the server.
18220	Identity *ResourceIdentity `json:"identity,omitempty"`
18221	// Kind - READ-ONLY; Kind of sql server. This is metadata used for the Azure portal experience.
18222	Kind *string `json:"kind,omitempty"`
18223	// ServerProperties - Resource properties.
18224	*ServerProperties `json:"properties,omitempty"`
18225	// Location - Resource location.
18226	Location *string `json:"location,omitempty"`
18227	// Tags - Resource tags.
18228	Tags map[string]*string `json:"tags"`
18229	// ID - READ-ONLY; Resource ID.
18230	ID *string `json:"id,omitempty"`
18231	// Name - READ-ONLY; Resource name.
18232	Name *string `json:"name,omitempty"`
18233	// Type - READ-ONLY; Resource type.
18234	Type *string `json:"type,omitempty"`
18235}
18236
18237// MarshalJSON is the custom marshaler for Server.
18238func (s Server) MarshalJSON() ([]byte, error) {
18239	objectMap := make(map[string]interface{})
18240	if s.Identity != nil {
18241		objectMap["identity"] = s.Identity
18242	}
18243	if s.ServerProperties != nil {
18244		objectMap["properties"] = s.ServerProperties
18245	}
18246	if s.Location != nil {
18247		objectMap["location"] = s.Location
18248	}
18249	if s.Tags != nil {
18250		objectMap["tags"] = s.Tags
18251	}
18252	return json.Marshal(objectMap)
18253}
18254
18255// UnmarshalJSON is the custom unmarshaler for Server struct.
18256func (s *Server) UnmarshalJSON(body []byte) error {
18257	var m map[string]*json.RawMessage
18258	err := json.Unmarshal(body, &m)
18259	if err != nil {
18260		return err
18261	}
18262	for k, v := range m {
18263		switch k {
18264		case "identity":
18265			if v != nil {
18266				var identity ResourceIdentity
18267				err = json.Unmarshal(*v, &identity)
18268				if err != nil {
18269					return err
18270				}
18271				s.Identity = &identity
18272			}
18273		case "kind":
18274			if v != nil {
18275				var kind string
18276				err = json.Unmarshal(*v, &kind)
18277				if err != nil {
18278					return err
18279				}
18280				s.Kind = &kind
18281			}
18282		case "properties":
18283			if v != nil {
18284				var serverProperties ServerProperties
18285				err = json.Unmarshal(*v, &serverProperties)
18286				if err != nil {
18287					return err
18288				}
18289				s.ServerProperties = &serverProperties
18290			}
18291		case "location":
18292			if v != nil {
18293				var location string
18294				err = json.Unmarshal(*v, &location)
18295				if err != nil {
18296					return err
18297				}
18298				s.Location = &location
18299			}
18300		case "tags":
18301			if v != nil {
18302				var tags map[string]*string
18303				err = json.Unmarshal(*v, &tags)
18304				if err != nil {
18305					return err
18306				}
18307				s.Tags = tags
18308			}
18309		case "id":
18310			if v != nil {
18311				var ID string
18312				err = json.Unmarshal(*v, &ID)
18313				if err != nil {
18314					return err
18315				}
18316				s.ID = &ID
18317			}
18318		case "name":
18319			if v != nil {
18320				var name string
18321				err = json.Unmarshal(*v, &name)
18322				if err != nil {
18323					return err
18324				}
18325				s.Name = &name
18326			}
18327		case "type":
18328			if v != nil {
18329				var typeVar string
18330				err = json.Unmarshal(*v, &typeVar)
18331				if err != nil {
18332					return err
18333				}
18334				s.Type = &typeVar
18335			}
18336		}
18337	}
18338
18339	return nil
18340}
18341
18342// ServerAutomaticTuning server-level Automatic Tuning.
18343type ServerAutomaticTuning struct {
18344	autorest.Response `json:"-"`
18345	// AutomaticTuningServerProperties - Resource properties.
18346	*AutomaticTuningServerProperties `json:"properties,omitempty"`
18347	// ID - READ-ONLY; Resource ID.
18348	ID *string `json:"id,omitempty"`
18349	// Name - READ-ONLY; Resource name.
18350	Name *string `json:"name,omitempty"`
18351	// Type - READ-ONLY; Resource type.
18352	Type *string `json:"type,omitempty"`
18353}
18354
18355// MarshalJSON is the custom marshaler for ServerAutomaticTuning.
18356func (sat ServerAutomaticTuning) MarshalJSON() ([]byte, error) {
18357	objectMap := make(map[string]interface{})
18358	if sat.AutomaticTuningServerProperties != nil {
18359		objectMap["properties"] = sat.AutomaticTuningServerProperties
18360	}
18361	return json.Marshal(objectMap)
18362}
18363
18364// UnmarshalJSON is the custom unmarshaler for ServerAutomaticTuning struct.
18365func (sat *ServerAutomaticTuning) UnmarshalJSON(body []byte) error {
18366	var m map[string]*json.RawMessage
18367	err := json.Unmarshal(body, &m)
18368	if err != nil {
18369		return err
18370	}
18371	for k, v := range m {
18372		switch k {
18373		case "properties":
18374			if v != nil {
18375				var automaticTuningServerProperties AutomaticTuningServerProperties
18376				err = json.Unmarshal(*v, &automaticTuningServerProperties)
18377				if err != nil {
18378					return err
18379				}
18380				sat.AutomaticTuningServerProperties = &automaticTuningServerProperties
18381			}
18382		case "id":
18383			if v != nil {
18384				var ID string
18385				err = json.Unmarshal(*v, &ID)
18386				if err != nil {
18387					return err
18388				}
18389				sat.ID = &ID
18390			}
18391		case "name":
18392			if v != nil {
18393				var name string
18394				err = json.Unmarshal(*v, &name)
18395				if err != nil {
18396					return err
18397				}
18398				sat.Name = &name
18399			}
18400		case "type":
18401			if v != nil {
18402				var typeVar string
18403				err = json.Unmarshal(*v, &typeVar)
18404				if err != nil {
18405					return err
18406				}
18407				sat.Type = &typeVar
18408			}
18409		}
18410	}
18411
18412	return nil
18413}
18414
18415// ServerAzureADAdministrator azure Active Directory administrator.
18416type ServerAzureADAdministrator struct {
18417	autorest.Response `json:"-"`
18418	// AdministratorProperties - Resource properties.
18419	*AdministratorProperties `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 ServerAzureADAdministrator.
18429func (saaa ServerAzureADAdministrator) MarshalJSON() ([]byte, error) {
18430	objectMap := make(map[string]interface{})
18431	if saaa.AdministratorProperties != nil {
18432		objectMap["properties"] = saaa.AdministratorProperties
18433	}
18434	return json.Marshal(objectMap)
18435}
18436
18437// UnmarshalJSON is the custom unmarshaler for ServerAzureADAdministrator struct.
18438func (saaa *ServerAzureADAdministrator) 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 administratorProperties AdministratorProperties
18449				err = json.Unmarshal(*v, &administratorProperties)
18450				if err != nil {
18451					return err
18452				}
18453				saaa.AdministratorProperties = &administratorProperties
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				saaa.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				saaa.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				saaa.Type = &typeVar
18481			}
18482		}
18483	}
18484
18485	return nil
18486}
18487
18488// ServerAzureADAdministratorsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results
18489// of a long-running operation.
18490type ServerAzureADAdministratorsCreateOrUpdateFuture struct {
18491	azure.FutureAPI
18492	// Result returns the result of the asynchronous operation.
18493	// If the operation has not completed it will return an error.
18494	Result func(ServerAzureADAdministratorsClient) (ServerAzureADAdministrator, error)
18495}
18496
18497// UnmarshalJSON is the custom unmarshaller for CreateFuture.
18498func (future *ServerAzureADAdministratorsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
18499	var azFuture azure.Future
18500	if err := json.Unmarshal(body, &azFuture); err != nil {
18501		return err
18502	}
18503	future.FutureAPI = &azFuture
18504	future.Result = future.result
18505	return nil
18506}
18507
18508// result is the default implementation for ServerAzureADAdministratorsCreateOrUpdateFuture.Result.
18509func (future *ServerAzureADAdministratorsCreateOrUpdateFuture) result(client ServerAzureADAdministratorsClient) (saaa ServerAzureADAdministrator, err error) {
18510	var done bool
18511	done, err = future.DoneWithContext(context.Background(), client)
18512	if err != nil {
18513		err = autorest.NewErrorWithError(err, "sql.ServerAzureADAdministratorsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
18514		return
18515	}
18516	if !done {
18517		saaa.Response.Response = future.Response()
18518		err = azure.NewAsyncOpIncompleteError("sql.ServerAzureADAdministratorsCreateOrUpdateFuture")
18519		return
18520	}
18521	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
18522	if saaa.Response.Response, err = future.GetResult(sender); err == nil && saaa.Response.Response.StatusCode != http.StatusNoContent {
18523		saaa, err = client.CreateOrUpdateResponder(saaa.Response.Response)
18524		if err != nil {
18525			err = autorest.NewErrorWithError(err, "sql.ServerAzureADAdministratorsCreateOrUpdateFuture", "Result", saaa.Response.Response, "Failure responding to request")
18526		}
18527	}
18528	return
18529}
18530
18531// ServerAzureADAdministratorsDeleteFuture an abstraction for monitoring and retrieving the results of a
18532// long-running operation.
18533type ServerAzureADAdministratorsDeleteFuture struct {
18534	azure.FutureAPI
18535	// Result returns the result of the asynchronous operation.
18536	// If the operation has not completed it will return an error.
18537	Result func(ServerAzureADAdministratorsClient) (autorest.Response, error)
18538}
18539
18540// UnmarshalJSON is the custom unmarshaller for CreateFuture.
18541func (future *ServerAzureADAdministratorsDeleteFuture) UnmarshalJSON(body []byte) error {
18542	var azFuture azure.Future
18543	if err := json.Unmarshal(body, &azFuture); err != nil {
18544		return err
18545	}
18546	future.FutureAPI = &azFuture
18547	future.Result = future.result
18548	return nil
18549}
18550
18551// result is the default implementation for ServerAzureADAdministratorsDeleteFuture.Result.
18552func (future *ServerAzureADAdministratorsDeleteFuture) result(client ServerAzureADAdministratorsClient) (ar autorest.Response, err error) {
18553	var done bool
18554	done, err = future.DoneWithContext(context.Background(), client)
18555	if err != nil {
18556		err = autorest.NewErrorWithError(err, "sql.ServerAzureADAdministratorsDeleteFuture", "Result", future.Response(), "Polling failure")
18557		return
18558	}
18559	if !done {
18560		ar.Response = future.Response()
18561		err = azure.NewAsyncOpIncompleteError("sql.ServerAzureADAdministratorsDeleteFuture")
18562		return
18563	}
18564	ar.Response = future.Response()
18565	return
18566}
18567
18568// ServerAzureADOnlyAuthentication azure Active Directory only authentication.
18569type ServerAzureADOnlyAuthentication struct {
18570	autorest.Response `json:"-"`
18571	// AzureADOnlyAuthProperties - Resource properties.
18572	*AzureADOnlyAuthProperties `json:"properties,omitempty"`
18573	// ID - READ-ONLY; Resource ID.
18574	ID *string `json:"id,omitempty"`
18575	// Name - READ-ONLY; Resource name.
18576	Name *string `json:"name,omitempty"`
18577	// Type - READ-ONLY; Resource type.
18578	Type *string `json:"type,omitempty"`
18579}
18580
18581// MarshalJSON is the custom marshaler for ServerAzureADOnlyAuthentication.
18582func (saaoa ServerAzureADOnlyAuthentication) MarshalJSON() ([]byte, error) {
18583	objectMap := make(map[string]interface{})
18584	if saaoa.AzureADOnlyAuthProperties != nil {
18585		objectMap["properties"] = saaoa.AzureADOnlyAuthProperties
18586	}
18587	return json.Marshal(objectMap)
18588}
18589
18590// UnmarshalJSON is the custom unmarshaler for ServerAzureADOnlyAuthentication struct.
18591func (saaoa *ServerAzureADOnlyAuthentication) UnmarshalJSON(body []byte) error {
18592	var m map[string]*json.RawMessage
18593	err := json.Unmarshal(body, &m)
18594	if err != nil {
18595		return err
18596	}
18597	for k, v := range m {
18598		switch k {
18599		case "properties":
18600			if v != nil {
18601				var azureADOnlyAuthProperties AzureADOnlyAuthProperties
18602				err = json.Unmarshal(*v, &azureADOnlyAuthProperties)
18603				if err != nil {
18604					return err
18605				}
18606				saaoa.AzureADOnlyAuthProperties = &azureADOnlyAuthProperties
18607			}
18608		case "id":
18609			if v != nil {
18610				var ID string
18611				err = json.Unmarshal(*v, &ID)
18612				if err != nil {
18613					return err
18614				}
18615				saaoa.ID = &ID
18616			}
18617		case "name":
18618			if v != nil {
18619				var name string
18620				err = json.Unmarshal(*v, &name)
18621				if err != nil {
18622					return err
18623				}
18624				saaoa.Name = &name
18625			}
18626		case "type":
18627			if v != nil {
18628				var typeVar string
18629				err = json.Unmarshal(*v, &typeVar)
18630				if err != nil {
18631					return err
18632				}
18633				saaoa.Type = &typeVar
18634			}
18635		}
18636	}
18637
18638	return nil
18639}
18640
18641// ServerAzureADOnlyAuthenticationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the
18642// results of a long-running operation.
18643type ServerAzureADOnlyAuthenticationsCreateOrUpdateFuture struct {
18644	azure.FutureAPI
18645	// Result returns the result of the asynchronous operation.
18646	// If the operation has not completed it will return an error.
18647	Result func(ServerAzureADOnlyAuthenticationsClient) (ServerAzureADOnlyAuthentication, error)
18648}
18649
18650// UnmarshalJSON is the custom unmarshaller for CreateFuture.
18651func (future *ServerAzureADOnlyAuthenticationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
18652	var azFuture azure.Future
18653	if err := json.Unmarshal(body, &azFuture); err != nil {
18654		return err
18655	}
18656	future.FutureAPI = &azFuture
18657	future.Result = future.result
18658	return nil
18659}
18660
18661// result is the default implementation for ServerAzureADOnlyAuthenticationsCreateOrUpdateFuture.Result.
18662func (future *ServerAzureADOnlyAuthenticationsCreateOrUpdateFuture) result(client ServerAzureADOnlyAuthenticationsClient) (saaoa ServerAzureADOnlyAuthentication, err error) {
18663	var done bool
18664	done, err = future.DoneWithContext(context.Background(), client)
18665	if err != nil {
18666		err = autorest.NewErrorWithError(err, "sql.ServerAzureADOnlyAuthenticationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
18667		return
18668	}
18669	if !done {
18670		saaoa.Response.Response = future.Response()
18671		err = azure.NewAsyncOpIncompleteError("sql.ServerAzureADOnlyAuthenticationsCreateOrUpdateFuture")
18672		return
18673	}
18674	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
18675	if saaoa.Response.Response, err = future.GetResult(sender); err == nil && saaoa.Response.Response.StatusCode != http.StatusNoContent {
18676		saaoa, err = client.CreateOrUpdateResponder(saaoa.Response.Response)
18677		if err != nil {
18678			err = autorest.NewErrorWithError(err, "sql.ServerAzureADOnlyAuthenticationsCreateOrUpdateFuture", "Result", saaoa.Response.Response, "Failure responding to request")
18679		}
18680	}
18681	return
18682}
18683
18684// ServerAzureADOnlyAuthenticationsDeleteFuture an abstraction for monitoring and retrieving the results of
18685// a long-running operation.
18686type ServerAzureADOnlyAuthenticationsDeleteFuture struct {
18687	azure.FutureAPI
18688	// Result returns the result of the asynchronous operation.
18689	// If the operation has not completed it will return an error.
18690	Result func(ServerAzureADOnlyAuthenticationsClient) (autorest.Response, error)
18691}
18692
18693// UnmarshalJSON is the custom unmarshaller for CreateFuture.
18694func (future *ServerAzureADOnlyAuthenticationsDeleteFuture) UnmarshalJSON(body []byte) error {
18695	var azFuture azure.Future
18696	if err := json.Unmarshal(body, &azFuture); err != nil {
18697		return err
18698	}
18699	future.FutureAPI = &azFuture
18700	future.Result = future.result
18701	return nil
18702}
18703
18704// result is the default implementation for ServerAzureADOnlyAuthenticationsDeleteFuture.Result.
18705func (future *ServerAzureADOnlyAuthenticationsDeleteFuture) result(client ServerAzureADOnlyAuthenticationsClient) (ar autorest.Response, err error) {
18706	var done bool
18707	done, err = future.DoneWithContext(context.Background(), client)
18708	if err != nil {
18709		err = autorest.NewErrorWithError(err, "sql.ServerAzureADOnlyAuthenticationsDeleteFuture", "Result", future.Response(), "Polling failure")
18710		return
18711	}
18712	if !done {
18713		ar.Response = future.Response()
18714		err = azure.NewAsyncOpIncompleteError("sql.ServerAzureADOnlyAuthenticationsDeleteFuture")
18715		return
18716	}
18717	ar.Response = future.Response()
18718	return
18719}
18720
18721// ServerBlobAuditingPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results
18722// of a long-running operation.
18723type ServerBlobAuditingPoliciesCreateOrUpdateFuture struct {
18724	azure.FutureAPI
18725	// Result returns the result of the asynchronous operation.
18726	// If the operation has not completed it will return an error.
18727	Result func(ServerBlobAuditingPoliciesClient) (ServerBlobAuditingPolicy, error)
18728}
18729
18730// UnmarshalJSON is the custom unmarshaller for CreateFuture.
18731func (future *ServerBlobAuditingPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
18732	var azFuture azure.Future
18733	if err := json.Unmarshal(body, &azFuture); err != nil {
18734		return err
18735	}
18736	future.FutureAPI = &azFuture
18737	future.Result = future.result
18738	return nil
18739}
18740
18741// result is the default implementation for ServerBlobAuditingPoliciesCreateOrUpdateFuture.Result.
18742func (future *ServerBlobAuditingPoliciesCreateOrUpdateFuture) result(client ServerBlobAuditingPoliciesClient) (sbap ServerBlobAuditingPolicy, err error) {
18743	var done bool
18744	done, err = future.DoneWithContext(context.Background(), client)
18745	if err != nil {
18746		err = autorest.NewErrorWithError(err, "sql.ServerBlobAuditingPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
18747		return
18748	}
18749	if !done {
18750		sbap.Response.Response = future.Response()
18751		err = azure.NewAsyncOpIncompleteError("sql.ServerBlobAuditingPoliciesCreateOrUpdateFuture")
18752		return
18753	}
18754	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
18755	if sbap.Response.Response, err = future.GetResult(sender); err == nil && sbap.Response.Response.StatusCode != http.StatusNoContent {
18756		sbap, err = client.CreateOrUpdateResponder(sbap.Response.Response)
18757		if err != nil {
18758			err = autorest.NewErrorWithError(err, "sql.ServerBlobAuditingPoliciesCreateOrUpdateFuture", "Result", sbap.Response.Response, "Failure responding to request")
18759		}
18760	}
18761	return
18762}
18763
18764// ServerBlobAuditingPolicy a server blob auditing policy.
18765type ServerBlobAuditingPolicy struct {
18766	autorest.Response `json:"-"`
18767	// ServerBlobAuditingPolicyProperties - Resource properties.
18768	*ServerBlobAuditingPolicyProperties `json:"properties,omitempty"`
18769	// ID - READ-ONLY; Resource ID.
18770	ID *string `json:"id,omitempty"`
18771	// Name - READ-ONLY; Resource name.
18772	Name *string `json:"name,omitempty"`
18773	// Type - READ-ONLY; Resource type.
18774	Type *string `json:"type,omitempty"`
18775}
18776
18777// MarshalJSON is the custom marshaler for ServerBlobAuditingPolicy.
18778func (sbap ServerBlobAuditingPolicy) MarshalJSON() ([]byte, error) {
18779	objectMap := make(map[string]interface{})
18780	if sbap.ServerBlobAuditingPolicyProperties != nil {
18781		objectMap["properties"] = sbap.ServerBlobAuditingPolicyProperties
18782	}
18783	return json.Marshal(objectMap)
18784}
18785
18786// UnmarshalJSON is the custom unmarshaler for ServerBlobAuditingPolicy struct.
18787func (sbap *ServerBlobAuditingPolicy) UnmarshalJSON(body []byte) error {
18788	var m map[string]*json.RawMessage
18789	err := json.Unmarshal(body, &m)
18790	if err != nil {
18791		return err
18792	}
18793	for k, v := range m {
18794		switch k {
18795		case "properties":
18796			if v != nil {
18797				var serverBlobAuditingPolicyProperties ServerBlobAuditingPolicyProperties
18798				err = json.Unmarshal(*v, &serverBlobAuditingPolicyProperties)
18799				if err != nil {
18800					return err
18801				}
18802				sbap.ServerBlobAuditingPolicyProperties = &serverBlobAuditingPolicyProperties
18803			}
18804		case "id":
18805			if v != nil {
18806				var ID string
18807				err = json.Unmarshal(*v, &ID)
18808				if err != nil {
18809					return err
18810				}
18811				sbap.ID = &ID
18812			}
18813		case "name":
18814			if v != nil {
18815				var name string
18816				err = json.Unmarshal(*v, &name)
18817				if err != nil {
18818					return err
18819				}
18820				sbap.Name = &name
18821			}
18822		case "type":
18823			if v != nil {
18824				var typeVar string
18825				err = json.Unmarshal(*v, &typeVar)
18826				if err != nil {
18827					return err
18828				}
18829				sbap.Type = &typeVar
18830			}
18831		}
18832	}
18833
18834	return nil
18835}
18836
18837// ServerBlobAuditingPolicyListResult a list of server auditing settings.
18838type ServerBlobAuditingPolicyListResult struct {
18839	autorest.Response `json:"-"`
18840	// Value - READ-ONLY; Array of results.
18841	Value *[]ServerBlobAuditingPolicy `json:"value,omitempty"`
18842	// NextLink - READ-ONLY; Link to retrieve next page of results.
18843	NextLink *string `json:"nextLink,omitempty"`
18844}
18845
18846// MarshalJSON is the custom marshaler for ServerBlobAuditingPolicyListResult.
18847func (sbaplr ServerBlobAuditingPolicyListResult) MarshalJSON() ([]byte, error) {
18848	objectMap := make(map[string]interface{})
18849	return json.Marshal(objectMap)
18850}
18851
18852// ServerBlobAuditingPolicyListResultIterator provides access to a complete listing of
18853// ServerBlobAuditingPolicy values.
18854type ServerBlobAuditingPolicyListResultIterator struct {
18855	i    int
18856	page ServerBlobAuditingPolicyListResultPage
18857}
18858
18859// NextWithContext advances to the next value.  If there was an error making
18860// the request the iterator does not advance and the error is returned.
18861func (iter *ServerBlobAuditingPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
18862	if tracing.IsEnabled() {
18863		ctx = tracing.StartSpan(ctx, fqdn+"/ServerBlobAuditingPolicyListResultIterator.NextWithContext")
18864		defer func() {
18865			sc := -1
18866			if iter.Response().Response.Response != nil {
18867				sc = iter.Response().Response.Response.StatusCode
18868			}
18869			tracing.EndSpan(ctx, sc, err)
18870		}()
18871	}
18872	iter.i++
18873	if iter.i < len(iter.page.Values()) {
18874		return nil
18875	}
18876	err = iter.page.NextWithContext(ctx)
18877	if err != nil {
18878		iter.i--
18879		return err
18880	}
18881	iter.i = 0
18882	return nil
18883}
18884
18885// Next advances to the next value.  If there was an error making
18886// the request the iterator does not advance and the error is returned.
18887// Deprecated: Use NextWithContext() instead.
18888func (iter *ServerBlobAuditingPolicyListResultIterator) Next() error {
18889	return iter.NextWithContext(context.Background())
18890}
18891
18892// NotDone returns true if the enumeration should be started or is not yet complete.
18893func (iter ServerBlobAuditingPolicyListResultIterator) NotDone() bool {
18894	return iter.page.NotDone() && iter.i < len(iter.page.Values())
18895}
18896
18897// Response returns the raw server response from the last page request.
18898func (iter ServerBlobAuditingPolicyListResultIterator) Response() ServerBlobAuditingPolicyListResult {
18899	return iter.page.Response()
18900}
18901
18902// Value returns the current value or a zero-initialized value if the
18903// iterator has advanced beyond the end of the collection.
18904func (iter ServerBlobAuditingPolicyListResultIterator) Value() ServerBlobAuditingPolicy {
18905	if !iter.page.NotDone() {
18906		return ServerBlobAuditingPolicy{}
18907	}
18908	return iter.page.Values()[iter.i]
18909}
18910
18911// Creates a new instance of the ServerBlobAuditingPolicyListResultIterator type.
18912func NewServerBlobAuditingPolicyListResultIterator(page ServerBlobAuditingPolicyListResultPage) ServerBlobAuditingPolicyListResultIterator {
18913	return ServerBlobAuditingPolicyListResultIterator{page: page}
18914}
18915
18916// IsEmpty returns true if the ListResult contains no values.
18917func (sbaplr ServerBlobAuditingPolicyListResult) IsEmpty() bool {
18918	return sbaplr.Value == nil || len(*sbaplr.Value) == 0
18919}
18920
18921// hasNextLink returns true if the NextLink is not empty.
18922func (sbaplr ServerBlobAuditingPolicyListResult) hasNextLink() bool {
18923	return sbaplr.NextLink != nil && len(*sbaplr.NextLink) != 0
18924}
18925
18926// serverBlobAuditingPolicyListResultPreparer prepares a request to retrieve the next set of results.
18927// It returns nil if no more results exist.
18928func (sbaplr ServerBlobAuditingPolicyListResult) serverBlobAuditingPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
18929	if !sbaplr.hasNextLink() {
18930		return nil, nil
18931	}
18932	return autorest.Prepare((&http.Request{}).WithContext(ctx),
18933		autorest.AsJSON(),
18934		autorest.AsGet(),
18935		autorest.WithBaseURL(to.String(sbaplr.NextLink)))
18936}
18937
18938// ServerBlobAuditingPolicyListResultPage contains a page of ServerBlobAuditingPolicy values.
18939type ServerBlobAuditingPolicyListResultPage struct {
18940	fn     func(context.Context, ServerBlobAuditingPolicyListResult) (ServerBlobAuditingPolicyListResult, error)
18941	sbaplr ServerBlobAuditingPolicyListResult
18942}
18943
18944// NextWithContext advances to the next page of values.  If there was an error making
18945// the request the page does not advance and the error is returned.
18946func (page *ServerBlobAuditingPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
18947	if tracing.IsEnabled() {
18948		ctx = tracing.StartSpan(ctx, fqdn+"/ServerBlobAuditingPolicyListResultPage.NextWithContext")
18949		defer func() {
18950			sc := -1
18951			if page.Response().Response.Response != nil {
18952				sc = page.Response().Response.Response.StatusCode
18953			}
18954			tracing.EndSpan(ctx, sc, err)
18955		}()
18956	}
18957	for {
18958		next, err := page.fn(ctx, page.sbaplr)
18959		if err != nil {
18960			return err
18961		}
18962		page.sbaplr = next
18963		if !next.hasNextLink() || !next.IsEmpty() {
18964			break
18965		}
18966	}
18967	return nil
18968}
18969
18970// Next advances to the next page of values.  If there was an error making
18971// the request the page does not advance and the error is returned.
18972// Deprecated: Use NextWithContext() instead.
18973func (page *ServerBlobAuditingPolicyListResultPage) Next() error {
18974	return page.NextWithContext(context.Background())
18975}
18976
18977// NotDone returns true if the page enumeration should be started or is not yet complete.
18978func (page ServerBlobAuditingPolicyListResultPage) NotDone() bool {
18979	return !page.sbaplr.IsEmpty()
18980}
18981
18982// Response returns the raw server response from the last page request.
18983func (page ServerBlobAuditingPolicyListResultPage) Response() ServerBlobAuditingPolicyListResult {
18984	return page.sbaplr
18985}
18986
18987// Values returns the slice of values for the current page or nil if there are no values.
18988func (page ServerBlobAuditingPolicyListResultPage) Values() []ServerBlobAuditingPolicy {
18989	if page.sbaplr.IsEmpty() {
18990		return nil
18991	}
18992	return *page.sbaplr.Value
18993}
18994
18995// Creates a new instance of the ServerBlobAuditingPolicyListResultPage type.
18996func NewServerBlobAuditingPolicyListResultPage(cur ServerBlobAuditingPolicyListResult, getNextPage func(context.Context, ServerBlobAuditingPolicyListResult) (ServerBlobAuditingPolicyListResult, error)) ServerBlobAuditingPolicyListResultPage {
18997	return ServerBlobAuditingPolicyListResultPage{
18998		fn:     getNextPage,
18999		sbaplr: cur,
19000	}
19001}
19002
19003// ServerBlobAuditingPolicyProperties properties of a server blob auditing policy.
19004type ServerBlobAuditingPolicyProperties struct {
19005	// State - Specifies the state of the policy. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. Possible values include: 'BlobAuditingPolicyStateEnabled', 'BlobAuditingPolicyStateDisabled'
19006	State BlobAuditingPolicyState `json:"state,omitempty"`
19007	// StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required.
19008	StorageEndpoint *string `json:"storageEndpoint,omitempty"`
19009	// StorageAccountAccessKey - Specifies the identifier key of the auditing storage account.
19010	// If state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage.
19011	// Prerequisites for using managed identity authentication:
19012	// 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD).
19013	// 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity.
19014	// For more information, see [Auditing to storage using Managed Identity authentication](https://go.microsoft.com/fwlink/?linkid=2114355)
19015	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
19016	// RetentionDays - Specifies the number of days to keep in the audit logs in the storage account.
19017	RetentionDays *int32 `json:"retentionDays,omitempty"`
19018	// AuditActionsAndGroups - Specifies the Actions-Groups and Actions to audit.
19019	//
19020	// 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:
19021	//
19022	// BATCH_COMPLETED_GROUP,
19023	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP,
19024	// FAILED_DATABASE_AUTHENTICATION_GROUP.
19025	//
19026	// This above combination is also the set that is configured by default when enabling auditing from the Azure portal.
19027	//
19028	// 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):
19029	//
19030	// APPLICATION_ROLE_CHANGE_PASSWORD_GROUP
19031	// BACKUP_RESTORE_GROUP
19032	// DATABASE_LOGOUT_GROUP
19033	// DATABASE_OBJECT_CHANGE_GROUP
19034	// DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP
19035	// DATABASE_OBJECT_PERMISSION_CHANGE_GROUP
19036	// DATABASE_OPERATION_GROUP
19037	// DATABASE_PERMISSION_CHANGE_GROUP
19038	// DATABASE_PRINCIPAL_CHANGE_GROUP
19039	// DATABASE_PRINCIPAL_IMPERSONATION_GROUP
19040	// DATABASE_ROLE_MEMBER_CHANGE_GROUP
19041	// FAILED_DATABASE_AUTHENTICATION_GROUP
19042	// SCHEMA_OBJECT_ACCESS_GROUP
19043	// SCHEMA_OBJECT_CHANGE_GROUP
19044	// SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP
19045	// SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP
19046	// SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP
19047	// USER_CHANGE_PASSWORD_GROUP
19048	// BATCH_STARTED_GROUP
19049	// BATCH_COMPLETED_GROUP
19050	//
19051	// 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.
19052	//
19053	// 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).
19054	//
19055	// 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:
19056	// SELECT
19057	// UPDATE
19058	// INSERT
19059	// DELETE
19060	// EXECUTE
19061	// RECEIVE
19062	// REFERENCES
19063	//
19064	// The general form for defining an action to be audited is:
19065	// {action} ON {object} BY {principal}
19066	//
19067	// 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.
19068	//
19069	// For example:
19070	// SELECT on dbo.myTable by public
19071	// SELECT on DATABASE::myDatabase by public
19072	// SELECT on SCHEMA::mySchema by public
19073	//
19074	// 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)
19075	AuditActionsAndGroups *[]string `json:"auditActionsAndGroups,omitempty"`
19076	// StorageAccountSubscriptionID - Specifies the blob storage subscription Id.
19077	StorageAccountSubscriptionID *uuid.UUID `json:"storageAccountSubscriptionId,omitempty"`
19078	// IsStorageSecondaryKeyInUse - Specifies whether storageAccountAccessKey value is the storage's secondary key.
19079	IsStorageSecondaryKeyInUse *bool `json:"isStorageSecondaryKeyInUse,omitempty"`
19080	// IsAzureMonitorTargetEnabled - Specifies whether audit events are sent to Azure Monitor.
19081	// In order to send the events to Azure Monitor, specify 'state' as 'Enabled' and 'isAzureMonitorTargetEnabled' as true.
19082	//
19083	// When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created.
19084	// Note that for server level audit you should use the 'master' database as {databaseName}.
19085	//
19086	// Diagnostic Settings URI format:
19087	// 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
19088	//
19089	// For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207)
19090	// or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043)
19091	IsAzureMonitorTargetEnabled *bool `json:"isAzureMonitorTargetEnabled,omitempty"`
19092	// QueueDelayMs - Specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed.
19093	// The default minimum value is 1000 (1 second). The maximum is 2,147,483,647.
19094	QueueDelayMs *int32 `json:"queueDelayMs,omitempty"`
19095}
19096
19097// ServerCommunicationLink server communication link.
19098type ServerCommunicationLink struct {
19099	autorest.Response `json:"-"`
19100	// ServerCommunicationLinkProperties - The properties of resource.
19101	*ServerCommunicationLinkProperties `json:"properties,omitempty"`
19102	// Location - READ-ONLY; Communication link location.
19103	Location *string `json:"location,omitempty"`
19104	// Kind - READ-ONLY; Communication link kind.  This property is used for Azure Portal metadata.
19105	Kind *string `json:"kind,omitempty"`
19106	// ID - READ-ONLY; Resource ID.
19107	ID *string `json:"id,omitempty"`
19108	// Name - READ-ONLY; Resource name.
19109	Name *string `json:"name,omitempty"`
19110	// Type - READ-ONLY; Resource type.
19111	Type *string `json:"type,omitempty"`
19112}
19113
19114// MarshalJSON is the custom marshaler for ServerCommunicationLink.
19115func (scl ServerCommunicationLink) MarshalJSON() ([]byte, error) {
19116	objectMap := make(map[string]interface{})
19117	if scl.ServerCommunicationLinkProperties != nil {
19118		objectMap["properties"] = scl.ServerCommunicationLinkProperties
19119	}
19120	return json.Marshal(objectMap)
19121}
19122
19123// UnmarshalJSON is the custom unmarshaler for ServerCommunicationLink struct.
19124func (scl *ServerCommunicationLink) UnmarshalJSON(body []byte) error {
19125	var m map[string]*json.RawMessage
19126	err := json.Unmarshal(body, &m)
19127	if err != nil {
19128		return err
19129	}
19130	for k, v := range m {
19131		switch k {
19132		case "properties":
19133			if v != nil {
19134				var serverCommunicationLinkProperties ServerCommunicationLinkProperties
19135				err = json.Unmarshal(*v, &serverCommunicationLinkProperties)
19136				if err != nil {
19137					return err
19138				}
19139				scl.ServerCommunicationLinkProperties = &serverCommunicationLinkProperties
19140			}
19141		case "location":
19142			if v != nil {
19143				var location string
19144				err = json.Unmarshal(*v, &location)
19145				if err != nil {
19146					return err
19147				}
19148				scl.Location = &location
19149			}
19150		case "kind":
19151			if v != nil {
19152				var kind string
19153				err = json.Unmarshal(*v, &kind)
19154				if err != nil {
19155					return err
19156				}
19157				scl.Kind = &kind
19158			}
19159		case "id":
19160			if v != nil {
19161				var ID string
19162				err = json.Unmarshal(*v, &ID)
19163				if err != nil {
19164					return err
19165				}
19166				scl.ID = &ID
19167			}
19168		case "name":
19169			if v != nil {
19170				var name string
19171				err = json.Unmarshal(*v, &name)
19172				if err != nil {
19173					return err
19174				}
19175				scl.Name = &name
19176			}
19177		case "type":
19178			if v != nil {
19179				var typeVar string
19180				err = json.Unmarshal(*v, &typeVar)
19181				if err != nil {
19182					return err
19183				}
19184				scl.Type = &typeVar
19185			}
19186		}
19187	}
19188
19189	return nil
19190}
19191
19192// ServerCommunicationLinkListResult a list of server communication links.
19193type ServerCommunicationLinkListResult struct {
19194	autorest.Response `json:"-"`
19195	// Value - The list of server communication links.
19196	Value *[]ServerCommunicationLink `json:"value,omitempty"`
19197}
19198
19199// ServerCommunicationLinkProperties the properties of a server communication link.
19200type ServerCommunicationLinkProperties struct {
19201	// State - READ-ONLY; The state.
19202	State *string `json:"state,omitempty"`
19203	// PartnerServer - The name of the partner server.
19204	PartnerServer *string `json:"partnerServer,omitempty"`
19205}
19206
19207// MarshalJSON is the custom marshaler for ServerCommunicationLinkProperties.
19208func (sclp ServerCommunicationLinkProperties) MarshalJSON() ([]byte, error) {
19209	objectMap := make(map[string]interface{})
19210	if sclp.PartnerServer != nil {
19211		objectMap["partnerServer"] = sclp.PartnerServer
19212	}
19213	return json.Marshal(objectMap)
19214}
19215
19216// ServerCommunicationLinksCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of
19217// a long-running operation.
19218type ServerCommunicationLinksCreateOrUpdateFuture struct {
19219	azure.FutureAPI
19220	// Result returns the result of the asynchronous operation.
19221	// If the operation has not completed it will return an error.
19222	Result func(ServerCommunicationLinksClient) (ServerCommunicationLink, error)
19223}
19224
19225// UnmarshalJSON is the custom unmarshaller for CreateFuture.
19226func (future *ServerCommunicationLinksCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
19227	var azFuture azure.Future
19228	if err := json.Unmarshal(body, &azFuture); err != nil {
19229		return err
19230	}
19231	future.FutureAPI = &azFuture
19232	future.Result = future.result
19233	return nil
19234}
19235
19236// result is the default implementation for ServerCommunicationLinksCreateOrUpdateFuture.Result.
19237func (future *ServerCommunicationLinksCreateOrUpdateFuture) result(client ServerCommunicationLinksClient) (scl ServerCommunicationLink, err error) {
19238	var done bool
19239	done, err = future.DoneWithContext(context.Background(), client)
19240	if err != nil {
19241		err = autorest.NewErrorWithError(err, "sql.ServerCommunicationLinksCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
19242		return
19243	}
19244	if !done {
19245		scl.Response.Response = future.Response()
19246		err = azure.NewAsyncOpIncompleteError("sql.ServerCommunicationLinksCreateOrUpdateFuture")
19247		return
19248	}
19249	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
19250	if scl.Response.Response, err = future.GetResult(sender); err == nil && scl.Response.Response.StatusCode != http.StatusNoContent {
19251		scl, err = client.CreateOrUpdateResponder(scl.Response.Response)
19252		if err != nil {
19253			err = autorest.NewErrorWithError(err, "sql.ServerCommunicationLinksCreateOrUpdateFuture", "Result", scl.Response.Response, "Failure responding to request")
19254		}
19255	}
19256	return
19257}
19258
19259// ServerConnectionPolicy a server secure connection policy.
19260type ServerConnectionPolicy struct {
19261	autorest.Response `json:"-"`
19262	// Kind - READ-ONLY; Metadata used for the Azure portal experience.
19263	Kind *string `json:"kind,omitempty"`
19264	// Location - READ-ONLY; Resource location.
19265	Location *string `json:"location,omitempty"`
19266	// ServerConnectionPolicyProperties - The properties of the server secure connection policy.
19267	*ServerConnectionPolicyProperties `json:"properties,omitempty"`
19268	// ID - READ-ONLY; Resource ID.
19269	ID *string `json:"id,omitempty"`
19270	// Name - READ-ONLY; Resource name.
19271	Name *string `json:"name,omitempty"`
19272	// Type - READ-ONLY; Resource type.
19273	Type *string `json:"type,omitempty"`
19274}
19275
19276// MarshalJSON is the custom marshaler for ServerConnectionPolicy.
19277func (scp ServerConnectionPolicy) MarshalJSON() ([]byte, error) {
19278	objectMap := make(map[string]interface{})
19279	if scp.ServerConnectionPolicyProperties != nil {
19280		objectMap["properties"] = scp.ServerConnectionPolicyProperties
19281	}
19282	return json.Marshal(objectMap)
19283}
19284
19285// UnmarshalJSON is the custom unmarshaler for ServerConnectionPolicy struct.
19286func (scp *ServerConnectionPolicy) UnmarshalJSON(body []byte) error {
19287	var m map[string]*json.RawMessage
19288	err := json.Unmarshal(body, &m)
19289	if err != nil {
19290		return err
19291	}
19292	for k, v := range m {
19293		switch k {
19294		case "kind":
19295			if v != nil {
19296				var kind string
19297				err = json.Unmarshal(*v, &kind)
19298				if err != nil {
19299					return err
19300				}
19301				scp.Kind = &kind
19302			}
19303		case "location":
19304			if v != nil {
19305				var location string
19306				err = json.Unmarshal(*v, &location)
19307				if err != nil {
19308					return err
19309				}
19310				scp.Location = &location
19311			}
19312		case "properties":
19313			if v != nil {
19314				var serverConnectionPolicyProperties ServerConnectionPolicyProperties
19315				err = json.Unmarshal(*v, &serverConnectionPolicyProperties)
19316				if err != nil {
19317					return err
19318				}
19319				scp.ServerConnectionPolicyProperties = &serverConnectionPolicyProperties
19320			}
19321		case "id":
19322			if v != nil {
19323				var ID string
19324				err = json.Unmarshal(*v, &ID)
19325				if err != nil {
19326					return err
19327				}
19328				scp.ID = &ID
19329			}
19330		case "name":
19331			if v != nil {
19332				var name string
19333				err = json.Unmarshal(*v, &name)
19334				if err != nil {
19335					return err
19336				}
19337				scp.Name = &name
19338			}
19339		case "type":
19340			if v != nil {
19341				var typeVar string
19342				err = json.Unmarshal(*v, &typeVar)
19343				if err != nil {
19344					return err
19345				}
19346				scp.Type = &typeVar
19347			}
19348		}
19349	}
19350
19351	return nil
19352}
19353
19354// ServerConnectionPolicyProperties the properties of a server secure connection policy.
19355type ServerConnectionPolicyProperties struct {
19356	// ConnectionType - The server connection type. Possible values include: 'ServerConnectionTypeDefault', 'ServerConnectionTypeProxy', 'ServerConnectionTypeRedirect'
19357	ConnectionType ServerConnectionType `json:"connectionType,omitempty"`
19358}
19359
19360// ServerDNSAlias a server DNS alias.
19361type ServerDNSAlias struct {
19362	autorest.Response `json:"-"`
19363	// ServerDNSAliasProperties - Resource properties.
19364	*ServerDNSAliasProperties `json:"properties,omitempty"`
19365	// ID - READ-ONLY; Resource ID.
19366	ID *string `json:"id,omitempty"`
19367	// Name - READ-ONLY; Resource name.
19368	Name *string `json:"name,omitempty"`
19369	// Type - READ-ONLY; Resource type.
19370	Type *string `json:"type,omitempty"`
19371}
19372
19373// MarshalJSON is the custom marshaler for ServerDNSAlias.
19374func (sda ServerDNSAlias) MarshalJSON() ([]byte, error) {
19375	objectMap := make(map[string]interface{})
19376	if sda.ServerDNSAliasProperties != nil {
19377		objectMap["properties"] = sda.ServerDNSAliasProperties
19378	}
19379	return json.Marshal(objectMap)
19380}
19381
19382// UnmarshalJSON is the custom unmarshaler for ServerDNSAlias struct.
19383func (sda *ServerDNSAlias) UnmarshalJSON(body []byte) error {
19384	var m map[string]*json.RawMessage
19385	err := json.Unmarshal(body, &m)
19386	if err != nil {
19387		return err
19388	}
19389	for k, v := range m {
19390		switch k {
19391		case "properties":
19392			if v != nil {
19393				var serverDNSAliasProperties ServerDNSAliasProperties
19394				err = json.Unmarshal(*v, &serverDNSAliasProperties)
19395				if err != nil {
19396					return err
19397				}
19398				sda.ServerDNSAliasProperties = &serverDNSAliasProperties
19399			}
19400		case "id":
19401			if v != nil {
19402				var ID string
19403				err = json.Unmarshal(*v, &ID)
19404				if err != nil {
19405					return err
19406				}
19407				sda.ID = &ID
19408			}
19409		case "name":
19410			if v != nil {
19411				var name string
19412				err = json.Unmarshal(*v, &name)
19413				if err != nil {
19414					return err
19415				}
19416				sda.Name = &name
19417			}
19418		case "type":
19419			if v != nil {
19420				var typeVar string
19421				err = json.Unmarshal(*v, &typeVar)
19422				if err != nil {
19423					return err
19424				}
19425				sda.Type = &typeVar
19426			}
19427		}
19428	}
19429
19430	return nil
19431}
19432
19433// ServerDNSAliasAcquisition a server DNS alias acquisition request.
19434type ServerDNSAliasAcquisition struct {
19435	// OldServerDNSAliasID - The id of the server alias that will be acquired to point to this server instead.
19436	OldServerDNSAliasID *string `json:"oldServerDnsAliasId,omitempty"`
19437}
19438
19439// ServerDNSAliasesAcquireFuture an abstraction for monitoring and retrieving the results of a long-running
19440// operation.
19441type ServerDNSAliasesAcquireFuture struct {
19442	azure.FutureAPI
19443	// Result returns the result of the asynchronous operation.
19444	// If the operation has not completed it will return an error.
19445	Result func(ServerDNSAliasesClient) (autorest.Response, error)
19446}
19447
19448// UnmarshalJSON is the custom unmarshaller for CreateFuture.
19449func (future *ServerDNSAliasesAcquireFuture) UnmarshalJSON(body []byte) error {
19450	var azFuture azure.Future
19451	if err := json.Unmarshal(body, &azFuture); err != nil {
19452		return err
19453	}
19454	future.FutureAPI = &azFuture
19455	future.Result = future.result
19456	return nil
19457}
19458
19459// result is the default implementation for ServerDNSAliasesAcquireFuture.Result.
19460func (future *ServerDNSAliasesAcquireFuture) result(client ServerDNSAliasesClient) (ar autorest.Response, err error) {
19461	var done bool
19462	done, err = future.DoneWithContext(context.Background(), client)
19463	if err != nil {
19464		err = autorest.NewErrorWithError(err, "sql.ServerDNSAliasesAcquireFuture", "Result", future.Response(), "Polling failure")
19465		return
19466	}
19467	if !done {
19468		ar.Response = future.Response()
19469		err = azure.NewAsyncOpIncompleteError("sql.ServerDNSAliasesAcquireFuture")
19470		return
19471	}
19472	ar.Response = future.Response()
19473	return
19474}
19475
19476// ServerDNSAliasesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
19477// long-running operation.
19478type ServerDNSAliasesCreateOrUpdateFuture struct {
19479	azure.FutureAPI
19480	// Result returns the result of the asynchronous operation.
19481	// If the operation has not completed it will return an error.
19482	Result func(ServerDNSAliasesClient) (ServerDNSAlias, error)
19483}
19484
19485// UnmarshalJSON is the custom unmarshaller for CreateFuture.
19486func (future *ServerDNSAliasesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
19487	var azFuture azure.Future
19488	if err := json.Unmarshal(body, &azFuture); err != nil {
19489		return err
19490	}
19491	future.FutureAPI = &azFuture
19492	future.Result = future.result
19493	return nil
19494}
19495
19496// result is the default implementation for ServerDNSAliasesCreateOrUpdateFuture.Result.
19497func (future *ServerDNSAliasesCreateOrUpdateFuture) result(client ServerDNSAliasesClient) (sda ServerDNSAlias, err error) {
19498	var done bool
19499	done, err = future.DoneWithContext(context.Background(), client)
19500	if err != nil {
19501		err = autorest.NewErrorWithError(err, "sql.ServerDNSAliasesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
19502		return
19503	}
19504	if !done {
19505		sda.Response.Response = future.Response()
19506		err = azure.NewAsyncOpIncompleteError("sql.ServerDNSAliasesCreateOrUpdateFuture")
19507		return
19508	}
19509	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
19510	if sda.Response.Response, err = future.GetResult(sender); err == nil && sda.Response.Response.StatusCode != http.StatusNoContent {
19511		sda, err = client.CreateOrUpdateResponder(sda.Response.Response)
19512		if err != nil {
19513			err = autorest.NewErrorWithError(err, "sql.ServerDNSAliasesCreateOrUpdateFuture", "Result", sda.Response.Response, "Failure responding to request")
19514		}
19515	}
19516	return
19517}
19518
19519// ServerDNSAliasesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
19520// operation.
19521type ServerDNSAliasesDeleteFuture struct {
19522	azure.FutureAPI
19523	// Result returns the result of the asynchronous operation.
19524	// If the operation has not completed it will return an error.
19525	Result func(ServerDNSAliasesClient) (autorest.Response, error)
19526}
19527
19528// UnmarshalJSON is the custom unmarshaller for CreateFuture.
19529func (future *ServerDNSAliasesDeleteFuture) UnmarshalJSON(body []byte) error {
19530	var azFuture azure.Future
19531	if err := json.Unmarshal(body, &azFuture); err != nil {
19532		return err
19533	}
19534	future.FutureAPI = &azFuture
19535	future.Result = future.result
19536	return nil
19537}
19538
19539// result is the default implementation for ServerDNSAliasesDeleteFuture.Result.
19540func (future *ServerDNSAliasesDeleteFuture) result(client ServerDNSAliasesClient) (ar autorest.Response, err error) {
19541	var done bool
19542	done, err = future.DoneWithContext(context.Background(), client)
19543	if err != nil {
19544		err = autorest.NewErrorWithError(err, "sql.ServerDNSAliasesDeleteFuture", "Result", future.Response(), "Polling failure")
19545		return
19546	}
19547	if !done {
19548		ar.Response = future.Response()
19549		err = azure.NewAsyncOpIncompleteError("sql.ServerDNSAliasesDeleteFuture")
19550		return
19551	}
19552	ar.Response = future.Response()
19553	return
19554}
19555
19556// ServerDNSAliasListResult a list of server DNS aliases.
19557type ServerDNSAliasListResult struct {
19558	autorest.Response `json:"-"`
19559	// Value - READ-ONLY; Array of results.
19560	Value *[]ServerDNSAlias `json:"value,omitempty"`
19561	// NextLink - READ-ONLY; Link to retrieve next page of results.
19562	NextLink *string `json:"nextLink,omitempty"`
19563}
19564
19565// MarshalJSON is the custom marshaler for ServerDNSAliasListResult.
19566func (sdalr ServerDNSAliasListResult) MarshalJSON() ([]byte, error) {
19567	objectMap := make(map[string]interface{})
19568	return json.Marshal(objectMap)
19569}
19570
19571// ServerDNSAliasListResultIterator provides access to a complete listing of ServerDNSAlias values.
19572type ServerDNSAliasListResultIterator struct {
19573	i    int
19574	page ServerDNSAliasListResultPage
19575}
19576
19577// NextWithContext advances to the next value.  If there was an error making
19578// the request the iterator does not advance and the error is returned.
19579func (iter *ServerDNSAliasListResultIterator) NextWithContext(ctx context.Context) (err error) {
19580	if tracing.IsEnabled() {
19581		ctx = tracing.StartSpan(ctx, fqdn+"/ServerDNSAliasListResultIterator.NextWithContext")
19582		defer func() {
19583			sc := -1
19584			if iter.Response().Response.Response != nil {
19585				sc = iter.Response().Response.Response.StatusCode
19586			}
19587			tracing.EndSpan(ctx, sc, err)
19588		}()
19589	}
19590	iter.i++
19591	if iter.i < len(iter.page.Values()) {
19592		return nil
19593	}
19594	err = iter.page.NextWithContext(ctx)
19595	if err != nil {
19596		iter.i--
19597		return err
19598	}
19599	iter.i = 0
19600	return nil
19601}
19602
19603// Next advances to the next value.  If there was an error making
19604// the request the iterator does not advance and the error is returned.
19605// Deprecated: Use NextWithContext() instead.
19606func (iter *ServerDNSAliasListResultIterator) Next() error {
19607	return iter.NextWithContext(context.Background())
19608}
19609
19610// NotDone returns true if the enumeration should be started or is not yet complete.
19611func (iter ServerDNSAliasListResultIterator) NotDone() bool {
19612	return iter.page.NotDone() && iter.i < len(iter.page.Values())
19613}
19614
19615// Response returns the raw server response from the last page request.
19616func (iter ServerDNSAliasListResultIterator) Response() ServerDNSAliasListResult {
19617	return iter.page.Response()
19618}
19619
19620// Value returns the current value or a zero-initialized value if the
19621// iterator has advanced beyond the end of the collection.
19622func (iter ServerDNSAliasListResultIterator) Value() ServerDNSAlias {
19623	if !iter.page.NotDone() {
19624		return ServerDNSAlias{}
19625	}
19626	return iter.page.Values()[iter.i]
19627}
19628
19629// Creates a new instance of the ServerDNSAliasListResultIterator type.
19630func NewServerDNSAliasListResultIterator(page ServerDNSAliasListResultPage) ServerDNSAliasListResultIterator {
19631	return ServerDNSAliasListResultIterator{page: page}
19632}
19633
19634// IsEmpty returns true if the ListResult contains no values.
19635func (sdalr ServerDNSAliasListResult) IsEmpty() bool {
19636	return sdalr.Value == nil || len(*sdalr.Value) == 0
19637}
19638
19639// hasNextLink returns true if the NextLink is not empty.
19640func (sdalr ServerDNSAliasListResult) hasNextLink() bool {
19641	return sdalr.NextLink != nil && len(*sdalr.NextLink) != 0
19642}
19643
19644// serverDNSAliasListResultPreparer prepares a request to retrieve the next set of results.
19645// It returns nil if no more results exist.
19646func (sdalr ServerDNSAliasListResult) serverDNSAliasListResultPreparer(ctx context.Context) (*http.Request, error) {
19647	if !sdalr.hasNextLink() {
19648		return nil, nil
19649	}
19650	return autorest.Prepare((&http.Request{}).WithContext(ctx),
19651		autorest.AsJSON(),
19652		autorest.AsGet(),
19653		autorest.WithBaseURL(to.String(sdalr.NextLink)))
19654}
19655
19656// ServerDNSAliasListResultPage contains a page of ServerDNSAlias values.
19657type ServerDNSAliasListResultPage struct {
19658	fn    func(context.Context, ServerDNSAliasListResult) (ServerDNSAliasListResult, error)
19659	sdalr ServerDNSAliasListResult
19660}
19661
19662// NextWithContext advances to the next page of values.  If there was an error making
19663// the request the page does not advance and the error is returned.
19664func (page *ServerDNSAliasListResultPage) NextWithContext(ctx context.Context) (err error) {
19665	if tracing.IsEnabled() {
19666		ctx = tracing.StartSpan(ctx, fqdn+"/ServerDNSAliasListResultPage.NextWithContext")
19667		defer func() {
19668			sc := -1
19669			if page.Response().Response.Response != nil {
19670				sc = page.Response().Response.Response.StatusCode
19671			}
19672			tracing.EndSpan(ctx, sc, err)
19673		}()
19674	}
19675	for {
19676		next, err := page.fn(ctx, page.sdalr)
19677		if err != nil {
19678			return err
19679		}
19680		page.sdalr = next
19681		if !next.hasNextLink() || !next.IsEmpty() {
19682			break
19683		}
19684	}
19685	return nil
19686}
19687
19688// Next advances to the next page of values.  If there was an error making
19689// the request the page does not advance and the error is returned.
19690// Deprecated: Use NextWithContext() instead.
19691func (page *ServerDNSAliasListResultPage) Next() error {
19692	return page.NextWithContext(context.Background())
19693}
19694
19695// NotDone returns true if the page enumeration should be started or is not yet complete.
19696func (page ServerDNSAliasListResultPage) NotDone() bool {
19697	return !page.sdalr.IsEmpty()
19698}
19699
19700// Response returns the raw server response from the last page request.
19701func (page ServerDNSAliasListResultPage) Response() ServerDNSAliasListResult {
19702	return page.sdalr
19703}
19704
19705// Values returns the slice of values for the current page or nil if there are no values.
19706func (page ServerDNSAliasListResultPage) Values() []ServerDNSAlias {
19707	if page.sdalr.IsEmpty() {
19708		return nil
19709	}
19710	return *page.sdalr.Value
19711}
19712
19713// Creates a new instance of the ServerDNSAliasListResultPage type.
19714func NewServerDNSAliasListResultPage(cur ServerDNSAliasListResult, getNextPage func(context.Context, ServerDNSAliasListResult) (ServerDNSAliasListResult, error)) ServerDNSAliasListResultPage {
19715	return ServerDNSAliasListResultPage{
19716		fn:    getNextPage,
19717		sdalr: cur,
19718	}
19719}
19720
19721// ServerDNSAliasProperties properties of a server DNS alias.
19722type ServerDNSAliasProperties struct {
19723	// AzureDNSRecord - READ-ONLY; The fully qualified DNS record for alias
19724	AzureDNSRecord *string `json:"azureDnsRecord,omitempty"`
19725}
19726
19727// MarshalJSON is the custom marshaler for ServerDNSAliasProperties.
19728func (sdap ServerDNSAliasProperties) MarshalJSON() ([]byte, error) {
19729	objectMap := make(map[string]interface{})
19730	return json.Marshal(objectMap)
19731}
19732
19733// ServerInfo server info for the server trust group.
19734type ServerInfo struct {
19735	// ServerID - Server Id.
19736	ServerID *string `json:"serverId,omitempty"`
19737}
19738
19739// ServerKey a server key.
19740type ServerKey struct {
19741	autorest.Response `json:"-"`
19742	// Kind - Kind of encryption protector. This is metadata used for the Azure portal experience.
19743	Kind *string `json:"kind,omitempty"`
19744	// Location - READ-ONLY; Resource location.
19745	Location *string `json:"location,omitempty"`
19746	// ServerKeyProperties - Resource properties.
19747	*ServerKeyProperties `json:"properties,omitempty"`
19748	// ID - READ-ONLY; Resource ID.
19749	ID *string `json:"id,omitempty"`
19750	// Name - READ-ONLY; Resource name.
19751	Name *string `json:"name,omitempty"`
19752	// Type - READ-ONLY; Resource type.
19753	Type *string `json:"type,omitempty"`
19754}
19755
19756// MarshalJSON is the custom marshaler for ServerKey.
19757func (sk ServerKey) MarshalJSON() ([]byte, error) {
19758	objectMap := make(map[string]interface{})
19759	if sk.Kind != nil {
19760		objectMap["kind"] = sk.Kind
19761	}
19762	if sk.ServerKeyProperties != nil {
19763		objectMap["properties"] = sk.ServerKeyProperties
19764	}
19765	return json.Marshal(objectMap)
19766}
19767
19768// UnmarshalJSON is the custom unmarshaler for ServerKey struct.
19769func (sk *ServerKey) UnmarshalJSON(body []byte) error {
19770	var m map[string]*json.RawMessage
19771	err := json.Unmarshal(body, &m)
19772	if err != nil {
19773		return err
19774	}
19775	for k, v := range m {
19776		switch k {
19777		case "kind":
19778			if v != nil {
19779				var kind string
19780				err = json.Unmarshal(*v, &kind)
19781				if err != nil {
19782					return err
19783				}
19784				sk.Kind = &kind
19785			}
19786		case "location":
19787			if v != nil {
19788				var location string
19789				err = json.Unmarshal(*v, &location)
19790				if err != nil {
19791					return err
19792				}
19793				sk.Location = &location
19794			}
19795		case "properties":
19796			if v != nil {
19797				var serverKeyProperties ServerKeyProperties
19798				err = json.Unmarshal(*v, &serverKeyProperties)
19799				if err != nil {
19800					return err
19801				}
19802				sk.ServerKeyProperties = &serverKeyProperties
19803			}
19804		case "id":
19805			if v != nil {
19806				var ID string
19807				err = json.Unmarshal(*v, &ID)
19808				if err != nil {
19809					return err
19810				}
19811				sk.ID = &ID
19812			}
19813		case "name":
19814			if v != nil {
19815				var name string
19816				err = json.Unmarshal(*v, &name)
19817				if err != nil {
19818					return err
19819				}
19820				sk.Name = &name
19821			}
19822		case "type":
19823			if v != nil {
19824				var typeVar string
19825				err = json.Unmarshal(*v, &typeVar)
19826				if err != nil {
19827					return err
19828				}
19829				sk.Type = &typeVar
19830			}
19831		}
19832	}
19833
19834	return nil
19835}
19836
19837// ServerKeyListResult a list of server keys.
19838type ServerKeyListResult struct {
19839	autorest.Response `json:"-"`
19840	// Value - READ-ONLY; Array of results.
19841	Value *[]ServerKey `json:"value,omitempty"`
19842	// NextLink - READ-ONLY; Link to retrieve next page of results.
19843	NextLink *string `json:"nextLink,omitempty"`
19844}
19845
19846// MarshalJSON is the custom marshaler for ServerKeyListResult.
19847func (sklr ServerKeyListResult) MarshalJSON() ([]byte, error) {
19848	objectMap := make(map[string]interface{})
19849	return json.Marshal(objectMap)
19850}
19851
19852// ServerKeyListResultIterator provides access to a complete listing of ServerKey values.
19853type ServerKeyListResultIterator struct {
19854	i    int
19855	page ServerKeyListResultPage
19856}
19857
19858// NextWithContext advances to the next value.  If there was an error making
19859// the request the iterator does not advance and the error is returned.
19860func (iter *ServerKeyListResultIterator) NextWithContext(ctx context.Context) (err error) {
19861	if tracing.IsEnabled() {
19862		ctx = tracing.StartSpan(ctx, fqdn+"/ServerKeyListResultIterator.NextWithContext")
19863		defer func() {
19864			sc := -1
19865			if iter.Response().Response.Response != nil {
19866				sc = iter.Response().Response.Response.StatusCode
19867			}
19868			tracing.EndSpan(ctx, sc, err)
19869		}()
19870	}
19871	iter.i++
19872	if iter.i < len(iter.page.Values()) {
19873		return nil
19874	}
19875	err = iter.page.NextWithContext(ctx)
19876	if err != nil {
19877		iter.i--
19878		return err
19879	}
19880	iter.i = 0
19881	return nil
19882}
19883
19884// Next advances to the next value.  If there was an error making
19885// the request the iterator does not advance and the error is returned.
19886// Deprecated: Use NextWithContext() instead.
19887func (iter *ServerKeyListResultIterator) Next() error {
19888	return iter.NextWithContext(context.Background())
19889}
19890
19891// NotDone returns true if the enumeration should be started or is not yet complete.
19892func (iter ServerKeyListResultIterator) NotDone() bool {
19893	return iter.page.NotDone() && iter.i < len(iter.page.Values())
19894}
19895
19896// Response returns the raw server response from the last page request.
19897func (iter ServerKeyListResultIterator) Response() ServerKeyListResult {
19898	return iter.page.Response()
19899}
19900
19901// Value returns the current value or a zero-initialized value if the
19902// iterator has advanced beyond the end of the collection.
19903func (iter ServerKeyListResultIterator) Value() ServerKey {
19904	if !iter.page.NotDone() {
19905		return ServerKey{}
19906	}
19907	return iter.page.Values()[iter.i]
19908}
19909
19910// Creates a new instance of the ServerKeyListResultIterator type.
19911func NewServerKeyListResultIterator(page ServerKeyListResultPage) ServerKeyListResultIterator {
19912	return ServerKeyListResultIterator{page: page}
19913}
19914
19915// IsEmpty returns true if the ListResult contains no values.
19916func (sklr ServerKeyListResult) IsEmpty() bool {
19917	return sklr.Value == nil || len(*sklr.Value) == 0
19918}
19919
19920// hasNextLink returns true if the NextLink is not empty.
19921func (sklr ServerKeyListResult) hasNextLink() bool {
19922	return sklr.NextLink != nil && len(*sklr.NextLink) != 0
19923}
19924
19925// serverKeyListResultPreparer prepares a request to retrieve the next set of results.
19926// It returns nil if no more results exist.
19927func (sklr ServerKeyListResult) serverKeyListResultPreparer(ctx context.Context) (*http.Request, error) {
19928	if !sklr.hasNextLink() {
19929		return nil, nil
19930	}
19931	return autorest.Prepare((&http.Request{}).WithContext(ctx),
19932		autorest.AsJSON(),
19933		autorest.AsGet(),
19934		autorest.WithBaseURL(to.String(sklr.NextLink)))
19935}
19936
19937// ServerKeyListResultPage contains a page of ServerKey values.
19938type ServerKeyListResultPage struct {
19939	fn   func(context.Context, ServerKeyListResult) (ServerKeyListResult, error)
19940	sklr ServerKeyListResult
19941}
19942
19943// NextWithContext advances to the next page of values.  If there was an error making
19944// the request the page does not advance and the error is returned.
19945func (page *ServerKeyListResultPage) NextWithContext(ctx context.Context) (err error) {
19946	if tracing.IsEnabled() {
19947		ctx = tracing.StartSpan(ctx, fqdn+"/ServerKeyListResultPage.NextWithContext")
19948		defer func() {
19949			sc := -1
19950			if page.Response().Response.Response != nil {
19951				sc = page.Response().Response.Response.StatusCode
19952			}
19953			tracing.EndSpan(ctx, sc, err)
19954		}()
19955	}
19956	for {
19957		next, err := page.fn(ctx, page.sklr)
19958		if err != nil {
19959			return err
19960		}
19961		page.sklr = next
19962		if !next.hasNextLink() || !next.IsEmpty() {
19963			break
19964		}
19965	}
19966	return nil
19967}
19968
19969// Next advances to the next page of values.  If there was an error making
19970// the request the page does not advance and the error is returned.
19971// Deprecated: Use NextWithContext() instead.
19972func (page *ServerKeyListResultPage) Next() error {
19973	return page.NextWithContext(context.Background())
19974}
19975
19976// NotDone returns true if the page enumeration should be started or is not yet complete.
19977func (page ServerKeyListResultPage) NotDone() bool {
19978	return !page.sklr.IsEmpty()
19979}
19980
19981// Response returns the raw server response from the last page request.
19982func (page ServerKeyListResultPage) Response() ServerKeyListResult {
19983	return page.sklr
19984}
19985
19986// Values returns the slice of values for the current page or nil if there are no values.
19987func (page ServerKeyListResultPage) Values() []ServerKey {
19988	if page.sklr.IsEmpty() {
19989		return nil
19990	}
19991	return *page.sklr.Value
19992}
19993
19994// Creates a new instance of the ServerKeyListResultPage type.
19995func NewServerKeyListResultPage(cur ServerKeyListResult, getNextPage func(context.Context, ServerKeyListResult) (ServerKeyListResult, error)) ServerKeyListResultPage {
19996	return ServerKeyListResultPage{
19997		fn:   getNextPage,
19998		sklr: cur,
19999	}
20000}
20001
20002// ServerKeyProperties properties for a server key execution.
20003type ServerKeyProperties struct {
20004	// Subregion - READ-ONLY; Subregion of the server key.
20005	Subregion *string `json:"subregion,omitempty"`
20006	// ServerKeyType - The server key type like 'ServiceManaged', 'AzureKeyVault'. Possible values include: 'ServiceManaged', 'AzureKeyVault'
20007	ServerKeyType ServerKeyType `json:"serverKeyType,omitempty"`
20008	// URI - The URI of the server key.
20009	URI *string `json:"uri,omitempty"`
20010	// Thumbprint - Thumbprint of the server key.
20011	Thumbprint *string `json:"thumbprint,omitempty"`
20012	// CreationDate - The server key creation date.
20013	CreationDate *date.Time `json:"creationDate,omitempty"`
20014}
20015
20016// MarshalJSON is the custom marshaler for ServerKeyProperties.
20017func (skp ServerKeyProperties) MarshalJSON() ([]byte, error) {
20018	objectMap := make(map[string]interface{})
20019	if skp.ServerKeyType != "" {
20020		objectMap["serverKeyType"] = skp.ServerKeyType
20021	}
20022	if skp.URI != nil {
20023		objectMap["uri"] = skp.URI
20024	}
20025	if skp.Thumbprint != nil {
20026		objectMap["thumbprint"] = skp.Thumbprint
20027	}
20028	if skp.CreationDate != nil {
20029		objectMap["creationDate"] = skp.CreationDate
20030	}
20031	return json.Marshal(objectMap)
20032}
20033
20034// ServerKeysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
20035// long-running operation.
20036type ServerKeysCreateOrUpdateFuture struct {
20037	azure.FutureAPI
20038	// Result returns the result of the asynchronous operation.
20039	// If the operation has not completed it will return an error.
20040	Result func(ServerKeysClient) (ServerKey, error)
20041}
20042
20043// UnmarshalJSON is the custom unmarshaller for CreateFuture.
20044func (future *ServerKeysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
20045	var azFuture azure.Future
20046	if err := json.Unmarshal(body, &azFuture); err != nil {
20047		return err
20048	}
20049	future.FutureAPI = &azFuture
20050	future.Result = future.result
20051	return nil
20052}
20053
20054// result is the default implementation for ServerKeysCreateOrUpdateFuture.Result.
20055func (future *ServerKeysCreateOrUpdateFuture) result(client ServerKeysClient) (sk ServerKey, err error) {
20056	var done bool
20057	done, err = future.DoneWithContext(context.Background(), client)
20058	if err != nil {
20059		err = autorest.NewErrorWithError(err, "sql.ServerKeysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
20060		return
20061	}
20062	if !done {
20063		sk.Response.Response = future.Response()
20064		err = azure.NewAsyncOpIncompleteError("sql.ServerKeysCreateOrUpdateFuture")
20065		return
20066	}
20067	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
20068	if sk.Response.Response, err = future.GetResult(sender); err == nil && sk.Response.Response.StatusCode != http.StatusNoContent {
20069		sk, err = client.CreateOrUpdateResponder(sk.Response.Response)
20070		if err != nil {
20071			err = autorest.NewErrorWithError(err, "sql.ServerKeysCreateOrUpdateFuture", "Result", sk.Response.Response, "Failure responding to request")
20072		}
20073	}
20074	return
20075}
20076
20077// ServerKeysDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
20078// operation.
20079type ServerKeysDeleteFuture struct {
20080	azure.FutureAPI
20081	// Result returns the result of the asynchronous operation.
20082	// If the operation has not completed it will return an error.
20083	Result func(ServerKeysClient) (autorest.Response, error)
20084}
20085
20086// UnmarshalJSON is the custom unmarshaller for CreateFuture.
20087func (future *ServerKeysDeleteFuture) UnmarshalJSON(body []byte) error {
20088	var azFuture azure.Future
20089	if err := json.Unmarshal(body, &azFuture); err != nil {
20090		return err
20091	}
20092	future.FutureAPI = &azFuture
20093	future.Result = future.result
20094	return nil
20095}
20096
20097// result is the default implementation for ServerKeysDeleteFuture.Result.
20098func (future *ServerKeysDeleteFuture) result(client ServerKeysClient) (ar autorest.Response, err error) {
20099	var done bool
20100	done, err = future.DoneWithContext(context.Background(), client)
20101	if err != nil {
20102		err = autorest.NewErrorWithError(err, "sql.ServerKeysDeleteFuture", "Result", future.Response(), "Polling failure")
20103		return
20104	}
20105	if !done {
20106		ar.Response = future.Response()
20107		err = azure.NewAsyncOpIncompleteError("sql.ServerKeysDeleteFuture")
20108		return
20109	}
20110	ar.Response = future.Response()
20111	return
20112}
20113
20114// ServerListResult a list of servers.
20115type ServerListResult struct {
20116	autorest.Response `json:"-"`
20117	// Value - READ-ONLY; Array of results.
20118	Value *[]Server `json:"value,omitempty"`
20119	// NextLink - READ-ONLY; Link to retrieve next page of results.
20120	NextLink *string `json:"nextLink,omitempty"`
20121}
20122
20123// MarshalJSON is the custom marshaler for ServerListResult.
20124func (slr ServerListResult) MarshalJSON() ([]byte, error) {
20125	objectMap := make(map[string]interface{})
20126	return json.Marshal(objectMap)
20127}
20128
20129// ServerListResultIterator provides access to a complete listing of Server values.
20130type ServerListResultIterator struct {
20131	i    int
20132	page ServerListResultPage
20133}
20134
20135// NextWithContext advances to the next value.  If there was an error making
20136// the request the iterator does not advance and the error is returned.
20137func (iter *ServerListResultIterator) NextWithContext(ctx context.Context) (err error) {
20138	if tracing.IsEnabled() {
20139		ctx = tracing.StartSpan(ctx, fqdn+"/ServerListResultIterator.NextWithContext")
20140		defer func() {
20141			sc := -1
20142			if iter.Response().Response.Response != nil {
20143				sc = iter.Response().Response.Response.StatusCode
20144			}
20145			tracing.EndSpan(ctx, sc, err)
20146		}()
20147	}
20148	iter.i++
20149	if iter.i < len(iter.page.Values()) {
20150		return nil
20151	}
20152	err = iter.page.NextWithContext(ctx)
20153	if err != nil {
20154		iter.i--
20155		return err
20156	}
20157	iter.i = 0
20158	return nil
20159}
20160
20161// Next advances to the next value.  If there was an error making
20162// the request the iterator does not advance and the error is returned.
20163// Deprecated: Use NextWithContext() instead.
20164func (iter *ServerListResultIterator) Next() error {
20165	return iter.NextWithContext(context.Background())
20166}
20167
20168// NotDone returns true if the enumeration should be started or is not yet complete.
20169func (iter ServerListResultIterator) NotDone() bool {
20170	return iter.page.NotDone() && iter.i < len(iter.page.Values())
20171}
20172
20173// Response returns the raw server response from the last page request.
20174func (iter ServerListResultIterator) Response() ServerListResult {
20175	return iter.page.Response()
20176}
20177
20178// Value returns the current value or a zero-initialized value if the
20179// iterator has advanced beyond the end of the collection.
20180func (iter ServerListResultIterator) Value() Server {
20181	if !iter.page.NotDone() {
20182		return Server{}
20183	}
20184	return iter.page.Values()[iter.i]
20185}
20186
20187// Creates a new instance of the ServerListResultIterator type.
20188func NewServerListResultIterator(page ServerListResultPage) ServerListResultIterator {
20189	return ServerListResultIterator{page: page}
20190}
20191
20192// IsEmpty returns true if the ListResult contains no values.
20193func (slr ServerListResult) IsEmpty() bool {
20194	return slr.Value == nil || len(*slr.Value) == 0
20195}
20196
20197// hasNextLink returns true if the NextLink is not empty.
20198func (slr ServerListResult) hasNextLink() bool {
20199	return slr.NextLink != nil && len(*slr.NextLink) != 0
20200}
20201
20202// serverListResultPreparer prepares a request to retrieve the next set of results.
20203// It returns nil if no more results exist.
20204func (slr ServerListResult) serverListResultPreparer(ctx context.Context) (*http.Request, error) {
20205	if !slr.hasNextLink() {
20206		return nil, nil
20207	}
20208	return autorest.Prepare((&http.Request{}).WithContext(ctx),
20209		autorest.AsJSON(),
20210		autorest.AsGet(),
20211		autorest.WithBaseURL(to.String(slr.NextLink)))
20212}
20213
20214// ServerListResultPage contains a page of Server values.
20215type ServerListResultPage struct {
20216	fn  func(context.Context, ServerListResult) (ServerListResult, error)
20217	slr ServerListResult
20218}
20219
20220// NextWithContext advances to the next page of values.  If there was an error making
20221// the request the page does not advance and the error is returned.
20222func (page *ServerListResultPage) NextWithContext(ctx context.Context) (err error) {
20223	if tracing.IsEnabled() {
20224		ctx = tracing.StartSpan(ctx, fqdn+"/ServerListResultPage.NextWithContext")
20225		defer func() {
20226			sc := -1
20227			if page.Response().Response.Response != nil {
20228				sc = page.Response().Response.Response.StatusCode
20229			}
20230			tracing.EndSpan(ctx, sc, err)
20231		}()
20232	}
20233	for {
20234		next, err := page.fn(ctx, page.slr)
20235		if err != nil {
20236			return err
20237		}
20238		page.slr = next
20239		if !next.hasNextLink() || !next.IsEmpty() {
20240			break
20241		}
20242	}
20243	return nil
20244}
20245
20246// Next advances to the next page of values.  If there was an error making
20247// the request the page does not advance and the error is returned.
20248// Deprecated: Use NextWithContext() instead.
20249func (page *ServerListResultPage) Next() error {
20250	return page.NextWithContext(context.Background())
20251}
20252
20253// NotDone returns true if the page enumeration should be started or is not yet complete.
20254func (page ServerListResultPage) NotDone() bool {
20255	return !page.slr.IsEmpty()
20256}
20257
20258// Response returns the raw server response from the last page request.
20259func (page ServerListResultPage) Response() ServerListResult {
20260	return page.slr
20261}
20262
20263// Values returns the slice of values for the current page or nil if there are no values.
20264func (page ServerListResultPage) Values() []Server {
20265	if page.slr.IsEmpty() {
20266		return nil
20267	}
20268	return *page.slr.Value
20269}
20270
20271// Creates a new instance of the ServerListResultPage type.
20272func NewServerListResultPage(cur ServerListResult, getNextPage func(context.Context, ServerListResult) (ServerListResult, error)) ServerListResultPage {
20273	return ServerListResultPage{
20274		fn:  getNextPage,
20275		slr: cur,
20276	}
20277}
20278
20279// ServerPrivateEndpointConnection a private endpoint connection under a server
20280type ServerPrivateEndpointConnection struct {
20281	// ID - READ-ONLY; Resource ID.
20282	ID *string `json:"id,omitempty"`
20283	// Properties - READ-ONLY; Private endpoint connection properties
20284	Properties *PrivateEndpointConnectionProperties `json:"properties,omitempty"`
20285}
20286
20287// MarshalJSON is the custom marshaler for ServerPrivateEndpointConnection.
20288func (spec ServerPrivateEndpointConnection) MarshalJSON() ([]byte, error) {
20289	objectMap := make(map[string]interface{})
20290	return json.Marshal(objectMap)
20291}
20292
20293// ServerProperties the properties of a server.
20294type ServerProperties struct {
20295	// AdministratorLogin - Administrator username for the server. Once created it cannot be changed.
20296	AdministratorLogin *string `json:"administratorLogin,omitempty"`
20297	// AdministratorLoginPassword - The administrator login password (required for server creation).
20298	AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"`
20299	// Version - The version of the server.
20300	Version *string `json:"version,omitempty"`
20301	// State - READ-ONLY; The state of the server.
20302	State *string `json:"state,omitempty"`
20303	// FullyQualifiedDomainName - READ-ONLY; The fully qualified domain name of the server.
20304	FullyQualifiedDomainName *string `json:"fullyQualifiedDomainName,omitempty"`
20305	// PrivateEndpointConnections - READ-ONLY; List of private endpoint connections on a server
20306	PrivateEndpointConnections *[]ServerPrivateEndpointConnection `json:"privateEndpointConnections,omitempty"`
20307	// MinimalTLSVersion - Minimal TLS version. Allowed values: '1.0', '1.1', '1.2'
20308	MinimalTLSVersion *string `json:"minimalTlsVersion,omitempty"`
20309	// 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: 'ServerPublicNetworkAccessEnabled', 'ServerPublicNetworkAccessDisabled'
20310	PublicNetworkAccess ServerPublicNetworkAccess `json:"publicNetworkAccess,omitempty"`
20311}
20312
20313// MarshalJSON is the custom marshaler for ServerProperties.
20314func (sp ServerProperties) MarshalJSON() ([]byte, error) {
20315	objectMap := make(map[string]interface{})
20316	if sp.AdministratorLogin != nil {
20317		objectMap["administratorLogin"] = sp.AdministratorLogin
20318	}
20319	if sp.AdministratorLoginPassword != nil {
20320		objectMap["administratorLoginPassword"] = sp.AdministratorLoginPassword
20321	}
20322	if sp.Version != nil {
20323		objectMap["version"] = sp.Version
20324	}
20325	if sp.MinimalTLSVersion != nil {
20326		objectMap["minimalTlsVersion"] = sp.MinimalTLSVersion
20327	}
20328	if sp.PublicNetworkAccess != "" {
20329		objectMap["publicNetworkAccess"] = sp.PublicNetworkAccess
20330	}
20331	return json.Marshal(objectMap)
20332}
20333
20334// ServersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
20335// operation.
20336type ServersCreateOrUpdateFuture struct {
20337	azure.FutureAPI
20338	// Result returns the result of the asynchronous operation.
20339	// If the operation has not completed it will return an error.
20340	Result func(ServersClient) (Server, error)
20341}
20342
20343// UnmarshalJSON is the custom unmarshaller for CreateFuture.
20344func (future *ServersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
20345	var azFuture azure.Future
20346	if err := json.Unmarshal(body, &azFuture); err != nil {
20347		return err
20348	}
20349	future.FutureAPI = &azFuture
20350	future.Result = future.result
20351	return nil
20352}
20353
20354// result is the default implementation for ServersCreateOrUpdateFuture.Result.
20355func (future *ServersCreateOrUpdateFuture) result(client ServersClient) (s Server, err error) {
20356	var done bool
20357	done, err = future.DoneWithContext(context.Background(), client)
20358	if err != nil {
20359		err = autorest.NewErrorWithError(err, "sql.ServersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
20360		return
20361	}
20362	if !done {
20363		s.Response.Response = future.Response()
20364		err = azure.NewAsyncOpIncompleteError("sql.ServersCreateOrUpdateFuture")
20365		return
20366	}
20367	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
20368	if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent {
20369		s, err = client.CreateOrUpdateResponder(s.Response.Response)
20370		if err != nil {
20371			err = autorest.NewErrorWithError(err, "sql.ServersCreateOrUpdateFuture", "Result", s.Response.Response, "Failure responding to request")
20372		}
20373	}
20374	return
20375}
20376
20377// ServersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
20378// operation.
20379type ServersDeleteFuture struct {
20380	azure.FutureAPI
20381	// Result returns the result of the asynchronous operation.
20382	// If the operation has not completed it will return an error.
20383	Result func(ServersClient) (autorest.Response, error)
20384}
20385
20386// UnmarshalJSON is the custom unmarshaller for CreateFuture.
20387func (future *ServersDeleteFuture) UnmarshalJSON(body []byte) error {
20388	var azFuture azure.Future
20389	if err := json.Unmarshal(body, &azFuture); err != nil {
20390		return err
20391	}
20392	future.FutureAPI = &azFuture
20393	future.Result = future.result
20394	return nil
20395}
20396
20397// result is the default implementation for ServersDeleteFuture.Result.
20398func (future *ServersDeleteFuture) result(client ServersClient) (ar autorest.Response, err error) {
20399	var done bool
20400	done, err = future.DoneWithContext(context.Background(), client)
20401	if err != nil {
20402		err = autorest.NewErrorWithError(err, "sql.ServersDeleteFuture", "Result", future.Response(), "Polling failure")
20403		return
20404	}
20405	if !done {
20406		ar.Response = future.Response()
20407		err = azure.NewAsyncOpIncompleteError("sql.ServersDeleteFuture")
20408		return
20409	}
20410	ar.Response = future.Response()
20411	return
20412}
20413
20414// ServerSecurityAlertPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results
20415// of a long-running operation.
20416type ServerSecurityAlertPoliciesCreateOrUpdateFuture struct {
20417	azure.FutureAPI
20418	// Result returns the result of the asynchronous operation.
20419	// If the operation has not completed it will return an error.
20420	Result func(ServerSecurityAlertPoliciesClient) (ServerSecurityAlertPolicy, error)
20421}
20422
20423// UnmarshalJSON is the custom unmarshaller for CreateFuture.
20424func (future *ServerSecurityAlertPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
20425	var azFuture azure.Future
20426	if err := json.Unmarshal(body, &azFuture); err != nil {
20427		return err
20428	}
20429	future.FutureAPI = &azFuture
20430	future.Result = future.result
20431	return nil
20432}
20433
20434// result is the default implementation for ServerSecurityAlertPoliciesCreateOrUpdateFuture.Result.
20435func (future *ServerSecurityAlertPoliciesCreateOrUpdateFuture) result(client ServerSecurityAlertPoliciesClient) (ssap ServerSecurityAlertPolicy, err error) {
20436	var done bool
20437	done, err = future.DoneWithContext(context.Background(), client)
20438	if err != nil {
20439		err = autorest.NewErrorWithError(err, "sql.ServerSecurityAlertPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
20440		return
20441	}
20442	if !done {
20443		ssap.Response.Response = future.Response()
20444		err = azure.NewAsyncOpIncompleteError("sql.ServerSecurityAlertPoliciesCreateOrUpdateFuture")
20445		return
20446	}
20447	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
20448	if ssap.Response.Response, err = future.GetResult(sender); err == nil && ssap.Response.Response.StatusCode != http.StatusNoContent {
20449		ssap, err = client.CreateOrUpdateResponder(ssap.Response.Response)
20450		if err != nil {
20451			err = autorest.NewErrorWithError(err, "sql.ServerSecurityAlertPoliciesCreateOrUpdateFuture", "Result", ssap.Response.Response, "Failure responding to request")
20452		}
20453	}
20454	return
20455}
20456
20457// ServerSecurityAlertPolicy a server security alert policy.
20458type ServerSecurityAlertPolicy struct {
20459	autorest.Response `json:"-"`
20460	// SecurityAlertPolicyProperties - Resource properties.
20461	*SecurityAlertPolicyProperties `json:"properties,omitempty"`
20462	// ID - READ-ONLY; Resource ID.
20463	ID *string `json:"id,omitempty"`
20464	// Name - READ-ONLY; Resource name.
20465	Name *string `json:"name,omitempty"`
20466	// Type - READ-ONLY; Resource type.
20467	Type *string `json:"type,omitempty"`
20468}
20469
20470// MarshalJSON is the custom marshaler for ServerSecurityAlertPolicy.
20471func (ssap ServerSecurityAlertPolicy) MarshalJSON() ([]byte, error) {
20472	objectMap := make(map[string]interface{})
20473	if ssap.SecurityAlertPolicyProperties != nil {
20474		objectMap["properties"] = ssap.SecurityAlertPolicyProperties
20475	}
20476	return json.Marshal(objectMap)
20477}
20478
20479// UnmarshalJSON is the custom unmarshaler for ServerSecurityAlertPolicy struct.
20480func (ssap *ServerSecurityAlertPolicy) UnmarshalJSON(body []byte) error {
20481	var m map[string]*json.RawMessage
20482	err := json.Unmarshal(body, &m)
20483	if err != nil {
20484		return err
20485	}
20486	for k, v := range m {
20487		switch k {
20488		case "properties":
20489			if v != nil {
20490				var securityAlertPolicyProperties SecurityAlertPolicyProperties
20491				err = json.Unmarshal(*v, &securityAlertPolicyProperties)
20492				if err != nil {
20493					return err
20494				}
20495				ssap.SecurityAlertPolicyProperties = &securityAlertPolicyProperties
20496			}
20497		case "id":
20498			if v != nil {
20499				var ID string
20500				err = json.Unmarshal(*v, &ID)
20501				if err != nil {
20502					return err
20503				}
20504				ssap.ID = &ID
20505			}
20506		case "name":
20507			if v != nil {
20508				var name string
20509				err = json.Unmarshal(*v, &name)
20510				if err != nil {
20511					return err
20512				}
20513				ssap.Name = &name
20514			}
20515		case "type":
20516			if v != nil {
20517				var typeVar string
20518				err = json.Unmarshal(*v, &typeVar)
20519				if err != nil {
20520					return err
20521				}
20522				ssap.Type = &typeVar
20523			}
20524		}
20525	}
20526
20527	return nil
20528}
20529
20530// ServersImportDatabaseFuture an abstraction for monitoring and retrieving the results of a long-running
20531// operation.
20532type ServersImportDatabaseFuture struct {
20533	azure.FutureAPI
20534	// Result returns the result of the asynchronous operation.
20535	// If the operation has not completed it will return an error.
20536	Result func(ServersClient) (ImportExportOperationResult, error)
20537}
20538
20539// UnmarshalJSON is the custom unmarshaller for CreateFuture.
20540func (future *ServersImportDatabaseFuture) UnmarshalJSON(body []byte) error {
20541	var azFuture azure.Future
20542	if err := json.Unmarshal(body, &azFuture); err != nil {
20543		return err
20544	}
20545	future.FutureAPI = &azFuture
20546	future.Result = future.result
20547	return nil
20548}
20549
20550// result is the default implementation for ServersImportDatabaseFuture.Result.
20551func (future *ServersImportDatabaseFuture) result(client ServersClient) (ieor ImportExportOperationResult, err error) {
20552	var done bool
20553	done, err = future.DoneWithContext(context.Background(), client)
20554	if err != nil {
20555		err = autorest.NewErrorWithError(err, "sql.ServersImportDatabaseFuture", "Result", future.Response(), "Polling failure")
20556		return
20557	}
20558	if !done {
20559		ieor.Response.Response = future.Response()
20560		err = azure.NewAsyncOpIncompleteError("sql.ServersImportDatabaseFuture")
20561		return
20562	}
20563	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
20564	if ieor.Response.Response, err = future.GetResult(sender); err == nil && ieor.Response.Response.StatusCode != http.StatusNoContent {
20565		ieor, err = client.ImportDatabaseResponder(ieor.Response.Response)
20566		if err != nil {
20567			err = autorest.NewErrorWithError(err, "sql.ServersImportDatabaseFuture", "Result", ieor.Response.Response, "Failure responding to request")
20568		}
20569	}
20570	return
20571}
20572
20573// ServersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
20574// operation.
20575type ServersUpdateFuture struct {
20576	azure.FutureAPI
20577	// Result returns the result of the asynchronous operation.
20578	// If the operation has not completed it will return an error.
20579	Result func(ServersClient) (Server, error)
20580}
20581
20582// UnmarshalJSON is the custom unmarshaller for CreateFuture.
20583func (future *ServersUpdateFuture) UnmarshalJSON(body []byte) error {
20584	var azFuture azure.Future
20585	if err := json.Unmarshal(body, &azFuture); err != nil {
20586		return err
20587	}
20588	future.FutureAPI = &azFuture
20589	future.Result = future.result
20590	return nil
20591}
20592
20593// result is the default implementation for ServersUpdateFuture.Result.
20594func (future *ServersUpdateFuture) result(client ServersClient) (s Server, err error) {
20595	var done bool
20596	done, err = future.DoneWithContext(context.Background(), client)
20597	if err != nil {
20598		err = autorest.NewErrorWithError(err, "sql.ServersUpdateFuture", "Result", future.Response(), "Polling failure")
20599		return
20600	}
20601	if !done {
20602		s.Response.Response = future.Response()
20603		err = azure.NewAsyncOpIncompleteError("sql.ServersUpdateFuture")
20604		return
20605	}
20606	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
20607	if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent {
20608		s, err = client.UpdateResponder(s.Response.Response)
20609		if err != nil {
20610			err = autorest.NewErrorWithError(err, "sql.ServersUpdateFuture", "Result", s.Response.Response, "Failure responding to request")
20611		}
20612	}
20613	return
20614}
20615
20616// ServerTrustGroup a server trust group.
20617type ServerTrustGroup struct {
20618	autorest.Response `json:"-"`
20619	// ServerTrustGroupProperties - Resource properties.
20620	*ServerTrustGroupProperties `json:"properties,omitempty"`
20621	// ID - READ-ONLY; Resource ID.
20622	ID *string `json:"id,omitempty"`
20623	// Name - READ-ONLY; Resource name.
20624	Name *string `json:"name,omitempty"`
20625	// Type - READ-ONLY; Resource type.
20626	Type *string `json:"type,omitempty"`
20627}
20628
20629// MarshalJSON is the custom marshaler for ServerTrustGroup.
20630func (stg ServerTrustGroup) MarshalJSON() ([]byte, error) {
20631	objectMap := make(map[string]interface{})
20632	if stg.ServerTrustGroupProperties != nil {
20633		objectMap["properties"] = stg.ServerTrustGroupProperties
20634	}
20635	return json.Marshal(objectMap)
20636}
20637
20638// UnmarshalJSON is the custom unmarshaler for ServerTrustGroup struct.
20639func (stg *ServerTrustGroup) UnmarshalJSON(body []byte) error {
20640	var m map[string]*json.RawMessage
20641	err := json.Unmarshal(body, &m)
20642	if err != nil {
20643		return err
20644	}
20645	for k, v := range m {
20646		switch k {
20647		case "properties":
20648			if v != nil {
20649				var serverTrustGroupProperties ServerTrustGroupProperties
20650				err = json.Unmarshal(*v, &serverTrustGroupProperties)
20651				if err != nil {
20652					return err
20653				}
20654				stg.ServerTrustGroupProperties = &serverTrustGroupProperties
20655			}
20656		case "id":
20657			if v != nil {
20658				var ID string
20659				err = json.Unmarshal(*v, &ID)
20660				if err != nil {
20661					return err
20662				}
20663				stg.ID = &ID
20664			}
20665		case "name":
20666			if v != nil {
20667				var name string
20668				err = json.Unmarshal(*v, &name)
20669				if err != nil {
20670					return err
20671				}
20672				stg.Name = &name
20673			}
20674		case "type":
20675			if v != nil {
20676				var typeVar string
20677				err = json.Unmarshal(*v, &typeVar)
20678				if err != nil {
20679					return err
20680				}
20681				stg.Type = &typeVar
20682			}
20683		}
20684	}
20685
20686	return nil
20687}
20688
20689// ServerTrustGroupListResult a list of server trust groups.
20690type ServerTrustGroupListResult struct {
20691	autorest.Response `json:"-"`
20692	// Value - READ-ONLY; Array of results.
20693	Value *[]ServerTrustGroup `json:"value,omitempty"`
20694	// NextLink - READ-ONLY; Link to retrieve next page of results.
20695	NextLink *string `json:"nextLink,omitempty"`
20696}
20697
20698// MarshalJSON is the custom marshaler for ServerTrustGroupListResult.
20699func (stglr ServerTrustGroupListResult) MarshalJSON() ([]byte, error) {
20700	objectMap := make(map[string]interface{})
20701	return json.Marshal(objectMap)
20702}
20703
20704// ServerTrustGroupListResultIterator provides access to a complete listing of ServerTrustGroup values.
20705type ServerTrustGroupListResultIterator struct {
20706	i    int
20707	page ServerTrustGroupListResultPage
20708}
20709
20710// NextWithContext advances to the next value.  If there was an error making
20711// the request the iterator does not advance and the error is returned.
20712func (iter *ServerTrustGroupListResultIterator) NextWithContext(ctx context.Context) (err error) {
20713	if tracing.IsEnabled() {
20714		ctx = tracing.StartSpan(ctx, fqdn+"/ServerTrustGroupListResultIterator.NextWithContext")
20715		defer func() {
20716			sc := -1
20717			if iter.Response().Response.Response != nil {
20718				sc = iter.Response().Response.Response.StatusCode
20719			}
20720			tracing.EndSpan(ctx, sc, err)
20721		}()
20722	}
20723	iter.i++
20724	if iter.i < len(iter.page.Values()) {
20725		return nil
20726	}
20727	err = iter.page.NextWithContext(ctx)
20728	if err != nil {
20729		iter.i--
20730		return err
20731	}
20732	iter.i = 0
20733	return nil
20734}
20735
20736// Next advances to the next value.  If there was an error making
20737// the request the iterator does not advance and the error is returned.
20738// Deprecated: Use NextWithContext() instead.
20739func (iter *ServerTrustGroupListResultIterator) Next() error {
20740	return iter.NextWithContext(context.Background())
20741}
20742
20743// NotDone returns true if the enumeration should be started or is not yet complete.
20744func (iter ServerTrustGroupListResultIterator) NotDone() bool {
20745	return iter.page.NotDone() && iter.i < len(iter.page.Values())
20746}
20747
20748// Response returns the raw server response from the last page request.
20749func (iter ServerTrustGroupListResultIterator) Response() ServerTrustGroupListResult {
20750	return iter.page.Response()
20751}
20752
20753// Value returns the current value or a zero-initialized value if the
20754// iterator has advanced beyond the end of the collection.
20755func (iter ServerTrustGroupListResultIterator) Value() ServerTrustGroup {
20756	if !iter.page.NotDone() {
20757		return ServerTrustGroup{}
20758	}
20759	return iter.page.Values()[iter.i]
20760}
20761
20762// Creates a new instance of the ServerTrustGroupListResultIterator type.
20763func NewServerTrustGroupListResultIterator(page ServerTrustGroupListResultPage) ServerTrustGroupListResultIterator {
20764	return ServerTrustGroupListResultIterator{page: page}
20765}
20766
20767// IsEmpty returns true if the ListResult contains no values.
20768func (stglr ServerTrustGroupListResult) IsEmpty() bool {
20769	return stglr.Value == nil || len(*stglr.Value) == 0
20770}
20771
20772// hasNextLink returns true if the NextLink is not empty.
20773func (stglr ServerTrustGroupListResult) hasNextLink() bool {
20774	return stglr.NextLink != nil && len(*stglr.NextLink) != 0
20775}
20776
20777// serverTrustGroupListResultPreparer prepares a request to retrieve the next set of results.
20778// It returns nil if no more results exist.
20779func (stglr ServerTrustGroupListResult) serverTrustGroupListResultPreparer(ctx context.Context) (*http.Request, error) {
20780	if !stglr.hasNextLink() {
20781		return nil, nil
20782	}
20783	return autorest.Prepare((&http.Request{}).WithContext(ctx),
20784		autorest.AsJSON(),
20785		autorest.AsGet(),
20786		autorest.WithBaseURL(to.String(stglr.NextLink)))
20787}
20788
20789// ServerTrustGroupListResultPage contains a page of ServerTrustGroup values.
20790type ServerTrustGroupListResultPage struct {
20791	fn    func(context.Context, ServerTrustGroupListResult) (ServerTrustGroupListResult, error)
20792	stglr ServerTrustGroupListResult
20793}
20794
20795// NextWithContext advances to the next page of values.  If there was an error making
20796// the request the page does not advance and the error is returned.
20797func (page *ServerTrustGroupListResultPage) NextWithContext(ctx context.Context) (err error) {
20798	if tracing.IsEnabled() {
20799		ctx = tracing.StartSpan(ctx, fqdn+"/ServerTrustGroupListResultPage.NextWithContext")
20800		defer func() {
20801			sc := -1
20802			if page.Response().Response.Response != nil {
20803				sc = page.Response().Response.Response.StatusCode
20804			}
20805			tracing.EndSpan(ctx, sc, err)
20806		}()
20807	}
20808	for {
20809		next, err := page.fn(ctx, page.stglr)
20810		if err != nil {
20811			return err
20812		}
20813		page.stglr = next
20814		if !next.hasNextLink() || !next.IsEmpty() {
20815			break
20816		}
20817	}
20818	return nil
20819}
20820
20821// Next advances to the next page of values.  If there was an error making
20822// the request the page does not advance and the error is returned.
20823// Deprecated: Use NextWithContext() instead.
20824func (page *ServerTrustGroupListResultPage) Next() error {
20825	return page.NextWithContext(context.Background())
20826}
20827
20828// NotDone returns true if the page enumeration should be started or is not yet complete.
20829func (page ServerTrustGroupListResultPage) NotDone() bool {
20830	return !page.stglr.IsEmpty()
20831}
20832
20833// Response returns the raw server response from the last page request.
20834func (page ServerTrustGroupListResultPage) Response() ServerTrustGroupListResult {
20835	return page.stglr
20836}
20837
20838// Values returns the slice of values for the current page or nil if there are no values.
20839func (page ServerTrustGroupListResultPage) Values() []ServerTrustGroup {
20840	if page.stglr.IsEmpty() {
20841		return nil
20842	}
20843	return *page.stglr.Value
20844}
20845
20846// Creates a new instance of the ServerTrustGroupListResultPage type.
20847func NewServerTrustGroupListResultPage(cur ServerTrustGroupListResult, getNextPage func(context.Context, ServerTrustGroupListResult) (ServerTrustGroupListResult, error)) ServerTrustGroupListResultPage {
20848	return ServerTrustGroupListResultPage{
20849		fn:    getNextPage,
20850		stglr: cur,
20851	}
20852}
20853
20854// ServerTrustGroupProperties properties of a server trust group.
20855type ServerTrustGroupProperties struct {
20856	// GroupMembers - Group members information for the server trust group.
20857	GroupMembers *[]ServerInfo `json:"groupMembers,omitempty"`
20858	// TrustScopes - Trust scope of the server trust group.
20859	TrustScopes *[]string `json:"trustScopes,omitempty"`
20860}
20861
20862// ServerTrustGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
20863// long-running operation.
20864type ServerTrustGroupsCreateOrUpdateFuture struct {
20865	azure.FutureAPI
20866	// Result returns the result of the asynchronous operation.
20867	// If the operation has not completed it will return an error.
20868	Result func(ServerTrustGroupsClient) (ServerTrustGroup, error)
20869}
20870
20871// UnmarshalJSON is the custom unmarshaller for CreateFuture.
20872func (future *ServerTrustGroupsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
20873	var azFuture azure.Future
20874	if err := json.Unmarshal(body, &azFuture); err != nil {
20875		return err
20876	}
20877	future.FutureAPI = &azFuture
20878	future.Result = future.result
20879	return nil
20880}
20881
20882// result is the default implementation for ServerTrustGroupsCreateOrUpdateFuture.Result.
20883func (future *ServerTrustGroupsCreateOrUpdateFuture) result(client ServerTrustGroupsClient) (stg ServerTrustGroup, err error) {
20884	var done bool
20885	done, err = future.DoneWithContext(context.Background(), client)
20886	if err != nil {
20887		err = autorest.NewErrorWithError(err, "sql.ServerTrustGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
20888		return
20889	}
20890	if !done {
20891		stg.Response.Response = future.Response()
20892		err = azure.NewAsyncOpIncompleteError("sql.ServerTrustGroupsCreateOrUpdateFuture")
20893		return
20894	}
20895	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
20896	if stg.Response.Response, err = future.GetResult(sender); err == nil && stg.Response.Response.StatusCode != http.StatusNoContent {
20897		stg, err = client.CreateOrUpdateResponder(stg.Response.Response)
20898		if err != nil {
20899			err = autorest.NewErrorWithError(err, "sql.ServerTrustGroupsCreateOrUpdateFuture", "Result", stg.Response.Response, "Failure responding to request")
20900		}
20901	}
20902	return
20903}
20904
20905// ServerTrustGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
20906// operation.
20907type ServerTrustGroupsDeleteFuture struct {
20908	azure.FutureAPI
20909	// Result returns the result of the asynchronous operation.
20910	// If the operation has not completed it will return an error.
20911	Result func(ServerTrustGroupsClient) (autorest.Response, error)
20912}
20913
20914// UnmarshalJSON is the custom unmarshaller for CreateFuture.
20915func (future *ServerTrustGroupsDeleteFuture) UnmarshalJSON(body []byte) error {
20916	var azFuture azure.Future
20917	if err := json.Unmarshal(body, &azFuture); err != nil {
20918		return err
20919	}
20920	future.FutureAPI = &azFuture
20921	future.Result = future.result
20922	return nil
20923}
20924
20925// result is the default implementation for ServerTrustGroupsDeleteFuture.Result.
20926func (future *ServerTrustGroupsDeleteFuture) result(client ServerTrustGroupsClient) (ar autorest.Response, err error) {
20927	var done bool
20928	done, err = future.DoneWithContext(context.Background(), client)
20929	if err != nil {
20930		err = autorest.NewErrorWithError(err, "sql.ServerTrustGroupsDeleteFuture", "Result", future.Response(), "Polling failure")
20931		return
20932	}
20933	if !done {
20934		ar.Response = future.Response()
20935		err = azure.NewAsyncOpIncompleteError("sql.ServerTrustGroupsDeleteFuture")
20936		return
20937	}
20938	ar.Response = future.Response()
20939	return
20940}
20941
20942// ServerUpdate an update request for an Azure SQL Database server.
20943type ServerUpdate struct {
20944	// ServerProperties - Resource properties.
20945	*ServerProperties `json:"properties,omitempty"`
20946	// Tags - Resource tags.
20947	Tags map[string]*string `json:"tags"`
20948}
20949
20950// MarshalJSON is the custom marshaler for ServerUpdate.
20951func (su ServerUpdate) MarshalJSON() ([]byte, error) {
20952	objectMap := make(map[string]interface{})
20953	if su.ServerProperties != nil {
20954		objectMap["properties"] = su.ServerProperties
20955	}
20956	if su.Tags != nil {
20957		objectMap["tags"] = su.Tags
20958	}
20959	return json.Marshal(objectMap)
20960}
20961
20962// UnmarshalJSON is the custom unmarshaler for ServerUpdate struct.
20963func (su *ServerUpdate) UnmarshalJSON(body []byte) error {
20964	var m map[string]*json.RawMessage
20965	err := json.Unmarshal(body, &m)
20966	if err != nil {
20967		return err
20968	}
20969	for k, v := range m {
20970		switch k {
20971		case "properties":
20972			if v != nil {
20973				var serverProperties ServerProperties
20974				err = json.Unmarshal(*v, &serverProperties)
20975				if err != nil {
20976					return err
20977				}
20978				su.ServerProperties = &serverProperties
20979			}
20980		case "tags":
20981			if v != nil {
20982				var tags map[string]*string
20983				err = json.Unmarshal(*v, &tags)
20984				if err != nil {
20985					return err
20986				}
20987				su.Tags = tags
20988			}
20989		}
20990	}
20991
20992	return nil
20993}
20994
20995// ServerUsage represents server metrics.
20996type ServerUsage struct {
20997	// Name - READ-ONLY; Name of the server usage metric.
20998	Name *string `json:"name,omitempty"`
20999	// ResourceName - READ-ONLY; The name of the resource.
21000	ResourceName *string `json:"resourceName,omitempty"`
21001	// DisplayName - READ-ONLY; The metric display name.
21002	DisplayName *string `json:"displayName,omitempty"`
21003	// CurrentValue - READ-ONLY; The current value of the metric.
21004	CurrentValue *float64 `json:"currentValue,omitempty"`
21005	// Limit - READ-ONLY; The current limit of the metric.
21006	Limit *float64 `json:"limit,omitempty"`
21007	// Unit - READ-ONLY; The units of the metric.
21008	Unit *string `json:"unit,omitempty"`
21009	// NextResetTime - READ-ONLY; The next reset time for the metric (ISO8601 format).
21010	NextResetTime *date.Time `json:"nextResetTime,omitempty"`
21011}
21012
21013// MarshalJSON is the custom marshaler for ServerUsage.
21014func (su ServerUsage) MarshalJSON() ([]byte, error) {
21015	objectMap := make(map[string]interface{})
21016	return json.Marshal(objectMap)
21017}
21018
21019// ServerUsageListResult represents the response to a list server metrics request.
21020type ServerUsageListResult struct {
21021	autorest.Response `json:"-"`
21022	// Value - The list of server metrics for the server.
21023	Value *[]ServerUsage `json:"value,omitempty"`
21024}
21025
21026// ServerVersionCapability the server capability
21027type ServerVersionCapability struct {
21028	// Name - READ-ONLY; The server version name.
21029	Name *string `json:"name,omitempty"`
21030	// SupportedEditions - READ-ONLY; The list of supported database editions.
21031	SupportedEditions *[]EditionCapability `json:"supportedEditions,omitempty"`
21032	// SupportedElasticPoolEditions - READ-ONLY; The list of supported elastic pool editions.
21033	SupportedElasticPoolEditions *[]ElasticPoolEditionCapability `json:"supportedElasticPoolEditions,omitempty"`
21034	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
21035	Status CapabilityStatus `json:"status,omitempty"`
21036	// Reason - The reason for the capability not being available.
21037	Reason *string `json:"reason,omitempty"`
21038}
21039
21040// MarshalJSON is the custom marshaler for ServerVersionCapability.
21041func (svc ServerVersionCapability) MarshalJSON() ([]byte, error) {
21042	objectMap := make(map[string]interface{})
21043	if svc.Reason != nil {
21044		objectMap["reason"] = svc.Reason
21045	}
21046	return json.Marshal(objectMap)
21047}
21048
21049// ServerVulnerabilityAssessment a server vulnerability assessment.
21050type ServerVulnerabilityAssessment struct {
21051	autorest.Response `json:"-"`
21052	// ServerVulnerabilityAssessmentProperties - Resource properties.
21053	*ServerVulnerabilityAssessmentProperties `json:"properties,omitempty"`
21054	// ID - READ-ONLY; Resource ID.
21055	ID *string `json:"id,omitempty"`
21056	// Name - READ-ONLY; Resource name.
21057	Name *string `json:"name,omitempty"`
21058	// Type - READ-ONLY; Resource type.
21059	Type *string `json:"type,omitempty"`
21060}
21061
21062// MarshalJSON is the custom marshaler for ServerVulnerabilityAssessment.
21063func (sva ServerVulnerabilityAssessment) MarshalJSON() ([]byte, error) {
21064	objectMap := make(map[string]interface{})
21065	if sva.ServerVulnerabilityAssessmentProperties != nil {
21066		objectMap["properties"] = sva.ServerVulnerabilityAssessmentProperties
21067	}
21068	return json.Marshal(objectMap)
21069}
21070
21071// UnmarshalJSON is the custom unmarshaler for ServerVulnerabilityAssessment struct.
21072func (sva *ServerVulnerabilityAssessment) UnmarshalJSON(body []byte) error {
21073	var m map[string]*json.RawMessage
21074	err := json.Unmarshal(body, &m)
21075	if err != nil {
21076		return err
21077	}
21078	for k, v := range m {
21079		switch k {
21080		case "properties":
21081			if v != nil {
21082				var serverVulnerabilityAssessmentProperties ServerVulnerabilityAssessmentProperties
21083				err = json.Unmarshal(*v, &serverVulnerabilityAssessmentProperties)
21084				if err != nil {
21085					return err
21086				}
21087				sva.ServerVulnerabilityAssessmentProperties = &serverVulnerabilityAssessmentProperties
21088			}
21089		case "id":
21090			if v != nil {
21091				var ID string
21092				err = json.Unmarshal(*v, &ID)
21093				if err != nil {
21094					return err
21095				}
21096				sva.ID = &ID
21097			}
21098		case "name":
21099			if v != nil {
21100				var name string
21101				err = json.Unmarshal(*v, &name)
21102				if err != nil {
21103					return err
21104				}
21105				sva.Name = &name
21106			}
21107		case "type":
21108			if v != nil {
21109				var typeVar string
21110				err = json.Unmarshal(*v, &typeVar)
21111				if err != nil {
21112					return err
21113				}
21114				sva.Type = &typeVar
21115			}
21116		}
21117	}
21118
21119	return nil
21120}
21121
21122// ServerVulnerabilityAssessmentListResult a list of the server's vulnerability assessments.
21123type ServerVulnerabilityAssessmentListResult struct {
21124	autorest.Response `json:"-"`
21125	// Value - READ-ONLY; Array of results.
21126	Value *[]ServerVulnerabilityAssessment `json:"value,omitempty"`
21127	// NextLink - READ-ONLY; Link to retrieve next page of results.
21128	NextLink *string `json:"nextLink,omitempty"`
21129}
21130
21131// MarshalJSON is the custom marshaler for ServerVulnerabilityAssessmentListResult.
21132func (svalr ServerVulnerabilityAssessmentListResult) MarshalJSON() ([]byte, error) {
21133	objectMap := make(map[string]interface{})
21134	return json.Marshal(objectMap)
21135}
21136
21137// ServerVulnerabilityAssessmentListResultIterator provides access to a complete listing of
21138// ServerVulnerabilityAssessment values.
21139type ServerVulnerabilityAssessmentListResultIterator struct {
21140	i    int
21141	page ServerVulnerabilityAssessmentListResultPage
21142}
21143
21144// NextWithContext advances to the next value.  If there was an error making
21145// the request the iterator does not advance and the error is returned.
21146func (iter *ServerVulnerabilityAssessmentListResultIterator) NextWithContext(ctx context.Context) (err error) {
21147	if tracing.IsEnabled() {
21148		ctx = tracing.StartSpan(ctx, fqdn+"/ServerVulnerabilityAssessmentListResultIterator.NextWithContext")
21149		defer func() {
21150			sc := -1
21151			if iter.Response().Response.Response != nil {
21152				sc = iter.Response().Response.Response.StatusCode
21153			}
21154			tracing.EndSpan(ctx, sc, err)
21155		}()
21156	}
21157	iter.i++
21158	if iter.i < len(iter.page.Values()) {
21159		return nil
21160	}
21161	err = iter.page.NextWithContext(ctx)
21162	if err != nil {
21163		iter.i--
21164		return err
21165	}
21166	iter.i = 0
21167	return nil
21168}
21169
21170// Next advances to the next value.  If there was an error making
21171// the request the iterator does not advance and the error is returned.
21172// Deprecated: Use NextWithContext() instead.
21173func (iter *ServerVulnerabilityAssessmentListResultIterator) Next() error {
21174	return iter.NextWithContext(context.Background())
21175}
21176
21177// NotDone returns true if the enumeration should be started or is not yet complete.
21178func (iter ServerVulnerabilityAssessmentListResultIterator) NotDone() bool {
21179	return iter.page.NotDone() && iter.i < len(iter.page.Values())
21180}
21181
21182// Response returns the raw server response from the last page request.
21183func (iter ServerVulnerabilityAssessmentListResultIterator) Response() ServerVulnerabilityAssessmentListResult {
21184	return iter.page.Response()
21185}
21186
21187// Value returns the current value or a zero-initialized value if the
21188// iterator has advanced beyond the end of the collection.
21189func (iter ServerVulnerabilityAssessmentListResultIterator) Value() ServerVulnerabilityAssessment {
21190	if !iter.page.NotDone() {
21191		return ServerVulnerabilityAssessment{}
21192	}
21193	return iter.page.Values()[iter.i]
21194}
21195
21196// Creates a new instance of the ServerVulnerabilityAssessmentListResultIterator type.
21197func NewServerVulnerabilityAssessmentListResultIterator(page ServerVulnerabilityAssessmentListResultPage) ServerVulnerabilityAssessmentListResultIterator {
21198	return ServerVulnerabilityAssessmentListResultIterator{page: page}
21199}
21200
21201// IsEmpty returns true if the ListResult contains no values.
21202func (svalr ServerVulnerabilityAssessmentListResult) IsEmpty() bool {
21203	return svalr.Value == nil || len(*svalr.Value) == 0
21204}
21205
21206// hasNextLink returns true if the NextLink is not empty.
21207func (svalr ServerVulnerabilityAssessmentListResult) hasNextLink() bool {
21208	return svalr.NextLink != nil && len(*svalr.NextLink) != 0
21209}
21210
21211// serverVulnerabilityAssessmentListResultPreparer prepares a request to retrieve the next set of results.
21212// It returns nil if no more results exist.
21213func (svalr ServerVulnerabilityAssessmentListResult) serverVulnerabilityAssessmentListResultPreparer(ctx context.Context) (*http.Request, error) {
21214	if !svalr.hasNextLink() {
21215		return nil, nil
21216	}
21217	return autorest.Prepare((&http.Request{}).WithContext(ctx),
21218		autorest.AsJSON(),
21219		autorest.AsGet(),
21220		autorest.WithBaseURL(to.String(svalr.NextLink)))
21221}
21222
21223// ServerVulnerabilityAssessmentListResultPage contains a page of ServerVulnerabilityAssessment values.
21224type ServerVulnerabilityAssessmentListResultPage struct {
21225	fn    func(context.Context, ServerVulnerabilityAssessmentListResult) (ServerVulnerabilityAssessmentListResult, error)
21226	svalr ServerVulnerabilityAssessmentListResult
21227}
21228
21229// NextWithContext advances to the next page of values.  If there was an error making
21230// the request the page does not advance and the error is returned.
21231func (page *ServerVulnerabilityAssessmentListResultPage) NextWithContext(ctx context.Context) (err error) {
21232	if tracing.IsEnabled() {
21233		ctx = tracing.StartSpan(ctx, fqdn+"/ServerVulnerabilityAssessmentListResultPage.NextWithContext")
21234		defer func() {
21235			sc := -1
21236			if page.Response().Response.Response != nil {
21237				sc = page.Response().Response.Response.StatusCode
21238			}
21239			tracing.EndSpan(ctx, sc, err)
21240		}()
21241	}
21242	for {
21243		next, err := page.fn(ctx, page.svalr)
21244		if err != nil {
21245			return err
21246		}
21247		page.svalr = next
21248		if !next.hasNextLink() || !next.IsEmpty() {
21249			break
21250		}
21251	}
21252	return nil
21253}
21254
21255// Next advances to the next page of values.  If there was an error making
21256// the request the page does not advance and the error is returned.
21257// Deprecated: Use NextWithContext() instead.
21258func (page *ServerVulnerabilityAssessmentListResultPage) Next() error {
21259	return page.NextWithContext(context.Background())
21260}
21261
21262// NotDone returns true if the page enumeration should be started or is not yet complete.
21263func (page ServerVulnerabilityAssessmentListResultPage) NotDone() bool {
21264	return !page.svalr.IsEmpty()
21265}
21266
21267// Response returns the raw server response from the last page request.
21268func (page ServerVulnerabilityAssessmentListResultPage) Response() ServerVulnerabilityAssessmentListResult {
21269	return page.svalr
21270}
21271
21272// Values returns the slice of values for the current page or nil if there are no values.
21273func (page ServerVulnerabilityAssessmentListResultPage) Values() []ServerVulnerabilityAssessment {
21274	if page.svalr.IsEmpty() {
21275		return nil
21276	}
21277	return *page.svalr.Value
21278}
21279
21280// Creates a new instance of the ServerVulnerabilityAssessmentListResultPage type.
21281func NewServerVulnerabilityAssessmentListResultPage(cur ServerVulnerabilityAssessmentListResult, getNextPage func(context.Context, ServerVulnerabilityAssessmentListResult) (ServerVulnerabilityAssessmentListResult, error)) ServerVulnerabilityAssessmentListResultPage {
21282	return ServerVulnerabilityAssessmentListResultPage{
21283		fn:    getNextPage,
21284		svalr: cur,
21285	}
21286}
21287
21288// ServerVulnerabilityAssessmentProperties properties of a server Vulnerability Assessment.
21289type ServerVulnerabilityAssessmentProperties struct {
21290	// StorageContainerPath - A blob storage container path to hold the scan results (e.g. https://myStorage.blob.core.windows.net/VaScans/).
21291	StorageContainerPath *string `json:"storageContainerPath,omitempty"`
21292	// StorageContainerSasKey - A shared access signature (SAS Key) that has read and write access to the blob container specified in 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't specified, StorageContainerSasKey is required.
21293	StorageContainerSasKey *string `json:"storageContainerSasKey,omitempty"`
21294	// StorageAccountAccessKey - Specifies the identifier key of the storage account for vulnerability assessment scan results. If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is required.
21295	StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
21296	// RecurringScans - The recurring scans settings
21297	RecurringScans *VulnerabilityAssessmentRecurringScansProperties `json:"recurringScans,omitempty"`
21298}
21299
21300// ServiceObjective represents a database service objective.
21301type ServiceObjective struct {
21302	autorest.Response `json:"-"`
21303	// ServiceObjectiveProperties - Represents the properties of the resource.
21304	*ServiceObjectiveProperties `json:"properties,omitempty"`
21305	// ID - READ-ONLY; Resource ID.
21306	ID *string `json:"id,omitempty"`
21307	// Name - READ-ONLY; Resource name.
21308	Name *string `json:"name,omitempty"`
21309	// Type - READ-ONLY; Resource type.
21310	Type *string `json:"type,omitempty"`
21311}
21312
21313// MarshalJSON is the custom marshaler for ServiceObjective.
21314func (so ServiceObjective) MarshalJSON() ([]byte, error) {
21315	objectMap := make(map[string]interface{})
21316	if so.ServiceObjectiveProperties != nil {
21317		objectMap["properties"] = so.ServiceObjectiveProperties
21318	}
21319	return json.Marshal(objectMap)
21320}
21321
21322// UnmarshalJSON is the custom unmarshaler for ServiceObjective struct.
21323func (so *ServiceObjective) UnmarshalJSON(body []byte) error {
21324	var m map[string]*json.RawMessage
21325	err := json.Unmarshal(body, &m)
21326	if err != nil {
21327		return err
21328	}
21329	for k, v := range m {
21330		switch k {
21331		case "properties":
21332			if v != nil {
21333				var serviceObjectiveProperties ServiceObjectiveProperties
21334				err = json.Unmarshal(*v, &serviceObjectiveProperties)
21335				if err != nil {
21336					return err
21337				}
21338				so.ServiceObjectiveProperties = &serviceObjectiveProperties
21339			}
21340		case "id":
21341			if v != nil {
21342				var ID string
21343				err = json.Unmarshal(*v, &ID)
21344				if err != nil {
21345					return err
21346				}
21347				so.ID = &ID
21348			}
21349		case "name":
21350			if v != nil {
21351				var name string
21352				err = json.Unmarshal(*v, &name)
21353				if err != nil {
21354					return err
21355				}
21356				so.Name = &name
21357			}
21358		case "type":
21359			if v != nil {
21360				var typeVar string
21361				err = json.Unmarshal(*v, &typeVar)
21362				if err != nil {
21363					return err
21364				}
21365				so.Type = &typeVar
21366			}
21367		}
21368	}
21369
21370	return nil
21371}
21372
21373// ServiceObjectiveCapability the service objectives capability.
21374type ServiceObjectiveCapability struct {
21375	// ID - READ-ONLY; The unique ID of the service objective.
21376	ID *uuid.UUID `json:"id,omitempty"`
21377	// Name - READ-ONLY; The service objective name.
21378	Name *string `json:"name,omitempty"`
21379	// SupportedMaxSizes - READ-ONLY; The list of supported maximum database sizes.
21380	SupportedMaxSizes *[]MaxSizeRangeCapability `json:"supportedMaxSizes,omitempty"`
21381	// PerformanceLevel - READ-ONLY; The performance level.
21382	PerformanceLevel *PerformanceLevelCapability `json:"performanceLevel,omitempty"`
21383	// Sku - READ-ONLY; The sku.
21384	Sku *Sku `json:"sku,omitempty"`
21385	// SupportedLicenseTypes - READ-ONLY; List of supported license types.
21386	SupportedLicenseTypes *[]LicenseTypeCapability `json:"supportedLicenseTypes,omitempty"`
21387	// IncludedMaxSize - READ-ONLY; The included (free) max size.
21388	IncludedMaxSize *MaxSizeCapability `json:"includedMaxSize,omitempty"`
21389	// ZoneRedundant - READ-ONLY; Whether or not zone redundancy is supported for the service objective.
21390	ZoneRedundant *bool `json:"zoneRedundant,omitempty"`
21391	// SupportedAutoPauseDelay - READ-ONLY; Supported time range for auto pause delay
21392	SupportedAutoPauseDelay *AutoPauseDelayTimeRange `json:"supportedAutoPauseDelay,omitempty"`
21393	// SupportedMinCapacities - READ-ONLY; List of supported min capacities
21394	SupportedMinCapacities *[]MinCapacityCapability `json:"supportedMinCapacities,omitempty"`
21395	// ComputeModel - READ-ONLY; The compute model
21396	ComputeModel *string `json:"computeModel,omitempty"`
21397	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
21398	Status CapabilityStatus `json:"status,omitempty"`
21399	// Reason - The reason for the capability not being available.
21400	Reason *string `json:"reason,omitempty"`
21401}
21402
21403// MarshalJSON is the custom marshaler for ServiceObjectiveCapability.
21404func (soc ServiceObjectiveCapability) MarshalJSON() ([]byte, error) {
21405	objectMap := make(map[string]interface{})
21406	if soc.Reason != nil {
21407		objectMap["reason"] = soc.Reason
21408	}
21409	return json.Marshal(objectMap)
21410}
21411
21412// ServiceObjectiveListResult represents the response to a get database service objectives request.
21413type ServiceObjectiveListResult struct {
21414	autorest.Response `json:"-"`
21415	// Value - The list of database service objectives.
21416	Value *[]ServiceObjective `json:"value,omitempty"`
21417}
21418
21419// ServiceObjectiveProperties represents the properties of a database service objective.
21420type ServiceObjectiveProperties struct {
21421	// ServiceObjectiveName - READ-ONLY; The name for the service objective.
21422	ServiceObjectiveName *string `json:"serviceObjectiveName,omitempty"`
21423	// IsDefault - READ-ONLY; Gets whether the service level objective is the default service objective.
21424	IsDefault *bool `json:"isDefault,omitempty"`
21425	// IsSystem - READ-ONLY; Gets whether the service level objective is a system service objective.
21426	IsSystem *bool `json:"isSystem,omitempty"`
21427	// Description - READ-ONLY; The description for the service level objective.
21428	Description *string `json:"description,omitempty"`
21429	// Enabled - READ-ONLY; Gets whether the service level objective is enabled.
21430	Enabled *bool `json:"enabled,omitempty"`
21431}
21432
21433// MarshalJSON is the custom marshaler for ServiceObjectiveProperties.
21434func (sop ServiceObjectiveProperties) MarshalJSON() ([]byte, error) {
21435	objectMap := make(map[string]interface{})
21436	return json.Marshal(objectMap)
21437}
21438
21439// ServiceTierAdvisor represents a Service Tier Advisor.
21440type ServiceTierAdvisor struct {
21441	autorest.Response `json:"-"`
21442	// ServiceTierAdvisorProperties - READ-ONLY; The properties representing the resource.
21443	*ServiceTierAdvisorProperties `json:"properties,omitempty"`
21444	// ID - READ-ONLY; Resource ID.
21445	ID *string `json:"id,omitempty"`
21446	// Name - READ-ONLY; Resource name.
21447	Name *string `json:"name,omitempty"`
21448	// Type - READ-ONLY; Resource type.
21449	Type *string `json:"type,omitempty"`
21450}
21451
21452// MarshalJSON is the custom marshaler for ServiceTierAdvisor.
21453func (sta ServiceTierAdvisor) MarshalJSON() ([]byte, error) {
21454	objectMap := make(map[string]interface{})
21455	return json.Marshal(objectMap)
21456}
21457
21458// UnmarshalJSON is the custom unmarshaler for ServiceTierAdvisor struct.
21459func (sta *ServiceTierAdvisor) UnmarshalJSON(body []byte) error {
21460	var m map[string]*json.RawMessage
21461	err := json.Unmarshal(body, &m)
21462	if err != nil {
21463		return err
21464	}
21465	for k, v := range m {
21466		switch k {
21467		case "properties":
21468			if v != nil {
21469				var serviceTierAdvisorProperties ServiceTierAdvisorProperties
21470				err = json.Unmarshal(*v, &serviceTierAdvisorProperties)
21471				if err != nil {
21472					return err
21473				}
21474				sta.ServiceTierAdvisorProperties = &serviceTierAdvisorProperties
21475			}
21476		case "id":
21477			if v != nil {
21478				var ID string
21479				err = json.Unmarshal(*v, &ID)
21480				if err != nil {
21481					return err
21482				}
21483				sta.ID = &ID
21484			}
21485		case "name":
21486			if v != nil {
21487				var name string
21488				err = json.Unmarshal(*v, &name)
21489				if err != nil {
21490					return err
21491				}
21492				sta.Name = &name
21493			}
21494		case "type":
21495			if v != nil {
21496				var typeVar string
21497				err = json.Unmarshal(*v, &typeVar)
21498				if err != nil {
21499					return err
21500				}
21501				sta.Type = &typeVar
21502			}
21503		}
21504	}
21505
21506	return nil
21507}
21508
21509// ServiceTierAdvisorListResult represents the response to a list service tier advisor request.
21510type ServiceTierAdvisorListResult struct {
21511	autorest.Response `json:"-"`
21512	// Value - The list of service tier advisors for specified database.
21513	Value *[]ServiceTierAdvisor `json:"value,omitempty"`
21514}
21515
21516// ServiceTierAdvisorProperties represents the properties of a Service Tier Advisor.
21517type ServiceTierAdvisorProperties struct {
21518	// ObservationPeriodStart - READ-ONLY; The observation period start (ISO8601 format).
21519	ObservationPeriodStart *date.Time `json:"observationPeriodStart,omitempty"`
21520	// ObservationPeriodEnd - READ-ONLY; The observation period start (ISO8601 format).
21521	ObservationPeriodEnd *date.Time `json:"observationPeriodEnd,omitempty"`
21522	// ActiveTimeRatio - READ-ONLY; The activeTimeRatio for service tier advisor.
21523	ActiveTimeRatio *float64 `json:"activeTimeRatio,omitempty"`
21524	// MinDtu - READ-ONLY; Gets or sets minDtu for service tier advisor.
21525	MinDtu *float64 `json:"minDtu,omitempty"`
21526	// AvgDtu - READ-ONLY; Gets or sets avgDtu for service tier advisor.
21527	AvgDtu *float64 `json:"avgDtu,omitempty"`
21528	// MaxDtu - READ-ONLY; Gets or sets maxDtu for service tier advisor.
21529	MaxDtu *float64 `json:"maxDtu,omitempty"`
21530	// MaxSizeInGB - READ-ONLY; Gets or sets maxSizeInGB for service tier advisor.
21531	MaxSizeInGB *float64 `json:"maxSizeInGB,omitempty"`
21532	// ServiceLevelObjectiveUsageMetrics - READ-ONLY; Gets or sets serviceLevelObjectiveUsageMetrics for the service tier advisor.
21533	ServiceLevelObjectiveUsageMetrics *[]SloUsageMetric `json:"serviceLevelObjectiveUsageMetrics,omitempty"`
21534	// CurrentServiceLevelObjective - READ-ONLY; Gets or sets currentServiceLevelObjective for service tier advisor.
21535	CurrentServiceLevelObjective *string `json:"currentServiceLevelObjective,omitempty"`
21536	// CurrentServiceLevelObjectiveID - READ-ONLY; Gets or sets currentServiceLevelObjectiveId for service tier advisor.
21537	CurrentServiceLevelObjectiveID *uuid.UUID `json:"currentServiceLevelObjectiveId,omitempty"`
21538	// UsageBasedRecommendationServiceLevelObjective - READ-ONLY; Gets or sets usageBasedRecommendationServiceLevelObjective for service tier advisor.
21539	UsageBasedRecommendationServiceLevelObjective *string `json:"usageBasedRecommendationServiceLevelObjective,omitempty"`
21540	// UsageBasedRecommendationServiceLevelObjectiveID - READ-ONLY; Gets or sets usageBasedRecommendationServiceLevelObjectiveId for service tier advisor.
21541	UsageBasedRecommendationServiceLevelObjectiveID *uuid.UUID `json:"usageBasedRecommendationServiceLevelObjectiveId,omitempty"`
21542	// DatabaseSizeBasedRecommendationServiceLevelObjective - READ-ONLY; Gets or sets databaseSizeBasedRecommendationServiceLevelObjective for service tier advisor.
21543	DatabaseSizeBasedRecommendationServiceLevelObjective *string `json:"databaseSizeBasedRecommendationServiceLevelObjective,omitempty"`
21544	// DatabaseSizeBasedRecommendationServiceLevelObjectiveID - READ-ONLY; Gets or sets databaseSizeBasedRecommendationServiceLevelObjectiveId for service tier advisor.
21545	DatabaseSizeBasedRecommendationServiceLevelObjectiveID *uuid.UUID `json:"databaseSizeBasedRecommendationServiceLevelObjectiveId,omitempty"`
21546	// DisasterPlanBasedRecommendationServiceLevelObjective - READ-ONLY; Gets or sets disasterPlanBasedRecommendationServiceLevelObjective for service tier advisor.
21547	DisasterPlanBasedRecommendationServiceLevelObjective *string `json:"disasterPlanBasedRecommendationServiceLevelObjective,omitempty"`
21548	// DisasterPlanBasedRecommendationServiceLevelObjectiveID - READ-ONLY; Gets or sets disasterPlanBasedRecommendationServiceLevelObjectiveId for service tier advisor.
21549	DisasterPlanBasedRecommendationServiceLevelObjectiveID *uuid.UUID `json:"disasterPlanBasedRecommendationServiceLevelObjectiveId,omitempty"`
21550	// OverallRecommendationServiceLevelObjective - READ-ONLY; Gets or sets overallRecommendationServiceLevelObjective for service tier advisor.
21551	OverallRecommendationServiceLevelObjective *string `json:"overallRecommendationServiceLevelObjective,omitempty"`
21552	// OverallRecommendationServiceLevelObjectiveID - READ-ONLY; Gets or sets overallRecommendationServiceLevelObjectiveId for service tier advisor.
21553	OverallRecommendationServiceLevelObjectiveID *uuid.UUID `json:"overallRecommendationServiceLevelObjectiveId,omitempty"`
21554	// Confidence - READ-ONLY; Gets or sets confidence for service tier advisor.
21555	Confidence *float64 `json:"confidence,omitempty"`
21556}
21557
21558// MarshalJSON is the custom marshaler for ServiceTierAdvisorProperties.
21559func (stap ServiceTierAdvisorProperties) MarshalJSON() ([]byte, error) {
21560	objectMap := make(map[string]interface{})
21561	return json.Marshal(objectMap)
21562}
21563
21564// Sku an ARM Resource SKU.
21565type Sku struct {
21566	// Name - The name of the SKU, typically, a letter + Number code, e.g. P3.
21567	Name *string `json:"name,omitempty"`
21568	// Tier - The tier or edition of the particular SKU, e.g. Basic, Premium.
21569	Tier *string `json:"tier,omitempty"`
21570	// Size - Size of the particular SKU
21571	Size *string `json:"size,omitempty"`
21572	// Family - If the service has different generations of hardware, for the same SKU, then that can be captured here.
21573	Family *string `json:"family,omitempty"`
21574	// Capacity - Capacity of the particular SKU.
21575	Capacity *int32 `json:"capacity,omitempty"`
21576}
21577
21578// SloUsageMetric a Slo Usage Metric.
21579type SloUsageMetric struct {
21580	// 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'
21581	ServiceLevelObjective ServiceObjectiveName `json:"serviceLevelObjective,omitempty"`
21582	// ServiceLevelObjectiveID - READ-ONLY; The serviceLevelObjectiveId for SLO usage metric.
21583	ServiceLevelObjectiveID *uuid.UUID `json:"serviceLevelObjectiveId,omitempty"`
21584	// InRangeTimeRatio - READ-ONLY; Gets or sets inRangeTimeRatio for SLO usage metric.
21585	InRangeTimeRatio *float64 `json:"inRangeTimeRatio,omitempty"`
21586}
21587
21588// MarshalJSON is the custom marshaler for SloUsageMetric.
21589func (sum SloUsageMetric) MarshalJSON() ([]byte, error) {
21590	objectMap := make(map[string]interface{})
21591	return json.Marshal(objectMap)
21592}
21593
21594// StorageCapability the storage account type capability.
21595type StorageCapability struct {
21596	// StorageAccountType - READ-ONLY; The storage account type for the database's backups. Possible values include: 'StorageAccountType1GRS', 'StorageAccountType1LRS', 'StorageAccountType1ZRS'
21597	StorageAccountType StorageAccountType1 `json:"storageAccountType,omitempty"`
21598	// Status - READ-ONLY; The status of the capability. Possible values include: 'CapabilityStatusVisible', 'CapabilityStatusAvailable', 'CapabilityStatusDefault', 'CapabilityStatusDisabled'
21599	Status CapabilityStatus `json:"status,omitempty"`
21600	// Reason - The reason for the capability not being available.
21601	Reason *string `json:"reason,omitempty"`
21602}
21603
21604// MarshalJSON is the custom marshaler for StorageCapability.
21605func (sc StorageCapability) MarshalJSON() ([]byte, error) {
21606	objectMap := make(map[string]interface{})
21607	if sc.Reason != nil {
21608		objectMap["reason"] = sc.Reason
21609	}
21610	return json.Marshal(objectMap)
21611}
21612
21613// SubscriptionUsage usage Metric of a Subscription in a Location.
21614type SubscriptionUsage struct {
21615	autorest.Response `json:"-"`
21616	// SubscriptionUsageProperties - Resource properties.
21617	*SubscriptionUsageProperties `json:"properties,omitempty"`
21618	// ID - READ-ONLY; Resource ID.
21619	ID *string `json:"id,omitempty"`
21620	// Name - READ-ONLY; Resource name.
21621	Name *string `json:"name,omitempty"`
21622	// Type - READ-ONLY; Resource type.
21623	Type *string `json:"type,omitempty"`
21624}
21625
21626// MarshalJSON is the custom marshaler for SubscriptionUsage.
21627func (su SubscriptionUsage) MarshalJSON() ([]byte, error) {
21628	objectMap := make(map[string]interface{})
21629	if su.SubscriptionUsageProperties != nil {
21630		objectMap["properties"] = su.SubscriptionUsageProperties
21631	}
21632	return json.Marshal(objectMap)
21633}
21634
21635// UnmarshalJSON is the custom unmarshaler for SubscriptionUsage struct.
21636func (su *SubscriptionUsage) UnmarshalJSON(body []byte) error {
21637	var m map[string]*json.RawMessage
21638	err := json.Unmarshal(body, &m)
21639	if err != nil {
21640		return err
21641	}
21642	for k, v := range m {
21643		switch k {
21644		case "properties":
21645			if v != nil {
21646				var subscriptionUsageProperties SubscriptionUsageProperties
21647				err = json.Unmarshal(*v, &subscriptionUsageProperties)
21648				if err != nil {
21649					return err
21650				}
21651				su.SubscriptionUsageProperties = &subscriptionUsageProperties
21652			}
21653		case "id":
21654			if v != nil {
21655				var ID string
21656				err = json.Unmarshal(*v, &ID)
21657				if err != nil {
21658					return err
21659				}
21660				su.ID = &ID
21661			}
21662		case "name":
21663			if v != nil {
21664				var name string
21665				err = json.Unmarshal(*v, &name)
21666				if err != nil {
21667					return err
21668				}
21669				su.Name = &name
21670			}
21671		case "type":
21672			if v != nil {
21673				var typeVar string
21674				err = json.Unmarshal(*v, &typeVar)
21675				if err != nil {
21676					return err
21677				}
21678				su.Type = &typeVar
21679			}
21680		}
21681	}
21682
21683	return nil
21684}
21685
21686// SubscriptionUsageListResult a list of subscription usage metrics in a location.
21687type SubscriptionUsageListResult struct {
21688	autorest.Response `json:"-"`
21689	// Value - READ-ONLY; Array of results.
21690	Value *[]SubscriptionUsage `json:"value,omitempty"`
21691	// NextLink - READ-ONLY; Link to retrieve next page of results.
21692	NextLink *string `json:"nextLink,omitempty"`
21693}
21694
21695// MarshalJSON is the custom marshaler for SubscriptionUsageListResult.
21696func (sulr SubscriptionUsageListResult) MarshalJSON() ([]byte, error) {
21697	objectMap := make(map[string]interface{})
21698	return json.Marshal(objectMap)
21699}
21700
21701// SubscriptionUsageListResultIterator provides access to a complete listing of SubscriptionUsage values.
21702type SubscriptionUsageListResultIterator struct {
21703	i    int
21704	page SubscriptionUsageListResultPage
21705}
21706
21707// NextWithContext advances to the next value.  If there was an error making
21708// the request the iterator does not advance and the error is returned.
21709func (iter *SubscriptionUsageListResultIterator) NextWithContext(ctx context.Context) (err error) {
21710	if tracing.IsEnabled() {
21711		ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionUsageListResultIterator.NextWithContext")
21712		defer func() {
21713			sc := -1
21714			if iter.Response().Response.Response != nil {
21715				sc = iter.Response().Response.Response.StatusCode
21716			}
21717			tracing.EndSpan(ctx, sc, err)
21718		}()
21719	}
21720	iter.i++
21721	if iter.i < len(iter.page.Values()) {
21722		return nil
21723	}
21724	err = iter.page.NextWithContext(ctx)
21725	if err != nil {
21726		iter.i--
21727		return err
21728	}
21729	iter.i = 0
21730	return nil
21731}
21732
21733// Next advances to the next value.  If there was an error making
21734// the request the iterator does not advance and the error is returned.
21735// Deprecated: Use NextWithContext() instead.
21736func (iter *SubscriptionUsageListResultIterator) Next() error {
21737	return iter.NextWithContext(context.Background())
21738}
21739
21740// NotDone returns true if the enumeration should be started or is not yet complete.
21741func (iter SubscriptionUsageListResultIterator) NotDone() bool {
21742	return iter.page.NotDone() && iter.i < len(iter.page.Values())
21743}
21744
21745// Response returns the raw server response from the last page request.
21746func (iter SubscriptionUsageListResultIterator) Response() SubscriptionUsageListResult {
21747	return iter.page.Response()
21748}
21749
21750// Value returns the current value or a zero-initialized value if the
21751// iterator has advanced beyond the end of the collection.
21752func (iter SubscriptionUsageListResultIterator) Value() SubscriptionUsage {
21753	if !iter.page.NotDone() {
21754		return SubscriptionUsage{}
21755	}
21756	return iter.page.Values()[iter.i]
21757}
21758
21759// Creates a new instance of the SubscriptionUsageListResultIterator type.
21760func NewSubscriptionUsageListResultIterator(page SubscriptionUsageListResultPage) SubscriptionUsageListResultIterator {
21761	return SubscriptionUsageListResultIterator{page: page}
21762}
21763
21764// IsEmpty returns true if the ListResult contains no values.
21765func (sulr SubscriptionUsageListResult) IsEmpty() bool {
21766	return sulr.Value == nil || len(*sulr.Value) == 0
21767}
21768
21769// hasNextLink returns true if the NextLink is not empty.
21770func (sulr SubscriptionUsageListResult) hasNextLink() bool {
21771	return sulr.NextLink != nil && len(*sulr.NextLink) != 0
21772}
21773
21774// subscriptionUsageListResultPreparer prepares a request to retrieve the next set of results.
21775// It returns nil if no more results exist.
21776func (sulr SubscriptionUsageListResult) subscriptionUsageListResultPreparer(ctx context.Context) (*http.Request, error) {
21777	if !sulr.hasNextLink() {
21778		return nil, nil
21779	}
21780	return autorest.Prepare((&http.Request{}).WithContext(ctx),
21781		autorest.AsJSON(),
21782		autorest.AsGet(),
21783		autorest.WithBaseURL(to.String(sulr.NextLink)))
21784}
21785
21786// SubscriptionUsageListResultPage contains a page of SubscriptionUsage values.
21787type SubscriptionUsageListResultPage struct {
21788	fn   func(context.Context, SubscriptionUsageListResult) (SubscriptionUsageListResult, error)
21789	sulr SubscriptionUsageListResult
21790}
21791
21792// NextWithContext advances to the next page of values.  If there was an error making
21793// the request the page does not advance and the error is returned.
21794func (page *SubscriptionUsageListResultPage) NextWithContext(ctx context.Context) (err error) {
21795	if tracing.IsEnabled() {
21796		ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionUsageListResultPage.NextWithContext")
21797		defer func() {
21798			sc := -1
21799			if page.Response().Response.Response != nil {
21800				sc = page.Response().Response.Response.StatusCode
21801			}
21802			tracing.EndSpan(ctx, sc, err)
21803		}()
21804	}
21805	for {
21806		next, err := page.fn(ctx, page.sulr)
21807		if err != nil {
21808			return err
21809		}
21810		page.sulr = next
21811		if !next.hasNextLink() || !next.IsEmpty() {
21812			break
21813		}
21814	}
21815	return nil
21816}
21817
21818// Next advances to the next page of values.  If there was an error making
21819// the request the page does not advance and the error is returned.
21820// Deprecated: Use NextWithContext() instead.
21821func (page *SubscriptionUsageListResultPage) Next() error {
21822	return page.NextWithContext(context.Background())
21823}
21824
21825// NotDone returns true if the page enumeration should be started or is not yet complete.
21826func (page SubscriptionUsageListResultPage) NotDone() bool {
21827	return !page.sulr.IsEmpty()
21828}
21829
21830// Response returns the raw server response from the last page request.
21831func (page SubscriptionUsageListResultPage) Response() SubscriptionUsageListResult {
21832	return page.sulr
21833}
21834
21835// Values returns the slice of values for the current page or nil if there are no values.
21836func (page SubscriptionUsageListResultPage) Values() []SubscriptionUsage {
21837	if page.sulr.IsEmpty() {
21838		return nil
21839	}
21840	return *page.sulr.Value
21841}
21842
21843// Creates a new instance of the SubscriptionUsageListResultPage type.
21844func NewSubscriptionUsageListResultPage(cur SubscriptionUsageListResult, getNextPage func(context.Context, SubscriptionUsageListResult) (SubscriptionUsageListResult, error)) SubscriptionUsageListResultPage {
21845	return SubscriptionUsageListResultPage{
21846		fn:   getNextPage,
21847		sulr: cur,
21848	}
21849}
21850
21851// SubscriptionUsageProperties properties of a subscription usage.
21852type SubscriptionUsageProperties struct {
21853	// DisplayName - READ-ONLY; User-readable name of the metric.
21854	DisplayName *string `json:"displayName,omitempty"`
21855	// CurrentValue - READ-ONLY; Current value of the metric.
21856	CurrentValue *float64 `json:"currentValue,omitempty"`
21857	// Limit - READ-ONLY; Boundary value of the metric.
21858	Limit *float64 `json:"limit,omitempty"`
21859	// Unit - READ-ONLY; Unit of the metric.
21860	Unit *string `json:"unit,omitempty"`
21861}
21862
21863// MarshalJSON is the custom marshaler for SubscriptionUsageProperties.
21864func (sup SubscriptionUsageProperties) MarshalJSON() ([]byte, error) {
21865	objectMap := make(map[string]interface{})
21866	return json.Marshal(objectMap)
21867}
21868
21869// SyncAgent an Azure SQL Database sync agent.
21870type SyncAgent struct {
21871	autorest.Response `json:"-"`
21872	// SyncAgentProperties - Resource properties.
21873	*SyncAgentProperties `json:"properties,omitempty"`
21874	// ID - READ-ONLY; Resource ID.
21875	ID *string `json:"id,omitempty"`
21876	// Name - READ-ONLY; Resource name.
21877	Name *string `json:"name,omitempty"`
21878	// Type - READ-ONLY; Resource type.
21879	Type *string `json:"type,omitempty"`
21880}
21881
21882// MarshalJSON is the custom marshaler for SyncAgent.
21883func (sa SyncAgent) MarshalJSON() ([]byte, error) {
21884	objectMap := make(map[string]interface{})
21885	if sa.SyncAgentProperties != nil {
21886		objectMap["properties"] = sa.SyncAgentProperties
21887	}
21888	return json.Marshal(objectMap)
21889}
21890
21891// UnmarshalJSON is the custom unmarshaler for SyncAgent struct.
21892func (sa *SyncAgent) UnmarshalJSON(body []byte) error {
21893	var m map[string]*json.RawMessage
21894	err := json.Unmarshal(body, &m)
21895	if err != nil {
21896		return err
21897	}
21898	for k, v := range m {
21899		switch k {
21900		case "properties":
21901			if v != nil {
21902				var syncAgentProperties SyncAgentProperties
21903				err = json.Unmarshal(*v, &syncAgentProperties)
21904				if err != nil {
21905					return err
21906				}
21907				sa.SyncAgentProperties = &syncAgentProperties
21908			}
21909		case "id":
21910			if v != nil {
21911				var ID string
21912				err = json.Unmarshal(*v, &ID)
21913				if err != nil {
21914					return err
21915				}
21916				sa.ID = &ID
21917			}
21918		case "name":
21919			if v != nil {
21920				var name string
21921				err = json.Unmarshal(*v, &name)
21922				if err != nil {
21923					return err
21924				}
21925				sa.Name = &name
21926			}
21927		case "type":
21928			if v != nil {
21929				var typeVar string
21930				err = json.Unmarshal(*v, &typeVar)
21931				if err != nil {
21932					return err
21933				}
21934				sa.Type = &typeVar
21935			}
21936		}
21937	}
21938
21939	return nil
21940}
21941
21942// SyncAgentKeyProperties properties of an Azure SQL Database sync agent key.
21943type SyncAgentKeyProperties struct {
21944	autorest.Response `json:"-"`
21945	// SyncAgentKey - READ-ONLY; Key of sync agent.
21946	SyncAgentKey *string `json:"syncAgentKey,omitempty"`
21947}
21948
21949// MarshalJSON is the custom marshaler for SyncAgentKeyProperties.
21950func (sakp SyncAgentKeyProperties) MarshalJSON() ([]byte, error) {
21951	objectMap := make(map[string]interface{})
21952	return json.Marshal(objectMap)
21953}
21954
21955// SyncAgentLinkedDatabase an Azure SQL Database sync agent linked database.
21956type SyncAgentLinkedDatabase struct {
21957	// SyncAgentLinkedDatabaseProperties - Resource properties.
21958	*SyncAgentLinkedDatabaseProperties `json:"properties,omitempty"`
21959	// ID - READ-ONLY; Resource ID.
21960	ID *string `json:"id,omitempty"`
21961	// Name - READ-ONLY; Resource name.
21962	Name *string `json:"name,omitempty"`
21963	// Type - READ-ONLY; Resource type.
21964	Type *string `json:"type,omitempty"`
21965}
21966
21967// MarshalJSON is the custom marshaler for SyncAgentLinkedDatabase.
21968func (sald SyncAgentLinkedDatabase) MarshalJSON() ([]byte, error) {
21969	objectMap := make(map[string]interface{})
21970	if sald.SyncAgentLinkedDatabaseProperties != nil {
21971		objectMap["properties"] = sald.SyncAgentLinkedDatabaseProperties
21972	}
21973	return json.Marshal(objectMap)
21974}
21975
21976// UnmarshalJSON is the custom unmarshaler for SyncAgentLinkedDatabase struct.
21977func (sald *SyncAgentLinkedDatabase) UnmarshalJSON(body []byte) error {
21978	var m map[string]*json.RawMessage
21979	err := json.Unmarshal(body, &m)
21980	if err != nil {
21981		return err
21982	}
21983	for k, v := range m {
21984		switch k {
21985		case "properties":
21986			if v != nil {
21987				var syncAgentLinkedDatabaseProperties SyncAgentLinkedDatabaseProperties
21988				err = json.Unmarshal(*v, &syncAgentLinkedDatabaseProperties)
21989				if err != nil {
21990					return err
21991				}
21992				sald.SyncAgentLinkedDatabaseProperties = &syncAgentLinkedDatabaseProperties
21993			}
21994		case "id":
21995			if v != nil {
21996				var ID string
21997				err = json.Unmarshal(*v, &ID)
21998				if err != nil {
21999					return err
22000				}
22001				sald.ID = &ID
22002			}
22003		case "name":
22004			if v != nil {
22005				var name string
22006				err = json.Unmarshal(*v, &name)
22007				if err != nil {
22008					return err
22009				}
22010				sald.Name = &name
22011			}
22012		case "type":
22013			if v != nil {
22014				var typeVar string
22015				err = json.Unmarshal(*v, &typeVar)
22016				if err != nil {
22017					return err
22018				}
22019				sald.Type = &typeVar
22020			}
22021		}
22022	}
22023
22024	return nil
22025}
22026
22027// SyncAgentLinkedDatabaseListResult a list of sync agent linked databases.
22028type SyncAgentLinkedDatabaseListResult struct {
22029	autorest.Response `json:"-"`
22030	// Value - READ-ONLY; Array of results.
22031	Value *[]SyncAgentLinkedDatabase `json:"value,omitempty"`
22032	// NextLink - READ-ONLY; Link to retrieve next page of results.
22033	NextLink *string `json:"nextLink,omitempty"`
22034}
22035
22036// MarshalJSON is the custom marshaler for SyncAgentLinkedDatabaseListResult.
22037func (saldlr SyncAgentLinkedDatabaseListResult) MarshalJSON() ([]byte, error) {
22038	objectMap := make(map[string]interface{})
22039	return json.Marshal(objectMap)
22040}
22041
22042// SyncAgentLinkedDatabaseListResultIterator provides access to a complete listing of
22043// SyncAgentLinkedDatabase values.
22044type SyncAgentLinkedDatabaseListResultIterator struct {
22045	i    int
22046	page SyncAgentLinkedDatabaseListResultPage
22047}
22048
22049// NextWithContext advances to the next value.  If there was an error making
22050// the request the iterator does not advance and the error is returned.
22051func (iter *SyncAgentLinkedDatabaseListResultIterator) NextWithContext(ctx context.Context) (err error) {
22052	if tracing.IsEnabled() {
22053		ctx = tracing.StartSpan(ctx, fqdn+"/SyncAgentLinkedDatabaseListResultIterator.NextWithContext")
22054		defer func() {
22055			sc := -1
22056			if iter.Response().Response.Response != nil {
22057				sc = iter.Response().Response.Response.StatusCode
22058			}
22059			tracing.EndSpan(ctx, sc, err)
22060		}()
22061	}
22062	iter.i++
22063	if iter.i < len(iter.page.Values()) {
22064		return nil
22065	}
22066	err = iter.page.NextWithContext(ctx)
22067	if err != nil {
22068		iter.i--
22069		return err
22070	}
22071	iter.i = 0
22072	return nil
22073}
22074
22075// Next advances to the next value.  If there was an error making
22076// the request the iterator does not advance and the error is returned.
22077// Deprecated: Use NextWithContext() instead.
22078func (iter *SyncAgentLinkedDatabaseListResultIterator) Next() error {
22079	return iter.NextWithContext(context.Background())
22080}
22081
22082// NotDone returns true if the enumeration should be started or is not yet complete.
22083func (iter SyncAgentLinkedDatabaseListResultIterator) NotDone() bool {
22084	return iter.page.NotDone() && iter.i < len(iter.page.Values())
22085}
22086
22087// Response returns the raw server response from the last page request.
22088func (iter SyncAgentLinkedDatabaseListResultIterator) Response() SyncAgentLinkedDatabaseListResult {
22089	return iter.page.Response()
22090}
22091
22092// Value returns the current value or a zero-initialized value if the
22093// iterator has advanced beyond the end of the collection.
22094func (iter SyncAgentLinkedDatabaseListResultIterator) Value() SyncAgentLinkedDatabase {
22095	if !iter.page.NotDone() {
22096		return SyncAgentLinkedDatabase{}
22097	}
22098	return iter.page.Values()[iter.i]
22099}
22100
22101// Creates a new instance of the SyncAgentLinkedDatabaseListResultIterator type.
22102func NewSyncAgentLinkedDatabaseListResultIterator(page SyncAgentLinkedDatabaseListResultPage) SyncAgentLinkedDatabaseListResultIterator {
22103	return SyncAgentLinkedDatabaseListResultIterator{page: page}
22104}
22105
22106// IsEmpty returns true if the ListResult contains no values.
22107func (saldlr SyncAgentLinkedDatabaseListResult) IsEmpty() bool {
22108	return saldlr.Value == nil || len(*saldlr.Value) == 0
22109}
22110
22111// hasNextLink returns true if the NextLink is not empty.
22112func (saldlr SyncAgentLinkedDatabaseListResult) hasNextLink() bool {
22113	return saldlr.NextLink != nil && len(*saldlr.NextLink) != 0
22114}
22115
22116// syncAgentLinkedDatabaseListResultPreparer prepares a request to retrieve the next set of results.
22117// It returns nil if no more results exist.
22118func (saldlr SyncAgentLinkedDatabaseListResult) syncAgentLinkedDatabaseListResultPreparer(ctx context.Context) (*http.Request, error) {
22119	if !saldlr.hasNextLink() {
22120		return nil, nil
22121	}
22122	return autorest.Prepare((&http.Request{}).WithContext(ctx),
22123		autorest.AsJSON(),
22124		autorest.AsGet(),
22125		autorest.WithBaseURL(to.String(saldlr.NextLink)))
22126}
22127
22128// SyncAgentLinkedDatabaseListResultPage contains a page of SyncAgentLinkedDatabase values.
22129type SyncAgentLinkedDatabaseListResultPage struct {
22130	fn     func(context.Context, SyncAgentLinkedDatabaseListResult) (SyncAgentLinkedDatabaseListResult, error)
22131	saldlr SyncAgentLinkedDatabaseListResult
22132}
22133
22134// NextWithContext advances to the next page of values.  If there was an error making
22135// the request the page does not advance and the error is returned.
22136func (page *SyncAgentLinkedDatabaseListResultPage) NextWithContext(ctx context.Context) (err error) {
22137	if tracing.IsEnabled() {
22138		ctx = tracing.StartSpan(ctx, fqdn+"/SyncAgentLinkedDatabaseListResultPage.NextWithContext")
22139		defer func() {
22140			sc := -1
22141			if page.Response().Response.Response != nil {
22142				sc = page.Response().Response.Response.StatusCode
22143			}
22144			tracing.EndSpan(ctx, sc, err)
22145		}()
22146	}
22147	for {
22148		next, err := page.fn(ctx, page.saldlr)
22149		if err != nil {
22150			return err
22151		}
22152		page.saldlr = next
22153		if !next.hasNextLink() || !next.IsEmpty() {
22154			break
22155		}
22156	}
22157	return nil
22158}
22159
22160// Next advances to the next page of values.  If there was an error making
22161// the request the page does not advance and the error is returned.
22162// Deprecated: Use NextWithContext() instead.
22163func (page *SyncAgentLinkedDatabaseListResultPage) Next() error {
22164	return page.NextWithContext(context.Background())
22165}
22166
22167// NotDone returns true if the page enumeration should be started or is not yet complete.
22168func (page SyncAgentLinkedDatabaseListResultPage) NotDone() bool {
22169	return !page.saldlr.IsEmpty()
22170}
22171
22172// Response returns the raw server response from the last page request.
22173func (page SyncAgentLinkedDatabaseListResultPage) Response() SyncAgentLinkedDatabaseListResult {
22174	return page.saldlr
22175}
22176
22177// Values returns the slice of values for the current page or nil if there are no values.
22178func (page SyncAgentLinkedDatabaseListResultPage) Values() []SyncAgentLinkedDatabase {
22179	if page.saldlr.IsEmpty() {
22180		return nil
22181	}
22182	return *page.saldlr.Value
22183}
22184
22185// Creates a new instance of the SyncAgentLinkedDatabaseListResultPage type.
22186func NewSyncAgentLinkedDatabaseListResultPage(cur SyncAgentLinkedDatabaseListResult, getNextPage func(context.Context, SyncAgentLinkedDatabaseListResult) (SyncAgentLinkedDatabaseListResult, error)) SyncAgentLinkedDatabaseListResultPage {
22187	return SyncAgentLinkedDatabaseListResultPage{
22188		fn:     getNextPage,
22189		saldlr: cur,
22190	}
22191}
22192
22193// SyncAgentLinkedDatabaseProperties properties of an Azure SQL Database sync agent linked database.
22194type SyncAgentLinkedDatabaseProperties struct {
22195	// DatabaseType - READ-ONLY; Type of the sync agent linked database. Possible values include: 'AzureSQLDatabase', 'SQLServerDatabase'
22196	DatabaseType SyncMemberDbType `json:"databaseType,omitempty"`
22197	// DatabaseID - READ-ONLY; Id of the sync agent linked database.
22198	DatabaseID *string `json:"databaseId,omitempty"`
22199	// Description - READ-ONLY; Description of the sync agent linked database.
22200	Description *string `json:"description,omitempty"`
22201	// ServerName - READ-ONLY; Server name of the sync agent linked database.
22202	ServerName *string `json:"serverName,omitempty"`
22203	// DatabaseName - READ-ONLY; Database name of the sync agent linked database.
22204	DatabaseName *string `json:"databaseName,omitempty"`
22205	// UserName - READ-ONLY; User name of the sync agent linked database.
22206	UserName *string `json:"userName,omitempty"`
22207}
22208
22209// MarshalJSON is the custom marshaler for SyncAgentLinkedDatabaseProperties.
22210func (saldp SyncAgentLinkedDatabaseProperties) MarshalJSON() ([]byte, error) {
22211	objectMap := make(map[string]interface{})
22212	return json.Marshal(objectMap)
22213}
22214
22215// SyncAgentListResult a list of sync agents.
22216type SyncAgentListResult struct {
22217	autorest.Response `json:"-"`
22218	// Value - READ-ONLY; Array of results.
22219	Value *[]SyncAgent `json:"value,omitempty"`
22220	// NextLink - READ-ONLY; Link to retrieve next page of results.
22221	NextLink *string `json:"nextLink,omitempty"`
22222}
22223
22224// MarshalJSON is the custom marshaler for SyncAgentListResult.
22225func (salr SyncAgentListResult) MarshalJSON() ([]byte, error) {
22226	objectMap := make(map[string]interface{})
22227	return json.Marshal(objectMap)
22228}
22229
22230// SyncAgentListResultIterator provides access to a complete listing of SyncAgent values.
22231type SyncAgentListResultIterator struct {
22232	i    int
22233	page SyncAgentListResultPage
22234}
22235
22236// NextWithContext advances to the next value.  If there was an error making
22237// the request the iterator does not advance and the error is returned.
22238func (iter *SyncAgentListResultIterator) NextWithContext(ctx context.Context) (err error) {
22239	if tracing.IsEnabled() {
22240		ctx = tracing.StartSpan(ctx, fqdn+"/SyncAgentListResultIterator.NextWithContext")
22241		defer func() {
22242			sc := -1
22243			if iter.Response().Response.Response != nil {
22244				sc = iter.Response().Response.Response.StatusCode
22245			}
22246			tracing.EndSpan(ctx, sc, err)
22247		}()
22248	}
22249	iter.i++
22250	if iter.i < len(iter.page.Values()) {
22251		return nil
22252	}
22253	err = iter.page.NextWithContext(ctx)
22254	if err != nil {
22255		iter.i--
22256		return err
22257	}
22258	iter.i = 0
22259	return nil
22260}
22261
22262// Next advances to the next value.  If there was an error making
22263// the request the iterator does not advance and the error is returned.
22264// Deprecated: Use NextWithContext() instead.
22265func (iter *SyncAgentListResultIterator) Next() error {
22266	return iter.NextWithContext(context.Background())
22267}
22268
22269// NotDone returns true if the enumeration should be started or is not yet complete.
22270func (iter SyncAgentListResultIterator) NotDone() bool {
22271	return iter.page.NotDone() && iter.i < len(iter.page.Values())
22272}
22273
22274// Response returns the raw server response from the last page request.
22275func (iter SyncAgentListResultIterator) Response() SyncAgentListResult {
22276	return iter.page.Response()
22277}
22278
22279// Value returns the current value or a zero-initialized value if the
22280// iterator has advanced beyond the end of the collection.
22281func (iter SyncAgentListResultIterator) Value() SyncAgent {
22282	if !iter.page.NotDone() {
22283		return SyncAgent{}
22284	}
22285	return iter.page.Values()[iter.i]
22286}
22287
22288// Creates a new instance of the SyncAgentListResultIterator type.
22289func NewSyncAgentListResultIterator(page SyncAgentListResultPage) SyncAgentListResultIterator {
22290	return SyncAgentListResultIterator{page: page}
22291}
22292
22293// IsEmpty returns true if the ListResult contains no values.
22294func (salr SyncAgentListResult) IsEmpty() bool {
22295	return salr.Value == nil || len(*salr.Value) == 0
22296}
22297
22298// hasNextLink returns true if the NextLink is not empty.
22299func (salr SyncAgentListResult) hasNextLink() bool {
22300	return salr.NextLink != nil && len(*salr.NextLink) != 0
22301}
22302
22303// syncAgentListResultPreparer prepares a request to retrieve the next set of results.
22304// It returns nil if no more results exist.
22305func (salr SyncAgentListResult) syncAgentListResultPreparer(ctx context.Context) (*http.Request, error) {
22306	if !salr.hasNextLink() {
22307		return nil, nil
22308	}
22309	return autorest.Prepare((&http.Request{}).WithContext(ctx),
22310		autorest.AsJSON(),
22311		autorest.AsGet(),
22312		autorest.WithBaseURL(to.String(salr.NextLink)))
22313}
22314
22315// SyncAgentListResultPage contains a page of SyncAgent values.
22316type SyncAgentListResultPage struct {
22317	fn   func(context.Context, SyncAgentListResult) (SyncAgentListResult, error)
22318	salr SyncAgentListResult
22319}
22320
22321// NextWithContext advances to the next page of values.  If there was an error making
22322// the request the page does not advance and the error is returned.
22323func (page *SyncAgentListResultPage) NextWithContext(ctx context.Context) (err error) {
22324	if tracing.IsEnabled() {
22325		ctx = tracing.StartSpan(ctx, fqdn+"/SyncAgentListResultPage.NextWithContext")
22326		defer func() {
22327			sc := -1
22328			if page.Response().Response.Response != nil {
22329				sc = page.Response().Response.Response.StatusCode
22330			}
22331			tracing.EndSpan(ctx, sc, err)
22332		}()
22333	}
22334	for {
22335		next, err := page.fn(ctx, page.salr)
22336		if err != nil {
22337			return err
22338		}
22339		page.salr = next
22340		if !next.hasNextLink() || !next.IsEmpty() {
22341			break
22342		}
22343	}
22344	return nil
22345}
22346
22347// Next advances to the next page of values.  If there was an error making
22348// the request the page does not advance and the error is returned.
22349// Deprecated: Use NextWithContext() instead.
22350func (page *SyncAgentListResultPage) Next() error {
22351	return page.NextWithContext(context.Background())
22352}
22353
22354// NotDone returns true if the page enumeration should be started or is not yet complete.
22355func (page SyncAgentListResultPage) NotDone() bool {
22356	return !page.salr.IsEmpty()
22357}
22358
22359// Response returns the raw server response from the last page request.
22360func (page SyncAgentListResultPage) Response() SyncAgentListResult {
22361	return page.salr
22362}
22363
22364// Values returns the slice of values for the current page or nil if there are no values.
22365func (page SyncAgentListResultPage) Values() []SyncAgent {
22366	if page.salr.IsEmpty() {
22367		return nil
22368	}
22369	return *page.salr.Value
22370}
22371
22372// Creates a new instance of the SyncAgentListResultPage type.
22373func NewSyncAgentListResultPage(cur SyncAgentListResult, getNextPage func(context.Context, SyncAgentListResult) (SyncAgentListResult, error)) SyncAgentListResultPage {
22374	return SyncAgentListResultPage{
22375		fn:   getNextPage,
22376		salr: cur,
22377	}
22378}
22379
22380// SyncAgentProperties properties of an Azure SQL Database sync agent.
22381type SyncAgentProperties struct {
22382	// Name - READ-ONLY; Name of the sync agent.
22383	Name *string `json:"name,omitempty"`
22384	// SyncDatabaseID - ARM resource id of the sync database in the sync agent.
22385	SyncDatabaseID *string `json:"syncDatabaseId,omitempty"`
22386	// LastAliveTime - READ-ONLY; Last alive time of the sync agent.
22387	LastAliveTime *date.Time `json:"lastAliveTime,omitempty"`
22388	// State - READ-ONLY; State of the sync agent. Possible values include: 'SyncAgentStateOnline', 'SyncAgentStateOffline', 'SyncAgentStateNeverConnected'
22389	State SyncAgentState `json:"state,omitempty"`
22390	// IsUpToDate - READ-ONLY; If the sync agent version is up to date.
22391	IsUpToDate *bool `json:"isUpToDate,omitempty"`
22392	// ExpiryTime - READ-ONLY; Expiration time of the sync agent version.
22393	ExpiryTime *date.Time `json:"expiryTime,omitempty"`
22394	// Version - READ-ONLY; Version of the sync agent.
22395	Version *string `json:"version,omitempty"`
22396}
22397
22398// MarshalJSON is the custom marshaler for SyncAgentProperties.
22399func (sap SyncAgentProperties) MarshalJSON() ([]byte, error) {
22400	objectMap := make(map[string]interface{})
22401	if sap.SyncDatabaseID != nil {
22402		objectMap["syncDatabaseId"] = sap.SyncDatabaseID
22403	}
22404	return json.Marshal(objectMap)
22405}
22406
22407// SyncAgentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
22408// long-running operation.
22409type SyncAgentsCreateOrUpdateFuture struct {
22410	azure.FutureAPI
22411	// Result returns the result of the asynchronous operation.
22412	// If the operation has not completed it will return an error.
22413	Result func(SyncAgentsClient) (SyncAgent, error)
22414}
22415
22416// UnmarshalJSON is the custom unmarshaller for CreateFuture.
22417func (future *SyncAgentsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
22418	var azFuture azure.Future
22419	if err := json.Unmarshal(body, &azFuture); err != nil {
22420		return err
22421	}
22422	future.FutureAPI = &azFuture
22423	future.Result = future.result
22424	return nil
22425}
22426
22427// result is the default implementation for SyncAgentsCreateOrUpdateFuture.Result.
22428func (future *SyncAgentsCreateOrUpdateFuture) result(client SyncAgentsClient) (sa SyncAgent, err error) {
22429	var done bool
22430	done, err = future.DoneWithContext(context.Background(), client)
22431	if err != nil {
22432		err = autorest.NewErrorWithError(err, "sql.SyncAgentsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
22433		return
22434	}
22435	if !done {
22436		sa.Response.Response = future.Response()
22437		err = azure.NewAsyncOpIncompleteError("sql.SyncAgentsCreateOrUpdateFuture")
22438		return
22439	}
22440	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
22441	if sa.Response.Response, err = future.GetResult(sender); err == nil && sa.Response.Response.StatusCode != http.StatusNoContent {
22442		sa, err = client.CreateOrUpdateResponder(sa.Response.Response)
22443		if err != nil {
22444			err = autorest.NewErrorWithError(err, "sql.SyncAgentsCreateOrUpdateFuture", "Result", sa.Response.Response, "Failure responding to request")
22445		}
22446	}
22447	return
22448}
22449
22450// SyncAgentsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
22451// operation.
22452type SyncAgentsDeleteFuture struct {
22453	azure.FutureAPI
22454	// Result returns the result of the asynchronous operation.
22455	// If the operation has not completed it will return an error.
22456	Result func(SyncAgentsClient) (autorest.Response, error)
22457}
22458
22459// UnmarshalJSON is the custom unmarshaller for CreateFuture.
22460func (future *SyncAgentsDeleteFuture) UnmarshalJSON(body []byte) error {
22461	var azFuture azure.Future
22462	if err := json.Unmarshal(body, &azFuture); err != nil {
22463		return err
22464	}
22465	future.FutureAPI = &azFuture
22466	future.Result = future.result
22467	return nil
22468}
22469
22470// result is the default implementation for SyncAgentsDeleteFuture.Result.
22471func (future *SyncAgentsDeleteFuture) result(client SyncAgentsClient) (ar autorest.Response, err error) {
22472	var done bool
22473	done, err = future.DoneWithContext(context.Background(), client)
22474	if err != nil {
22475		err = autorest.NewErrorWithError(err, "sql.SyncAgentsDeleteFuture", "Result", future.Response(), "Polling failure")
22476		return
22477	}
22478	if !done {
22479		ar.Response = future.Response()
22480		err = azure.NewAsyncOpIncompleteError("sql.SyncAgentsDeleteFuture")
22481		return
22482	}
22483	ar.Response = future.Response()
22484	return
22485}
22486
22487// SyncDatabaseIDListResult a list of sync database ID properties.
22488type SyncDatabaseIDListResult struct {
22489	autorest.Response `json:"-"`
22490	// Value - READ-ONLY; Array of results.
22491	Value *[]SyncDatabaseIDProperties `json:"value,omitempty"`
22492	// NextLink - READ-ONLY; Link to retrieve next page of results.
22493	NextLink *string `json:"nextLink,omitempty"`
22494}
22495
22496// MarshalJSON is the custom marshaler for SyncDatabaseIDListResult.
22497func (sdilr SyncDatabaseIDListResult) MarshalJSON() ([]byte, error) {
22498	objectMap := make(map[string]interface{})
22499	return json.Marshal(objectMap)
22500}
22501
22502// SyncDatabaseIDListResultIterator provides access to a complete listing of SyncDatabaseIDProperties
22503// values.
22504type SyncDatabaseIDListResultIterator struct {
22505	i    int
22506	page SyncDatabaseIDListResultPage
22507}
22508
22509// NextWithContext advances to the next value.  If there was an error making
22510// the request the iterator does not advance and the error is returned.
22511func (iter *SyncDatabaseIDListResultIterator) NextWithContext(ctx context.Context) (err error) {
22512	if tracing.IsEnabled() {
22513		ctx = tracing.StartSpan(ctx, fqdn+"/SyncDatabaseIDListResultIterator.NextWithContext")
22514		defer func() {
22515			sc := -1
22516			if iter.Response().Response.Response != nil {
22517				sc = iter.Response().Response.Response.StatusCode
22518			}
22519			tracing.EndSpan(ctx, sc, err)
22520		}()
22521	}
22522	iter.i++
22523	if iter.i < len(iter.page.Values()) {
22524		return nil
22525	}
22526	err = iter.page.NextWithContext(ctx)
22527	if err != nil {
22528		iter.i--
22529		return err
22530	}
22531	iter.i = 0
22532	return nil
22533}
22534
22535// Next advances to the next value.  If there was an error making
22536// the request the iterator does not advance and the error is returned.
22537// Deprecated: Use NextWithContext() instead.
22538func (iter *SyncDatabaseIDListResultIterator) Next() error {
22539	return iter.NextWithContext(context.Background())
22540}
22541
22542// NotDone returns true if the enumeration should be started or is not yet complete.
22543func (iter SyncDatabaseIDListResultIterator) NotDone() bool {
22544	return iter.page.NotDone() && iter.i < len(iter.page.Values())
22545}
22546
22547// Response returns the raw server response from the last page request.
22548func (iter SyncDatabaseIDListResultIterator) Response() SyncDatabaseIDListResult {
22549	return iter.page.Response()
22550}
22551
22552// Value returns the current value or a zero-initialized value if the
22553// iterator has advanced beyond the end of the collection.
22554func (iter SyncDatabaseIDListResultIterator) Value() SyncDatabaseIDProperties {
22555	if !iter.page.NotDone() {
22556		return SyncDatabaseIDProperties{}
22557	}
22558	return iter.page.Values()[iter.i]
22559}
22560
22561// Creates a new instance of the SyncDatabaseIDListResultIterator type.
22562func NewSyncDatabaseIDListResultIterator(page SyncDatabaseIDListResultPage) SyncDatabaseIDListResultIterator {
22563	return SyncDatabaseIDListResultIterator{page: page}
22564}
22565
22566// IsEmpty returns true if the ListResult contains no values.
22567func (sdilr SyncDatabaseIDListResult) IsEmpty() bool {
22568	return sdilr.Value == nil || len(*sdilr.Value) == 0
22569}
22570
22571// hasNextLink returns true if the NextLink is not empty.
22572func (sdilr SyncDatabaseIDListResult) hasNextLink() bool {
22573	return sdilr.NextLink != nil && len(*sdilr.NextLink) != 0
22574}
22575
22576// syncDatabaseIDListResultPreparer prepares a request to retrieve the next set of results.
22577// It returns nil if no more results exist.
22578func (sdilr SyncDatabaseIDListResult) syncDatabaseIDListResultPreparer(ctx context.Context) (*http.Request, error) {
22579	if !sdilr.hasNextLink() {
22580		return nil, nil
22581	}
22582	return autorest.Prepare((&http.Request{}).WithContext(ctx),
22583		autorest.AsJSON(),
22584		autorest.AsGet(),
22585		autorest.WithBaseURL(to.String(sdilr.NextLink)))
22586}
22587
22588// SyncDatabaseIDListResultPage contains a page of SyncDatabaseIDProperties values.
22589type SyncDatabaseIDListResultPage struct {
22590	fn    func(context.Context, SyncDatabaseIDListResult) (SyncDatabaseIDListResult, error)
22591	sdilr SyncDatabaseIDListResult
22592}
22593
22594// NextWithContext advances to the next page of values.  If there was an error making
22595// the request the page does not advance and the error is returned.
22596func (page *SyncDatabaseIDListResultPage) NextWithContext(ctx context.Context) (err error) {
22597	if tracing.IsEnabled() {
22598		ctx = tracing.StartSpan(ctx, fqdn+"/SyncDatabaseIDListResultPage.NextWithContext")
22599		defer func() {
22600			sc := -1
22601			if page.Response().Response.Response != nil {
22602				sc = page.Response().Response.Response.StatusCode
22603			}
22604			tracing.EndSpan(ctx, sc, err)
22605		}()
22606	}
22607	for {
22608		next, err := page.fn(ctx, page.sdilr)
22609		if err != nil {
22610			return err
22611		}
22612		page.sdilr = next
22613		if !next.hasNextLink() || !next.IsEmpty() {
22614			break
22615		}
22616	}
22617	return nil
22618}
22619
22620// Next advances to the next page of values.  If there was an error making
22621// the request the page does not advance and the error is returned.
22622// Deprecated: Use NextWithContext() instead.
22623func (page *SyncDatabaseIDListResultPage) Next() error {
22624	return page.NextWithContext(context.Background())
22625}
22626
22627// NotDone returns true if the page enumeration should be started or is not yet complete.
22628func (page SyncDatabaseIDListResultPage) NotDone() bool {
22629	return !page.sdilr.IsEmpty()
22630}
22631
22632// Response returns the raw server response from the last page request.
22633func (page SyncDatabaseIDListResultPage) Response() SyncDatabaseIDListResult {
22634	return page.sdilr
22635}
22636
22637// Values returns the slice of values for the current page or nil if there are no values.
22638func (page SyncDatabaseIDListResultPage) Values() []SyncDatabaseIDProperties {
22639	if page.sdilr.IsEmpty() {
22640		return nil
22641	}
22642	return *page.sdilr.Value
22643}
22644
22645// Creates a new instance of the SyncDatabaseIDListResultPage type.
22646func NewSyncDatabaseIDListResultPage(cur SyncDatabaseIDListResult, getNextPage func(context.Context, SyncDatabaseIDListResult) (SyncDatabaseIDListResult, error)) SyncDatabaseIDListResultPage {
22647	return SyncDatabaseIDListResultPage{
22648		fn:    getNextPage,
22649		sdilr: cur,
22650	}
22651}
22652
22653// SyncDatabaseIDProperties properties of the sync database id.
22654type SyncDatabaseIDProperties struct {
22655	// ID - READ-ONLY; ARM resource id of sync database.
22656	ID *string `json:"id,omitempty"`
22657}
22658
22659// MarshalJSON is the custom marshaler for SyncDatabaseIDProperties.
22660func (sdip SyncDatabaseIDProperties) MarshalJSON() ([]byte, error) {
22661	objectMap := make(map[string]interface{})
22662	return json.Marshal(objectMap)
22663}
22664
22665// SyncFullSchemaProperties properties of the database full schema.
22666type SyncFullSchemaProperties struct {
22667	// Tables - READ-ONLY; List of tables in the database full schema.
22668	Tables *[]SyncFullSchemaTable `json:"tables,omitempty"`
22669	// LastUpdateTime - READ-ONLY; Last update time of the database schema.
22670	LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"`
22671}
22672
22673// MarshalJSON is the custom marshaler for SyncFullSchemaProperties.
22674func (sfsp SyncFullSchemaProperties) MarshalJSON() ([]byte, error) {
22675	objectMap := make(map[string]interface{})
22676	return json.Marshal(objectMap)
22677}
22678
22679// SyncFullSchemaPropertiesListResult a list of sync schema properties.
22680type SyncFullSchemaPropertiesListResult struct {
22681	autorest.Response `json:"-"`
22682	// Value - READ-ONLY; Array of results.
22683	Value *[]SyncFullSchemaProperties `json:"value,omitempty"`
22684	// NextLink - READ-ONLY; Link to retrieve next page of results.
22685	NextLink *string `json:"nextLink,omitempty"`
22686}
22687
22688// MarshalJSON is the custom marshaler for SyncFullSchemaPropertiesListResult.
22689func (sfsplr SyncFullSchemaPropertiesListResult) MarshalJSON() ([]byte, error) {
22690	objectMap := make(map[string]interface{})
22691	return json.Marshal(objectMap)
22692}
22693
22694// SyncFullSchemaPropertiesListResultIterator provides access to a complete listing of
22695// SyncFullSchemaProperties values.
22696type SyncFullSchemaPropertiesListResultIterator struct {
22697	i    int
22698	page SyncFullSchemaPropertiesListResultPage
22699}
22700
22701// NextWithContext advances to the next value.  If there was an error making
22702// the request the iterator does not advance and the error is returned.
22703func (iter *SyncFullSchemaPropertiesListResultIterator) NextWithContext(ctx context.Context) (err error) {
22704	if tracing.IsEnabled() {
22705		ctx = tracing.StartSpan(ctx, fqdn+"/SyncFullSchemaPropertiesListResultIterator.NextWithContext")
22706		defer func() {
22707			sc := -1
22708			if iter.Response().Response.Response != nil {
22709				sc = iter.Response().Response.Response.StatusCode
22710			}
22711			tracing.EndSpan(ctx, sc, err)
22712		}()
22713	}
22714	iter.i++
22715	if iter.i < len(iter.page.Values()) {
22716		return nil
22717	}
22718	err = iter.page.NextWithContext(ctx)
22719	if err != nil {
22720		iter.i--
22721		return err
22722	}
22723	iter.i = 0
22724	return nil
22725}
22726
22727// Next advances to the next value.  If there was an error making
22728// the request the iterator does not advance and the error is returned.
22729// Deprecated: Use NextWithContext() instead.
22730func (iter *SyncFullSchemaPropertiesListResultIterator) Next() error {
22731	return iter.NextWithContext(context.Background())
22732}
22733
22734// NotDone returns true if the enumeration should be started or is not yet complete.
22735func (iter SyncFullSchemaPropertiesListResultIterator) NotDone() bool {
22736	return iter.page.NotDone() && iter.i < len(iter.page.Values())
22737}
22738
22739// Response returns the raw server response from the last page request.
22740func (iter SyncFullSchemaPropertiesListResultIterator) Response() SyncFullSchemaPropertiesListResult {
22741	return iter.page.Response()
22742}
22743
22744// Value returns the current value or a zero-initialized value if the
22745// iterator has advanced beyond the end of the collection.
22746func (iter SyncFullSchemaPropertiesListResultIterator) Value() SyncFullSchemaProperties {
22747	if !iter.page.NotDone() {
22748		return SyncFullSchemaProperties{}
22749	}
22750	return iter.page.Values()[iter.i]
22751}
22752
22753// Creates a new instance of the SyncFullSchemaPropertiesListResultIterator type.
22754func NewSyncFullSchemaPropertiesListResultIterator(page SyncFullSchemaPropertiesListResultPage) SyncFullSchemaPropertiesListResultIterator {
22755	return SyncFullSchemaPropertiesListResultIterator{page: page}
22756}
22757
22758// IsEmpty returns true if the ListResult contains no values.
22759func (sfsplr SyncFullSchemaPropertiesListResult) IsEmpty() bool {
22760	return sfsplr.Value == nil || len(*sfsplr.Value) == 0
22761}
22762
22763// hasNextLink returns true if the NextLink is not empty.
22764func (sfsplr SyncFullSchemaPropertiesListResult) hasNextLink() bool {
22765	return sfsplr.NextLink != nil && len(*sfsplr.NextLink) != 0
22766}
22767
22768// syncFullSchemaPropertiesListResultPreparer prepares a request to retrieve the next set of results.
22769// It returns nil if no more results exist.
22770func (sfsplr SyncFullSchemaPropertiesListResult) syncFullSchemaPropertiesListResultPreparer(ctx context.Context) (*http.Request, error) {
22771	if !sfsplr.hasNextLink() {
22772		return nil, nil
22773	}
22774	return autorest.Prepare((&http.Request{}).WithContext(ctx),
22775		autorest.AsJSON(),
22776		autorest.AsGet(),
22777		autorest.WithBaseURL(to.String(sfsplr.NextLink)))
22778}
22779
22780// SyncFullSchemaPropertiesListResultPage contains a page of SyncFullSchemaProperties values.
22781type SyncFullSchemaPropertiesListResultPage struct {
22782	fn     func(context.Context, SyncFullSchemaPropertiesListResult) (SyncFullSchemaPropertiesListResult, error)
22783	sfsplr SyncFullSchemaPropertiesListResult
22784}
22785
22786// NextWithContext advances to the next page of values.  If there was an error making
22787// the request the page does not advance and the error is returned.
22788func (page *SyncFullSchemaPropertiesListResultPage) NextWithContext(ctx context.Context) (err error) {
22789	if tracing.IsEnabled() {
22790		ctx = tracing.StartSpan(ctx, fqdn+"/SyncFullSchemaPropertiesListResultPage.NextWithContext")
22791		defer func() {
22792			sc := -1
22793			if page.Response().Response.Response != nil {
22794				sc = page.Response().Response.Response.StatusCode
22795			}
22796			tracing.EndSpan(ctx, sc, err)
22797		}()
22798	}
22799	for {
22800		next, err := page.fn(ctx, page.sfsplr)
22801		if err != nil {
22802			return err
22803		}
22804		page.sfsplr = next
22805		if !next.hasNextLink() || !next.IsEmpty() {
22806			break
22807		}
22808	}
22809	return nil
22810}
22811
22812// Next advances to the next page of values.  If there was an error making
22813// the request the page does not advance and the error is returned.
22814// Deprecated: Use NextWithContext() instead.
22815func (page *SyncFullSchemaPropertiesListResultPage) Next() error {
22816	return page.NextWithContext(context.Background())
22817}
22818
22819// NotDone returns true if the page enumeration should be started or is not yet complete.
22820func (page SyncFullSchemaPropertiesListResultPage) NotDone() bool {
22821	return !page.sfsplr.IsEmpty()
22822}
22823
22824// Response returns the raw server response from the last page request.
22825func (page SyncFullSchemaPropertiesListResultPage) Response() SyncFullSchemaPropertiesListResult {
22826	return page.sfsplr
22827}
22828
22829// Values returns the slice of values for the current page or nil if there are no values.
22830func (page SyncFullSchemaPropertiesListResultPage) Values() []SyncFullSchemaProperties {
22831	if page.sfsplr.IsEmpty() {
22832		return nil
22833	}
22834	return *page.sfsplr.Value
22835}
22836
22837// Creates a new instance of the SyncFullSchemaPropertiesListResultPage type.
22838func NewSyncFullSchemaPropertiesListResultPage(cur SyncFullSchemaPropertiesListResult, getNextPage func(context.Context, SyncFullSchemaPropertiesListResult) (SyncFullSchemaPropertiesListResult, error)) SyncFullSchemaPropertiesListResultPage {
22839	return SyncFullSchemaPropertiesListResultPage{
22840		fn:     getNextPage,
22841		sfsplr: cur,
22842	}
22843}
22844
22845// SyncFullSchemaTable properties of the table in the database full schema.
22846type SyncFullSchemaTable struct {
22847	// Columns - READ-ONLY; List of columns in the table of database full schema.
22848	Columns *[]SyncFullSchemaTableColumn `json:"columns,omitempty"`
22849	// ErrorID - READ-ONLY; Error id of the table.
22850	ErrorID *string `json:"errorId,omitempty"`
22851	// HasError - READ-ONLY; If there is error in the table.
22852	HasError *bool `json:"hasError,omitempty"`
22853	// Name - READ-ONLY; Name of the table.
22854	Name *string `json:"name,omitempty"`
22855	// QuotedName - READ-ONLY; Quoted name of the table.
22856	QuotedName *string `json:"quotedName,omitempty"`
22857}
22858
22859// MarshalJSON is the custom marshaler for SyncFullSchemaTable.
22860func (sfst SyncFullSchemaTable) MarshalJSON() ([]byte, error) {
22861	objectMap := make(map[string]interface{})
22862	return json.Marshal(objectMap)
22863}
22864
22865// SyncFullSchemaTableColumn properties of the column in the table of database full schema.
22866type SyncFullSchemaTableColumn struct {
22867	// DataSize - READ-ONLY; Data size of the column.
22868	DataSize *string `json:"dataSize,omitempty"`
22869	// DataType - READ-ONLY; Data type of the column.
22870	DataType *string `json:"dataType,omitempty"`
22871	// ErrorID - READ-ONLY; Error id of the column.
22872	ErrorID *string `json:"errorId,omitempty"`
22873	// HasError - READ-ONLY; If there is error in the table.
22874	HasError *bool `json:"hasError,omitempty"`
22875	// IsPrimaryKey - READ-ONLY; If it is the primary key of the table.
22876	IsPrimaryKey *bool `json:"isPrimaryKey,omitempty"`
22877	// Name - READ-ONLY; Name of the column.
22878	Name *string `json:"name,omitempty"`
22879	// QuotedName - READ-ONLY; Quoted name of the column.
22880	QuotedName *string `json:"quotedName,omitempty"`
22881}
22882
22883// MarshalJSON is the custom marshaler for SyncFullSchemaTableColumn.
22884func (sfstc SyncFullSchemaTableColumn) MarshalJSON() ([]byte, error) {
22885	objectMap := make(map[string]interface{})
22886	return json.Marshal(objectMap)
22887}
22888
22889// SyncGroup an Azure SQL Database sync group.
22890type SyncGroup struct {
22891	autorest.Response `json:"-"`
22892	// SyncGroupProperties - Resource properties.
22893	*SyncGroupProperties `json:"properties,omitempty"`
22894	// ID - READ-ONLY; Resource ID.
22895	ID *string `json:"id,omitempty"`
22896	// Name - READ-ONLY; Resource name.
22897	Name *string `json:"name,omitempty"`
22898	// Type - READ-ONLY; Resource type.
22899	Type *string `json:"type,omitempty"`
22900}
22901
22902// MarshalJSON is the custom marshaler for SyncGroup.
22903func (sg SyncGroup) MarshalJSON() ([]byte, error) {
22904	objectMap := make(map[string]interface{})
22905	if sg.SyncGroupProperties != nil {
22906		objectMap["properties"] = sg.SyncGroupProperties
22907	}
22908	return json.Marshal(objectMap)
22909}
22910
22911// UnmarshalJSON is the custom unmarshaler for SyncGroup struct.
22912func (sg *SyncGroup) UnmarshalJSON(body []byte) error {
22913	var m map[string]*json.RawMessage
22914	err := json.Unmarshal(body, &m)
22915	if err != nil {
22916		return err
22917	}
22918	for k, v := range m {
22919		switch k {
22920		case "properties":
22921			if v != nil {
22922				var syncGroupProperties SyncGroupProperties
22923				err = json.Unmarshal(*v, &syncGroupProperties)
22924				if err != nil {
22925					return err
22926				}
22927				sg.SyncGroupProperties = &syncGroupProperties
22928			}
22929		case "id":
22930			if v != nil {
22931				var ID string
22932				err = json.Unmarshal(*v, &ID)
22933				if err != nil {
22934					return err
22935				}
22936				sg.ID = &ID
22937			}
22938		case "name":
22939			if v != nil {
22940				var name string
22941				err = json.Unmarshal(*v, &name)
22942				if err != nil {
22943					return err
22944				}
22945				sg.Name = &name
22946			}
22947		case "type":
22948			if v != nil {
22949				var typeVar string
22950				err = json.Unmarshal(*v, &typeVar)
22951				if err != nil {
22952					return err
22953				}
22954				sg.Type = &typeVar
22955			}
22956		}
22957	}
22958
22959	return nil
22960}
22961
22962// SyncGroupListResult a list of sync groups.
22963type SyncGroupListResult struct {
22964	autorest.Response `json:"-"`
22965	// Value - READ-ONLY; Array of results.
22966	Value *[]SyncGroup `json:"value,omitempty"`
22967	// NextLink - READ-ONLY; Link to retrieve next page of results.
22968	NextLink *string `json:"nextLink,omitempty"`
22969}
22970
22971// MarshalJSON is the custom marshaler for SyncGroupListResult.
22972func (sglr SyncGroupListResult) MarshalJSON() ([]byte, error) {
22973	objectMap := make(map[string]interface{})
22974	return json.Marshal(objectMap)
22975}
22976
22977// SyncGroupListResultIterator provides access to a complete listing of SyncGroup values.
22978type SyncGroupListResultIterator struct {
22979	i    int
22980	page SyncGroupListResultPage
22981}
22982
22983// NextWithContext advances to the next value.  If there was an error making
22984// the request the iterator does not advance and the error is returned.
22985func (iter *SyncGroupListResultIterator) NextWithContext(ctx context.Context) (err error) {
22986	if tracing.IsEnabled() {
22987		ctx = tracing.StartSpan(ctx, fqdn+"/SyncGroupListResultIterator.NextWithContext")
22988		defer func() {
22989			sc := -1
22990			if iter.Response().Response.Response != nil {
22991				sc = iter.Response().Response.Response.StatusCode
22992			}
22993			tracing.EndSpan(ctx, sc, err)
22994		}()
22995	}
22996	iter.i++
22997	if iter.i < len(iter.page.Values()) {
22998		return nil
22999	}
23000	err = iter.page.NextWithContext(ctx)
23001	if err != nil {
23002		iter.i--
23003		return err
23004	}
23005	iter.i = 0
23006	return nil
23007}
23008
23009// Next advances to the next value.  If there was an error making
23010// the request the iterator does not advance and the error is returned.
23011// Deprecated: Use NextWithContext() instead.
23012func (iter *SyncGroupListResultIterator) Next() error {
23013	return iter.NextWithContext(context.Background())
23014}
23015
23016// NotDone returns true if the enumeration should be started or is not yet complete.
23017func (iter SyncGroupListResultIterator) NotDone() bool {
23018	return iter.page.NotDone() && iter.i < len(iter.page.Values())
23019}
23020
23021// Response returns the raw server response from the last page request.
23022func (iter SyncGroupListResultIterator) Response() SyncGroupListResult {
23023	return iter.page.Response()
23024}
23025
23026// Value returns the current value or a zero-initialized value if the
23027// iterator has advanced beyond the end of the collection.
23028func (iter SyncGroupListResultIterator) Value() SyncGroup {
23029	if !iter.page.NotDone() {
23030		return SyncGroup{}
23031	}
23032	return iter.page.Values()[iter.i]
23033}
23034
23035// Creates a new instance of the SyncGroupListResultIterator type.
23036func NewSyncGroupListResultIterator(page SyncGroupListResultPage) SyncGroupListResultIterator {
23037	return SyncGroupListResultIterator{page: page}
23038}
23039
23040// IsEmpty returns true if the ListResult contains no values.
23041func (sglr SyncGroupListResult) IsEmpty() bool {
23042	return sglr.Value == nil || len(*sglr.Value) == 0
23043}
23044
23045// hasNextLink returns true if the NextLink is not empty.
23046func (sglr SyncGroupListResult) hasNextLink() bool {
23047	return sglr.NextLink != nil && len(*sglr.NextLink) != 0
23048}
23049
23050// syncGroupListResultPreparer prepares a request to retrieve the next set of results.
23051// It returns nil if no more results exist.
23052func (sglr SyncGroupListResult) syncGroupListResultPreparer(ctx context.Context) (*http.Request, error) {
23053	if !sglr.hasNextLink() {
23054		return nil, nil
23055	}
23056	return autorest.Prepare((&http.Request{}).WithContext(ctx),
23057		autorest.AsJSON(),
23058		autorest.AsGet(),
23059		autorest.WithBaseURL(to.String(sglr.NextLink)))
23060}
23061
23062// SyncGroupListResultPage contains a page of SyncGroup values.
23063type SyncGroupListResultPage struct {
23064	fn   func(context.Context, SyncGroupListResult) (SyncGroupListResult, error)
23065	sglr SyncGroupListResult
23066}
23067
23068// NextWithContext advances to the next page of values.  If there was an error making
23069// the request the page does not advance and the error is returned.
23070func (page *SyncGroupListResultPage) NextWithContext(ctx context.Context) (err error) {
23071	if tracing.IsEnabled() {
23072		ctx = tracing.StartSpan(ctx, fqdn+"/SyncGroupListResultPage.NextWithContext")
23073		defer func() {
23074			sc := -1
23075			if page.Response().Response.Response != nil {
23076				sc = page.Response().Response.Response.StatusCode
23077			}
23078			tracing.EndSpan(ctx, sc, err)
23079		}()
23080	}
23081	for {
23082		next, err := page.fn(ctx, page.sglr)
23083		if err != nil {
23084			return err
23085		}
23086		page.sglr = next
23087		if !next.hasNextLink() || !next.IsEmpty() {
23088			break
23089		}
23090	}
23091	return nil
23092}
23093
23094// Next advances to the next page of values.  If there was an error making
23095// the request the page does not advance and the error is returned.
23096// Deprecated: Use NextWithContext() instead.
23097func (page *SyncGroupListResultPage) Next() error {
23098	return page.NextWithContext(context.Background())
23099}
23100
23101// NotDone returns true if the page enumeration should be started or is not yet complete.
23102func (page SyncGroupListResultPage) NotDone() bool {
23103	return !page.sglr.IsEmpty()
23104}
23105
23106// Response returns the raw server response from the last page request.
23107func (page SyncGroupListResultPage) Response() SyncGroupListResult {
23108	return page.sglr
23109}
23110
23111// Values returns the slice of values for the current page or nil if there are no values.
23112func (page SyncGroupListResultPage) Values() []SyncGroup {
23113	if page.sglr.IsEmpty() {
23114		return nil
23115	}
23116	return *page.sglr.Value
23117}
23118
23119// Creates a new instance of the SyncGroupListResultPage type.
23120func NewSyncGroupListResultPage(cur SyncGroupListResult, getNextPage func(context.Context, SyncGroupListResult) (SyncGroupListResult, error)) SyncGroupListResultPage {
23121	return SyncGroupListResultPage{
23122		fn:   getNextPage,
23123		sglr: cur,
23124	}
23125}
23126
23127// SyncGroupLogListResult a list of sync group log properties.
23128type SyncGroupLogListResult struct {
23129	autorest.Response `json:"-"`
23130	// Value - READ-ONLY; Array of results.
23131	Value *[]SyncGroupLogProperties `json:"value,omitempty"`
23132	// NextLink - READ-ONLY; Link to retrieve next page of results.
23133	NextLink *string `json:"nextLink,omitempty"`
23134}
23135
23136// MarshalJSON is the custom marshaler for SyncGroupLogListResult.
23137func (sgllr SyncGroupLogListResult) MarshalJSON() ([]byte, error) {
23138	objectMap := make(map[string]interface{})
23139	return json.Marshal(objectMap)
23140}
23141
23142// SyncGroupLogListResultIterator provides access to a complete listing of SyncGroupLogProperties values.
23143type SyncGroupLogListResultIterator struct {
23144	i    int
23145	page SyncGroupLogListResultPage
23146}
23147
23148// NextWithContext advances to the next value.  If there was an error making
23149// the request the iterator does not advance and the error is returned.
23150func (iter *SyncGroupLogListResultIterator) NextWithContext(ctx context.Context) (err error) {
23151	if tracing.IsEnabled() {
23152		ctx = tracing.StartSpan(ctx, fqdn+"/SyncGroupLogListResultIterator.NextWithContext")
23153		defer func() {
23154			sc := -1
23155			if iter.Response().Response.Response != nil {
23156				sc = iter.Response().Response.Response.StatusCode
23157			}
23158			tracing.EndSpan(ctx, sc, err)
23159		}()
23160	}
23161	iter.i++
23162	if iter.i < len(iter.page.Values()) {
23163		return nil
23164	}
23165	err = iter.page.NextWithContext(ctx)
23166	if err != nil {
23167		iter.i--
23168		return err
23169	}
23170	iter.i = 0
23171	return nil
23172}
23173
23174// Next advances to the next value.  If there was an error making
23175// the request the iterator does not advance and the error is returned.
23176// Deprecated: Use NextWithContext() instead.
23177func (iter *SyncGroupLogListResultIterator) Next() error {
23178	return iter.NextWithContext(context.Background())
23179}
23180
23181// NotDone returns true if the enumeration should be started or is not yet complete.
23182func (iter SyncGroupLogListResultIterator) NotDone() bool {
23183	return iter.page.NotDone() && iter.i < len(iter.page.Values())
23184}
23185
23186// Response returns the raw server response from the last page request.
23187func (iter SyncGroupLogListResultIterator) Response() SyncGroupLogListResult {
23188	return iter.page.Response()
23189}
23190
23191// Value returns the current value or a zero-initialized value if the
23192// iterator has advanced beyond the end of the collection.
23193func (iter SyncGroupLogListResultIterator) Value() SyncGroupLogProperties {
23194	if !iter.page.NotDone() {
23195		return SyncGroupLogProperties{}
23196	}
23197	return iter.page.Values()[iter.i]
23198}
23199
23200// Creates a new instance of the SyncGroupLogListResultIterator type.
23201func NewSyncGroupLogListResultIterator(page SyncGroupLogListResultPage) SyncGroupLogListResultIterator {
23202	return SyncGroupLogListResultIterator{page: page}
23203}
23204
23205// IsEmpty returns true if the ListResult contains no values.
23206func (sgllr SyncGroupLogListResult) IsEmpty() bool {
23207	return sgllr.Value == nil || len(*sgllr.Value) == 0
23208}
23209
23210// hasNextLink returns true if the NextLink is not empty.
23211func (sgllr SyncGroupLogListResult) hasNextLink() bool {
23212	return sgllr.NextLink != nil && len(*sgllr.NextLink) != 0
23213}
23214
23215// syncGroupLogListResultPreparer prepares a request to retrieve the next set of results.
23216// It returns nil if no more results exist.
23217func (sgllr SyncGroupLogListResult) syncGroupLogListResultPreparer(ctx context.Context) (*http.Request, error) {
23218	if !sgllr.hasNextLink() {
23219		return nil, nil
23220	}
23221	return autorest.Prepare((&http.Request{}).WithContext(ctx),
23222		autorest.AsJSON(),
23223		autorest.AsGet(),
23224		autorest.WithBaseURL(to.String(sgllr.NextLink)))
23225}
23226
23227// SyncGroupLogListResultPage contains a page of SyncGroupLogProperties values.
23228type SyncGroupLogListResultPage struct {
23229	fn    func(context.Context, SyncGroupLogListResult) (SyncGroupLogListResult, error)
23230	sgllr SyncGroupLogListResult
23231}
23232
23233// NextWithContext advances to the next page of values.  If there was an error making
23234// the request the page does not advance and the error is returned.
23235func (page *SyncGroupLogListResultPage) NextWithContext(ctx context.Context) (err error) {
23236	if tracing.IsEnabled() {
23237		ctx = tracing.StartSpan(ctx, fqdn+"/SyncGroupLogListResultPage.NextWithContext")
23238		defer func() {
23239			sc := -1
23240			if page.Response().Response.Response != nil {
23241				sc = page.Response().Response.Response.StatusCode
23242			}
23243			tracing.EndSpan(ctx, sc, err)
23244		}()
23245	}
23246	for {
23247		next, err := page.fn(ctx, page.sgllr)
23248		if err != nil {
23249			return err
23250		}
23251		page.sgllr = next
23252		if !next.hasNextLink() || !next.IsEmpty() {
23253			break
23254		}
23255	}
23256	return nil
23257}
23258
23259// Next advances to the next page of values.  If there was an error making
23260// the request the page does not advance and the error is returned.
23261// Deprecated: Use NextWithContext() instead.
23262func (page *SyncGroupLogListResultPage) Next() error {
23263	return page.NextWithContext(context.Background())
23264}
23265
23266// NotDone returns true if the page enumeration should be started or is not yet complete.
23267func (page SyncGroupLogListResultPage) NotDone() bool {
23268	return !page.sgllr.IsEmpty()
23269}
23270
23271// Response returns the raw server response from the last page request.
23272func (page SyncGroupLogListResultPage) Response() SyncGroupLogListResult {
23273	return page.sgllr
23274}
23275
23276// Values returns the slice of values for the current page or nil if there are no values.
23277func (page SyncGroupLogListResultPage) Values() []SyncGroupLogProperties {
23278	if page.sgllr.IsEmpty() {
23279		return nil
23280	}
23281	return *page.sgllr.Value
23282}
23283
23284// Creates a new instance of the SyncGroupLogListResultPage type.
23285func NewSyncGroupLogListResultPage(cur SyncGroupLogListResult, getNextPage func(context.Context, SyncGroupLogListResult) (SyncGroupLogListResult, error)) SyncGroupLogListResultPage {
23286	return SyncGroupLogListResultPage{
23287		fn:    getNextPage,
23288		sgllr: cur,
23289	}
23290}
23291
23292// SyncGroupLogProperties properties of an Azure SQL Database sync group log.
23293type SyncGroupLogProperties struct {
23294	// Timestamp - READ-ONLY; Timestamp of the sync group log.
23295	Timestamp *date.Time `json:"timestamp,omitempty"`
23296	// Type - READ-ONLY; Type of the sync group log. Possible values include: 'SyncGroupLogTypeAll', 'SyncGroupLogTypeError', 'SyncGroupLogTypeWarning', 'SyncGroupLogTypeSuccess'
23297	Type SyncGroupLogType `json:"type,omitempty"`
23298	// Source - READ-ONLY; Source of the sync group log.
23299	Source *string `json:"source,omitempty"`
23300	// Details - READ-ONLY; Details of the sync group log.
23301	Details *string `json:"details,omitempty"`
23302	// TracingID - READ-ONLY; TracingId of the sync group log.
23303	TracingID *uuid.UUID `json:"tracingId,omitempty"`
23304	// OperationStatus - READ-ONLY; OperationStatus of the sync group log.
23305	OperationStatus *string `json:"operationStatus,omitempty"`
23306}
23307
23308// MarshalJSON is the custom marshaler for SyncGroupLogProperties.
23309func (sglp SyncGroupLogProperties) MarshalJSON() ([]byte, error) {
23310	objectMap := make(map[string]interface{})
23311	return json.Marshal(objectMap)
23312}
23313
23314// SyncGroupProperties properties of a sync group.
23315type SyncGroupProperties struct {
23316	// Interval - Sync interval of the sync group.
23317	Interval *int32 `json:"interval,omitempty"`
23318	// LastSyncTime - READ-ONLY; Last sync time of the sync group.
23319	LastSyncTime *date.Time `json:"lastSyncTime,omitempty"`
23320	// ConflictResolutionPolicy - Conflict resolution policy of the sync group. Possible values include: 'HubWin', 'MemberWin'
23321	ConflictResolutionPolicy SyncConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"`
23322	// SyncDatabaseID - ARM resource id of the sync database in the sync group.
23323	SyncDatabaseID *string `json:"syncDatabaseId,omitempty"`
23324	// HubDatabaseUserName - User name for the sync group hub database credential.
23325	HubDatabaseUserName *string `json:"hubDatabaseUserName,omitempty"`
23326	// HubDatabasePassword - Password for the sync group hub database credential.
23327	HubDatabasePassword *string `json:"hubDatabasePassword,omitempty"`
23328	// SyncState - READ-ONLY; Sync state of the sync group. Possible values include: 'NotReady', 'Error', 'Warning', 'Progressing', 'Good'
23329	SyncState SyncGroupState `json:"syncState,omitempty"`
23330	// Schema - Sync schema of the sync group.
23331	Schema *SyncGroupSchema `json:"schema,omitempty"`
23332	// UsePrivateLinkConnection - If use private link connection is enabled.
23333	UsePrivateLinkConnection *bool `json:"usePrivateLinkConnection,omitempty"`
23334	// PrivateEndpointName - READ-ONLY; Private endpoint name of the sync group if use private link connection is enabled.
23335	PrivateEndpointName *string `json:"privateEndpointName,omitempty"`
23336}
23337
23338// MarshalJSON is the custom marshaler for SyncGroupProperties.
23339func (sgp SyncGroupProperties) MarshalJSON() ([]byte, error) {
23340	objectMap := make(map[string]interface{})
23341	if sgp.Interval != nil {
23342		objectMap["interval"] = sgp.Interval
23343	}
23344	if sgp.ConflictResolutionPolicy != "" {
23345		objectMap["conflictResolutionPolicy"] = sgp.ConflictResolutionPolicy
23346	}
23347	if sgp.SyncDatabaseID != nil {
23348		objectMap["syncDatabaseId"] = sgp.SyncDatabaseID
23349	}
23350	if sgp.HubDatabaseUserName != nil {
23351		objectMap["hubDatabaseUserName"] = sgp.HubDatabaseUserName
23352	}
23353	if sgp.HubDatabasePassword != nil {
23354		objectMap["hubDatabasePassword"] = sgp.HubDatabasePassword
23355	}
23356	if sgp.Schema != nil {
23357		objectMap["schema"] = sgp.Schema
23358	}
23359	if sgp.UsePrivateLinkConnection != nil {
23360		objectMap["usePrivateLinkConnection"] = sgp.UsePrivateLinkConnection
23361	}
23362	return json.Marshal(objectMap)
23363}
23364
23365// SyncGroupSchema properties of sync group schema.
23366type SyncGroupSchema struct {
23367	// Tables - List of tables in sync group schema.
23368	Tables *[]SyncGroupSchemaTable `json:"tables,omitempty"`
23369	// MasterSyncMemberName - Name of master sync member where the schema is from.
23370	MasterSyncMemberName *string `json:"masterSyncMemberName,omitempty"`
23371}
23372
23373// SyncGroupSchemaTable properties of table in sync group schema.
23374type SyncGroupSchemaTable struct {
23375	// Columns - List of columns in sync group schema.
23376	Columns *[]SyncGroupSchemaTableColumn `json:"columns,omitempty"`
23377	// QuotedName - Quoted name of sync group schema table.
23378	QuotedName *string `json:"quotedName,omitempty"`
23379}
23380
23381// SyncGroupSchemaTableColumn properties of column in sync group table.
23382type SyncGroupSchemaTableColumn struct {
23383	// QuotedName - Quoted name of sync group table column.
23384	QuotedName *string `json:"quotedName,omitempty"`
23385	// DataSize - Data size of the column.
23386	DataSize *string `json:"dataSize,omitempty"`
23387	// DataType - Data type of the column.
23388	DataType *string `json:"dataType,omitempty"`
23389}
23390
23391// SyncGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
23392// long-running operation.
23393type SyncGroupsCreateOrUpdateFuture struct {
23394	azure.FutureAPI
23395	// Result returns the result of the asynchronous operation.
23396	// If the operation has not completed it will return an error.
23397	Result func(SyncGroupsClient) (SyncGroup, error)
23398}
23399
23400// UnmarshalJSON is the custom unmarshaller for CreateFuture.
23401func (future *SyncGroupsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
23402	var azFuture azure.Future
23403	if err := json.Unmarshal(body, &azFuture); err != nil {
23404		return err
23405	}
23406	future.FutureAPI = &azFuture
23407	future.Result = future.result
23408	return nil
23409}
23410
23411// result is the default implementation for SyncGroupsCreateOrUpdateFuture.Result.
23412func (future *SyncGroupsCreateOrUpdateFuture) result(client SyncGroupsClient) (sg SyncGroup, err error) {
23413	var done bool
23414	done, err = future.DoneWithContext(context.Background(), client)
23415	if err != nil {
23416		err = autorest.NewErrorWithError(err, "sql.SyncGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
23417		return
23418	}
23419	if !done {
23420		sg.Response.Response = future.Response()
23421		err = azure.NewAsyncOpIncompleteError("sql.SyncGroupsCreateOrUpdateFuture")
23422		return
23423	}
23424	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
23425	if sg.Response.Response, err = future.GetResult(sender); err == nil && sg.Response.Response.StatusCode != http.StatusNoContent {
23426		sg, err = client.CreateOrUpdateResponder(sg.Response.Response)
23427		if err != nil {
23428			err = autorest.NewErrorWithError(err, "sql.SyncGroupsCreateOrUpdateFuture", "Result", sg.Response.Response, "Failure responding to request")
23429		}
23430	}
23431	return
23432}
23433
23434// SyncGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
23435// operation.
23436type SyncGroupsDeleteFuture struct {
23437	azure.FutureAPI
23438	// Result returns the result of the asynchronous operation.
23439	// If the operation has not completed it will return an error.
23440	Result func(SyncGroupsClient) (autorest.Response, error)
23441}
23442
23443// UnmarshalJSON is the custom unmarshaller for CreateFuture.
23444func (future *SyncGroupsDeleteFuture) UnmarshalJSON(body []byte) error {
23445	var azFuture azure.Future
23446	if err := json.Unmarshal(body, &azFuture); err != nil {
23447		return err
23448	}
23449	future.FutureAPI = &azFuture
23450	future.Result = future.result
23451	return nil
23452}
23453
23454// result is the default implementation for SyncGroupsDeleteFuture.Result.
23455func (future *SyncGroupsDeleteFuture) result(client SyncGroupsClient) (ar autorest.Response, err error) {
23456	var done bool
23457	done, err = future.DoneWithContext(context.Background(), client)
23458	if err != nil {
23459		err = autorest.NewErrorWithError(err, "sql.SyncGroupsDeleteFuture", "Result", future.Response(), "Polling failure")
23460		return
23461	}
23462	if !done {
23463		ar.Response = future.Response()
23464		err = azure.NewAsyncOpIncompleteError("sql.SyncGroupsDeleteFuture")
23465		return
23466	}
23467	ar.Response = future.Response()
23468	return
23469}
23470
23471// SyncGroupsRefreshHubSchemaFuture an abstraction for monitoring and retrieving the results of a
23472// long-running operation.
23473type SyncGroupsRefreshHubSchemaFuture struct {
23474	azure.FutureAPI
23475	// Result returns the result of the asynchronous operation.
23476	// If the operation has not completed it will return an error.
23477	Result func(SyncGroupsClient) (autorest.Response, error)
23478}
23479
23480// UnmarshalJSON is the custom unmarshaller for CreateFuture.
23481func (future *SyncGroupsRefreshHubSchemaFuture) UnmarshalJSON(body []byte) error {
23482	var azFuture azure.Future
23483	if err := json.Unmarshal(body, &azFuture); err != nil {
23484		return err
23485	}
23486	future.FutureAPI = &azFuture
23487	future.Result = future.result
23488	return nil
23489}
23490
23491// result is the default implementation for SyncGroupsRefreshHubSchemaFuture.Result.
23492func (future *SyncGroupsRefreshHubSchemaFuture) result(client SyncGroupsClient) (ar autorest.Response, err error) {
23493	var done bool
23494	done, err = future.DoneWithContext(context.Background(), client)
23495	if err != nil {
23496		err = autorest.NewErrorWithError(err, "sql.SyncGroupsRefreshHubSchemaFuture", "Result", future.Response(), "Polling failure")
23497		return
23498	}
23499	if !done {
23500		ar.Response = future.Response()
23501		err = azure.NewAsyncOpIncompleteError("sql.SyncGroupsRefreshHubSchemaFuture")
23502		return
23503	}
23504	ar.Response = future.Response()
23505	return
23506}
23507
23508// SyncGroupsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
23509// operation.
23510type SyncGroupsUpdateFuture struct {
23511	azure.FutureAPI
23512	// Result returns the result of the asynchronous operation.
23513	// If the operation has not completed it will return an error.
23514	Result func(SyncGroupsClient) (SyncGroup, error)
23515}
23516
23517// UnmarshalJSON is the custom unmarshaller for CreateFuture.
23518func (future *SyncGroupsUpdateFuture) UnmarshalJSON(body []byte) error {
23519	var azFuture azure.Future
23520	if err := json.Unmarshal(body, &azFuture); err != nil {
23521		return err
23522	}
23523	future.FutureAPI = &azFuture
23524	future.Result = future.result
23525	return nil
23526}
23527
23528// result is the default implementation for SyncGroupsUpdateFuture.Result.
23529func (future *SyncGroupsUpdateFuture) result(client SyncGroupsClient) (sg SyncGroup, err error) {
23530	var done bool
23531	done, err = future.DoneWithContext(context.Background(), client)
23532	if err != nil {
23533		err = autorest.NewErrorWithError(err, "sql.SyncGroupsUpdateFuture", "Result", future.Response(), "Polling failure")
23534		return
23535	}
23536	if !done {
23537		sg.Response.Response = future.Response()
23538		err = azure.NewAsyncOpIncompleteError("sql.SyncGroupsUpdateFuture")
23539		return
23540	}
23541	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
23542	if sg.Response.Response, err = future.GetResult(sender); err == nil && sg.Response.Response.StatusCode != http.StatusNoContent {
23543		sg, err = client.UpdateResponder(sg.Response.Response)
23544		if err != nil {
23545			err = autorest.NewErrorWithError(err, "sql.SyncGroupsUpdateFuture", "Result", sg.Response.Response, "Failure responding to request")
23546		}
23547	}
23548	return
23549}
23550
23551// SyncMember an Azure SQL Database sync member.
23552type SyncMember struct {
23553	autorest.Response `json:"-"`
23554	// SyncMemberProperties - Resource properties.
23555	*SyncMemberProperties `json:"properties,omitempty"`
23556	// ID - READ-ONLY; Resource ID.
23557	ID *string `json:"id,omitempty"`
23558	// Name - READ-ONLY; Resource name.
23559	Name *string `json:"name,omitempty"`
23560	// Type - READ-ONLY; Resource type.
23561	Type *string `json:"type,omitempty"`
23562}
23563
23564// MarshalJSON is the custom marshaler for SyncMember.
23565func (sm SyncMember) MarshalJSON() ([]byte, error) {
23566	objectMap := make(map[string]interface{})
23567	if sm.SyncMemberProperties != nil {
23568		objectMap["properties"] = sm.SyncMemberProperties
23569	}
23570	return json.Marshal(objectMap)
23571}
23572
23573// UnmarshalJSON is the custom unmarshaler for SyncMember struct.
23574func (sm *SyncMember) UnmarshalJSON(body []byte) error {
23575	var m map[string]*json.RawMessage
23576	err := json.Unmarshal(body, &m)
23577	if err != nil {
23578		return err
23579	}
23580	for k, v := range m {
23581		switch k {
23582		case "properties":
23583			if v != nil {
23584				var syncMemberProperties SyncMemberProperties
23585				err = json.Unmarshal(*v, &syncMemberProperties)
23586				if err != nil {
23587					return err
23588				}
23589				sm.SyncMemberProperties = &syncMemberProperties
23590			}
23591		case "id":
23592			if v != nil {
23593				var ID string
23594				err = json.Unmarshal(*v, &ID)
23595				if err != nil {
23596					return err
23597				}
23598				sm.ID = &ID
23599			}
23600		case "name":
23601			if v != nil {
23602				var name string
23603				err = json.Unmarshal(*v, &name)
23604				if err != nil {
23605					return err
23606				}
23607				sm.Name = &name
23608			}
23609		case "type":
23610			if v != nil {
23611				var typeVar string
23612				err = json.Unmarshal(*v, &typeVar)
23613				if err != nil {
23614					return err
23615				}
23616				sm.Type = &typeVar
23617			}
23618		}
23619	}
23620
23621	return nil
23622}
23623
23624// SyncMemberListResult a list of Azure SQL Database sync members.
23625type SyncMemberListResult struct {
23626	autorest.Response `json:"-"`
23627	// Value - READ-ONLY; Array of results.
23628	Value *[]SyncMember `json:"value,omitempty"`
23629	// NextLink - READ-ONLY; Link to retrieve next page of results.
23630	NextLink *string `json:"nextLink,omitempty"`
23631}
23632
23633// MarshalJSON is the custom marshaler for SyncMemberListResult.
23634func (smlr SyncMemberListResult) MarshalJSON() ([]byte, error) {
23635	objectMap := make(map[string]interface{})
23636	return json.Marshal(objectMap)
23637}
23638
23639// SyncMemberListResultIterator provides access to a complete listing of SyncMember values.
23640type SyncMemberListResultIterator struct {
23641	i    int
23642	page SyncMemberListResultPage
23643}
23644
23645// NextWithContext advances to the next value.  If there was an error making
23646// the request the iterator does not advance and the error is returned.
23647func (iter *SyncMemberListResultIterator) NextWithContext(ctx context.Context) (err error) {
23648	if tracing.IsEnabled() {
23649		ctx = tracing.StartSpan(ctx, fqdn+"/SyncMemberListResultIterator.NextWithContext")
23650		defer func() {
23651			sc := -1
23652			if iter.Response().Response.Response != nil {
23653				sc = iter.Response().Response.Response.StatusCode
23654			}
23655			tracing.EndSpan(ctx, sc, err)
23656		}()
23657	}
23658	iter.i++
23659	if iter.i < len(iter.page.Values()) {
23660		return nil
23661	}
23662	err = iter.page.NextWithContext(ctx)
23663	if err != nil {
23664		iter.i--
23665		return err
23666	}
23667	iter.i = 0
23668	return nil
23669}
23670
23671// Next advances to the next value.  If there was an error making
23672// the request the iterator does not advance and the error is returned.
23673// Deprecated: Use NextWithContext() instead.
23674func (iter *SyncMemberListResultIterator) Next() error {
23675	return iter.NextWithContext(context.Background())
23676}
23677
23678// NotDone returns true if the enumeration should be started or is not yet complete.
23679func (iter SyncMemberListResultIterator) NotDone() bool {
23680	return iter.page.NotDone() && iter.i < len(iter.page.Values())
23681}
23682
23683// Response returns the raw server response from the last page request.
23684func (iter SyncMemberListResultIterator) Response() SyncMemberListResult {
23685	return iter.page.Response()
23686}
23687
23688// Value returns the current value or a zero-initialized value if the
23689// iterator has advanced beyond the end of the collection.
23690func (iter SyncMemberListResultIterator) Value() SyncMember {
23691	if !iter.page.NotDone() {
23692		return SyncMember{}
23693	}
23694	return iter.page.Values()[iter.i]
23695}
23696
23697// Creates a new instance of the SyncMemberListResultIterator type.
23698func NewSyncMemberListResultIterator(page SyncMemberListResultPage) SyncMemberListResultIterator {
23699	return SyncMemberListResultIterator{page: page}
23700}
23701
23702// IsEmpty returns true if the ListResult contains no values.
23703func (smlr SyncMemberListResult) IsEmpty() bool {
23704	return smlr.Value == nil || len(*smlr.Value) == 0
23705}
23706
23707// hasNextLink returns true if the NextLink is not empty.
23708func (smlr SyncMemberListResult) hasNextLink() bool {
23709	return smlr.NextLink != nil && len(*smlr.NextLink) != 0
23710}
23711
23712// syncMemberListResultPreparer prepares a request to retrieve the next set of results.
23713// It returns nil if no more results exist.
23714func (smlr SyncMemberListResult) syncMemberListResultPreparer(ctx context.Context) (*http.Request, error) {
23715	if !smlr.hasNextLink() {
23716		return nil, nil
23717	}
23718	return autorest.Prepare((&http.Request{}).WithContext(ctx),
23719		autorest.AsJSON(),
23720		autorest.AsGet(),
23721		autorest.WithBaseURL(to.String(smlr.NextLink)))
23722}
23723
23724// SyncMemberListResultPage contains a page of SyncMember values.
23725type SyncMemberListResultPage struct {
23726	fn   func(context.Context, SyncMemberListResult) (SyncMemberListResult, error)
23727	smlr SyncMemberListResult
23728}
23729
23730// NextWithContext advances to the next page of values.  If there was an error making
23731// the request the page does not advance and the error is returned.
23732func (page *SyncMemberListResultPage) NextWithContext(ctx context.Context) (err error) {
23733	if tracing.IsEnabled() {
23734		ctx = tracing.StartSpan(ctx, fqdn+"/SyncMemberListResultPage.NextWithContext")
23735		defer func() {
23736			sc := -1
23737			if page.Response().Response.Response != nil {
23738				sc = page.Response().Response.Response.StatusCode
23739			}
23740			tracing.EndSpan(ctx, sc, err)
23741		}()
23742	}
23743	for {
23744		next, err := page.fn(ctx, page.smlr)
23745		if err != nil {
23746			return err
23747		}
23748		page.smlr = next
23749		if !next.hasNextLink() || !next.IsEmpty() {
23750			break
23751		}
23752	}
23753	return nil
23754}
23755
23756// Next advances to the next page of values.  If there was an error making
23757// the request the page does not advance and the error is returned.
23758// Deprecated: Use NextWithContext() instead.
23759func (page *SyncMemberListResultPage) Next() error {
23760	return page.NextWithContext(context.Background())
23761}
23762
23763// NotDone returns true if the page enumeration should be started or is not yet complete.
23764func (page SyncMemberListResultPage) NotDone() bool {
23765	return !page.smlr.IsEmpty()
23766}
23767
23768// Response returns the raw server response from the last page request.
23769func (page SyncMemberListResultPage) Response() SyncMemberListResult {
23770	return page.smlr
23771}
23772
23773// Values returns the slice of values for the current page or nil if there are no values.
23774func (page SyncMemberListResultPage) Values() []SyncMember {
23775	if page.smlr.IsEmpty() {
23776		return nil
23777	}
23778	return *page.smlr.Value
23779}
23780
23781// Creates a new instance of the SyncMemberListResultPage type.
23782func NewSyncMemberListResultPage(cur SyncMemberListResult, getNextPage func(context.Context, SyncMemberListResult) (SyncMemberListResult, error)) SyncMemberListResultPage {
23783	return SyncMemberListResultPage{
23784		fn:   getNextPage,
23785		smlr: cur,
23786	}
23787}
23788
23789// SyncMemberProperties properties of a sync member.
23790type SyncMemberProperties struct {
23791	// DatabaseType - Database type of the sync member. Possible values include: 'AzureSQLDatabase', 'SQLServerDatabase'
23792	DatabaseType SyncMemberDbType `json:"databaseType,omitempty"`
23793	// SyncAgentID - ARM resource id of the sync agent in the sync member.
23794	SyncAgentID *string `json:"syncAgentId,omitempty"`
23795	// SQLServerDatabaseID - SQL Server database id of the sync member.
23796	SQLServerDatabaseID *uuid.UUID `json:"sqlServerDatabaseId,omitempty"`
23797	// SyncMemberAzureDatabaseResourceID - ARM resource id of the sync member logical database, for sync members in Azure.
23798	SyncMemberAzureDatabaseResourceID *string `json:"syncMemberAzureDatabaseResourceId,omitempty"`
23799	// UsePrivateLinkConnection - Whether to use private link connection.
23800	UsePrivateLinkConnection *bool `json:"usePrivateLinkConnection,omitempty"`
23801	// PrivateEndpointName - READ-ONLY; Private endpoint name of the sync member if use private link connection is enabled, for sync members in Azure.
23802	PrivateEndpointName *string `json:"privateEndpointName,omitempty"`
23803	// ServerName - Server name of the member database in the sync member
23804	ServerName *string `json:"serverName,omitempty"`
23805	// DatabaseName - Database name of the member database in the sync member.
23806	DatabaseName *string `json:"databaseName,omitempty"`
23807	// UserName - User name of the member database in the sync member.
23808	UserName *string `json:"userName,omitempty"`
23809	// Password - Password of the member database in the sync member.
23810	Password *string `json:"password,omitempty"`
23811	// SyncDirection - Sync direction of the sync member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', 'OneWayHubToMember'
23812	SyncDirection SyncDirection `json:"syncDirection,omitempty"`
23813	// SyncState - READ-ONLY; Sync state of the sync member. Possible values include: 'SyncInProgress', 'SyncSucceeded', 'SyncFailed', 'DisabledTombstoneCleanup', 'DisabledBackupRestore', 'SyncSucceededWithWarnings', 'SyncCancelling', 'SyncCancelled', 'UnProvisioned', 'Provisioning', 'Provisioned', 'ProvisionFailed', 'DeProvisioning', 'DeProvisioned', 'DeProvisionFailed', 'Reprovisioning', 'ReprovisionFailed', 'UnReprovisioned'
23814	SyncState SyncMemberState `json:"syncState,omitempty"`
23815}
23816
23817// MarshalJSON is the custom marshaler for SyncMemberProperties.
23818func (smp SyncMemberProperties) MarshalJSON() ([]byte, error) {
23819	objectMap := make(map[string]interface{})
23820	if smp.DatabaseType != "" {
23821		objectMap["databaseType"] = smp.DatabaseType
23822	}
23823	if smp.SyncAgentID != nil {
23824		objectMap["syncAgentId"] = smp.SyncAgentID
23825	}
23826	if smp.SQLServerDatabaseID != nil {
23827		objectMap["sqlServerDatabaseId"] = smp.SQLServerDatabaseID
23828	}
23829	if smp.SyncMemberAzureDatabaseResourceID != nil {
23830		objectMap["syncMemberAzureDatabaseResourceId"] = smp.SyncMemberAzureDatabaseResourceID
23831	}
23832	if smp.UsePrivateLinkConnection != nil {
23833		objectMap["usePrivateLinkConnection"] = smp.UsePrivateLinkConnection
23834	}
23835	if smp.ServerName != nil {
23836		objectMap["serverName"] = smp.ServerName
23837	}
23838	if smp.DatabaseName != nil {
23839		objectMap["databaseName"] = smp.DatabaseName
23840	}
23841	if smp.UserName != nil {
23842		objectMap["userName"] = smp.UserName
23843	}
23844	if smp.Password != nil {
23845		objectMap["password"] = smp.Password
23846	}
23847	if smp.SyncDirection != "" {
23848		objectMap["syncDirection"] = smp.SyncDirection
23849	}
23850	return json.Marshal(objectMap)
23851}
23852
23853// SyncMembersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
23854// long-running operation.
23855type SyncMembersCreateOrUpdateFuture struct {
23856	azure.FutureAPI
23857	// Result returns the result of the asynchronous operation.
23858	// If the operation has not completed it will return an error.
23859	Result func(SyncMembersClient) (SyncMember, error)
23860}
23861
23862// UnmarshalJSON is the custom unmarshaller for CreateFuture.
23863func (future *SyncMembersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
23864	var azFuture azure.Future
23865	if err := json.Unmarshal(body, &azFuture); err != nil {
23866		return err
23867	}
23868	future.FutureAPI = &azFuture
23869	future.Result = future.result
23870	return nil
23871}
23872
23873// result is the default implementation for SyncMembersCreateOrUpdateFuture.Result.
23874func (future *SyncMembersCreateOrUpdateFuture) result(client SyncMembersClient) (sm SyncMember, err error) {
23875	var done bool
23876	done, err = future.DoneWithContext(context.Background(), client)
23877	if err != nil {
23878		err = autorest.NewErrorWithError(err, "sql.SyncMembersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
23879		return
23880	}
23881	if !done {
23882		sm.Response.Response = future.Response()
23883		err = azure.NewAsyncOpIncompleteError("sql.SyncMembersCreateOrUpdateFuture")
23884		return
23885	}
23886	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
23887	if sm.Response.Response, err = future.GetResult(sender); err == nil && sm.Response.Response.StatusCode != http.StatusNoContent {
23888		sm, err = client.CreateOrUpdateResponder(sm.Response.Response)
23889		if err != nil {
23890			err = autorest.NewErrorWithError(err, "sql.SyncMembersCreateOrUpdateFuture", "Result", sm.Response.Response, "Failure responding to request")
23891		}
23892	}
23893	return
23894}
23895
23896// SyncMembersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
23897// operation.
23898type SyncMembersDeleteFuture struct {
23899	azure.FutureAPI
23900	// Result returns the result of the asynchronous operation.
23901	// If the operation has not completed it will return an error.
23902	Result func(SyncMembersClient) (autorest.Response, error)
23903}
23904
23905// UnmarshalJSON is the custom unmarshaller for CreateFuture.
23906func (future *SyncMembersDeleteFuture) UnmarshalJSON(body []byte) error {
23907	var azFuture azure.Future
23908	if err := json.Unmarshal(body, &azFuture); err != nil {
23909		return err
23910	}
23911	future.FutureAPI = &azFuture
23912	future.Result = future.result
23913	return nil
23914}
23915
23916// result is the default implementation for SyncMembersDeleteFuture.Result.
23917func (future *SyncMembersDeleteFuture) result(client SyncMembersClient) (ar autorest.Response, err error) {
23918	var done bool
23919	done, err = future.DoneWithContext(context.Background(), client)
23920	if err != nil {
23921		err = autorest.NewErrorWithError(err, "sql.SyncMembersDeleteFuture", "Result", future.Response(), "Polling failure")
23922		return
23923	}
23924	if !done {
23925		ar.Response = future.Response()
23926		err = azure.NewAsyncOpIncompleteError("sql.SyncMembersDeleteFuture")
23927		return
23928	}
23929	ar.Response = future.Response()
23930	return
23931}
23932
23933// SyncMembersRefreshMemberSchemaFuture an abstraction for monitoring and retrieving the results of a
23934// long-running operation.
23935type SyncMembersRefreshMemberSchemaFuture struct {
23936	azure.FutureAPI
23937	// Result returns the result of the asynchronous operation.
23938	// If the operation has not completed it will return an error.
23939	Result func(SyncMembersClient) (autorest.Response, error)
23940}
23941
23942// UnmarshalJSON is the custom unmarshaller for CreateFuture.
23943func (future *SyncMembersRefreshMemberSchemaFuture) UnmarshalJSON(body []byte) error {
23944	var azFuture azure.Future
23945	if err := json.Unmarshal(body, &azFuture); err != nil {
23946		return err
23947	}
23948	future.FutureAPI = &azFuture
23949	future.Result = future.result
23950	return nil
23951}
23952
23953// result is the default implementation for SyncMembersRefreshMemberSchemaFuture.Result.
23954func (future *SyncMembersRefreshMemberSchemaFuture) result(client SyncMembersClient) (ar autorest.Response, err error) {
23955	var done bool
23956	done, err = future.DoneWithContext(context.Background(), client)
23957	if err != nil {
23958		err = autorest.NewErrorWithError(err, "sql.SyncMembersRefreshMemberSchemaFuture", "Result", future.Response(), "Polling failure")
23959		return
23960	}
23961	if !done {
23962		ar.Response = future.Response()
23963		err = azure.NewAsyncOpIncompleteError("sql.SyncMembersRefreshMemberSchemaFuture")
23964		return
23965	}
23966	ar.Response = future.Response()
23967	return
23968}
23969
23970// SyncMembersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
23971// operation.
23972type SyncMembersUpdateFuture struct {
23973	azure.FutureAPI
23974	// Result returns the result of the asynchronous operation.
23975	// If the operation has not completed it will return an error.
23976	Result func(SyncMembersClient) (SyncMember, error)
23977}
23978
23979// UnmarshalJSON is the custom unmarshaller for CreateFuture.
23980func (future *SyncMembersUpdateFuture) UnmarshalJSON(body []byte) error {
23981	var azFuture azure.Future
23982	if err := json.Unmarshal(body, &azFuture); err != nil {
23983		return err
23984	}
23985	future.FutureAPI = &azFuture
23986	future.Result = future.result
23987	return nil
23988}
23989
23990// result is the default implementation for SyncMembersUpdateFuture.Result.
23991func (future *SyncMembersUpdateFuture) result(client SyncMembersClient) (sm SyncMember, err error) {
23992	var done bool
23993	done, err = future.DoneWithContext(context.Background(), client)
23994	if err != nil {
23995		err = autorest.NewErrorWithError(err, "sql.SyncMembersUpdateFuture", "Result", future.Response(), "Polling failure")
23996		return
23997	}
23998	if !done {
23999		sm.Response.Response = future.Response()
24000		err = azure.NewAsyncOpIncompleteError("sql.SyncMembersUpdateFuture")
24001		return
24002	}
24003	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
24004	if sm.Response.Response, err = future.GetResult(sender); err == nil && sm.Response.Response.StatusCode != http.StatusNoContent {
24005		sm, err = client.UpdateResponder(sm.Response.Response)
24006		if err != nil {
24007			err = autorest.NewErrorWithError(err, "sql.SyncMembersUpdateFuture", "Result", sm.Response.Response, "Failure responding to request")
24008		}
24009	}
24010	return
24011}
24012
24013// TdeCertificate a TDE certificate that can be uploaded into a server.
24014type TdeCertificate struct {
24015	// TdeCertificateProperties - Resource properties.
24016	*TdeCertificateProperties `json:"properties,omitempty"`
24017	// ID - READ-ONLY; Resource ID.
24018	ID *string `json:"id,omitempty"`
24019	// Name - READ-ONLY; Resource name.
24020	Name *string `json:"name,omitempty"`
24021	// Type - READ-ONLY; Resource type.
24022	Type *string `json:"type,omitempty"`
24023}
24024
24025// MarshalJSON is the custom marshaler for TdeCertificate.
24026func (tc TdeCertificate) MarshalJSON() ([]byte, error) {
24027	objectMap := make(map[string]interface{})
24028	if tc.TdeCertificateProperties != nil {
24029		objectMap["properties"] = tc.TdeCertificateProperties
24030	}
24031	return json.Marshal(objectMap)
24032}
24033
24034// UnmarshalJSON is the custom unmarshaler for TdeCertificate struct.
24035func (tc *TdeCertificate) UnmarshalJSON(body []byte) error {
24036	var m map[string]*json.RawMessage
24037	err := json.Unmarshal(body, &m)
24038	if err != nil {
24039		return err
24040	}
24041	for k, v := range m {
24042		switch k {
24043		case "properties":
24044			if v != nil {
24045				var tdeCertificateProperties TdeCertificateProperties
24046				err = json.Unmarshal(*v, &tdeCertificateProperties)
24047				if err != nil {
24048					return err
24049				}
24050				tc.TdeCertificateProperties = &tdeCertificateProperties
24051			}
24052		case "id":
24053			if v != nil {
24054				var ID string
24055				err = json.Unmarshal(*v, &ID)
24056				if err != nil {
24057					return err
24058				}
24059				tc.ID = &ID
24060			}
24061		case "name":
24062			if v != nil {
24063				var name string
24064				err = json.Unmarshal(*v, &name)
24065				if err != nil {
24066					return err
24067				}
24068				tc.Name = &name
24069			}
24070		case "type":
24071			if v != nil {
24072				var typeVar string
24073				err = json.Unmarshal(*v, &typeVar)
24074				if err != nil {
24075					return err
24076				}
24077				tc.Type = &typeVar
24078			}
24079		}
24080	}
24081
24082	return nil
24083}
24084
24085// TdeCertificateProperties properties of a TDE certificate.
24086type TdeCertificateProperties struct {
24087	// PrivateBlob - The base64 encoded certificate private blob.
24088	PrivateBlob *string `json:"privateBlob,omitempty"`
24089	// CertPassword - The certificate password.
24090	CertPassword *string `json:"certPassword,omitempty"`
24091}
24092
24093// TdeCertificatesCreateFuture an abstraction for monitoring and retrieving the results of a long-running
24094// operation.
24095type TdeCertificatesCreateFuture struct {
24096	azure.FutureAPI
24097	// Result returns the result of the asynchronous operation.
24098	// If the operation has not completed it will return an error.
24099	Result func(TdeCertificatesClient) (autorest.Response, error)
24100}
24101
24102// UnmarshalJSON is the custom unmarshaller for CreateFuture.
24103func (future *TdeCertificatesCreateFuture) UnmarshalJSON(body []byte) error {
24104	var azFuture azure.Future
24105	if err := json.Unmarshal(body, &azFuture); err != nil {
24106		return err
24107	}
24108	future.FutureAPI = &azFuture
24109	future.Result = future.result
24110	return nil
24111}
24112
24113// result is the default implementation for TdeCertificatesCreateFuture.Result.
24114func (future *TdeCertificatesCreateFuture) result(client TdeCertificatesClient) (ar autorest.Response, err error) {
24115	var done bool
24116	done, err = future.DoneWithContext(context.Background(), client)
24117	if err != nil {
24118		err = autorest.NewErrorWithError(err, "sql.TdeCertificatesCreateFuture", "Result", future.Response(), "Polling failure")
24119		return
24120	}
24121	if !done {
24122		ar.Response = future.Response()
24123		err = azure.NewAsyncOpIncompleteError("sql.TdeCertificatesCreateFuture")
24124		return
24125	}
24126	ar.Response = future.Response()
24127	return
24128}
24129
24130// TrackedResource ARM tracked top level resource.
24131type TrackedResource struct {
24132	// Location - Resource location.
24133	Location *string `json:"location,omitempty"`
24134	// Tags - Resource tags.
24135	Tags map[string]*string `json:"tags"`
24136	// ID - READ-ONLY; Resource ID.
24137	ID *string `json:"id,omitempty"`
24138	// Name - READ-ONLY; Resource name.
24139	Name *string `json:"name,omitempty"`
24140	// Type - READ-ONLY; Resource type.
24141	Type *string `json:"type,omitempty"`
24142}
24143
24144// MarshalJSON is the custom marshaler for TrackedResource.
24145func (tr TrackedResource) MarshalJSON() ([]byte, error) {
24146	objectMap := make(map[string]interface{})
24147	if tr.Location != nil {
24148		objectMap["location"] = tr.Location
24149	}
24150	if tr.Tags != nil {
24151		objectMap["tags"] = tr.Tags
24152	}
24153	return json.Marshal(objectMap)
24154}
24155
24156// TransparentDataEncryption represents a database transparent data encryption configuration.
24157type TransparentDataEncryption struct {
24158	autorest.Response `json:"-"`
24159	// Location - READ-ONLY; Resource location.
24160	Location *string `json:"location,omitempty"`
24161	// TransparentDataEncryptionProperties - Represents the properties of the resource.
24162	*TransparentDataEncryptionProperties `json:"properties,omitempty"`
24163	// ID - READ-ONLY; Resource ID.
24164	ID *string `json:"id,omitempty"`
24165	// Name - READ-ONLY; Resource name.
24166	Name *string `json:"name,omitempty"`
24167	// Type - READ-ONLY; Resource type.
24168	Type *string `json:"type,omitempty"`
24169}
24170
24171// MarshalJSON is the custom marshaler for TransparentDataEncryption.
24172func (tde TransparentDataEncryption) MarshalJSON() ([]byte, error) {
24173	objectMap := make(map[string]interface{})
24174	if tde.TransparentDataEncryptionProperties != nil {
24175		objectMap["properties"] = tde.TransparentDataEncryptionProperties
24176	}
24177	return json.Marshal(objectMap)
24178}
24179
24180// UnmarshalJSON is the custom unmarshaler for TransparentDataEncryption struct.
24181func (tde *TransparentDataEncryption) UnmarshalJSON(body []byte) error {
24182	var m map[string]*json.RawMessage
24183	err := json.Unmarshal(body, &m)
24184	if err != nil {
24185		return err
24186	}
24187	for k, v := range m {
24188		switch k {
24189		case "location":
24190			if v != nil {
24191				var location string
24192				err = json.Unmarshal(*v, &location)
24193				if err != nil {
24194					return err
24195				}
24196				tde.Location = &location
24197			}
24198		case "properties":
24199			if v != nil {
24200				var transparentDataEncryptionProperties TransparentDataEncryptionProperties
24201				err = json.Unmarshal(*v, &transparentDataEncryptionProperties)
24202				if err != nil {
24203					return err
24204				}
24205				tde.TransparentDataEncryptionProperties = &transparentDataEncryptionProperties
24206			}
24207		case "id":
24208			if v != nil {
24209				var ID string
24210				err = json.Unmarshal(*v, &ID)
24211				if err != nil {
24212					return err
24213				}
24214				tde.ID = &ID
24215			}
24216		case "name":
24217			if v != nil {
24218				var name string
24219				err = json.Unmarshal(*v, &name)
24220				if err != nil {
24221					return err
24222				}
24223				tde.Name = &name
24224			}
24225		case "type":
24226			if v != nil {
24227				var typeVar string
24228				err = json.Unmarshal(*v, &typeVar)
24229				if err != nil {
24230					return err
24231				}
24232				tde.Type = &typeVar
24233			}
24234		}
24235	}
24236
24237	return nil
24238}
24239
24240// TransparentDataEncryptionActivity represents a database transparent data encryption Scan.
24241type TransparentDataEncryptionActivity struct {
24242	// Location - READ-ONLY; Resource location.
24243	Location *string `json:"location,omitempty"`
24244	// TransparentDataEncryptionActivityProperties - Represents the properties of the resource.
24245	*TransparentDataEncryptionActivityProperties `json:"properties,omitempty"`
24246	// ID - READ-ONLY; Resource ID.
24247	ID *string `json:"id,omitempty"`
24248	// Name - READ-ONLY; Resource name.
24249	Name *string `json:"name,omitempty"`
24250	// Type - READ-ONLY; Resource type.
24251	Type *string `json:"type,omitempty"`
24252}
24253
24254// MarshalJSON is the custom marshaler for TransparentDataEncryptionActivity.
24255func (tdea TransparentDataEncryptionActivity) MarshalJSON() ([]byte, error) {
24256	objectMap := make(map[string]interface{})
24257	if tdea.TransparentDataEncryptionActivityProperties != nil {
24258		objectMap["properties"] = tdea.TransparentDataEncryptionActivityProperties
24259	}
24260	return json.Marshal(objectMap)
24261}
24262
24263// UnmarshalJSON is the custom unmarshaler for TransparentDataEncryptionActivity struct.
24264func (tdea *TransparentDataEncryptionActivity) UnmarshalJSON(body []byte) error {
24265	var m map[string]*json.RawMessage
24266	err := json.Unmarshal(body, &m)
24267	if err != nil {
24268		return err
24269	}
24270	for k, v := range m {
24271		switch k {
24272		case "location":
24273			if v != nil {
24274				var location string
24275				err = json.Unmarshal(*v, &location)
24276				if err != nil {
24277					return err
24278				}
24279				tdea.Location = &location
24280			}
24281		case "properties":
24282			if v != nil {
24283				var transparentDataEncryptionActivityProperties TransparentDataEncryptionActivityProperties
24284				err = json.Unmarshal(*v, &transparentDataEncryptionActivityProperties)
24285				if err != nil {
24286					return err
24287				}
24288				tdea.TransparentDataEncryptionActivityProperties = &transparentDataEncryptionActivityProperties
24289			}
24290		case "id":
24291			if v != nil {
24292				var ID string
24293				err = json.Unmarshal(*v, &ID)
24294				if err != nil {
24295					return err
24296				}
24297				tdea.ID = &ID
24298			}
24299		case "name":
24300			if v != nil {
24301				var name string
24302				err = json.Unmarshal(*v, &name)
24303				if err != nil {
24304					return err
24305				}
24306				tdea.Name = &name
24307			}
24308		case "type":
24309			if v != nil {
24310				var typeVar string
24311				err = json.Unmarshal(*v, &typeVar)
24312				if err != nil {
24313					return err
24314				}
24315				tdea.Type = &typeVar
24316			}
24317		}
24318	}
24319
24320	return nil
24321}
24322
24323// TransparentDataEncryptionActivityListResult represents the response to a list database transparent data
24324// encryption activity request.
24325type TransparentDataEncryptionActivityListResult struct {
24326	autorest.Response `json:"-"`
24327	// Value - The list of database transparent data encryption activities.
24328	Value *[]TransparentDataEncryptionActivity `json:"value,omitempty"`
24329}
24330
24331// TransparentDataEncryptionActivityProperties represents the properties of a database transparent data
24332// encryption Scan.
24333type TransparentDataEncryptionActivityProperties struct {
24334	// Status - READ-ONLY; The status of the database. Possible values include: 'Encrypting', 'Decrypting'
24335	Status TransparentDataEncryptionActivityStatus `json:"status,omitempty"`
24336	// PercentComplete - READ-ONLY; The percent complete of the transparent data encryption scan for a database.
24337	PercentComplete *float64 `json:"percentComplete,omitempty"`
24338}
24339
24340// MarshalJSON is the custom marshaler for TransparentDataEncryptionActivityProperties.
24341func (tdeap TransparentDataEncryptionActivityProperties) MarshalJSON() ([]byte, error) {
24342	objectMap := make(map[string]interface{})
24343	return json.Marshal(objectMap)
24344}
24345
24346// TransparentDataEncryptionProperties represents the properties of a database transparent data encryption.
24347type TransparentDataEncryptionProperties struct {
24348	// Status - The status of the database transparent data encryption. Possible values include: 'TransparentDataEncryptionStatusEnabled', 'TransparentDataEncryptionStatusDisabled'
24349	Status TransparentDataEncryptionStatus `json:"status,omitempty"`
24350}
24351
24352// UnlinkParameters represents the parameters for Unlink Replication Link request.
24353type UnlinkParameters struct {
24354	// ForcedTermination - Determines whether link will be terminated in a forced or a friendly way.
24355	ForcedTermination *bool `json:"forcedTermination,omitempty"`
24356}
24357
24358// UpsertManagedServerOperationParameters ...
24359type UpsertManagedServerOperationParameters struct {
24360	Family          *string `json:"family,omitempty"`
24361	Tier            *string `json:"tier,omitempty"`
24362	VCores          *int32  `json:"vCores,omitempty"`
24363	StorageSizeInGB *int32  `json:"storageSizeInGB,omitempty"`
24364}
24365
24366// UpsertManagedServerOperationStep ...
24367type UpsertManagedServerOperationStep struct {
24368	Order *int32  `json:"order,omitempty"`
24369	Name  *string `json:"name,omitempty"`
24370	// Status - Possible values include: 'StatusNotStarted', 'StatusInProgress', 'StatusSlowedDown', 'StatusCompleted', 'StatusFailed', 'StatusCanceled'
24371	Status Status `json:"status,omitempty"`
24372}
24373
24374// Usage ARM usage.
24375type Usage struct {
24376	// ID - READ-ONLY; Resource ID.
24377	ID *string `json:"id,omitempty"`
24378	// Name - READ-ONLY; Resource name.
24379	Name *Name `json:"name,omitempty"`
24380	// Type - READ-ONLY; Resource type.
24381	Type *string `json:"type,omitempty"`
24382	// Unit - READ-ONLY; Usage unit.
24383	Unit *string `json:"unit,omitempty"`
24384	// CurrentValue - READ-ONLY; Usage current value.
24385	CurrentValue *int32 `json:"currentValue,omitempty"`
24386	// Limit - READ-ONLY; Usage limit.
24387	Limit *int32 `json:"limit,omitempty"`
24388	// RequestedLimit - READ-ONLY; Usage requested limit.
24389	RequestedLimit *int32 `json:"requestedLimit,omitempty"`
24390}
24391
24392// MarshalJSON is the custom marshaler for Usage.
24393func (u Usage) MarshalJSON() ([]byte, error) {
24394	objectMap := make(map[string]interface{})
24395	return json.Marshal(objectMap)
24396}
24397
24398// UsageListResult a list of usages.
24399type UsageListResult struct {
24400	autorest.Response `json:"-"`
24401	// Value - READ-ONLY; Array of results.
24402	Value *[]Usage `json:"value,omitempty"`
24403	// NextLink - READ-ONLY; Link to retrieve next page of results.
24404	NextLink *string `json:"nextLink,omitempty"`
24405}
24406
24407// MarshalJSON is the custom marshaler for UsageListResult.
24408func (ulr UsageListResult) MarshalJSON() ([]byte, error) {
24409	objectMap := make(map[string]interface{})
24410	return json.Marshal(objectMap)
24411}
24412
24413// UsageListResultIterator provides access to a complete listing of Usage values.
24414type UsageListResultIterator struct {
24415	i    int
24416	page UsageListResultPage
24417}
24418
24419// NextWithContext advances to the next value.  If there was an error making
24420// the request the iterator does not advance and the error is returned.
24421func (iter *UsageListResultIterator) NextWithContext(ctx context.Context) (err error) {
24422	if tracing.IsEnabled() {
24423		ctx = tracing.StartSpan(ctx, fqdn+"/UsageListResultIterator.NextWithContext")
24424		defer func() {
24425			sc := -1
24426			if iter.Response().Response.Response != nil {
24427				sc = iter.Response().Response.Response.StatusCode
24428			}
24429			tracing.EndSpan(ctx, sc, err)
24430		}()
24431	}
24432	iter.i++
24433	if iter.i < len(iter.page.Values()) {
24434		return nil
24435	}
24436	err = iter.page.NextWithContext(ctx)
24437	if err != nil {
24438		iter.i--
24439		return err
24440	}
24441	iter.i = 0
24442	return nil
24443}
24444
24445// Next advances to the next value.  If there was an error making
24446// the request the iterator does not advance and the error is returned.
24447// Deprecated: Use NextWithContext() instead.
24448func (iter *UsageListResultIterator) Next() error {
24449	return iter.NextWithContext(context.Background())
24450}
24451
24452// NotDone returns true if the enumeration should be started or is not yet complete.
24453func (iter UsageListResultIterator) NotDone() bool {
24454	return iter.page.NotDone() && iter.i < len(iter.page.Values())
24455}
24456
24457// Response returns the raw server response from the last page request.
24458func (iter UsageListResultIterator) Response() UsageListResult {
24459	return iter.page.Response()
24460}
24461
24462// Value returns the current value or a zero-initialized value if the
24463// iterator has advanced beyond the end of the collection.
24464func (iter UsageListResultIterator) Value() Usage {
24465	if !iter.page.NotDone() {
24466		return Usage{}
24467	}
24468	return iter.page.Values()[iter.i]
24469}
24470
24471// Creates a new instance of the UsageListResultIterator type.
24472func NewUsageListResultIterator(page UsageListResultPage) UsageListResultIterator {
24473	return UsageListResultIterator{page: page}
24474}
24475
24476// IsEmpty returns true if the ListResult contains no values.
24477func (ulr UsageListResult) IsEmpty() bool {
24478	return ulr.Value == nil || len(*ulr.Value) == 0
24479}
24480
24481// hasNextLink returns true if the NextLink is not empty.
24482func (ulr UsageListResult) hasNextLink() bool {
24483	return ulr.NextLink != nil && len(*ulr.NextLink) != 0
24484}
24485
24486// usageListResultPreparer prepares a request to retrieve the next set of results.
24487// It returns nil if no more results exist.
24488func (ulr UsageListResult) usageListResultPreparer(ctx context.Context) (*http.Request, error) {
24489	if !ulr.hasNextLink() {
24490		return nil, nil
24491	}
24492	return autorest.Prepare((&http.Request{}).WithContext(ctx),
24493		autorest.AsJSON(),
24494		autorest.AsGet(),
24495		autorest.WithBaseURL(to.String(ulr.NextLink)))
24496}
24497
24498// UsageListResultPage contains a page of Usage values.
24499type UsageListResultPage struct {
24500	fn  func(context.Context, UsageListResult) (UsageListResult, error)
24501	ulr UsageListResult
24502}
24503
24504// NextWithContext advances to the next page of values.  If there was an error making
24505// the request the page does not advance and the error is returned.
24506func (page *UsageListResultPage) NextWithContext(ctx context.Context) (err error) {
24507	if tracing.IsEnabled() {
24508		ctx = tracing.StartSpan(ctx, fqdn+"/UsageListResultPage.NextWithContext")
24509		defer func() {
24510			sc := -1
24511			if page.Response().Response.Response != nil {
24512				sc = page.Response().Response.Response.StatusCode
24513			}
24514			tracing.EndSpan(ctx, sc, err)
24515		}()
24516	}
24517	for {
24518		next, err := page.fn(ctx, page.ulr)
24519		if err != nil {
24520			return err
24521		}
24522		page.ulr = next
24523		if !next.hasNextLink() || !next.IsEmpty() {
24524			break
24525		}
24526	}
24527	return nil
24528}
24529
24530// Next advances to the next page of values.  If there was an error making
24531// the request the page does not advance and the error is returned.
24532// Deprecated: Use NextWithContext() instead.
24533func (page *UsageListResultPage) Next() error {
24534	return page.NextWithContext(context.Background())
24535}
24536
24537// NotDone returns true if the page enumeration should be started or is not yet complete.
24538func (page UsageListResultPage) NotDone() bool {
24539	return !page.ulr.IsEmpty()
24540}
24541
24542// Response returns the raw server response from the last page request.
24543func (page UsageListResultPage) Response() UsageListResult {
24544	return page.ulr
24545}
24546
24547// Values returns the slice of values for the current page or nil if there are no values.
24548func (page UsageListResultPage) Values() []Usage {
24549	if page.ulr.IsEmpty() {
24550		return nil
24551	}
24552	return *page.ulr.Value
24553}
24554
24555// Creates a new instance of the UsageListResultPage type.
24556func NewUsageListResultPage(cur UsageListResult, getNextPage func(context.Context, UsageListResult) (UsageListResult, error)) UsageListResultPage {
24557	return UsageListResultPage{
24558		fn:  getNextPage,
24559		ulr: cur,
24560	}
24561}
24562
24563// VirtualCluster an Azure SQL virtual cluster.
24564type VirtualCluster struct {
24565	autorest.Response `json:"-"`
24566	// VirtualClusterProperties - Resource properties.
24567	*VirtualClusterProperties `json:"properties,omitempty"`
24568	// Location - Resource location.
24569	Location *string `json:"location,omitempty"`
24570	// Tags - Resource tags.
24571	Tags map[string]*string `json:"tags"`
24572	// ID - READ-ONLY; Resource ID.
24573	ID *string `json:"id,omitempty"`
24574	// Name - READ-ONLY; Resource name.
24575	Name *string `json:"name,omitempty"`
24576	// Type - READ-ONLY; Resource type.
24577	Type *string `json:"type,omitempty"`
24578}
24579
24580// MarshalJSON is the custom marshaler for VirtualCluster.
24581func (vc VirtualCluster) MarshalJSON() ([]byte, error) {
24582	objectMap := make(map[string]interface{})
24583	if vc.VirtualClusterProperties != nil {
24584		objectMap["properties"] = vc.VirtualClusterProperties
24585	}
24586	if vc.Location != nil {
24587		objectMap["location"] = vc.Location
24588	}
24589	if vc.Tags != nil {
24590		objectMap["tags"] = vc.Tags
24591	}
24592	return json.Marshal(objectMap)
24593}
24594
24595// UnmarshalJSON is the custom unmarshaler for VirtualCluster struct.
24596func (vc *VirtualCluster) UnmarshalJSON(body []byte) error {
24597	var m map[string]*json.RawMessage
24598	err := json.Unmarshal(body, &m)
24599	if err != nil {
24600		return err
24601	}
24602	for k, v := range m {
24603		switch k {
24604		case "properties":
24605			if v != nil {
24606				var virtualClusterProperties VirtualClusterProperties
24607				err = json.Unmarshal(*v, &virtualClusterProperties)
24608				if err != nil {
24609					return err
24610				}
24611				vc.VirtualClusterProperties = &virtualClusterProperties
24612			}
24613		case "location":
24614			if v != nil {
24615				var location string
24616				err = json.Unmarshal(*v, &location)
24617				if err != nil {
24618					return err
24619				}
24620				vc.Location = &location
24621			}
24622		case "tags":
24623			if v != nil {
24624				var tags map[string]*string
24625				err = json.Unmarshal(*v, &tags)
24626				if err != nil {
24627					return err
24628				}
24629				vc.Tags = tags
24630			}
24631		case "id":
24632			if v != nil {
24633				var ID string
24634				err = json.Unmarshal(*v, &ID)
24635				if err != nil {
24636					return err
24637				}
24638				vc.ID = &ID
24639			}
24640		case "name":
24641			if v != nil {
24642				var name string
24643				err = json.Unmarshal(*v, &name)
24644				if err != nil {
24645					return err
24646				}
24647				vc.Name = &name
24648			}
24649		case "type":
24650			if v != nil {
24651				var typeVar string
24652				err = json.Unmarshal(*v, &typeVar)
24653				if err != nil {
24654					return err
24655				}
24656				vc.Type = &typeVar
24657			}
24658		}
24659	}
24660
24661	return nil
24662}
24663
24664// VirtualClusterListResult a list of virtual clusters.
24665type VirtualClusterListResult struct {
24666	autorest.Response `json:"-"`
24667	// Value - READ-ONLY; Array of results.
24668	Value *[]VirtualCluster `json:"value,omitempty"`
24669	// NextLink - READ-ONLY; Link to retrieve next page of results.
24670	NextLink *string `json:"nextLink,omitempty"`
24671}
24672
24673// MarshalJSON is the custom marshaler for VirtualClusterListResult.
24674func (vclr VirtualClusterListResult) MarshalJSON() ([]byte, error) {
24675	objectMap := make(map[string]interface{})
24676	return json.Marshal(objectMap)
24677}
24678
24679// VirtualClusterListResultIterator provides access to a complete listing of VirtualCluster values.
24680type VirtualClusterListResultIterator struct {
24681	i    int
24682	page VirtualClusterListResultPage
24683}
24684
24685// NextWithContext advances to the next value.  If there was an error making
24686// the request the iterator does not advance and the error is returned.
24687func (iter *VirtualClusterListResultIterator) NextWithContext(ctx context.Context) (err error) {
24688	if tracing.IsEnabled() {
24689		ctx = tracing.StartSpan(ctx, fqdn+"/VirtualClusterListResultIterator.NextWithContext")
24690		defer func() {
24691			sc := -1
24692			if iter.Response().Response.Response != nil {
24693				sc = iter.Response().Response.Response.StatusCode
24694			}
24695			tracing.EndSpan(ctx, sc, err)
24696		}()
24697	}
24698	iter.i++
24699	if iter.i < len(iter.page.Values()) {
24700		return nil
24701	}
24702	err = iter.page.NextWithContext(ctx)
24703	if err != nil {
24704		iter.i--
24705		return err
24706	}
24707	iter.i = 0
24708	return nil
24709}
24710
24711// Next advances to the next value.  If there was an error making
24712// the request the iterator does not advance and the error is returned.
24713// Deprecated: Use NextWithContext() instead.
24714func (iter *VirtualClusterListResultIterator) Next() error {
24715	return iter.NextWithContext(context.Background())
24716}
24717
24718// NotDone returns true if the enumeration should be started or is not yet complete.
24719func (iter VirtualClusterListResultIterator) NotDone() bool {
24720	return iter.page.NotDone() && iter.i < len(iter.page.Values())
24721}
24722
24723// Response returns the raw server response from the last page request.
24724func (iter VirtualClusterListResultIterator) Response() VirtualClusterListResult {
24725	return iter.page.Response()
24726}
24727
24728// Value returns the current value or a zero-initialized value if the
24729// iterator has advanced beyond the end of the collection.
24730func (iter VirtualClusterListResultIterator) Value() VirtualCluster {
24731	if !iter.page.NotDone() {
24732		return VirtualCluster{}
24733	}
24734	return iter.page.Values()[iter.i]
24735}
24736
24737// Creates a new instance of the VirtualClusterListResultIterator type.
24738func NewVirtualClusterListResultIterator(page VirtualClusterListResultPage) VirtualClusterListResultIterator {
24739	return VirtualClusterListResultIterator{page: page}
24740}
24741
24742// IsEmpty returns true if the ListResult contains no values.
24743func (vclr VirtualClusterListResult) IsEmpty() bool {
24744	return vclr.Value == nil || len(*vclr.Value) == 0
24745}
24746
24747// hasNextLink returns true if the NextLink is not empty.
24748func (vclr VirtualClusterListResult) hasNextLink() bool {
24749	return vclr.NextLink != nil && len(*vclr.NextLink) != 0
24750}
24751
24752// virtualClusterListResultPreparer prepares a request to retrieve the next set of results.
24753// It returns nil if no more results exist.
24754func (vclr VirtualClusterListResult) virtualClusterListResultPreparer(ctx context.Context) (*http.Request, error) {
24755	if !vclr.hasNextLink() {
24756		return nil, nil
24757	}
24758	return autorest.Prepare((&http.Request{}).WithContext(ctx),
24759		autorest.AsJSON(),
24760		autorest.AsGet(),
24761		autorest.WithBaseURL(to.String(vclr.NextLink)))
24762}
24763
24764// VirtualClusterListResultPage contains a page of VirtualCluster values.
24765type VirtualClusterListResultPage struct {
24766	fn   func(context.Context, VirtualClusterListResult) (VirtualClusterListResult, error)
24767	vclr VirtualClusterListResult
24768}
24769
24770// NextWithContext advances to the next page of values.  If there was an error making
24771// the request the page does not advance and the error is returned.
24772func (page *VirtualClusterListResultPage) NextWithContext(ctx context.Context) (err error) {
24773	if tracing.IsEnabled() {
24774		ctx = tracing.StartSpan(ctx, fqdn+"/VirtualClusterListResultPage.NextWithContext")
24775		defer func() {
24776			sc := -1
24777			if page.Response().Response.Response != nil {
24778				sc = page.Response().Response.Response.StatusCode
24779			}
24780			tracing.EndSpan(ctx, sc, err)
24781		}()
24782	}
24783	for {
24784		next, err := page.fn(ctx, page.vclr)
24785		if err != nil {
24786			return err
24787		}
24788		page.vclr = next
24789		if !next.hasNextLink() || !next.IsEmpty() {
24790			break
24791		}
24792	}
24793	return nil
24794}
24795
24796// Next advances to the next page of values.  If there was an error making
24797// the request the page does not advance and the error is returned.
24798// Deprecated: Use NextWithContext() instead.
24799func (page *VirtualClusterListResultPage) Next() error {
24800	return page.NextWithContext(context.Background())
24801}
24802
24803// NotDone returns true if the page enumeration should be started or is not yet complete.
24804func (page VirtualClusterListResultPage) NotDone() bool {
24805	return !page.vclr.IsEmpty()
24806}
24807
24808// Response returns the raw server response from the last page request.
24809func (page VirtualClusterListResultPage) Response() VirtualClusterListResult {
24810	return page.vclr
24811}
24812
24813// Values returns the slice of values for the current page or nil if there are no values.
24814func (page VirtualClusterListResultPage) Values() []VirtualCluster {
24815	if page.vclr.IsEmpty() {
24816		return nil
24817	}
24818	return *page.vclr.Value
24819}
24820
24821// Creates a new instance of the VirtualClusterListResultPage type.
24822func NewVirtualClusterListResultPage(cur VirtualClusterListResult, getNextPage func(context.Context, VirtualClusterListResult) (VirtualClusterListResult, error)) VirtualClusterListResultPage {
24823	return VirtualClusterListResultPage{
24824		fn:   getNextPage,
24825		vclr: cur,
24826	}
24827}
24828
24829// VirtualClusterProperties the properties of a virtual cluster.
24830type VirtualClusterProperties struct {
24831	// SubnetID - READ-ONLY; Subnet resource ID for the virtual cluster.
24832	SubnetID *string `json:"subnetId,omitempty"`
24833	// Family - If the service has different generations of hardware, for the same SKU, then that can be captured here.
24834	Family *string `json:"family,omitempty"`
24835	// ChildResources - READ-ONLY; List of resources in this virtual cluster.
24836	ChildResources *[]string `json:"childResources,omitempty"`
24837}
24838
24839// MarshalJSON is the custom marshaler for VirtualClusterProperties.
24840func (vcp VirtualClusterProperties) MarshalJSON() ([]byte, error) {
24841	objectMap := make(map[string]interface{})
24842	if vcp.Family != nil {
24843		objectMap["family"] = vcp.Family
24844	}
24845	return json.Marshal(objectMap)
24846}
24847
24848// VirtualClustersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
24849// operation.
24850type VirtualClustersDeleteFuture struct {
24851	azure.FutureAPI
24852	// Result returns the result of the asynchronous operation.
24853	// If the operation has not completed it will return an error.
24854	Result func(VirtualClustersClient) (autorest.Response, error)
24855}
24856
24857// UnmarshalJSON is the custom unmarshaller for CreateFuture.
24858func (future *VirtualClustersDeleteFuture) UnmarshalJSON(body []byte) error {
24859	var azFuture azure.Future
24860	if err := json.Unmarshal(body, &azFuture); err != nil {
24861		return err
24862	}
24863	future.FutureAPI = &azFuture
24864	future.Result = future.result
24865	return nil
24866}
24867
24868// result is the default implementation for VirtualClustersDeleteFuture.Result.
24869func (future *VirtualClustersDeleteFuture) result(client VirtualClustersClient) (ar autorest.Response, err error) {
24870	var done bool
24871	done, err = future.DoneWithContext(context.Background(), client)
24872	if err != nil {
24873		err = autorest.NewErrorWithError(err, "sql.VirtualClustersDeleteFuture", "Result", future.Response(), "Polling failure")
24874		return
24875	}
24876	if !done {
24877		ar.Response = future.Response()
24878		err = azure.NewAsyncOpIncompleteError("sql.VirtualClustersDeleteFuture")
24879		return
24880	}
24881	ar.Response = future.Response()
24882	return
24883}
24884
24885// VirtualClustersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
24886// operation.
24887type VirtualClustersUpdateFuture struct {
24888	azure.FutureAPI
24889	// Result returns the result of the asynchronous operation.
24890	// If the operation has not completed it will return an error.
24891	Result func(VirtualClustersClient) (VirtualCluster, error)
24892}
24893
24894// UnmarshalJSON is the custom unmarshaller for CreateFuture.
24895func (future *VirtualClustersUpdateFuture) UnmarshalJSON(body []byte) error {
24896	var azFuture azure.Future
24897	if err := json.Unmarshal(body, &azFuture); err != nil {
24898		return err
24899	}
24900	future.FutureAPI = &azFuture
24901	future.Result = future.result
24902	return nil
24903}
24904
24905// result is the default implementation for VirtualClustersUpdateFuture.Result.
24906func (future *VirtualClustersUpdateFuture) result(client VirtualClustersClient) (vc VirtualCluster, err error) {
24907	var done bool
24908	done, err = future.DoneWithContext(context.Background(), client)
24909	if err != nil {
24910		err = autorest.NewErrorWithError(err, "sql.VirtualClustersUpdateFuture", "Result", future.Response(), "Polling failure")
24911		return
24912	}
24913	if !done {
24914		vc.Response.Response = future.Response()
24915		err = azure.NewAsyncOpIncompleteError("sql.VirtualClustersUpdateFuture")
24916		return
24917	}
24918	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
24919	if vc.Response.Response, err = future.GetResult(sender); err == nil && vc.Response.Response.StatusCode != http.StatusNoContent {
24920		vc, err = client.UpdateResponder(vc.Response.Response)
24921		if err != nil {
24922			err = autorest.NewErrorWithError(err, "sql.VirtualClustersUpdateFuture", "Result", vc.Response.Response, "Failure responding to request")
24923		}
24924	}
24925	return
24926}
24927
24928// VirtualClusterUpdate an update request for an Azure SQL Database virtual cluster.
24929type VirtualClusterUpdate struct {
24930	// VirtualClusterProperties - Resource properties.
24931	*VirtualClusterProperties `json:"properties,omitempty"`
24932	// Tags - Resource tags.
24933	Tags map[string]*string `json:"tags"`
24934}
24935
24936// MarshalJSON is the custom marshaler for VirtualClusterUpdate.
24937func (vcu VirtualClusterUpdate) MarshalJSON() ([]byte, error) {
24938	objectMap := make(map[string]interface{})
24939	if vcu.VirtualClusterProperties != nil {
24940		objectMap["properties"] = vcu.VirtualClusterProperties
24941	}
24942	if vcu.Tags != nil {
24943		objectMap["tags"] = vcu.Tags
24944	}
24945	return json.Marshal(objectMap)
24946}
24947
24948// UnmarshalJSON is the custom unmarshaler for VirtualClusterUpdate struct.
24949func (vcu *VirtualClusterUpdate) UnmarshalJSON(body []byte) error {
24950	var m map[string]*json.RawMessage
24951	err := json.Unmarshal(body, &m)
24952	if err != nil {
24953		return err
24954	}
24955	for k, v := range m {
24956		switch k {
24957		case "properties":
24958			if v != nil {
24959				var virtualClusterProperties VirtualClusterProperties
24960				err = json.Unmarshal(*v, &virtualClusterProperties)
24961				if err != nil {
24962					return err
24963				}
24964				vcu.VirtualClusterProperties = &virtualClusterProperties
24965			}
24966		case "tags":
24967			if v != nil {
24968				var tags map[string]*string
24969				err = json.Unmarshal(*v, &tags)
24970				if err != nil {
24971					return err
24972				}
24973				vcu.Tags = tags
24974			}
24975		}
24976	}
24977
24978	return nil
24979}
24980
24981// VirtualNetworkRule a virtual network rule.
24982type VirtualNetworkRule struct {
24983	autorest.Response `json:"-"`
24984	// VirtualNetworkRuleProperties - Resource properties.
24985	*VirtualNetworkRuleProperties `json:"properties,omitempty"`
24986	// ID - READ-ONLY; Resource ID.
24987	ID *string `json:"id,omitempty"`
24988	// Name - READ-ONLY; Resource name.
24989	Name *string `json:"name,omitempty"`
24990	// Type - READ-ONLY; Resource type.
24991	Type *string `json:"type,omitempty"`
24992}
24993
24994// MarshalJSON is the custom marshaler for VirtualNetworkRule.
24995func (vnr VirtualNetworkRule) MarshalJSON() ([]byte, error) {
24996	objectMap := make(map[string]interface{})
24997	if vnr.VirtualNetworkRuleProperties != nil {
24998		objectMap["properties"] = vnr.VirtualNetworkRuleProperties
24999	}
25000	return json.Marshal(objectMap)
25001}
25002
25003// UnmarshalJSON is the custom unmarshaler for VirtualNetworkRule struct.
25004func (vnr *VirtualNetworkRule) UnmarshalJSON(body []byte) error {
25005	var m map[string]*json.RawMessage
25006	err := json.Unmarshal(body, &m)
25007	if err != nil {
25008		return err
25009	}
25010	for k, v := range m {
25011		switch k {
25012		case "properties":
25013			if v != nil {
25014				var virtualNetworkRuleProperties VirtualNetworkRuleProperties
25015				err = json.Unmarshal(*v, &virtualNetworkRuleProperties)
25016				if err != nil {
25017					return err
25018				}
25019				vnr.VirtualNetworkRuleProperties = &virtualNetworkRuleProperties
25020			}
25021		case "id":
25022			if v != nil {
25023				var ID string
25024				err = json.Unmarshal(*v, &ID)
25025				if err != nil {
25026					return err
25027				}
25028				vnr.ID = &ID
25029			}
25030		case "name":
25031			if v != nil {
25032				var name string
25033				err = json.Unmarshal(*v, &name)
25034				if err != nil {
25035					return err
25036				}
25037				vnr.Name = &name
25038			}
25039		case "type":
25040			if v != nil {
25041				var typeVar string
25042				err = json.Unmarshal(*v, &typeVar)
25043				if err != nil {
25044					return err
25045				}
25046				vnr.Type = &typeVar
25047			}
25048		}
25049	}
25050
25051	return nil
25052}
25053
25054// VirtualNetworkRuleListResult a list of virtual network rules.
25055type VirtualNetworkRuleListResult struct {
25056	autorest.Response `json:"-"`
25057	// Value - READ-ONLY; Array of results.
25058	Value *[]VirtualNetworkRule `json:"value,omitempty"`
25059	// NextLink - READ-ONLY; Link to retrieve next page of results.
25060	NextLink *string `json:"nextLink,omitempty"`
25061}
25062
25063// MarshalJSON is the custom marshaler for VirtualNetworkRuleListResult.
25064func (vnrlr VirtualNetworkRuleListResult) MarshalJSON() ([]byte, error) {
25065	objectMap := make(map[string]interface{})
25066	return json.Marshal(objectMap)
25067}
25068
25069// VirtualNetworkRuleListResultIterator provides access to a complete listing of VirtualNetworkRule values.
25070type VirtualNetworkRuleListResultIterator struct {
25071	i    int
25072	page VirtualNetworkRuleListResultPage
25073}
25074
25075// NextWithContext advances to the next value.  If there was an error making
25076// the request the iterator does not advance and the error is returned.
25077func (iter *VirtualNetworkRuleListResultIterator) NextWithContext(ctx context.Context) (err error) {
25078	if tracing.IsEnabled() {
25079		ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkRuleListResultIterator.NextWithContext")
25080		defer func() {
25081			sc := -1
25082			if iter.Response().Response.Response != nil {
25083				sc = iter.Response().Response.Response.StatusCode
25084			}
25085			tracing.EndSpan(ctx, sc, err)
25086		}()
25087	}
25088	iter.i++
25089	if iter.i < len(iter.page.Values()) {
25090		return nil
25091	}
25092	err = iter.page.NextWithContext(ctx)
25093	if err != nil {
25094		iter.i--
25095		return err
25096	}
25097	iter.i = 0
25098	return nil
25099}
25100
25101// Next advances to the next value.  If there was an error making
25102// the request the iterator does not advance and the error is returned.
25103// Deprecated: Use NextWithContext() instead.
25104func (iter *VirtualNetworkRuleListResultIterator) Next() error {
25105	return iter.NextWithContext(context.Background())
25106}
25107
25108// NotDone returns true if the enumeration should be started or is not yet complete.
25109func (iter VirtualNetworkRuleListResultIterator) NotDone() bool {
25110	return iter.page.NotDone() && iter.i < len(iter.page.Values())
25111}
25112
25113// Response returns the raw server response from the last page request.
25114func (iter VirtualNetworkRuleListResultIterator) Response() VirtualNetworkRuleListResult {
25115	return iter.page.Response()
25116}
25117
25118// Value returns the current value or a zero-initialized value if the
25119// iterator has advanced beyond the end of the collection.
25120func (iter VirtualNetworkRuleListResultIterator) Value() VirtualNetworkRule {
25121	if !iter.page.NotDone() {
25122		return VirtualNetworkRule{}
25123	}
25124	return iter.page.Values()[iter.i]
25125}
25126
25127// Creates a new instance of the VirtualNetworkRuleListResultIterator type.
25128func NewVirtualNetworkRuleListResultIterator(page VirtualNetworkRuleListResultPage) VirtualNetworkRuleListResultIterator {
25129	return VirtualNetworkRuleListResultIterator{page: page}
25130}
25131
25132// IsEmpty returns true if the ListResult contains no values.
25133func (vnrlr VirtualNetworkRuleListResult) IsEmpty() bool {
25134	return vnrlr.Value == nil || len(*vnrlr.Value) == 0
25135}
25136
25137// hasNextLink returns true if the NextLink is not empty.
25138func (vnrlr VirtualNetworkRuleListResult) hasNextLink() bool {
25139	return vnrlr.NextLink != nil && len(*vnrlr.NextLink) != 0
25140}
25141
25142// virtualNetworkRuleListResultPreparer prepares a request to retrieve the next set of results.
25143// It returns nil if no more results exist.
25144func (vnrlr VirtualNetworkRuleListResult) virtualNetworkRuleListResultPreparer(ctx context.Context) (*http.Request, error) {
25145	if !vnrlr.hasNextLink() {
25146		return nil, nil
25147	}
25148	return autorest.Prepare((&http.Request{}).WithContext(ctx),
25149		autorest.AsJSON(),
25150		autorest.AsGet(),
25151		autorest.WithBaseURL(to.String(vnrlr.NextLink)))
25152}
25153
25154// VirtualNetworkRuleListResultPage contains a page of VirtualNetworkRule values.
25155type VirtualNetworkRuleListResultPage struct {
25156	fn    func(context.Context, VirtualNetworkRuleListResult) (VirtualNetworkRuleListResult, error)
25157	vnrlr VirtualNetworkRuleListResult
25158}
25159
25160// NextWithContext advances to the next page of values.  If there was an error making
25161// the request the page does not advance and the error is returned.
25162func (page *VirtualNetworkRuleListResultPage) NextWithContext(ctx context.Context) (err error) {
25163	if tracing.IsEnabled() {
25164		ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkRuleListResultPage.NextWithContext")
25165		defer func() {
25166			sc := -1
25167			if page.Response().Response.Response != nil {
25168				sc = page.Response().Response.Response.StatusCode
25169			}
25170			tracing.EndSpan(ctx, sc, err)
25171		}()
25172	}
25173	for {
25174		next, err := page.fn(ctx, page.vnrlr)
25175		if err != nil {
25176			return err
25177		}
25178		page.vnrlr = next
25179		if !next.hasNextLink() || !next.IsEmpty() {
25180			break
25181		}
25182	}
25183	return nil
25184}
25185
25186// Next advances to the next page of values.  If there was an error making
25187// the request the page does not advance and the error is returned.
25188// Deprecated: Use NextWithContext() instead.
25189func (page *VirtualNetworkRuleListResultPage) Next() error {
25190	return page.NextWithContext(context.Background())
25191}
25192
25193// NotDone returns true if the page enumeration should be started or is not yet complete.
25194func (page VirtualNetworkRuleListResultPage) NotDone() bool {
25195	return !page.vnrlr.IsEmpty()
25196}
25197
25198// Response returns the raw server response from the last page request.
25199func (page VirtualNetworkRuleListResultPage) Response() VirtualNetworkRuleListResult {
25200	return page.vnrlr
25201}
25202
25203// Values returns the slice of values for the current page or nil if there are no values.
25204func (page VirtualNetworkRuleListResultPage) Values() []VirtualNetworkRule {
25205	if page.vnrlr.IsEmpty() {
25206		return nil
25207	}
25208	return *page.vnrlr.Value
25209}
25210
25211// Creates a new instance of the VirtualNetworkRuleListResultPage type.
25212func NewVirtualNetworkRuleListResultPage(cur VirtualNetworkRuleListResult, getNextPage func(context.Context, VirtualNetworkRuleListResult) (VirtualNetworkRuleListResult, error)) VirtualNetworkRuleListResultPage {
25213	return VirtualNetworkRuleListResultPage{
25214		fn:    getNextPage,
25215		vnrlr: cur,
25216	}
25217}
25218
25219// VirtualNetworkRuleProperties properties of a virtual network rule.
25220type VirtualNetworkRuleProperties struct {
25221	// VirtualNetworkSubnetID - The ARM resource id of the virtual network subnet.
25222	VirtualNetworkSubnetID *string `json:"virtualNetworkSubnetId,omitempty"`
25223	// IgnoreMissingVnetServiceEndpoint - Create firewall rule before the virtual network has vnet service endpoint enabled.
25224	IgnoreMissingVnetServiceEndpoint *bool `json:"ignoreMissingVnetServiceEndpoint,omitempty"`
25225	// State - READ-ONLY; Virtual Network Rule State. Possible values include: 'VirtualNetworkRuleStateInitializing', 'VirtualNetworkRuleStateInProgress', 'VirtualNetworkRuleStateReady', 'VirtualNetworkRuleStateDeleting', 'VirtualNetworkRuleStateUnknown'
25226	State VirtualNetworkRuleState `json:"state,omitempty"`
25227}
25228
25229// MarshalJSON is the custom marshaler for VirtualNetworkRuleProperties.
25230func (vnrp VirtualNetworkRuleProperties) MarshalJSON() ([]byte, error) {
25231	objectMap := make(map[string]interface{})
25232	if vnrp.VirtualNetworkSubnetID != nil {
25233		objectMap["virtualNetworkSubnetId"] = vnrp.VirtualNetworkSubnetID
25234	}
25235	if vnrp.IgnoreMissingVnetServiceEndpoint != nil {
25236		objectMap["ignoreMissingVnetServiceEndpoint"] = vnrp.IgnoreMissingVnetServiceEndpoint
25237	}
25238	return json.Marshal(objectMap)
25239}
25240
25241// VirtualNetworkRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
25242// long-running operation.
25243type VirtualNetworkRulesCreateOrUpdateFuture struct {
25244	azure.FutureAPI
25245	// Result returns the result of the asynchronous operation.
25246	// If the operation has not completed it will return an error.
25247	Result func(VirtualNetworkRulesClient) (VirtualNetworkRule, error)
25248}
25249
25250// UnmarshalJSON is the custom unmarshaller for CreateFuture.
25251func (future *VirtualNetworkRulesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
25252	var azFuture azure.Future
25253	if err := json.Unmarshal(body, &azFuture); err != nil {
25254		return err
25255	}
25256	future.FutureAPI = &azFuture
25257	future.Result = future.result
25258	return nil
25259}
25260
25261// result is the default implementation for VirtualNetworkRulesCreateOrUpdateFuture.Result.
25262func (future *VirtualNetworkRulesCreateOrUpdateFuture) result(client VirtualNetworkRulesClient) (vnr VirtualNetworkRule, err error) {
25263	var done bool
25264	done, err = future.DoneWithContext(context.Background(), client)
25265	if err != nil {
25266		err = autorest.NewErrorWithError(err, "sql.VirtualNetworkRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
25267		return
25268	}
25269	if !done {
25270		vnr.Response.Response = future.Response()
25271		err = azure.NewAsyncOpIncompleteError("sql.VirtualNetworkRulesCreateOrUpdateFuture")
25272		return
25273	}
25274	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
25275	if vnr.Response.Response, err = future.GetResult(sender); err == nil && vnr.Response.Response.StatusCode != http.StatusNoContent {
25276		vnr, err = client.CreateOrUpdateResponder(vnr.Response.Response)
25277		if err != nil {
25278			err = autorest.NewErrorWithError(err, "sql.VirtualNetworkRulesCreateOrUpdateFuture", "Result", vnr.Response.Response, "Failure responding to request")
25279		}
25280	}
25281	return
25282}
25283
25284// VirtualNetworkRulesDeleteFuture an abstraction for monitoring and retrieving the results of a
25285// long-running operation.
25286type VirtualNetworkRulesDeleteFuture struct {
25287	azure.FutureAPI
25288	// Result returns the result of the asynchronous operation.
25289	// If the operation has not completed it will return an error.
25290	Result func(VirtualNetworkRulesClient) (autorest.Response, error)
25291}
25292
25293// UnmarshalJSON is the custom unmarshaller for CreateFuture.
25294func (future *VirtualNetworkRulesDeleteFuture) UnmarshalJSON(body []byte) error {
25295	var azFuture azure.Future
25296	if err := json.Unmarshal(body, &azFuture); err != nil {
25297		return err
25298	}
25299	future.FutureAPI = &azFuture
25300	future.Result = future.result
25301	return nil
25302}
25303
25304// result is the default implementation for VirtualNetworkRulesDeleteFuture.Result.
25305func (future *VirtualNetworkRulesDeleteFuture) result(client VirtualNetworkRulesClient) (ar autorest.Response, err error) {
25306	var done bool
25307	done, err = future.DoneWithContext(context.Background(), client)
25308	if err != nil {
25309		err = autorest.NewErrorWithError(err, "sql.VirtualNetworkRulesDeleteFuture", "Result", future.Response(), "Polling failure")
25310		return
25311	}
25312	if !done {
25313		ar.Response = future.Response()
25314		err = azure.NewAsyncOpIncompleteError("sql.VirtualNetworkRulesDeleteFuture")
25315		return
25316	}
25317	ar.Response = future.Response()
25318	return
25319}
25320
25321// VulnerabilityAssessmentRecurringScansProperties properties of a Vulnerability Assessment recurring
25322// scans.
25323type VulnerabilityAssessmentRecurringScansProperties struct {
25324	// IsEnabled - Recurring scans state.
25325	IsEnabled *bool `json:"isEnabled,omitempty"`
25326	// EmailSubscriptionAdmins - Specifies that the schedule scan notification will be is sent to the subscription administrators.
25327	EmailSubscriptionAdmins *bool `json:"emailSubscriptionAdmins,omitempty"`
25328	// Emails - Specifies an array of e-mail addresses to which the scan notification is sent.
25329	Emails *[]string `json:"emails,omitempty"`
25330}
25331
25332// VulnerabilityAssessmentScanError properties of a vulnerability assessment scan error.
25333type VulnerabilityAssessmentScanError struct {
25334	// Code - READ-ONLY; The error code.
25335	Code *string `json:"code,omitempty"`
25336	// Message - READ-ONLY; The error message.
25337	Message *string `json:"message,omitempty"`
25338}
25339
25340// MarshalJSON is the custom marshaler for VulnerabilityAssessmentScanError.
25341func (vase VulnerabilityAssessmentScanError) MarshalJSON() ([]byte, error) {
25342	objectMap := make(map[string]interface{})
25343	return json.Marshal(objectMap)
25344}
25345
25346// VulnerabilityAssessmentScanRecord a vulnerability assessment scan record.
25347type VulnerabilityAssessmentScanRecord struct {
25348	autorest.Response `json:"-"`
25349	// VulnerabilityAssessmentScanRecordProperties - Resource properties.
25350	*VulnerabilityAssessmentScanRecordProperties `json:"properties,omitempty"`
25351	// ID - READ-ONLY; Resource ID.
25352	ID *string `json:"id,omitempty"`
25353	// Name - READ-ONLY; Resource name.
25354	Name *string `json:"name,omitempty"`
25355	// Type - READ-ONLY; Resource type.
25356	Type *string `json:"type,omitempty"`
25357}
25358
25359// MarshalJSON is the custom marshaler for VulnerabilityAssessmentScanRecord.
25360func (vasr VulnerabilityAssessmentScanRecord) MarshalJSON() ([]byte, error) {
25361	objectMap := make(map[string]interface{})
25362	if vasr.VulnerabilityAssessmentScanRecordProperties != nil {
25363		objectMap["properties"] = vasr.VulnerabilityAssessmentScanRecordProperties
25364	}
25365	return json.Marshal(objectMap)
25366}
25367
25368// UnmarshalJSON is the custom unmarshaler for VulnerabilityAssessmentScanRecord struct.
25369func (vasr *VulnerabilityAssessmentScanRecord) UnmarshalJSON(body []byte) error {
25370	var m map[string]*json.RawMessage
25371	err := json.Unmarshal(body, &m)
25372	if err != nil {
25373		return err
25374	}
25375	for k, v := range m {
25376		switch k {
25377		case "properties":
25378			if v != nil {
25379				var vulnerabilityAssessmentScanRecordProperties VulnerabilityAssessmentScanRecordProperties
25380				err = json.Unmarshal(*v, &vulnerabilityAssessmentScanRecordProperties)
25381				if err != nil {
25382					return err
25383				}
25384				vasr.VulnerabilityAssessmentScanRecordProperties = &vulnerabilityAssessmentScanRecordProperties
25385			}
25386		case "id":
25387			if v != nil {
25388				var ID string
25389				err = json.Unmarshal(*v, &ID)
25390				if err != nil {
25391					return err
25392				}
25393				vasr.ID = &ID
25394			}
25395		case "name":
25396			if v != nil {
25397				var name string
25398				err = json.Unmarshal(*v, &name)
25399				if err != nil {
25400					return err
25401				}
25402				vasr.Name = &name
25403			}
25404		case "type":
25405			if v != nil {
25406				var typeVar string
25407				err = json.Unmarshal(*v, &typeVar)
25408				if err != nil {
25409					return err
25410				}
25411				vasr.Type = &typeVar
25412			}
25413		}
25414	}
25415
25416	return nil
25417}
25418
25419// VulnerabilityAssessmentScanRecordListResult a list of vulnerability assessment scan records.
25420type VulnerabilityAssessmentScanRecordListResult struct {
25421	autorest.Response `json:"-"`
25422	// Value - READ-ONLY; Array of results.
25423	Value *[]VulnerabilityAssessmentScanRecord `json:"value,omitempty"`
25424	// NextLink - READ-ONLY; Link to retrieve next page of results.
25425	NextLink *string `json:"nextLink,omitempty"`
25426}
25427
25428// MarshalJSON is the custom marshaler for VulnerabilityAssessmentScanRecordListResult.
25429func (vasrlr VulnerabilityAssessmentScanRecordListResult) MarshalJSON() ([]byte, error) {
25430	objectMap := make(map[string]interface{})
25431	return json.Marshal(objectMap)
25432}
25433
25434// VulnerabilityAssessmentScanRecordListResultIterator provides access to a complete listing of
25435// VulnerabilityAssessmentScanRecord values.
25436type VulnerabilityAssessmentScanRecordListResultIterator struct {
25437	i    int
25438	page VulnerabilityAssessmentScanRecordListResultPage
25439}
25440
25441// NextWithContext advances to the next value.  If there was an error making
25442// the request the iterator does not advance and the error is returned.
25443func (iter *VulnerabilityAssessmentScanRecordListResultIterator) NextWithContext(ctx context.Context) (err error) {
25444	if tracing.IsEnabled() {
25445		ctx = tracing.StartSpan(ctx, fqdn+"/VulnerabilityAssessmentScanRecordListResultIterator.NextWithContext")
25446		defer func() {
25447			sc := -1
25448			if iter.Response().Response.Response != nil {
25449				sc = iter.Response().Response.Response.StatusCode
25450			}
25451			tracing.EndSpan(ctx, sc, err)
25452		}()
25453	}
25454	iter.i++
25455	if iter.i < len(iter.page.Values()) {
25456		return nil
25457	}
25458	err = iter.page.NextWithContext(ctx)
25459	if err != nil {
25460		iter.i--
25461		return err
25462	}
25463	iter.i = 0
25464	return nil
25465}
25466
25467// Next advances to the next value.  If there was an error making
25468// the request the iterator does not advance and the error is returned.
25469// Deprecated: Use NextWithContext() instead.
25470func (iter *VulnerabilityAssessmentScanRecordListResultIterator) Next() error {
25471	return iter.NextWithContext(context.Background())
25472}
25473
25474// NotDone returns true if the enumeration should be started or is not yet complete.
25475func (iter VulnerabilityAssessmentScanRecordListResultIterator) NotDone() bool {
25476	return iter.page.NotDone() && iter.i < len(iter.page.Values())
25477}
25478
25479// Response returns the raw server response from the last page request.
25480func (iter VulnerabilityAssessmentScanRecordListResultIterator) Response() VulnerabilityAssessmentScanRecordListResult {
25481	return iter.page.Response()
25482}
25483
25484// Value returns the current value or a zero-initialized value if the
25485// iterator has advanced beyond the end of the collection.
25486func (iter VulnerabilityAssessmentScanRecordListResultIterator) Value() VulnerabilityAssessmentScanRecord {
25487	if !iter.page.NotDone() {
25488		return VulnerabilityAssessmentScanRecord{}
25489	}
25490	return iter.page.Values()[iter.i]
25491}
25492
25493// Creates a new instance of the VulnerabilityAssessmentScanRecordListResultIterator type.
25494func NewVulnerabilityAssessmentScanRecordListResultIterator(page VulnerabilityAssessmentScanRecordListResultPage) VulnerabilityAssessmentScanRecordListResultIterator {
25495	return VulnerabilityAssessmentScanRecordListResultIterator{page: page}
25496}
25497
25498// IsEmpty returns true if the ListResult contains no values.
25499func (vasrlr VulnerabilityAssessmentScanRecordListResult) IsEmpty() bool {
25500	return vasrlr.Value == nil || len(*vasrlr.Value) == 0
25501}
25502
25503// hasNextLink returns true if the NextLink is not empty.
25504func (vasrlr VulnerabilityAssessmentScanRecordListResult) hasNextLink() bool {
25505	return vasrlr.NextLink != nil && len(*vasrlr.NextLink) != 0
25506}
25507
25508// vulnerabilityAssessmentScanRecordListResultPreparer prepares a request to retrieve the next set of results.
25509// It returns nil if no more results exist.
25510func (vasrlr VulnerabilityAssessmentScanRecordListResult) vulnerabilityAssessmentScanRecordListResultPreparer(ctx context.Context) (*http.Request, error) {
25511	if !vasrlr.hasNextLink() {
25512		return nil, nil
25513	}
25514	return autorest.Prepare((&http.Request{}).WithContext(ctx),
25515		autorest.AsJSON(),
25516		autorest.AsGet(),
25517		autorest.WithBaseURL(to.String(vasrlr.NextLink)))
25518}
25519
25520// VulnerabilityAssessmentScanRecordListResultPage contains a page of VulnerabilityAssessmentScanRecord
25521// values.
25522type VulnerabilityAssessmentScanRecordListResultPage struct {
25523	fn     func(context.Context, VulnerabilityAssessmentScanRecordListResult) (VulnerabilityAssessmentScanRecordListResult, error)
25524	vasrlr VulnerabilityAssessmentScanRecordListResult
25525}
25526
25527// NextWithContext advances to the next page of values.  If there was an error making
25528// the request the page does not advance and the error is returned.
25529func (page *VulnerabilityAssessmentScanRecordListResultPage) NextWithContext(ctx context.Context) (err error) {
25530	if tracing.IsEnabled() {
25531		ctx = tracing.StartSpan(ctx, fqdn+"/VulnerabilityAssessmentScanRecordListResultPage.NextWithContext")
25532		defer func() {
25533			sc := -1
25534			if page.Response().Response.Response != nil {
25535				sc = page.Response().Response.Response.StatusCode
25536			}
25537			tracing.EndSpan(ctx, sc, err)
25538		}()
25539	}
25540	for {
25541		next, err := page.fn(ctx, page.vasrlr)
25542		if err != nil {
25543			return err
25544		}
25545		page.vasrlr = next
25546		if !next.hasNextLink() || !next.IsEmpty() {
25547			break
25548		}
25549	}
25550	return nil
25551}
25552
25553// Next advances to the next page of values.  If there was an error making
25554// the request the page does not advance and the error is returned.
25555// Deprecated: Use NextWithContext() instead.
25556func (page *VulnerabilityAssessmentScanRecordListResultPage) Next() error {
25557	return page.NextWithContext(context.Background())
25558}
25559
25560// NotDone returns true if the page enumeration should be started or is not yet complete.
25561func (page VulnerabilityAssessmentScanRecordListResultPage) NotDone() bool {
25562	return !page.vasrlr.IsEmpty()
25563}
25564
25565// Response returns the raw server response from the last page request.
25566func (page VulnerabilityAssessmentScanRecordListResultPage) Response() VulnerabilityAssessmentScanRecordListResult {
25567	return page.vasrlr
25568}
25569
25570// Values returns the slice of values for the current page or nil if there are no values.
25571func (page VulnerabilityAssessmentScanRecordListResultPage) Values() []VulnerabilityAssessmentScanRecord {
25572	if page.vasrlr.IsEmpty() {
25573		return nil
25574	}
25575	return *page.vasrlr.Value
25576}
25577
25578// Creates a new instance of the VulnerabilityAssessmentScanRecordListResultPage type.
25579func NewVulnerabilityAssessmentScanRecordListResultPage(cur VulnerabilityAssessmentScanRecordListResult, getNextPage func(context.Context, VulnerabilityAssessmentScanRecordListResult) (VulnerabilityAssessmentScanRecordListResult, error)) VulnerabilityAssessmentScanRecordListResultPage {
25580	return VulnerabilityAssessmentScanRecordListResultPage{
25581		fn:     getNextPage,
25582		vasrlr: cur,
25583	}
25584}
25585
25586// VulnerabilityAssessmentScanRecordProperties properties of a vulnerability assessment scan record.
25587type VulnerabilityAssessmentScanRecordProperties struct {
25588	// ScanID - READ-ONLY; The scan ID.
25589	ScanID *string `json:"scanId,omitempty"`
25590	// TriggerType - READ-ONLY; The scan trigger type. Possible values include: 'VulnerabilityAssessmentScanTriggerTypeOnDemand', 'VulnerabilityAssessmentScanTriggerTypeRecurring'
25591	TriggerType VulnerabilityAssessmentScanTriggerType `json:"triggerType,omitempty"`
25592	// State - READ-ONLY; The scan status. Possible values include: 'VulnerabilityAssessmentScanStatePassed', 'VulnerabilityAssessmentScanStateFailed', 'VulnerabilityAssessmentScanStateFailedToRun', 'VulnerabilityAssessmentScanStateInProgress'
25593	State VulnerabilityAssessmentScanState `json:"state,omitempty"`
25594	// StartTime - READ-ONLY; The scan start time (UTC).
25595	StartTime *date.Time `json:"startTime,omitempty"`
25596	// EndTime - READ-ONLY; The scan end time (UTC).
25597	EndTime *date.Time `json:"endTime,omitempty"`
25598	// Errors - READ-ONLY; The scan errors.
25599	Errors *[]VulnerabilityAssessmentScanError `json:"errors,omitempty"`
25600	// StorageContainerPath - READ-ONLY; The scan results storage container path.
25601	StorageContainerPath *string `json:"storageContainerPath,omitempty"`
25602	// NumberOfFailedSecurityChecks - READ-ONLY; The number of failed security checks.
25603	NumberOfFailedSecurityChecks *int32 `json:"numberOfFailedSecurityChecks,omitempty"`
25604}
25605
25606// MarshalJSON is the custom marshaler for VulnerabilityAssessmentScanRecordProperties.
25607func (vasrp VulnerabilityAssessmentScanRecordProperties) MarshalJSON() ([]byte, error) {
25608	objectMap := make(map[string]interface{})
25609	return json.Marshal(objectMap)
25610}
25611
25612// WorkloadClassifier workload classifier operations for a data warehouse
25613type WorkloadClassifier struct {
25614	autorest.Response `json:"-"`
25615	// WorkloadClassifierProperties - Resource properties.
25616	*WorkloadClassifierProperties `json:"properties,omitempty"`
25617	// ID - READ-ONLY; Resource ID.
25618	ID *string `json:"id,omitempty"`
25619	// Name - READ-ONLY; Resource name.
25620	Name *string `json:"name,omitempty"`
25621	// Type - READ-ONLY; Resource type.
25622	Type *string `json:"type,omitempty"`
25623}
25624
25625// MarshalJSON is the custom marshaler for WorkloadClassifier.
25626func (wc WorkloadClassifier) MarshalJSON() ([]byte, error) {
25627	objectMap := make(map[string]interface{})
25628	if wc.WorkloadClassifierProperties != nil {
25629		objectMap["properties"] = wc.WorkloadClassifierProperties
25630	}
25631	return json.Marshal(objectMap)
25632}
25633
25634// UnmarshalJSON is the custom unmarshaler for WorkloadClassifier struct.
25635func (wc *WorkloadClassifier) UnmarshalJSON(body []byte) error {
25636	var m map[string]*json.RawMessage
25637	err := json.Unmarshal(body, &m)
25638	if err != nil {
25639		return err
25640	}
25641	for k, v := range m {
25642		switch k {
25643		case "properties":
25644			if v != nil {
25645				var workloadClassifierProperties WorkloadClassifierProperties
25646				err = json.Unmarshal(*v, &workloadClassifierProperties)
25647				if err != nil {
25648					return err
25649				}
25650				wc.WorkloadClassifierProperties = &workloadClassifierProperties
25651			}
25652		case "id":
25653			if v != nil {
25654				var ID string
25655				err = json.Unmarshal(*v, &ID)
25656				if err != nil {
25657					return err
25658				}
25659				wc.ID = &ID
25660			}
25661		case "name":
25662			if v != nil {
25663				var name string
25664				err = json.Unmarshal(*v, &name)
25665				if err != nil {
25666					return err
25667				}
25668				wc.Name = &name
25669			}
25670		case "type":
25671			if v != nil {
25672				var typeVar string
25673				err = json.Unmarshal(*v, &typeVar)
25674				if err != nil {
25675					return err
25676				}
25677				wc.Type = &typeVar
25678			}
25679		}
25680	}
25681
25682	return nil
25683}
25684
25685// WorkloadClassifierListResult a list of workload classifiers for a workload group.
25686type WorkloadClassifierListResult struct {
25687	autorest.Response `json:"-"`
25688	// Value - READ-ONLY; Array of results.
25689	Value *[]WorkloadClassifier `json:"value,omitempty"`
25690	// NextLink - READ-ONLY; Link to retrieve next page of results.
25691	NextLink *string `json:"nextLink,omitempty"`
25692}
25693
25694// MarshalJSON is the custom marshaler for WorkloadClassifierListResult.
25695func (wclr WorkloadClassifierListResult) MarshalJSON() ([]byte, error) {
25696	objectMap := make(map[string]interface{})
25697	return json.Marshal(objectMap)
25698}
25699
25700// WorkloadClassifierListResultIterator provides access to a complete listing of WorkloadClassifier values.
25701type WorkloadClassifierListResultIterator struct {
25702	i    int
25703	page WorkloadClassifierListResultPage
25704}
25705
25706// NextWithContext advances to the next value.  If there was an error making
25707// the request the iterator does not advance and the error is returned.
25708func (iter *WorkloadClassifierListResultIterator) NextWithContext(ctx context.Context) (err error) {
25709	if tracing.IsEnabled() {
25710		ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadClassifierListResultIterator.NextWithContext")
25711		defer func() {
25712			sc := -1
25713			if iter.Response().Response.Response != nil {
25714				sc = iter.Response().Response.Response.StatusCode
25715			}
25716			tracing.EndSpan(ctx, sc, err)
25717		}()
25718	}
25719	iter.i++
25720	if iter.i < len(iter.page.Values()) {
25721		return nil
25722	}
25723	err = iter.page.NextWithContext(ctx)
25724	if err != nil {
25725		iter.i--
25726		return err
25727	}
25728	iter.i = 0
25729	return nil
25730}
25731
25732// Next advances to the next value.  If there was an error making
25733// the request the iterator does not advance and the error is returned.
25734// Deprecated: Use NextWithContext() instead.
25735func (iter *WorkloadClassifierListResultIterator) Next() error {
25736	return iter.NextWithContext(context.Background())
25737}
25738
25739// NotDone returns true if the enumeration should be started or is not yet complete.
25740func (iter WorkloadClassifierListResultIterator) NotDone() bool {
25741	return iter.page.NotDone() && iter.i < len(iter.page.Values())
25742}
25743
25744// Response returns the raw server response from the last page request.
25745func (iter WorkloadClassifierListResultIterator) Response() WorkloadClassifierListResult {
25746	return iter.page.Response()
25747}
25748
25749// Value returns the current value or a zero-initialized value if the
25750// iterator has advanced beyond the end of the collection.
25751func (iter WorkloadClassifierListResultIterator) Value() WorkloadClassifier {
25752	if !iter.page.NotDone() {
25753		return WorkloadClassifier{}
25754	}
25755	return iter.page.Values()[iter.i]
25756}
25757
25758// Creates a new instance of the WorkloadClassifierListResultIterator type.
25759func NewWorkloadClassifierListResultIterator(page WorkloadClassifierListResultPage) WorkloadClassifierListResultIterator {
25760	return WorkloadClassifierListResultIterator{page: page}
25761}
25762
25763// IsEmpty returns true if the ListResult contains no values.
25764func (wclr WorkloadClassifierListResult) IsEmpty() bool {
25765	return wclr.Value == nil || len(*wclr.Value) == 0
25766}
25767
25768// hasNextLink returns true if the NextLink is not empty.
25769func (wclr WorkloadClassifierListResult) hasNextLink() bool {
25770	return wclr.NextLink != nil && len(*wclr.NextLink) != 0
25771}
25772
25773// workloadClassifierListResultPreparer prepares a request to retrieve the next set of results.
25774// It returns nil if no more results exist.
25775func (wclr WorkloadClassifierListResult) workloadClassifierListResultPreparer(ctx context.Context) (*http.Request, error) {
25776	if !wclr.hasNextLink() {
25777		return nil, nil
25778	}
25779	return autorest.Prepare((&http.Request{}).WithContext(ctx),
25780		autorest.AsJSON(),
25781		autorest.AsGet(),
25782		autorest.WithBaseURL(to.String(wclr.NextLink)))
25783}
25784
25785// WorkloadClassifierListResultPage contains a page of WorkloadClassifier values.
25786type WorkloadClassifierListResultPage struct {
25787	fn   func(context.Context, WorkloadClassifierListResult) (WorkloadClassifierListResult, error)
25788	wclr WorkloadClassifierListResult
25789}
25790
25791// NextWithContext advances to the next page of values.  If there was an error making
25792// the request the page does not advance and the error is returned.
25793func (page *WorkloadClassifierListResultPage) NextWithContext(ctx context.Context) (err error) {
25794	if tracing.IsEnabled() {
25795		ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadClassifierListResultPage.NextWithContext")
25796		defer func() {
25797			sc := -1
25798			if page.Response().Response.Response != nil {
25799				sc = page.Response().Response.Response.StatusCode
25800			}
25801			tracing.EndSpan(ctx, sc, err)
25802		}()
25803	}
25804	for {
25805		next, err := page.fn(ctx, page.wclr)
25806		if err != nil {
25807			return err
25808		}
25809		page.wclr = next
25810		if !next.hasNextLink() || !next.IsEmpty() {
25811			break
25812		}
25813	}
25814	return nil
25815}
25816
25817// Next advances to the next page of values.  If there was an error making
25818// the request the page does not advance and the error is returned.
25819// Deprecated: Use NextWithContext() instead.
25820func (page *WorkloadClassifierListResultPage) Next() error {
25821	return page.NextWithContext(context.Background())
25822}
25823
25824// NotDone returns true if the page enumeration should be started or is not yet complete.
25825func (page WorkloadClassifierListResultPage) NotDone() bool {
25826	return !page.wclr.IsEmpty()
25827}
25828
25829// Response returns the raw server response from the last page request.
25830func (page WorkloadClassifierListResultPage) Response() WorkloadClassifierListResult {
25831	return page.wclr
25832}
25833
25834// Values returns the slice of values for the current page or nil if there are no values.
25835func (page WorkloadClassifierListResultPage) Values() []WorkloadClassifier {
25836	if page.wclr.IsEmpty() {
25837		return nil
25838	}
25839	return *page.wclr.Value
25840}
25841
25842// Creates a new instance of the WorkloadClassifierListResultPage type.
25843func NewWorkloadClassifierListResultPage(cur WorkloadClassifierListResult, getNextPage func(context.Context, WorkloadClassifierListResult) (WorkloadClassifierListResult, error)) WorkloadClassifierListResultPage {
25844	return WorkloadClassifierListResultPage{
25845		fn:   getNextPage,
25846		wclr: cur,
25847	}
25848}
25849
25850// WorkloadClassifierProperties workload classifier definition. For more information look at
25851// sys.workload_management_workload_classifiers (DMV).
25852type WorkloadClassifierProperties struct {
25853	// MemberName - The workload classifier member name.
25854	MemberName *string `json:"memberName,omitempty"`
25855	// Label - The workload classifier label.
25856	Label *string `json:"label,omitempty"`
25857	// Context - The workload classifier context.
25858	Context *string `json:"context,omitempty"`
25859	// StartTime - The workload classifier start time for classification.
25860	StartTime *string `json:"startTime,omitempty"`
25861	// EndTime - The workload classifier end time for classification.
25862	EndTime *string `json:"endTime,omitempty"`
25863	// Importance - The workload classifier importance.
25864	Importance *string `json:"importance,omitempty"`
25865}
25866
25867// WorkloadClassifiersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
25868// long-running operation.
25869type WorkloadClassifiersCreateOrUpdateFuture struct {
25870	azure.FutureAPI
25871	// Result returns the result of the asynchronous operation.
25872	// If the operation has not completed it will return an error.
25873	Result func(WorkloadClassifiersClient) (WorkloadClassifier, error)
25874}
25875
25876// UnmarshalJSON is the custom unmarshaller for CreateFuture.
25877func (future *WorkloadClassifiersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
25878	var azFuture azure.Future
25879	if err := json.Unmarshal(body, &azFuture); err != nil {
25880		return err
25881	}
25882	future.FutureAPI = &azFuture
25883	future.Result = future.result
25884	return nil
25885}
25886
25887// result is the default implementation for WorkloadClassifiersCreateOrUpdateFuture.Result.
25888func (future *WorkloadClassifiersCreateOrUpdateFuture) result(client WorkloadClassifiersClient) (wc WorkloadClassifier, err error) {
25889	var done bool
25890	done, err = future.DoneWithContext(context.Background(), client)
25891	if err != nil {
25892		err = autorest.NewErrorWithError(err, "sql.WorkloadClassifiersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
25893		return
25894	}
25895	if !done {
25896		wc.Response.Response = future.Response()
25897		err = azure.NewAsyncOpIncompleteError("sql.WorkloadClassifiersCreateOrUpdateFuture")
25898		return
25899	}
25900	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
25901	if wc.Response.Response, err = future.GetResult(sender); err == nil && wc.Response.Response.StatusCode != http.StatusNoContent {
25902		wc, err = client.CreateOrUpdateResponder(wc.Response.Response)
25903		if err != nil {
25904			err = autorest.NewErrorWithError(err, "sql.WorkloadClassifiersCreateOrUpdateFuture", "Result", wc.Response.Response, "Failure responding to request")
25905		}
25906	}
25907	return
25908}
25909
25910// WorkloadClassifiersDeleteFuture an abstraction for monitoring and retrieving the results of a
25911// long-running operation.
25912type WorkloadClassifiersDeleteFuture struct {
25913	azure.FutureAPI
25914	// Result returns the result of the asynchronous operation.
25915	// If the operation has not completed it will return an error.
25916	Result func(WorkloadClassifiersClient) (autorest.Response, error)
25917}
25918
25919// UnmarshalJSON is the custom unmarshaller for CreateFuture.
25920func (future *WorkloadClassifiersDeleteFuture) UnmarshalJSON(body []byte) error {
25921	var azFuture azure.Future
25922	if err := json.Unmarshal(body, &azFuture); err != nil {
25923		return err
25924	}
25925	future.FutureAPI = &azFuture
25926	future.Result = future.result
25927	return nil
25928}
25929
25930// result is the default implementation for WorkloadClassifiersDeleteFuture.Result.
25931func (future *WorkloadClassifiersDeleteFuture) result(client WorkloadClassifiersClient) (ar autorest.Response, err error) {
25932	var done bool
25933	done, err = future.DoneWithContext(context.Background(), client)
25934	if err != nil {
25935		err = autorest.NewErrorWithError(err, "sql.WorkloadClassifiersDeleteFuture", "Result", future.Response(), "Polling failure")
25936		return
25937	}
25938	if !done {
25939		ar.Response = future.Response()
25940		err = azure.NewAsyncOpIncompleteError("sql.WorkloadClassifiersDeleteFuture")
25941		return
25942	}
25943	ar.Response = future.Response()
25944	return
25945}
25946
25947// WorkloadGroup workload group operations for a data warehouse
25948type WorkloadGroup struct {
25949	autorest.Response `json:"-"`
25950	// WorkloadGroupProperties - Resource properties.
25951	*WorkloadGroupProperties `json:"properties,omitempty"`
25952	// ID - READ-ONLY; Resource ID.
25953	ID *string `json:"id,omitempty"`
25954	// Name - READ-ONLY; Resource name.
25955	Name *string `json:"name,omitempty"`
25956	// Type - READ-ONLY; Resource type.
25957	Type *string `json:"type,omitempty"`
25958}
25959
25960// MarshalJSON is the custom marshaler for WorkloadGroup.
25961func (wg WorkloadGroup) MarshalJSON() ([]byte, error) {
25962	objectMap := make(map[string]interface{})
25963	if wg.WorkloadGroupProperties != nil {
25964		objectMap["properties"] = wg.WorkloadGroupProperties
25965	}
25966	return json.Marshal(objectMap)
25967}
25968
25969// UnmarshalJSON is the custom unmarshaler for WorkloadGroup struct.
25970func (wg *WorkloadGroup) UnmarshalJSON(body []byte) error {
25971	var m map[string]*json.RawMessage
25972	err := json.Unmarshal(body, &m)
25973	if err != nil {
25974		return err
25975	}
25976	for k, v := range m {
25977		switch k {
25978		case "properties":
25979			if v != nil {
25980				var workloadGroupProperties WorkloadGroupProperties
25981				err = json.Unmarshal(*v, &workloadGroupProperties)
25982				if err != nil {
25983					return err
25984				}
25985				wg.WorkloadGroupProperties = &workloadGroupProperties
25986			}
25987		case "id":
25988			if v != nil {
25989				var ID string
25990				err = json.Unmarshal(*v, &ID)
25991				if err != nil {
25992					return err
25993				}
25994				wg.ID = &ID
25995			}
25996		case "name":
25997			if v != nil {
25998				var name string
25999				err = json.Unmarshal(*v, &name)
26000				if err != nil {
26001					return err
26002				}
26003				wg.Name = &name
26004			}
26005		case "type":
26006			if v != nil {
26007				var typeVar string
26008				err = json.Unmarshal(*v, &typeVar)
26009				if err != nil {
26010					return err
26011				}
26012				wg.Type = &typeVar
26013			}
26014		}
26015	}
26016
26017	return nil
26018}
26019
26020// WorkloadGroupListResult a list of workload groups.
26021type WorkloadGroupListResult struct {
26022	autorest.Response `json:"-"`
26023	// Value - READ-ONLY; Array of results.
26024	Value *[]WorkloadGroup `json:"value,omitempty"`
26025	// NextLink - READ-ONLY; Link to retrieve next page of results.
26026	NextLink *string `json:"nextLink,omitempty"`
26027}
26028
26029// MarshalJSON is the custom marshaler for WorkloadGroupListResult.
26030func (wglr WorkloadGroupListResult) MarshalJSON() ([]byte, error) {
26031	objectMap := make(map[string]interface{})
26032	return json.Marshal(objectMap)
26033}
26034
26035// WorkloadGroupListResultIterator provides access to a complete listing of WorkloadGroup values.
26036type WorkloadGroupListResultIterator struct {
26037	i    int
26038	page WorkloadGroupListResultPage
26039}
26040
26041// NextWithContext advances to the next value.  If there was an error making
26042// the request the iterator does not advance and the error is returned.
26043func (iter *WorkloadGroupListResultIterator) NextWithContext(ctx context.Context) (err error) {
26044	if tracing.IsEnabled() {
26045		ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadGroupListResultIterator.NextWithContext")
26046		defer func() {
26047			sc := -1
26048			if iter.Response().Response.Response != nil {
26049				sc = iter.Response().Response.Response.StatusCode
26050			}
26051			tracing.EndSpan(ctx, sc, err)
26052		}()
26053	}
26054	iter.i++
26055	if iter.i < len(iter.page.Values()) {
26056		return nil
26057	}
26058	err = iter.page.NextWithContext(ctx)
26059	if err != nil {
26060		iter.i--
26061		return err
26062	}
26063	iter.i = 0
26064	return nil
26065}
26066
26067// Next advances to the next value.  If there was an error making
26068// the request the iterator does not advance and the error is returned.
26069// Deprecated: Use NextWithContext() instead.
26070func (iter *WorkloadGroupListResultIterator) Next() error {
26071	return iter.NextWithContext(context.Background())
26072}
26073
26074// NotDone returns true if the enumeration should be started or is not yet complete.
26075func (iter WorkloadGroupListResultIterator) NotDone() bool {
26076	return iter.page.NotDone() && iter.i < len(iter.page.Values())
26077}
26078
26079// Response returns the raw server response from the last page request.
26080func (iter WorkloadGroupListResultIterator) Response() WorkloadGroupListResult {
26081	return iter.page.Response()
26082}
26083
26084// Value returns the current value or a zero-initialized value if the
26085// iterator has advanced beyond the end of the collection.
26086func (iter WorkloadGroupListResultIterator) Value() WorkloadGroup {
26087	if !iter.page.NotDone() {
26088		return WorkloadGroup{}
26089	}
26090	return iter.page.Values()[iter.i]
26091}
26092
26093// Creates a new instance of the WorkloadGroupListResultIterator type.
26094func NewWorkloadGroupListResultIterator(page WorkloadGroupListResultPage) WorkloadGroupListResultIterator {
26095	return WorkloadGroupListResultIterator{page: page}
26096}
26097
26098// IsEmpty returns true if the ListResult contains no values.
26099func (wglr WorkloadGroupListResult) IsEmpty() bool {
26100	return wglr.Value == nil || len(*wglr.Value) == 0
26101}
26102
26103// hasNextLink returns true if the NextLink is not empty.
26104func (wglr WorkloadGroupListResult) hasNextLink() bool {
26105	return wglr.NextLink != nil && len(*wglr.NextLink) != 0
26106}
26107
26108// workloadGroupListResultPreparer prepares a request to retrieve the next set of results.
26109// It returns nil if no more results exist.
26110func (wglr WorkloadGroupListResult) workloadGroupListResultPreparer(ctx context.Context) (*http.Request, error) {
26111	if !wglr.hasNextLink() {
26112		return nil, nil
26113	}
26114	return autorest.Prepare((&http.Request{}).WithContext(ctx),
26115		autorest.AsJSON(),
26116		autorest.AsGet(),
26117		autorest.WithBaseURL(to.String(wglr.NextLink)))
26118}
26119
26120// WorkloadGroupListResultPage contains a page of WorkloadGroup values.
26121type WorkloadGroupListResultPage struct {
26122	fn   func(context.Context, WorkloadGroupListResult) (WorkloadGroupListResult, error)
26123	wglr WorkloadGroupListResult
26124}
26125
26126// NextWithContext advances to the next page of values.  If there was an error making
26127// the request the page does not advance and the error is returned.
26128func (page *WorkloadGroupListResultPage) NextWithContext(ctx context.Context) (err error) {
26129	if tracing.IsEnabled() {
26130		ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadGroupListResultPage.NextWithContext")
26131		defer func() {
26132			sc := -1
26133			if page.Response().Response.Response != nil {
26134				sc = page.Response().Response.Response.StatusCode
26135			}
26136			tracing.EndSpan(ctx, sc, err)
26137		}()
26138	}
26139	for {
26140		next, err := page.fn(ctx, page.wglr)
26141		if err != nil {
26142			return err
26143		}
26144		page.wglr = next
26145		if !next.hasNextLink() || !next.IsEmpty() {
26146			break
26147		}
26148	}
26149	return nil
26150}
26151
26152// Next advances to the next page of values.  If there was an error making
26153// the request the page does not advance and the error is returned.
26154// Deprecated: Use NextWithContext() instead.
26155func (page *WorkloadGroupListResultPage) Next() error {
26156	return page.NextWithContext(context.Background())
26157}
26158
26159// NotDone returns true if the page enumeration should be started or is not yet complete.
26160func (page WorkloadGroupListResultPage) NotDone() bool {
26161	return !page.wglr.IsEmpty()
26162}
26163
26164// Response returns the raw server response from the last page request.
26165func (page WorkloadGroupListResultPage) Response() WorkloadGroupListResult {
26166	return page.wglr
26167}
26168
26169// Values returns the slice of values for the current page or nil if there are no values.
26170func (page WorkloadGroupListResultPage) Values() []WorkloadGroup {
26171	if page.wglr.IsEmpty() {
26172		return nil
26173	}
26174	return *page.wglr.Value
26175}
26176
26177// Creates a new instance of the WorkloadGroupListResultPage type.
26178func NewWorkloadGroupListResultPage(cur WorkloadGroupListResult, getNextPage func(context.Context, WorkloadGroupListResult) (WorkloadGroupListResult, error)) WorkloadGroupListResultPage {
26179	return WorkloadGroupListResultPage{
26180		fn:   getNextPage,
26181		wglr: cur,
26182	}
26183}
26184
26185// WorkloadGroupProperties workload group definition. For more information look at
26186// sys.workload_management_workload_groups (DMV).
26187type WorkloadGroupProperties struct {
26188	// MinResourcePercent - The workload group minimum percentage resource.
26189	MinResourcePercent *int32 `json:"minResourcePercent,omitempty"`
26190	// MaxResourcePercent - The workload group cap percentage resource.
26191	MaxResourcePercent *int32 `json:"maxResourcePercent,omitempty"`
26192	// MinResourcePercentPerRequest - The workload group request minimum grant percentage.
26193	MinResourcePercentPerRequest *float64 `json:"minResourcePercentPerRequest,omitempty"`
26194	// MaxResourcePercentPerRequest - The workload group request maximum grant percentage.
26195	MaxResourcePercentPerRequest *float64 `json:"maxResourcePercentPerRequest,omitempty"`
26196	// Importance - The workload group importance level.
26197	Importance *string `json:"importance,omitempty"`
26198	// QueryExecutionTimeout - The workload group query execution timeout.
26199	QueryExecutionTimeout *int32 `json:"queryExecutionTimeout,omitempty"`
26200}
26201
26202// WorkloadGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
26203// long-running operation.
26204type WorkloadGroupsCreateOrUpdateFuture struct {
26205	azure.FutureAPI
26206	// Result returns the result of the asynchronous operation.
26207	// If the operation has not completed it will return an error.
26208	Result func(WorkloadGroupsClient) (WorkloadGroup, error)
26209}
26210
26211// UnmarshalJSON is the custom unmarshaller for CreateFuture.
26212func (future *WorkloadGroupsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
26213	var azFuture azure.Future
26214	if err := json.Unmarshal(body, &azFuture); err != nil {
26215		return err
26216	}
26217	future.FutureAPI = &azFuture
26218	future.Result = future.result
26219	return nil
26220}
26221
26222// result is the default implementation for WorkloadGroupsCreateOrUpdateFuture.Result.
26223func (future *WorkloadGroupsCreateOrUpdateFuture) result(client WorkloadGroupsClient) (wg WorkloadGroup, err error) {
26224	var done bool
26225	done, err = future.DoneWithContext(context.Background(), client)
26226	if err != nil {
26227		err = autorest.NewErrorWithError(err, "sql.WorkloadGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
26228		return
26229	}
26230	if !done {
26231		wg.Response.Response = future.Response()
26232		err = azure.NewAsyncOpIncompleteError("sql.WorkloadGroupsCreateOrUpdateFuture")
26233		return
26234	}
26235	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
26236	if wg.Response.Response, err = future.GetResult(sender); err == nil && wg.Response.Response.StatusCode != http.StatusNoContent {
26237		wg, err = client.CreateOrUpdateResponder(wg.Response.Response)
26238		if err != nil {
26239			err = autorest.NewErrorWithError(err, "sql.WorkloadGroupsCreateOrUpdateFuture", "Result", wg.Response.Response, "Failure responding to request")
26240		}
26241	}
26242	return
26243}
26244
26245// WorkloadGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
26246// operation.
26247type WorkloadGroupsDeleteFuture struct {
26248	azure.FutureAPI
26249	// Result returns the result of the asynchronous operation.
26250	// If the operation has not completed it will return an error.
26251	Result func(WorkloadGroupsClient) (autorest.Response, error)
26252}
26253
26254// UnmarshalJSON is the custom unmarshaller for CreateFuture.
26255func (future *WorkloadGroupsDeleteFuture) UnmarshalJSON(body []byte) error {
26256	var azFuture azure.Future
26257	if err := json.Unmarshal(body, &azFuture); err != nil {
26258		return err
26259	}
26260	future.FutureAPI = &azFuture
26261	future.Result = future.result
26262	return nil
26263}
26264
26265// result is the default implementation for WorkloadGroupsDeleteFuture.Result.
26266func (future *WorkloadGroupsDeleteFuture) result(client WorkloadGroupsClient) (ar autorest.Response, err error) {
26267	var done bool
26268	done, err = future.DoneWithContext(context.Background(), client)
26269	if err != nil {
26270		err = autorest.NewErrorWithError(err, "sql.WorkloadGroupsDeleteFuture", "Result", future.Response(), "Polling failure")
26271		return
26272	}
26273	if !done {
26274		ar.Response = future.Response()
26275		err = azure.NewAsyncOpIncompleteError("sql.WorkloadGroupsDeleteFuture")
26276		return
26277	}
26278	ar.Response = future.Response()
26279	return
26280}
26281